Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into fix/execute_benched
authorTom Cornebize <tom.cornebize@ensimag.grenoble-inp.fr>
Mon, 27 Nov 2017 15:49:33 +0000 (09:49 -0600)
committerTom Cornebize <tom.cornebize@ensimag.grenoble-inp.fr>
Mon, 27 Nov 2017 15:49:33 +0000 (09:49 -0600)
937 files changed:
.gitignore
.travis.yml
CMakeLists.txt
COPYING
ChangeLog
NEWS
contrib/benchmarking_code_block/inject.h
doc/Doxyfile.in
doc/doxygen/getting_started.doc
doc/doxygen/image/eclipseScreenShot.png [new file with mode: 0644]
doc/doxygen/inside_extending.doc
doc/doxygen/inside_release.doc
doc/doxygen/inside_tests.doc
doc/doxygen/install_yours.doc
doc/doxygen/module-s4u.doc
doc/doxygen/module-smpi.doc
doc/doxygen/module-xbt.doc
doc/doxygen/options.doc
doc/doxygen/outcomes_vizu.doc
doc/doxygen/tutorial_msg.doc
doc/doxygen/uhood.doc
doc/doxygen/uhood_arch.doc
doc/doxygen/uhood_switch.doc
doc/manpage/smpirun.1
examples/java/CMakeLists.txt
examples/java/app/bittorrent/Common.java
examples/java/app/bittorrent/Connection.java
examples/java/app/bittorrent/Main.java
examples/java/app/bittorrent/Peer.java
examples/java/app/bittorrent/app-bittorrent.tesh [moved from examples/java/app/bittorrent/app_bittorrent.tesh with 100% similarity]
examples/java/app/centralizedmutex/app-centralizedmutex.tesh [moved from examples/java/app/centralizedmutex/app_centralizedmutex.tesh with 100% similarity]
examples/java/app/masterworker/Main.java
examples/java/app/masterworker/app-masterworker.tesh [moved from examples/java/app/masterworker/app_masterworker.tesh with 100% similarity]
examples/java/app/pingpong/Main.java
examples/java/app/pingpong/app-pingpong.tesh [moved from examples/java/app/pingpong/app_pingpong.tesh with 100% similarity]
examples/java/app/tokenring/Main.java
examples/java/app/tokenring/app-tokenring.tesh [moved from examples/java/app/tokenring/app_tokenring.tesh with 100% similarity]
examples/java/async/dsend/Main.java
examples/java/async/dsend/async-dsend.tesh [moved from examples/java/async/dsend/async_dsend.tesh with 100% similarity]
examples/java/async/waitall/Main.java
examples/java/async/waitall/async-waitall.tesh [moved from examples/java/async/waitall/async_waitall.tesh with 100% similarity]
examples/java/async/yield/Main.java
examples/java/async/yield/async-yield.tesh [moved from examples/java/async/yield/async_yield.tesh with 100% similarity]
examples/java/cloud/masterworker/Main.java
examples/java/cloud/masterworker/Master.java
examples/java/cloud/masterworker/cloud-masterworker.tesh [moved from examples/java/cloud/masterworker/cloud_masterworker.tesh with 100% similarity]
examples/java/cloud/migration/Daemon.java
examples/java/cloud/migration/XVM.java
examples/java/cloud/migration/cloud-migration.tesh [moved from examples/java/cloud/migration/cloud_migration.tesh with 100% similarity]
examples/java/dht/chord/Node.java
examples/java/dht/chord/dht-chord.tesh [moved from examples/java/dht/chord/dht_chord.tesh with 95% similarity]
examples/java/dht/kademlia/Main.java
examples/java/dht/kademlia/Node.java
examples/java/dht/kademlia/RoutingTable.java
examples/java/dht/kademlia/dht-kademlia.tesh [moved from examples/java/dht/kademlia/dht_kademlia.tesh with 100% similarity]
examples/java/energy/consumption/energy-consumption.tesh [moved from examples/java/energy/consumption/energy_consumption.tesh with 100% similarity]
examples/java/energy/pstate/Main.java
examples/java/energy/pstate/energy-pstate.tesh [moved from examples/java/energy/pstate/energy_pstate.tesh with 100% similarity]
examples/java/energy/vm/energy-vm.tesh [moved from examples/java/energy/vm/energy_vm.tesh with 100% similarity]
examples/java/io/file/Main.java
examples/java/io/file/Node.java
examples/java/io/file/io-file.tesh [moved from examples/java/io/file/io_file.tesh with 100% similarity]
examples/java/io/storage/Client.java
examples/java/io/storage/Main.java
examples/java/io/storage/io-storage.tesh [moved from examples/java/io/storage/io_storage.tesh with 100% similarity]
examples/java/process/kill/Main.java
examples/java/process/kill/process-kill.tesh [moved from examples/java/process/kill/process_kill.tesh with 100% similarity]
examples/java/process/migration/process-migration.tesh [moved from examples/java/process/migration/process_migration.tesh with 100% similarity]
examples/java/process/startkilltime/process-startkilltime.tesh [moved from examples/java/process/startkilltime/process_startkilltime.tesh with 100% similarity]
examples/java/process/suspend/Main.java
examples/java/process/suspend/process-suspend.tesh [moved from examples/java/process/suspend/process_suspend.tesh with 100% similarity]
examples/java/task/priority/Main.java
examples/java/task/priority/task-priority.tesh [moved from examples/java/task/priority/task_priority.tesh with 100% similarity]
examples/java/trace/pingpong/Main.java
examples/java/trace/pingpong/Receiver.java
examples/java/trace/pingpong/Sender.java
examples/java/trace/pingpong/trace-pingpong.tesh [moved from examples/java/trace/pingpong/trace_pingpong.tesh with 100% similarity]
examples/msg/CMakeLists.txt
examples/msg/README.doc
examples/msg/app-bittorrent/messages.c [deleted file]
examples/msg/app-bittorrent/tracker.h [deleted file]
examples/msg/app-chainsend/broadcaster.c
examples/msg/app-chainsend/peer.c
examples/msg/app-pingpong/app-pingpong.tesh
examples/msg/async-waitany/async-waitany.tesh
examples/msg/cloud-capping/cloud-capping.c
examples/msg/cloud-masterworker/cloud-masterworker.c
examples/msg/cloud-two-tasks/cloud-two-tasks.c
examples/msg/dht-kademlia/answer.c
examples/msg/dht-kademlia/dht-kademlia.c
examples/msg/dht-kademlia/dht-kademlia.tesh
examples/msg/dht-kademlia/node.c
examples/msg/dht-kademlia/routing_table.c
examples/msg/dht-pastry/dht-pastry.c
examples/msg/energy-consumption/energy-consumption.c
examples/msg/energy-ptask/energy-ptask.c
examples/msg/energy-vm/energy-vm.tesh
examples/msg/io-file/io-file.c
examples/msg/io-file/io-file.tesh
examples/msg/io-remote/io-remote.c
examples/msg/io-remote/io-remote.tesh
examples/msg/io-storage/io-storage.c
examples/msg/mc/bugged1.tesh
examples/msg/mc/bugged1_liveness.tesh
examples/msg/mc/bugged1_liveness_sparse.tesh
examples/msg/mc/bugged1_liveness_stack_cleaner
examples/msg/mc/bugged1_liveness_visited.tesh
examples/msg/mc/bugged1_liveness_visited_sparse.tesh
examples/msg/mc/bugged2.c
examples/msg/mc/bugged2.tesh
examples/msg/mc/bugged3.c
examples/msg/mc/electric_fence.c
examples/msg/platform-properties/platform-properties.c
examples/msg/plugin-hostload/plugin-hostload.c
examples/msg/process-startkilltime/process-startkilltime.c
examples/msg/process-startkilltime/process-startkilltime.tesh
examples/msg/trace-categories/trace-categories.tesh
examples/msg/trace-host-user-variables/trace-host-user-variables.c
examples/msg/trace-host-user-variables/trace-host-user-variables.tesh
examples/msg/trace-link-user-variables/trace-link-user-variables.tesh
examples/msg/trace-masterworker/trace-masterworker.c
examples/msg/trace-masterworker/trace-masterworker.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/config_tracing.xml
examples/platforms/energy_platform.xml
examples/platforms/small_platform_constant.xml [new file with mode: 0644]
examples/s4u/CMakeLists.txt
examples/s4u/README.doc
examples/s4u/actions-comm/s4u-actions-comm-split-p0.txt [moved from examples/s4u/actions-comm/s4u_actions-comm_split_p0.txt with 100% similarity]
examples/s4u/actions-comm/s4u-actions-comm-split-p1.txt [moved from examples/s4u/actions-comm/s4u_actions-comm_split_p1.txt with 100% similarity]
examples/s4u/actions-comm/s4u-actions-comm-split_d.xml [moved from examples/s4u/actions-comm/s4u_actions-comm_split_d.xml with 77% similarity]
examples/s4u/actions-comm/s4u-actions-comm.cpp [moved from examples/s4u/actions-comm/s4u_actions-comm.cpp with 85% similarity]
examples/s4u/actions-comm/s4u-actions-comm.tesh [moved from examples/s4u/actions-comm/s4u_actions-comm.tesh with 71% similarity]
examples/s4u/actions-comm/s4u-actions-comm.txt [moved from examples/s4u/actions-comm/s4u_actions-comm.txt with 100% similarity]
examples/s4u/actions-comm/s4u-actions-comm_d.xml [moved from examples/s4u/actions-comm/s4u_actions-comm_d.xml with 100% similarity]
examples/s4u/actions-storage/s4u-actions-storage.cpp [moved from examples/s4u/actions-storage/s4u_actions-storage.cpp with 89% similarity]
examples/s4u/actions-storage/s4u-actions-storage.tesh [moved from examples/s4u/actions-storage/s4u_actions-storage.tesh with 61% similarity]
examples/s4u/actions-storage/s4u-actions-storage.txt [moved from examples/s4u/actions-storage/s4u_actions-storage.txt with 100% similarity]
examples/s4u/actions-storage/s4u-actions-storage_d.xml [moved from examples/s4u/actions-storage/s4u_actions-storage_d.xml with 100% similarity]
examples/s4u/actor-create/s4u-actor-create.cpp [moved from examples/s4u/actor-create/s4u_actor-create.cpp with 84% similarity]
examples/s4u/actor-create/s4u-actor-create.tesh [moved from examples/s4u/actor-create/s4u_actor-create.tesh with 93% similarity]
examples/s4u/actor-create/s4u-actor-create_d.xml [moved from examples/s4u/actor-create/s4u_actor-create_d.xml with 100% similarity]
examples/s4u/actor-daemon/s4u-actor-daemon.cpp [moved from examples/s4u/actor-daemon/s4u_actor-daemon.cpp with 91% similarity]
examples/s4u/actor-daemon/s4u-actor-daemon.tesh [moved from examples/s4u/actor-daemon/s4u_actor-daemon.tesh with 89% similarity]
examples/s4u/actor-execute/s4u-actor-execute.cpp [new file with mode: 0644]
examples/s4u/actor-execute/s4u-actor-execute.tesh [new file with mode: 0644]
examples/s4u/actor-kill/s4u-actor-kill.cpp [moved from examples/s4u/actor-kill/s4u_actor-kill.cpp with 60% similarity]
examples/s4u/actor-kill/s4u-actor-kill.tesh [new file with mode: 0644]
examples/s4u/actor-kill/s4u_actor-kill.tesh [deleted file]
examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp [new file with mode: 0644]
examples/s4u/actor-lifetime/s4u-actor-lifetime.tesh [new file with mode: 0644]
examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml [new file with mode: 0644]
examples/s4u/actor-migration/s4u-actor-migration.cpp [moved from examples/s4u/actor-migration/s4u_actor-migration.cpp with 93% similarity]
examples/s4u/actor-migration/s4u-actor-migration.tesh [moved from examples/s4u/actor-migration/s4u_actor-migration.tesh with 91% similarity]
examples/s4u/actor-priority/s4u-actor-priority.cpp [new file with mode: 0644]
examples/s4u/actor-priority/s4u-actor-priority.tesh [new file with mode: 0644]
examples/s4u/actor-priority/s4u-actor-priority_d.xml [new file with mode: 0644]
examples/s4u/actor-suspend/s4u-actor-suspend.cpp [moved from examples/s4u/actor-suspend/s4u_actor-suspend.cpp with 93% similarity]
examples/s4u/actor-suspend/s4u-actor-suspend.tesh [moved from examples/s4u/actor-suspend/s4u_actor-suspend.tesh with 95% similarity]
examples/s4u/app-bittorrent/s4u-app-bittorrent.tesh [new file with mode: 0644]
examples/s4u/app-bittorrent/s4u-app-bittorrent_d.xml [moved from examples/msg/app-bittorrent/app-bittorrent_d.xml with 100% similarity]
examples/s4u/app-bittorrent/s4u-bittorrent.cpp [new file with mode: 0644]
examples/s4u/app-bittorrent/s4u-bittorrent.hpp [new file with mode: 0644]
examples/s4u/app-bittorrent/s4u-peer.cpp [new file with mode: 0644]
examples/s4u/app-bittorrent/s4u-peer.hpp [new file with mode: 0644]
examples/s4u/app-bittorrent/s4u-tracker.cpp [new file with mode: 0644]
examples/s4u/app-bittorrent/s4u-tracker.hpp [new file with mode: 0644]
examples/s4u/app-masterworker/s4u-app-masterworker.cpp [moved from examples/s4u/app-masterworker/s4u_app-masterworker.cpp with 73% similarity]
examples/s4u/app-masterworker/s4u-app-masterworker.tesh [moved from examples/s4u/app-masterworker/s4u_app-masterworker.tesh with 94% similarity]
examples/s4u/app-masterworker/s4u-app-masterworker_d.xml [moved from examples/s4u/app-masterworker/s4u_app-masterworker_d.xml with 100% similarity]
examples/s4u/app-pingpong/s4u-app-pingpong.cpp [moved from examples/s4u/app-pingpong/s4u_app-pingpong.cpp with 93% similarity]
examples/s4u/app-pingpong/s4u-app-pingpong.tesh [moved from examples/s4u/app-pingpong/s4u_app-pingpong.tesh with 52% similarity]
examples/s4u/app-token-ring/s4u-app-token-ring.cpp [moved from examples/s4u/app-token-ring/s4u_app-token-ring.cpp with 65% similarity]
examples/s4u/app-token-ring/s4u-app-token-ring.tesh [moved from examples/s4u/app-token-ring/s4u_app-token-ring.tesh with 98% similarity]
examples/s4u/async-wait/s4u-async-wait.cpp [new file with mode: 0644]
examples/s4u/async-wait/s4u-async-wait.tesh [new file with mode: 0644]
examples/s4u/async-wait/s4u-async-wait_d.xml [new file with mode: 0644]
examples/s4u/async-waitall/s4u-async-waitall.cpp [new file with mode: 0644]
examples/s4u/async-waitall/s4u-async-waitall.tesh [new file with mode: 0644]
examples/s4u/async-waitall/s4u-async-waitall_d.xml [new file with mode: 0644]
examples/s4u/async-waitany/s4u-async-waitany.cpp [new file with mode: 0644]
examples/s4u/async-waitany/s4u-async-waitany.tesh [new file with mode: 0644]
examples/s4u/async-waitany/s4u-async-waitany_d.xml [new file with mode: 0644]
examples/s4u/dht-chord/node.cpp
examples/s4u/dht-chord/s4u-dht-chord.cpp [moved from examples/s4u/dht-chord/s4u_dht-chord.cpp with 87% similarity]
examples/s4u/dht-chord/s4u-dht-chord.hpp [moved from examples/s4u/dht-chord/s4u_dht-chord.hpp with 95% similarity]
examples/s4u/dht-chord/s4u-dht-chord.tesh [moved from examples/s4u/dht-chord/s4u_dht-chord.tesh with 75% similarity]
examples/s4u/dht-chord/s4u-dht-chord_d.xml [moved from examples/s4u/dht-chord/s4u_dht-chord_d.xml with 100% similarity]
examples/s4u/energy-link/s4u-energy-link.cpp [new file with mode: 0644]
examples/s4u/energy-link/s4u-energy-link.tesh [new file with mode: 0644]
examples/s4u/io/s4u-io.cpp [moved from examples/s4u/io/s4u_io.cpp with 64% similarity]
examples/s4u/io/s4u-io.tesh [moved from examples/s4u/io/s4u_io.tesh with 97% similarity]
examples/s4u/mutex/s4u-mutex.cpp [moved from examples/s4u/mutex/s4u_mutex.cpp with 93% similarity]
examples/s4u/mutex/s4u-mutex.tesh [moved from examples/s4u/mutex/s4u_mutex.tesh with 98% similarity]
examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp [moved from examples/s4u/plugin-hostload/s4u_plugin-hostload.cpp with 92% similarity]
examples/s4u/plugin-hostload/s4u-plugin-hostload.tesh [moved from examples/s4u/plugin-hostload/s4u_plugin-hostload.tesh with 96% similarity]
examples/simdag/dag-dotload/sd_dag-dotload.c
examples/simdag/daxload/sd_daxload.c
examples/simdag/daxload/sd_daxload.tesh
examples/simdag/properties/sd_properties.c
examples/simdag/schedule-dotload/sd_schedule-dotload.c
examples/simdag/test/sd_test.cpp
examples/smpi/CMakeLists.txt
examples/smpi/NAS/dt.c
examples/smpi/NAS/ep.c
examples/smpi/NAS/is.c
examples/smpi/mc/bugged1_liveness.c
examples/smpi/mc/non_deterministic.tesh
examples/smpi/mc/only_send_deterministic.c
examples/smpi/mc/only_send_deterministic.tesh
examples/smpi/replay/replay.c
examples/smpi/replay/replay.tesh
examples/smpi/replay_multiple/CMakeLists.txt
examples/smpi/replay_multiple/generate_multiple_deployment.sh
examples/smpi/replay_multiple/replay_multiple.c
examples/smpi/replay_multiple/replay_multiple.tesh
examples/smpi/trace/trace.tesh
examples/smpi/trace_call_location/trace_call_location.tesh
examples/smpi/trace_simple/trace_simple.tesh
include/msg/datatypes.h [deleted file]
include/msg/msg.h [deleted file]
include/simdag/datatypes.h [deleted file]
include/simdag/simdag.h [deleted file]
include/simgrid/chrono.hpp
include/simgrid/forward.h
include/simgrid/host.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/plugins/energy.h
include/simgrid/plugins/file_system.h [new file with mode: 0644]
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/ConditionVariable.hpp
include/simgrid/s4u/Engine.hpp
include/simgrid/s4u/File.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/simgrid/simix.hpp
include/simgrid/simix/blocking_simcall.hpp
include/smpi/smpi.h
include/xbt.h
include/xbt/Extendable.hpp
include/xbt/algorithm.hpp [new file with mode: 0644]
include/xbt/backtrace.h
include/xbt/base.h
include/xbt/config.h
include/xbt/config.hpp
include/xbt/cunit.h
include/xbt/dict.h
include/xbt/dynar.h
include/xbt/dynar.hpp
include/xbt/ex.h
include/xbt/ex.hpp
include/xbt/exception.hpp
include/xbt/file.h [deleted file]
include/xbt/file.hpp [new file with mode: 0644]
include/xbt/function_types.h
include/xbt/functional.hpp
include/xbt/future.hpp
include/xbt/heap.h [deleted file]
include/xbt/log.h
include/xbt/parmap.h
include/xbt/range.hpp
include/xbt/replay.hpp
include/xbt/signal.hpp
include/xbt/str.h
include/xbt/string.hpp
include/xbt/swag.h
include/xbt/sysdep.h
include/xbt/utility.hpp
include/xbt/xbt_os_thread.h
sonar-project.properties
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 54% 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_process.h
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/java/org/simgrid/msg/Msg.java
src/bindings/java/org/simgrid/msg/Process.java
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/instr/instr_interface.h
src/include/mc/mc.h
src/include/simgrid/sg_config.h
src/include/surf/datatypes.h [deleted file]
src/include/surf/datatypes.hpp [new file with mode: 0644]
src/include/surf/maxmin.h [deleted file]
src/include/surf/maxmin.hpp [new file with mode: 0644]
src/include/surf/surf.hpp [moved from src/include/surf/surf.h with 81% similarity]
src/include/xbt/parmap.hpp [new file with mode: 0644]
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_containers.hpp [new file with mode: 0644]
src/instr/instr_paje_events.cpp [new file with mode: 0644]
src/instr/instr_paje_events.hpp [new file with mode: 0644]
src/instr/instr_paje_header.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_types.hpp [new file with mode: 0644]
src/instr/instr_paje_values.cpp
src/instr/instr_paje_values.hpp [new file with mode: 0644]
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.h [deleted file]
src/instr/instr_smpi.hpp [new file with mode: 0644]
src/instr/jedule/jedule.cpp
src/instr/jedule/jedule_events.cpp
src/instr/jedule/jedule_platform.cpp
src/kernel/EngineImpl.cpp
src/kernel/EngineImpl.hpp
src/kernel/activity/CommImpl.cpp
src/kernel/activity/CommImpl.hpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/ExecImpl.hpp
src/kernel/activity/MailboxImpl.cpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/SleepImpl.cpp
src/kernel/activity/SleepImpl.hpp
src/kernel/activity/SynchroIo.cpp
src/kernel/activity/SynchroIo.hpp
src/kernel/activity/SynchroRaw.hpp
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextBoost.cpp
src/kernel/context/ContextBoost.hpp
src/kernel/context/ContextRaw.cpp
src/kernel/context/ContextRaw.hpp [new file with mode: 0644]
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextThread.hpp
src/kernel/context/ContextUnix.cpp
src/kernel/context/ContextUnix.hpp [new file with mode: 0644]
src/kernel/future.cpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/ClusterZone.hpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DijkstraZone.hpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/DragonflyZone.hpp
src/kernel/routing/EmptyZone.cpp
src/kernel/routing/EmptyZone.hpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FatTreeZone.hpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FloydZone.hpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/FullZone.hpp
src/kernel/routing/NetPoint.hpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/NetZoneImpl.hpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/RoutedZone.hpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/TorusZone.hpp
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/VivaldiZone.hpp
src/mc/ChunkedData.cpp
src/mc/ChunkedData.hpp
src/mc/DwarfExpression.cpp
src/mc/DwarfExpression.hpp
src/mc/LocationList.cpp
src/mc/LocationList.hpp
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/ObjectInformation.cpp
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.cpp
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_dwarf_attrnames.cpp
src/mc/mc_dwarf_tagnames.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 90% similarity]
src/mc/mc_replay.hpp [moved from src/mc/mc_replay.h with 76% 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 55% similarity]
src/mc/mc_state.cpp
src/mc/mc_state.hpp [moved from src/mc/mc_state.h with 78% 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/mc_xbt.cpp
src/mc/remote/Channel.cpp
src/mc/remote/Channel.hpp
src/mc/remote/Client.cpp
src/mc/remote/Client.hpp
src/mc/remote/RemoteClient.cpp
src/mc/remote/RemoteClient.hpp
src/mc/remote/RemotePtr.hpp
src/mc/remote/mc_protocol.cpp
src/mc/remote/mc_protocol.h
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 62% 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_file.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/dax_dtd.c
src/simdag/dax_dtd.h
src/simdag/sd_daxloader.cpp
src/simdag/sd_dotloader.cpp
src/simdag/sd_global.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 75% similarity]
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/popping_private.hpp [moved from src/simix/popping_private.h with 70% similarity]
src/simix/simcalls.in
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.h [deleted file]
src/simix/smx_host_private.hpp [new file with mode: 0644]
src/simix/smx_io.cpp
src/simix/smx_io_private.hpp [moved from src/simix/smx_io_private.h with 61% 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 63% 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/SmpiHost.hpp
src/smpi/include/private.h [deleted file]
src/smpi/include/private.hpp
src/smpi/include/smpi_coll.hpp
src/smpi/include/smpi_comm.hpp
src/smpi/include/smpi_datatype.hpp
src/smpi/include/smpi_datatype_derived.hpp
src/smpi/include/smpi_f2c.hpp
src/smpi/include/smpi_group.hpp
src/smpi/include/smpi_info.hpp
src/smpi/include/smpi_keyvals.hpp
src/smpi/include/smpi_process.hpp
src/smpi/include/smpi_request.hpp
src/smpi/include/smpi_topo.hpp
src/smpi/include/smpi_utils.hpp [moved from src/include/smpi/smpi_utils.hpp with 66% similarity]
src/smpi/include/smpi_win.hpp
src/smpi/internals/SmpiHost.cpp
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/internals/smpi_utils.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_info.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/smpi/smpirun.in
src/smpi/smpitools.sh
src/surf/FileImpl.cpp [deleted file]
src/surf/FileImpl.hpp [deleted file]
src/surf/HostImpl.cpp
src/surf/PropertyHolder.cpp
src/surf/PropertyHolder.hpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/fair_bottleneck.cpp
src/surf/instr_routing.cpp
src/surf/instr_surf.cpp
src/surf/lagrange.cpp
src/surf/maxmin.cpp
src/surf/maxmin_private.hpp [deleted file]
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_ib.cpp
src/surf/network_ib.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/network_smpi.cpp
src/surf/network_smpi.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 76% similarity]
src/surf/ns3/ns3_simulator.hpp [moved from src/surf/ns3/ns3_simulator.h with 80% similarity]
src/surf/plugins/host_energy.cpp
src/surf/plugins/host_load.cpp
src/surf/plugins/link_energy.cpp [new file with mode: 0644]
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/surf/storage_n11.hpp
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/trace_mgr_test.cpp
src/surf/xml/platf.hpp
src/surf/xml/platf_private.hpp
src/surf/xml/simgrid.dtd
src/surf/xml/simgrid_dtd.c
src/surf/xml/simgrid_dtd.h
src/surf/xml/surfxml_parseplatf.cpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/automaton/automaton.c
src/xbt/automaton/automatonparse_promela.c
src/xbt/backtrace_linux.cpp
src/xbt/config.cpp
src/xbt/cunit.cpp
src/xbt/dict.cpp
src/xbt/dict_cursor.c
src/xbt/dynar.cpp
src/xbt/ex.cpp
src/xbt/exception.cpp
src/xbt/graph.c
src/xbt/heap.c [deleted file]
src/xbt/heap_private.h [deleted file]
src/xbt/log.c
src/xbt/mallocator.c
src/xbt/mallocator_private.h
src/xbt/memory_map.cpp
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/mrealloc.c
src/xbt/parmap.cpp
src/xbt/string.cpp
src/xbt/swag.c
src/xbt/xbt_log_appender_file.c
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_log_layout_simple.c
src/xbt/xbt_main.cpp
src/xbt/xbt_os_file.c [deleted file]
src/xbt/xbt_os_file.cpp [new file with mode: 0644]
src/xbt/xbt_os_thread.c
src/xbt/xbt_os_time.c
src/xbt/xbt_replay.cpp
src/xbt/xbt_str.cpp
teshsuite/java/CMakeLists.txt
teshsuite/java/semaphoregc/SemaphoreGC.java [moved from teshsuite/java/semaphoreGC/SemaphoreGC.java with 93% similarity]
teshsuite/java/semaphoregc/semaphoregc.tesh [moved from teshsuite/java/semaphoreGC/semaphoreGC.tesh with 86% similarity]
teshsuite/java/sleephostoff/SleepHostOff.java [moved from teshsuite/java/sleepHostOff/SleepHostOff.java with 95% similarity]
teshsuite/java/sleephostoff/sleephostoff.tesh [moved from teshsuite/java/sleepHostOff/sleepHostOff.tesh with 93% similarity]
teshsuite/lua/lua_platforms.tesh
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/msg/CMakeLists.txt
teshsuite/msg/actions-storage/actions-storage.c
teshsuite/msg/app-bittorrent/app-bittorrent.tesh [moved from examples/msg/app-bittorrent/app-bittorrent.tesh with 88% similarity]
teshsuite/msg/app-bittorrent/app-bittorrent_d.xml [new file with mode: 0644]
teshsuite/msg/app-bittorrent/bittorrent.c [moved from examples/msg/app-bittorrent/bittorrent.c with 85% similarity]
teshsuite/msg/app-bittorrent/bittorrent.h [moved from examples/msg/app-bittorrent/bittorrent.h with 84% similarity]
teshsuite/msg/app-bittorrent/connection.c [moved from examples/msg/app-bittorrent/connection.c with 63% similarity]
teshsuite/msg/app-bittorrent/connection.h [moved from examples/msg/app-bittorrent/connection.h with 62% similarity]
teshsuite/msg/app-bittorrent/generate.py [moved from examples/msg/app-bittorrent/generate.py with 100% similarity]
teshsuite/msg/app-bittorrent/messages.c [new file with mode: 0644]
teshsuite/msg/app-bittorrent/messages.h [moved from examples/msg/app-bittorrent/messages.h with 74% similarity]
teshsuite/msg/app-bittorrent/peer.c [moved from examples/msg/app-bittorrent/peer.c with 63% similarity]
teshsuite/msg/app-bittorrent/peer.h [moved from examples/msg/app-bittorrent/peer.h with 57% similarity]
teshsuite/msg/app-bittorrent/tracker.c [moved from examples/msg/app-bittorrent/tracker.c with 72% similarity]
teshsuite/msg/app-bittorrent/tracker.h [new file with mode: 0644]
teshsuite/msg/cloud-sharing/cloud-sharing.tesh
teshsuite/msg/host_on_off_processes/host_on_off_processes.c
teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh
teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp
teshsuite/msg/task_progress/task_progress.cpp [new file with mode: 0644]
teshsuite/msg/task_progress/task_progress.tesh [new file with mode: 0644]
teshsuite/msg/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml
teshsuite/msg/trace_integration/test-hbp2.5-hbp1.5.xml
teshsuite/msg/trace_integration/trace_integration.tesh
teshsuite/s4u/CMakeLists.txt
teshsuite/s4u/actor/actor.cpp
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
teshsuite/s4u/comm-waitany/comm-waitany.cpp [deleted file]
teshsuite/s4u/concurrent_rw/concurrent_rw.cpp
teshsuite/s4u/concurrent_rw/concurrent_rw.tesh
teshsuite/s4u/pid/pid.cpp
teshsuite/s4u/storage_client_server/storage_client_server.cpp
teshsuite/s4u/storage_client_server/storage_client_server.tesh
teshsuite/simdag/CMakeLists.txt
teshsuite/simdag/basic-parsing-test/basic-parsing-test.tesh
teshsuite/simdag/evaluate-parse-time/evaluate-parse-time.c
teshsuite/simdag/flatifier/flatifier.cpp
teshsuite/simdag/is-router/is-router.cpp
teshsuite/simdag/platforms/clusterA.xml [deleted file]
teshsuite/simdag/platforms/clusterB.xml [deleted file]
teshsuite/simdag/platforms/platform_include.xml [deleted file]
teshsuite/simix/CMakeLists.txt
teshsuite/simix/generic_simcalls/generic_simcalls.cpp
teshsuite/smpi/coll-allgather/coll-allgather.c
teshsuite/smpi/coll-allgather/coll-allgather.tesh
teshsuite/smpi/coll-allgatherv/coll-allgatherv.c
teshsuite/smpi/coll-allgatherv/coll-allgatherv.tesh
teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh
teshsuite/smpi/coll-allreduce/coll-allreduce-large.tesh
teshsuite/smpi/coll-allreduce/coll-allreduce.c
teshsuite/smpi/coll-allreduce/coll-allreduce.tesh
teshsuite/smpi/coll-alltoall/clusters.tesh
teshsuite/smpi/coll-alltoall/coll-alltoall.c
teshsuite/smpi/coll-alltoall/coll-alltoall.tesh
teshsuite/smpi/coll-alltoallv/coll-alltoallv.c
teshsuite/smpi/coll-alltoallv/coll-alltoallv.tesh
teshsuite/smpi/coll-barrier/coll-barrier.tesh
teshsuite/smpi/coll-bcast/coll-bcast.c
teshsuite/smpi/coll-bcast/coll-bcast.tesh
teshsuite/smpi/coll-gather/coll-gather.tesh
teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.tesh
teshsuite/smpi/coll-reduce/coll-reduce.tesh
teshsuite/smpi/coll-scatter/coll-scatter.c
teshsuite/smpi/coll-scatter/coll-scatter.tesh
teshsuite/smpi/isp/umpire/CMakeLists.txt
teshsuite/smpi/isp/umpire/change-send-buffer.c
teshsuite/smpi/isp/umpire/comm-translate-ranks.c
teshsuite/smpi/isp/umpire/irecv-deadlock.c
teshsuite/smpi/isp/umpire/lost-request-waitall.c
teshsuite/smpi/isp/umpire/no-error-testany.c
teshsuite/smpi/isp/umpire/wait-deadlock.c
teshsuite/smpi/macro-partial-shared-communication/macro-partial-shared-communication.tesh
teshsuite/smpi/macro-partial-shared/macro-partial-shared.tesh
teshsuite/smpi/macro-shared/macro-shared.c
teshsuite/smpi/macro-shared/macro-shared.tesh
teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/coll/allgatherv4.c
teshsuite/smpi/mpich3-test/coll/allgatherv4_manual.c
teshsuite/smpi/mpich3-test/comm/cmsplit_type.c
teshsuite/smpi/mpich3-test/datatype/dataalign.c
teshsuite/smpi/mpich3-test/datatype/longdouble.c
teshsuite/smpi/mpich3-test/datatype/sendrecvt2.c
teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/info/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/topo/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/util/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/generate_report
teshsuite/smpi/mpich3-test/perf/CMakeLists.txt
teshsuite/smpi/mpich3-test/runtests
teshsuite/smpi/mpich3-test/util/dtypes.c
teshsuite/smpi/mpich3-test/util/dtypes_manual.c
teshsuite/smpi/privatization/privatization.tesh
teshsuite/smpi/privatization/privatization_dlopen.tesh
teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh
teshsuite/smpi/pt2pt-pingpong/TI_output.tesh
teshsuite/smpi/pt2pt-pingpong/broken_hostfiles.tesh
teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh
teshsuite/smpi/timers/timers.c
teshsuite/smpi/timers/timers.tesh
teshsuite/smpi/type-hvector/type-hvector.tesh
teshsuite/smpi/type-indexed/type-indexed.tesh
teshsuite/smpi/type-struct/type-struct.tesh
teshsuite/smpi/type-vector/type-vector.tesh
teshsuite/surf/lmm_usage/lmm_usage.cpp
teshsuite/surf/maxmin_bench/maxmin_bench.cpp
teshsuite/surf/surf_usage/surf_usage.cpp
teshsuite/surf/surf_usage2/surf_usage2.cpp
teshsuite/xbt/CMakeLists.txt
teshsuite/xbt/heap_bench/heap_bench.c [deleted file]
teshsuite/xbt/heap_bench/heap_bench.tesh [deleted file]
teshsuite/xbt/log_usage/log_usage.c
teshsuite/xbt/log_usage/log_usage.tesh
teshsuite/xbt/mmalloc/mmalloc_32.tesh
teshsuite/xbt/mmalloc/mmalloc_64.tesh
teshsuite/xbt/mmalloc/mmalloc_test.cpp
teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c
teshsuite/xbt/parmap_bench/parmap_bench.c [deleted file]
teshsuite/xbt/parmap_bench/parmap_bench.cpp [new file with mode: 0644]
teshsuite/xbt/parmap_test/parmap_test.cpp [moved from teshsuite/xbt/parmap_test/parmap_test.c with 51% similarity]
teshsuite/xbt/parmap_test/parmap_test.tesh
tools/cmake/DefinePackages.cmake
tools/cmake/Distrib.cmake
tools/cmake/GCCFlags.cmake
tools/cmake/Java.cmake
tools/cmake/MaintainerMode.cmake
tools/cmake/MakeLib.cmake
tools/cmake/Modules/FindLibelf.cmake [new file with mode: 0644]
tools/cmake/Tests.cmake
tools/cmake/src/internal_config.h.in
tools/cmake/test_prog/prog_asan.cpp [new file with mode: 0644]
tools/doxygen/xbt_log_extract_hierarchy.pl
tools/generate-dwarf-functions
tools/git-hooks/clang-format.pre-commit
tools/graphicator/CMakeLists.txt
tools/jenkins/Coverage.sh
tools/jenkins/DynamicAnalysis.sh
tools/jenkins/Sanitizers.sh
tools/jenkins/build.sh
tools/sg_unit_extractor.pl
tools/sg_xml_unit_converter.py
tools/simgrid.supp
tools/tesh/tesh.py

index c054e5b..e0eb0b8 100644 (file)
@@ -102,6 +102,7 @@ doc/simgrid.tag
 doc/doxygen/logcategories.doc
 doc/simgrid_modules.map
 doc/javadoc
+doc/example_lists/
 ### Specific of project 
 .settings/
 .csettings/
@@ -120,12 +121,9 @@ doc/msg-tuto-src/masterworker1
 doc/msg-tuto-src/masterworker2
 doc/msg-tuto-src/masterworker3
 doc/msg-tuto-src/masterworker4
-examples/msg/actions-comm/actions-comm
-examples/msg/actions-storage/actions-storage
 examples/msg/async-wait/async-wait
 examples/msg/async-waitall/async-waitall
 examples/msg/async-waitany/async-waitany
-examples/msg/app-bittorrent/bittorrent
 examples/msg/app-chainsend/chainsend
 examples/msg/cloud-capping/cloud-capping
 examples/msg/cloud-masterworker/cloud-masterworker
@@ -188,22 +186,33 @@ examples/msg/trace-masterworker/trace-masterworker
 examples/msg/trace-process-migration/trace-process-migration
 examples/msg/trace-platform/trace-platform
 examples/msg/trace-host-user-variables/trace-host-user-variables
-examples/s4u/app-masterworker/s4u_app-masterworker
-examples/s4u/app-pingpong/s4u_app-pingpong
-examples/s4u/app-token-ring/s4u_app-token-ring
-examples/s4u/actions-comm/s4u_actions-comm
-examples/s4u/actions-storage/s4u_actions-storage
-examples/s4u/actor-create/s4u_actor-create
-examples/s4u/actor-daemon/s4u_actor-daemon
-examples/s4u/actor-kill/s4u_actor-kill
-examples/s4u/actor-migration/s4u_actor-migration
-examples/s4u/actor-suspend/s4u_actor-suspend
-examples/s4u/basic/s4u_basic
-examples/s4u/basic/s4u_basic_deployment
-examples/s4u/basic/s4u_basic_function
-examples/s4u/dht-chord/s4u_dht-chord
-examples/s4u/io/s4u_io
-examples/s4u/mutex/s4u_mutex
+examples/msg/*.pcap
+examples/msg/*.tr
+examples/s4u/actions-comm/s4u-actions-comm
+examples/s4u/actions-storage/s4u-actions-storage
+examples/s4u/actor-create/s4u-actor-create
+examples/s4u/actor-daemon/s4u-actor-daemon
+examples/s4u/actor-execute/s4u-actor-execute
+examples/s4u/actor-kill/s4u-actor-kill
+examples/s4u/actor-lifetime/s4u-actor-lifetime
+examples/s4u/actor-migration/s4u-actor-migration
+examples/s4u/actor-priority/s4u-actor-priority
+examples/s4u/actor-suspend/s4u-actor-suspend
+examples/s4u/app-bittorrent/s4u-bittorrent
+examples/s4u/app-masterworker/s4u-app-masterworker
+examples/s4u/app-pingpong/s4u-app-pingpong
+examples/s4u/app-token-ring/s4u-app-token-ring
+examples/s4u/async-wait/s4u-async-wait
+examples/s4u/async-waitall/s4u-async-waitall
+examples/s4u/async-waitany/s4u-async-waitany
+examples/s4u/basic/s4u-basic
+examples/s4u/basic/s4u-basic_deployment
+examples/s4u/basic/s4u-basic_function
+examples/s4u/dht-chord/s4u-dht-chord
+examples/s4u/energy-link/s4u-energy-link
+examples/s4u/io/s4u-io
+examples/s4u/mutex/s4u-mutex
+examples/s4u/plugin-hostload/s4u-plugin-hostload
 examples/simdag/daxload/sd_daxload
 examples/simdag/dag-dotload/sd_dag-dotload
 examples/simdag/ptg-dotload/sd_ptg-dotload
@@ -231,6 +240,7 @@ examples/smpi/mc/send_deterministic
 examples/smpi/NAS/dt
 examples/smpi/NAS/ep
 examples/smpi/NAS/is
+examples/smpi/replay_multiple/deployment.xml
 examples/smpi/replay_multiple/replay_multiple
 examples/smpi/replay/one_trace
 examples/smpi/ring_c
@@ -243,13 +253,16 @@ examples/smpi/trace_simple/smpi_trace_simple
 examples/smpi/trace_call_location/smpi_trace_call_location
 testall
 teshsuite/datadesc_usage.out
-teshsuite/java/semaphoreGC/semaphoreGC_compiled
-teshsuite/java/sleepHostOff/sleepHostOff_compiled
+teshsuite/java/semaphoregc/java-semaphoregc_compiled
+teshsuite/java/sleephostoff/java-sleephostoff_compiled
 teshsuite/mc/dwarf/dwarf
 teshsuite/mc/dwarf-expression/dwarf-expression
 teshsuite/mc/random-bug/random-bug
 teshsuite/mc/mutex-handling/mutex-handling
 teshsuite/mc/mutex-handling/without-mutex-handling
+teshsuite/msg/actions-comm/actions-comm
+teshsuite/msg/actions-storage/actions-storage
+teshsuite/msg/app-bittorrent/bittorrent
 teshsuite/msg/cloud-sharing/cloud-sharing
 teshsuite/msg/concurrent_rw/concurrent_rw
 teshsuite/msg/get_sender/get_sender
@@ -666,7 +679,6 @@ teshsuite/smpi/mpich3-test/f77/datatype/gaddressf
 teshsuite/smpi/mpich3-test/f77/datatype/hindex1f
 teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf
 teshsuite/smpi/mpich3-test/f77/datatype/packef
-teshsuite/smpi/mpich3-test/f77/datatype/typeaints
 teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h
 teshsuite/smpi/mpich3-test/f77/datatype/typecntsf
 teshsuite/smpi/mpich3-test/f77/datatype/typem2f
@@ -685,6 +697,7 @@ teshsuite/smpi/mpich3-test/f77/rma/c2f2cwinf
 teshsuite/smpi/mpich3-test/f77/rma/winaccf
 teshsuite/smpi/mpich3-test/f77/rma/winfencef
 teshsuite/smpi/mpich3-test/f77/rma/wingetf
+teshsuite/smpi/mpich3-test/f77/rma/wingroupf
 teshsuite/smpi/mpich3-test/f77/rma/winnamef
 teshsuite/smpi/mpich3-test/f77/rma/winscale1f
 teshsuite/smpi/mpich3-test/f77/topo/cartcrf
@@ -727,6 +740,7 @@ teshsuite/smpi/mpich3-test/f90/rma/c2f2cwinf90
 teshsuite/smpi/mpich3-test/f90/rma/winaccf90
 teshsuite/smpi/mpich3-test/f90/rma/winfencef90
 teshsuite/smpi/mpich3-test/f90/rma/wingetf90
+teshsuite/smpi/mpich3-test/f90/rma/wingroupf90
 teshsuite/smpi/mpich3-test/f90/rma/winnamef90
 teshsuite/smpi/mpich3-test/f90/rma/winscale1f90
 teshsuite/smpi/mpich3-test/group/groupcreate
@@ -1064,7 +1078,6 @@ teshsuite/surf/lmm_usage/lmm_usage
 teshsuite/surf/maxmin_bench/maxmin_bench
 teshsuite/surf/surf_usage/surf_usage
 teshsuite/surf/surf_usage2/surf_usage2
-teshsuite/xbt/heap_bench/heap_bench
 teshsuite/xbt/log_large/log_large
 teshsuite/xbt/log_usage/log_usage
 teshsuite/xbt/mallocator/mallocator
@@ -1080,30 +1093,8 @@ test_sg
 tools/tesh/tesh
 unit_tmgr
 #########################################
-## touched files to track the dependencies of java examples
-examples/java/app/bittorrent/java_app_bittorrent_compiled
-examples/java/app/centralizedmutex/java_app_centralizedmutex_compiled
-examples/java/app/masterworker/java_app_masterworker_compiled
-examples/java/app/pingpong/java_app_pingpong_compiled
-examples/java/app/tokenring/java_app_tokenring_compiled
-examples/java/async/yield/java_async_yield_compiled
-examples/java/async/dsend/java_async_dsend_compiled
-examples/java/async/waitall/java_async_waitall_compiled
-examples/java/dht/chord/java_dht_chord_compiled
-examples/java/dht/kademlia/java_dht_kademlia_compiled
-examples/java/cloud/masterworker/java_cloud_masterworker_compiled
-examples/java/cloud/migration/java_cloud_migration_compiled
-examples/java/energy/consumption/java_energy_consumption_compiled
-examples/java/energy/pstate/java_energy_pstate_compiled
-examples/java/energy/vm/java_energy_vm_compiled
-examples/java/io/file/java_io_file_compiled
-examples/java/io/storage/java_io_storage_compiled
-examples/java/process/kill/java_process_kill_compiled
-examples/java/process/migration/java_process_migration_compiled
-examples/java/process/suspend/java_process_suspend_compiled
-examples/java/process/startkilltime/java_process_startkilltime_compiled
-examples/java/task/priority/java_task_priority_compiled
-examples/java/trace/pingpong/java_trace_pingpong_compiled
+## files touched to track the dependencies of java examples
+examples/java/*/*/*_compiled
 /CMakeCache.txt
 examples/smpi/mc/smpi_bugged1
 examples/smpi/mc/smpi_bugged1_liveness
index b53e23e..236576a 100644 (file)
@@ -50,7 +50,7 @@ script:
    - if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then brew update; fi
    - if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then brew install python3; fi
    - if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON .; fi
-   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -Denable_model-checking=ON  -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON .; fi
+   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -Denable_model-checking=ON  -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON .; fi
    # run make and ctest in the sonar wrapper on master/linux; run it directly in PR or OSX
    - if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then ./tools/internal/travis-sonarqube.sh make VERBOSE=1; else make VERBOSE=1 && ctest --output-on-failure --timeout 100; fi
 notifications:
index 19a9267..58b548b 100644 (file)
@@ -40,7 +40,7 @@ if(COMPILER_SUPPORTS_CXX11)
 else() 
   message(FATAL_ERROR 
           "The compiler ${CMAKE_CXX_COMPILER} (v${CMAKE_CXX_COMPILER_VERSION}) has no C++11 support. "
-           "Please use a decent C++ compiler.")
+          "Please install a decent C++ compiler (remove CMakeCache.txt once it's installed).")
 endif()
 
 ### And we need C11 standard, too
@@ -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)
 
@@ -204,6 +204,8 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
   ENDIF()
   if (WIN32)
     message(STATUS "Disable fast raw contexts on Windows.")
+  elseif(enable_address_sanitizer)
+    message("Disable fast raw contexts with ASan")
   else()
     set(HAVE_RAW_CONTEXTS 1)
   endif()
@@ -240,6 +242,7 @@ endif()
 if(WIN32)
   set(Boost_USE_STATIC_LIBS 1)
 endif()
+
 set(HAVE_PAPI 0)
 if(enable_smpi_papi)
   include(FindPAPI)
@@ -271,16 +274,8 @@ endif()
 find_package(Boost COMPONENTS context)
 set(Boost_FOUND 1) # This component is optional
 if(Boost_CONTEXT_FOUND)
-  if (Boost_VERSION LESS 105600)
-    message("Found Boost.Context API v1")
-    set(HAVE_BOOST_CONTEXTS 1)
-  elseif(Boost_VERSION LESS 106100)
-    message("Found Boost.Context API v2")
-    set(HAVE_BOOST_CONTEXTS 2)
-  else()
-    message("   WARNING : our implementation of Boost context factory is not compatible with Boost >=1.61 yet.")
-    set(HAVE_BOOST_CONTEXTS 0)
-  endif()
+  message("Found Boost.Context")
+  set(HAVE_BOOST_CONTEXTS 1)
 else()
   message ("   boost        : found.")
   message ("   boost-context: missing. Install libboost-context-dev for this optional feature.")
@@ -403,15 +398,16 @@ if(HAVE_LIBUNWIND)
   endif()
 else()
   if(enable_model-checking)
-    message(FATAL_ERROR "Please install libunwind-dev libdw-dev libevent-dev if you want to compile the SimGrid model checker.")
+    message(FATAL_ERROR "Please install libunwind-dev libdw-dev libelf-dev libevent-dev if you want to compile the SimGrid model checker.")
   endif()
 endif()
 
 if(enable_model-checking)
   find_package(Libdw REQUIRED)
+  find_package(Libelf REQUIRED)
   find_package(Libevent REQUIRED)
-  include_directories(${LIBDW_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
-  set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBDW_LIBRARIES}")
+  include_directories(${LIBDW_INCLUDE_DIR} ${LIBELF_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
+  set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBELF_LIBRARIES} ${LIBDW_LIBRARIES}")
   set(SIMGRID_HAVE_MC 1)
   if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_java)
     message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling java")
@@ -578,6 +574,8 @@ if(NOT HAVE_UCONTEXT_H)
 elseif(APPLE)
   message("-- No ucontext factory: Apple don't want us to use them.")
   set(HAVE_UCONTEXT_H 0)
+elseif(enable_address_sanitizer)
+  message("-- No ucontext factory: ASan does not support it (see http://code.google.com/p/address-sanitizer/issues/detail?id=189)")
 else()
   try_compile(compile_makecontext ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_makecontext.c
     OUTPUT_VARIABLE compile_makecontext_output)
@@ -678,6 +676,11 @@ else()
   set(GIT_VERSION "none, release version")
 endif()
 
+### Setup gcc & clang flags
+if (NOT MSVC)
+  include(${CMAKE_HOME_DIRECTORY}/tools/cmake/GCCFlags.cmake)
+endif()
+
 ### Generate the required headers and scripts
 #############################################
 
@@ -869,11 +872,6 @@ include(${CMAKE_HOME_DIRECTORY}/tools/cmake/DefinePackages.cmake)
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake)
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/UnitTesting.cmake)
 
-### Setup gcc & clang flags
-if (NOT MSVC)
-  include(${CMAKE_HOME_DIRECTORY}/tools/cmake/GCCFlags.cmake)
-endif()
-
 ### Make Libs
 if(NOT WIN32)
   include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
@@ -949,11 +947,6 @@ message("                version .............: ${CMAKE_CXX_COMPILER_VERSION}")
 if(${Java_FOUND})
   message("        Compiler: Javac .............: ${Java_JAVAC_EXECUTABLE}")
   message("                version .............: ${Java_VERSION_STRING}")
-if(${SWIG_FOUND})
-  message("                SWIG ................: Version ${SWIG_VERSION} found.")
-else()
-  message("                SWIG ................: Missing.")
-endif()
 endif()
 if(CMAKE_Fortran_COMPILER)
   message("        Compiler: Fortran ...........: ${SMPI_Fortran_COMPILER} (id: ${CMAKE_Fortran_COMPILER_ID})")
diff --git a/COPYING b/COPYING
index 763c3b3..f44d682 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -17,7 +17,27 @@ Copyright:
   Copyright (c) 2002-2004 The OSSP Project <http://www.ossp.org/>
   Copyright (c) 2002-2004 Cable & Wireless <http://www.cw.com/>
   Copyright (c) 2005-2015. The SimGrid Team.  
-Copyright: Expat
+License: Expat
+ This file is part of OSSP ex, an exception handling library
+ which can be found at http://www.ossp.org/pkg/lib/ex/.
+ .
+ Permission to use, copy, modify, and distribute this software for
+ any purpose with or without fee is hereby granted, provided that
+ the above copyright notice and this permission notice appear in all
+ copies.
+ .
+ THIS SOFTWARE IS PROVIDED AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
 Comment: Adapted from code from Ralf S. Engelschall and others in the OSSP project, remains under the original license.
 
 Files: src/xbt/mmalloc/* include/xbt/mmalloc.h
@@ -80,7 +100,6 @@ Comment: The author granted us the right to distribute this files under the LGPL
 
 Files:
  src/simdag/dax_dtd.c
- src/simdag/dax_dtd.l
  src/simdag/dax_dtd.h
  src/surf/xml/simgrid_dtd.c
  src/surf/xml/simgrid_dtd.h
@@ -102,7 +121,6 @@ Files:
  src/smpi/colls/allgatherv-ring.c
  src/smpi/colls/alltoall-2dmesh.c
  src/smpi/colls/alltoall-3dmesh.c
- src/smpi/colls/alltoall-bruck.c
  src/smpi/colls/alltoall-pair.c
  src/smpi/colls/alltoall-pair-light-barrier.c
  src/smpi/colls/alltoall-pair-mpi-barrier.c
@@ -125,6 +143,31 @@ Files:
  src/smpi/colls/bcast-scatter-rdb-allgather.c
 Copyright: Copyright (c) 2006, Ahmad Faraj & Xin Yuan
 License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+  * Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+ .
+  * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+ .
+  * Neither the name of the Florida State University nor the names of its
+    contributors may be used to endorse or promote products derived from this
+    software without specific prior written permission.
+ .
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+    ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+    ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 Comment: Borrowed from StarMPI.
 
 Files:
index 9f70fdb..eb74d9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,91 @@
-SimGrid (3.17) UNRELEASED (release target: September 22 2017)
+SimGrid (3.18) NOT RELEASED YET (target: December 24 2017)
 
  S4U
-  - Comm.detach(): start and forget about asynchronous emission
+ - 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*.
+
+ MSG
+ - Deprecate MSG_task_get_flops_amount(). Its semantic was weird:
+    before the start it returned the total amount of flops;
+    after it returned the ratio of remaining work. Split it:
+   MSG_task_get_initial_flops_amount() for first behavior
+   MSG_task_get_remaining_work_ratio() for the second one.
+   This fixes GitHub's #223 using PR #237. Thanks Michael Mercier.
+
+ XBT
+ - Define class simgrid::xbt::Path to manage file names.
+ - Removed unused functions:
+   - xbt/file.h: xbt_basename(), xbt_dirname(), xbt_getline()
+   - xbt/str.h: xbt_str_join()
+   - xbt/heap.h: use std::priority_queue or boost::heap instead
+
+ PLUGINS:
+ - New link_energy plugin for the consumption of the links.
+
+ XML
+ - Remove the undocumented/untested tag <include>
+
+ TRACE
+ - Remove viva specific tracing as the tool is no longer maintained
+
+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 for a coverage of
+ over 80%, and there is only one single known leak, of about 4kb.
+
+
+ S4U
+  - Comm.detach(): start and forget about asynchronous emission. A cleanup
+    handler may be given to free resources if the comm cannot be completed.
   - this_actor::send(mailbox) is now mailbox->put()
+  - New: simgrid::s4u::Comm::wait_all()
+  - New: Host.execute() for remote executions.
+
+ SURF
+  - Unused option network/sender-gap is removed.
+
+ MSG
+  - Deprecate MSG_task_isend_with_matching(): This unused feature
+    really complicates our internals. Will be removed in v3.20.
+
+ Simix
+  - Improved context termination.  It is now possible to free resources, even
+    when a process is forcibly killed.
+  - ContextBoost: add support for Boost versions above 1.61.
+
+ XBT
+ - Bring back run-time option --cfg=exception/cutpath to remove exception
+   backtraces.
+ - Removed unused functions:
+   - xbt/str.h: xbt_str_split_str(), xbt_str_subst(), xbt_str_ltrim(),
+       xbt_str_rtrim(), xbt_str_trim().
+   - xbt/xbt_os_thread.h: xbt_os_thread_cancel(), xbt_os_thread_detach().
+
+ Misc
+ - Removed header files obsolete since SimGrid 3.12:
+   msg/datatypes.h, msg/msg.h, simdag/datatypes.h, simdag/simdag.h.
+ - Fix many bugs:
+   - #3: SD_exit should be made optional
+   - #120: Memory leak when the processes are forcefully killed
+   - #159: Threading test regression in Actor refcounting
+   - #170: simgrid::s4u::Comm::wait_any() returns too many comms
+   - #185: simgrid::s4u::Engine::instance()->shutdown() segfaults
+   - #186: Actor::killAll() segfaults if some process is blocked on wait()
+   - #191: VM migration and pstate
+   - #192: Updating the energy consumptions of all hosts crashes with VMs
+   - #195: All actors have PID=0 in the logs
+   - #204: Sometimes segfault with thread contexts and mmap privatization
+   - #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.
 
@@ -52,7 +135,7 @@ SimGrid (3.16) Released June 22. 2017.
  SMPI
   - New algorithm to privatize globals: dlopen, with dynamic loading tricks
   - New option: smpi/keep-temps to not cleanup temp files
-  - New option : smpi/shared-malloc-blocksize . Relevant only when global shared 
+  - New option : smpi/shared-malloc-blocksize . Relevant only when global shared
     mallocs mode is used, allows to change the size of the fake file used
     (default 1MB), to potentially limit the number of mappings for large runs.
   - Support for sparse privatized malloc with SMPI_PARTIAL_SHARED_MALLOC()
@@ -93,7 +176,7 @@ SimGrid (3.15) Released March 22. 2017
 
  MSG
  - New: MSG_process_yield(). Stop and yield to other processes.
- - New: MSG_process_daemon(). Daemon processes are automatically killed 
+ - New: MSG_process_daemon(). Daemon processes are automatically killed
    when the last non-daemon process terminates
  - New: MSG_process_ref/unref(). Fiddle with the process refcounting.
  - Renamed MSG_energy_plugin_init() -> MSG_host_energy_plugin_init()
@@ -105,13 +188,13 @@ SimGrid (3.15) Released March 22. 2017
  - Kill the obscure NativeException. Nobody want to survive the issues
    it denotes, so use JniException that is a RuntimeException (not to
    be caught explicitly).
- - Partial bug fix in initialization. SimGrid flags on command line were 
-   consumed at C level but stayed in the original Java String[] args. 
+ - Partial bug fix in initialization. SimGrid flags on command line were
+   consumed at C level but stayed in the original Java String[] args.
    This could mess users' args[i] if SG flags were not put at the end of
    the command line.
-   The SimGrid flags are now removed from the Java arguments. However, 
+   The SimGrid flags are now removed from the Java arguments. However,
    the number of arguments REMAINS UNCHANGED. It is then UNSAFE to test
-   if args.length is greater than the number of YOUR OWN ARGUMENTS. 
+   if args.length is greater than the number of YOUR OWN ARGUMENTS.
    It might be if you have --log or --cfg flags in the command line.
  - Fix numerous memleaks all around the place. In particular, around VMs.
 
@@ -133,21 +216,21 @@ SimGrid (3.15) Released March 22. 2017
 
  SimDag
  - Backwards Compatibility breaks
-    - The SD_route_get_list and SD_route_get_size functions have been removed. 
-      They are replaced by the unique 
+    - The SD_route_get_list and SD_route_get_size functions have been removed.
+      They are replaced by the unique
          void sg_host_route(sg_host_t src, sg_host_t dst, xbt_dynar_t links)
-      The route from src to dst is built in the links dynar whose size can 
+      The route from src to dst is built in the links dynar whose size can
       be obtained with xbt_dynar_length.
     - The SD_route_bandwidth and SD_route_latency functions have been replaced by
-        sg_host_route_bandwidth and sg_host_route_latency. 
+        sg_host_route_bandwidth and sg_host_route_latency.
       Macros ensure the backwards compatibility, but you should fix your code
 
  SMPI
- - Major C++ rewrite ongoing (SMPI used to be C compiled in C++). 
+ - Major C++ rewrite ongoing (SMPI used to be C compiled in C++).
    This can break codes using SMPI internals (from private.h instead of the public smpi.h).
- - Bump our claim of support from MPI 1.1 to MPI 2.2. 
+ - Bump our claim of support from MPI 1.1 to MPI 2.2.
    We don't support 100% of it, but it should be enough. Contact us if not.
- - MPI_Win_lock/unlock, MPI_Get_accumulate support added (as for all RMA, implementation is 
+ - MPI_Win_lock/unlock, MPI_Get_accumulate support added (as for all RMA, implementation is
    naive and probably inaccurate)
  - New algorithm for SMPI_SHARED_MALLOC: global, where all blocks are
    mapped onto a unique small file using some system magic.
@@ -194,13 +277,13 @@ SimGrid (3.14) Released December 24. 2016
 
  SMPI
  * Privatization now works on FreeBSD
+
  * Privatization is now activated by default in smpirun
    You can turn it off with -no-privatize if something goes wrong.
 
  * Call-location tracing for SMPI.
-   You can add the exact location (filename / linenumber) of an MPI call to 
-   your trace files and slow down or speed up the simulation between two 
+   You can add the exact location (filename / linenumber) of an MPI call to
+   your trace files and slow down or speed up the simulation between two
    consecutive calls by using an adjustment file (see the documentation).
 
  * Fixed computation of timings for MPI_Send, MPI_Recv & possibly also others
@@ -212,8 +295,8 @@ SimGrid (3.14) Released December 24. 2016
  * smpi/cpu-threshold:-1 should become smpi/simulate-computation:no
    smpi/running-power    is renamed to smpi/host-speed
 
- * smpi/grow-injected-times option to enable or disable multiplication of the 
-   timings injected in MPI_Iprobe, or MPI_Test. Enabled by default, which can 
+ * smpi/grow-injected-times option to enable or disable multiplication of the
+   timings injected in MPI_Iprobe, or MPI_Test. Enabled by default, which can
    make simulation less precise (but also much faster).
 
  * smpirun script should be (much) faster for large deployments.
@@ -243,11 +326,11 @@ SimGrid (3.14) Released December 24. 2016
    - Ignored parameter of vm_create: core_nb, disk_path and disk_size.
    - Unimplemented save/restore methods
  * MSG_as_router_get_property_value() was redundent with
-   MSG_environment_as_get_property_value(). 
+   MSG_environment_as_get_property_value().
    - Removed MSG_as_router_*propert*() functions
    - Added MSG_environment_as_set_property_value() for consistency
- * xbt heterogeneous dictionnaries (created with xbt_dict_new()). 
-   Well, they are still there for now, but deprecated with a warning. 
+ * xbt heterogeneous dictionnaries (created with xbt_dict_new()).
+   Well, they are still there for now, but deprecated with a warning.
    Please switch to xbt_dict_new_homogeneous() before this is removed
    for real.
  * Task affinity. Its intended behavior (that was very badly tested
@@ -255,8 +338,8 @@ SimGrid (3.14) Released December 24. 2016
    would have hoped here.
  * xbt_os_sem_get_value: unused internally, deprecated on OS X El Capitan
  * Option network/coordinates is now useless and should be dropped.
- Storage: 
+
+ Storage:
  * Added option storage/max_file_descriptors to allow more than 1024 files opened
 
  SURF:
@@ -265,29 +348,29 @@ SimGrid (3.14) Released December 24. 2016
 
  XML:
  * Add Exa- and Peta- units such as EiB, EB, Eib, Eb for size, and
-   EiBps, EBps, Eibps, Ebps for bandwidth. 
+   EiBps, EBps, Eibps, Ebps for bandwidth.
    They may become useful to some lucky ones.
-   
+
  Java:
  * New functions: msg.Comm.waitAll() and msg.Comm.waitAny()
  * ex/app_tokenring: new example, very similar to the MSG Token Ring
  * ex/async_waitAll: new example, on asynchronous communications
 
  MSG:
- * Memory usage should be decreased for simulations with a large number 
+ * Memory usage should be decreased for simulations with a large number
    of processes. This also helps for SMPI.
 
 SimGrid (3.13) stable; urgency=low
 
  The Half Release, a.k.a. the Zealous Easter Trim.
+
  - We removed half of the lines, that were mostly experimental cruft.
    v3.12 lasted 286000 lines of code, v3.13 is only 142000 lines
    (not counting blanks and comments -- according to openhub.net)
  - The internals are now compiled in C++ (and will soon be clean C++)
- - We removed 75 klines of XML, 12 klines of Java, 5 klines of cmake, 
+ - We removed 75 klines of XML, 12 klines of Java, 5 klines of cmake,
    59 klines of C, etc. We added only 29 klines of C++ in replacement.
-   
+
  * Backwards Compatibility breaks
    - Removed Lua simulation bindings (switch to C or Java for that).
      Lua can still be used to describe platforms
@@ -299,11 +382,11 @@ SimGrid (3.13) stable; urgency=low
         way, with filter function.
           - MSG_task_listen_from_host
           - MSG_mailbox_get_count_host_waiting_tasks
-          - MSG_mailbox_put_with_timeout was removed. 
+          - MSG_mailbox_put_with_timeout was removed.
             Please use MSG_task_send_with_timeout instead.
-   - In SimDag 
-      - the SD_application_reinit function was removed. It has been a noop for a while. 
-      - The ACCESS_MODE of SD_workstation has been removed. This feature was not really usable and should soon be 
+   - In SimDag
+      - the SD_application_reinit function was removed. It has been a noop for a while.
+      - The ACCESS_MODE of SD_workstation has been removed. This feature was not really usable and should soon be
         replaced by a more flexible mechanism.
       - The following functions thus do not exist anymore
          - SD_workstation_get_access_mode
@@ -313,7 +396,7 @@ SimGrid (3.13) stable; urgency=low
         - SD_route_get_communication_time => SG_route_get_latency() + amount / SD_route_get_bandwidth()
         - SD_workstation_get_computation_time => amount / sg_host_speed()
    - In Java
-      - VM.setBound(int load) is now VM.setBound(double bound) to meet the MSG semantics. 
+      - VM.setBound(int load) is now VM.setBound(double bound) to meet the MSG semantics.
         Use VM.getSpeed()*load/100 for the legacy behavior.
    - In CMake
       - option enable_tracing was removed. It was not doing anything for a while.
@@ -352,7 +435,7 @@ SimGrid (3.13) stable; urgency=low
        And the same in bits:  'Tibps', 'Gibps', 'Mibps', 'Kibps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps'
      - latency. Default: 's' second. Also defined:
        'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond
-       
+
  * bin/simgrid_update_xml can upgrade your files automatically (won't convert unit-less values)
    tools/sg_xml_unit_converter.py may help (but it's just a warning and will probably ever be).
 
@@ -363,14 +446,14 @@ SimGrid (3.13) stable; urgency=low
 
  MSG
  * The examples were completely reorganized (in C and Java), for your browsing pleasure.
- * Kill all deprecated functions (the ones you had when declaring MSG_DEPRECATED). 
+ * Kill all deprecated functions (the ones you had when declaring MSG_DEPRECATED).
    They were deprecated since a few years, and probably did not even compile anymore.
 
  SimDag
- * The API has been profoundly modified to directly use the core objects instead of redefining its own. 
+ * The API has been profoundly modified to directly use the core objects instead of redefining its own.
    SD_Workstation_t and SD_link_t are now sg_host_t and sg_link_t respectively.
-   Some functions have also been renamed for consistency. Backward compatibility is maintained, but users are 
-   encouraged to update their codes. A list of the modified functions can be found at the end of 
+   Some functions have also been renamed for consistency. Backward compatibility is maintained, but users are
+   encouraged to update their codes. A list of the modified functions can be found at the end of
    include/simgrid/simdag.h
 
  Simix
@@ -406,7 +489,7 @@ SimGrid (3.13) stable; urgency=low
  * refactoring and cleanup of the code;
  * ongoing process to cleanly separate the model-checking algorithms
    from the code model-checking support.
+
  -- Wed Apr 27 21:00:53 CEST 2016 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.12) stable; urgency=low
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 c171b09..4828114 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. 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
@@ -66,7 +66,8 @@ static inline void xbt_inject_init(char *inputfile)
   if (fgets(line, 200, fpInput) == NULL)
     printf("Error input file is empty!"); // Skipping first row
   while (fgets(line, 200, fpInput) != NULL) {
-    key = strtok(line, "\t");
+    char *saveptr = NULL; /* for strtok_r() */
+    key = strtok_r(line, "\t", &saveptr);
 
     xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
     if (data)
@@ -75,20 +76,20 @@ static inline void xbt_inject_init(char *inputfile)
     data = (xbt_hist_t*)xbt_new(xbt_hist_t, 1);
 
     data->block_id = key;
-    data->counts   = atoi(strtok(NULL, "\t"));
-    data->mean     = atof(strtok(NULL, "\t"));
-    data->n        = atoi(strtok(NULL, "\t"));
+    data->counts   = atoi(strtok_r(NULL, "\t", &saveptr));
+    data->mean     = atof(strtok_r(NULL, "\t", &saveptr));
+    data->n        = atoi(strtok_r(NULL, "\t", &saveptr));
 
     data->breaks     = (double*)malloc(sizeof(double) * data->n);
     data->percentage = (double*)malloc(sizeof(double) * (data->n - 1));
     for (int i        = 0; i < data->n; i++)
-      data->breaks[i] = atof(strtok(NULL, "\t"));
+      data->breaks[i] = atof(strtok_r(NULL, "\t", &saveptr));
     for (int i            = 0; i < (data->n - 1); i++)
-      data->percentage[i] = atof(strtok(NULL, "\t"));
+      data->percentage[i] = atof(strtok_r(NULL, "\t", &saveptr));
 
     xbt_dict_set(mydict, key, data, NULL);
   }
-  fclose(fInput);
+  fclose(fpInput);
 }
 
 /* Initializing xbt dictionary for StarPU version, reading xbt_hist_t entries line by line */
@@ -113,11 +114,13 @@ static inline void inject_init_starpu(char *inputfile, xbt_dict_t *dict, RngStre
 
   if (fgets(line, MAX_LINE_INJ, fpInput) == NULL) {
     printf("Error input file is empty!"); // Skipping first row
+    fclose(fpInput);
     return;
   }
 
   while (fgets(line, MAX_LINE_INJ, fpInput) != NULL) {
-    key = strtok(line, "\t");
+    char *saveptr = NULL; /* for strtok_r() */
+    key = strtok_r(line, "\t", &saveptr);
 
     xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
     if (data)
@@ -125,21 +128,21 @@ static inline void inject_init_starpu(char *inputfile, xbt_dict_t *dict, RngStre
 
     data             = (xbt_hist_t*)xbt_new(xbt_hist_t, 1);
     data->block_id   = key;
-    data->counts     = atoi(strtok(NULL, "\t"));
-    data->mean       = atof(strtok(NULL, "\t"));
-    data->n          = atoi(strtok(NULL, "\t"));
+    data->counts     = atoi(strtok_r(NULL, "\t", &saveptr));
+    data->mean       = atof(strtok_r(NULL, "\t", &saveptr));
+    data->n          = atoi(strtok_r(NULL, "\t", &saveptr));
     data->breaks     = (double*)malloc(sizeof(double) * data->n);
     data->percentage = (double*)malloc(sizeof(double) * (data->n - 1));
 
     for (int i        = 0; i < data->n; i++)
-      data->breaks[i] = atof(strtok(NULL, "\t"));
+      data->breaks[i] = atof(strtok_r(NULL, "\t", &saveptr));
     for (int i = 0; i < (data->n - 1); i++) {
-      data->percentage[i] = atof(strtok(NULL, "\t"));
+      data->percentage[i] = atof(strtok_r(NULL, "\t", &saveptr));
     }
 
     xbt_dict_set(mydict, key, data, NULL);
   }
-  fclose(fInput);
+  fclose(fpInput);
 }
 
 /* Injecting time */
index 2ec75dd..500cbe4 100644 (file)
@@ -689,6 +689,7 @@ INPUT                  = doxygen/index.doc \
                          @CMAKE_HOME_DIRECTORY@/include/simgrid \
                          @CMAKE_HOME_DIRECTORY@/include/simgrid/s4u \
                          @CMAKE_HOME_DIRECTORY@/src/include/surf \
+                         @CMAKE_HOME_DIRECTORY@/src/include/xbt \
                          @CMAKE_HOME_DIRECTORY@/src/msg/ \
                          @CMAKE_HOME_DIRECTORY@/src/kernel/ \
                          @CMAKE_HOME_DIRECTORY@/src/kernel/activity/ \
index 0852c34..f7a049a 100644 (file)
@@ -26,7 +26,7 @@ your version (as long as your version is as free as ours). It also
 means that SimGrid is developed by a vivid community of users and
 developers. We hope that you will come and join us!
 
-SimGrid is the result of over 15 years of research from several
+SimGrid is the result of almost 20 years of research from several
 groups, both in France and in the USA. It benefited of many funding
 from various research instances, including the ANR, Inria, CNRS,
 University of Lorraine, University of Hawai'i at Manoa, ENS Rennes and
diff --git a/doc/doxygen/image/eclipseScreenShot.png b/doc/doxygen/image/eclipseScreenShot.png
new file mode 100644 (file)
index 0000000..4111737
Binary files /dev/null and b/doc/doxygen/image/eclipseScreenShot.png differ
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..186ec03 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,14 +92,16 @@ 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
+ - Document the tag on https://github.com/simgrid/simgrid/releases
  - Mail the simgrid-user mailing list
     - the NEWS chunk in the mail;
     - the ChangeLog chunk as attachment
  - Also mail some other lists (G5K users), with only the NEWS chunk
    and the link to the download section
-- Release the debian package   
+- Release the debian package
+- Update the simgrid/package.py for spack: https://github.com/solverstack/spack
 - Create the template for the next release in ChangeLog and NEWS files
 - Change the release number in CMakeLists.txt
 
index c8195c2..38732f6 100644 (file)
@@ -244,7 +244,7 @@ configurations. It takes a long time to answer, and it often reports
 issues but when it's green, then you know that SimGrid is very fit!
 We use <a href="https://travis-ci.org/simgrid/simgrid">Travis</a> to
 quickly run some tests on Linux and Mac. It answers quickly but may
-miss issues. And we use <a href="https://ci.appveyor.com/project/simgrid/simgrid">AppVeyor</a>
+miss issues. And we use <a href="https://ci.appveyor.com/project/mquinson/simgrid">AppVeyor</a>
 to build and somehow test SimGrid on windows. 
 
 \subsection inside_tests_jenkins Jenkins on the Inria CI servers
@@ -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 4d4383b..e8f454b 100644 (file)
@@ -22,18 +22,25 @@ documentation.
 Here is a `CMakeLists.txt` that you can use as a starting point for
 your project. It builds two simulators from a given set of source files.
 
+You first need to copy the `FindSimGrid.cmake` (at the root of the
+SimGrid tree) into the `cmake/Modules` directory of your project.
+
 @verbatim
 project(MyFirstScheduler)
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+find_package(SimGrid REQUIRED)
+include_directories(${SimGrid_INCLUDE_DIR})
+
 set(SIMULATOR_SOURCES main.c other.c util.c)
 add_executable(my_simulator ${SIMULATOR_SOURCES})
-target_link_libraries(my_simulator simgrid)
+target_link_libraries(my_simulator ${SimGrid_LIBRARY})
 
 set(OTHER_SOURCES blah.c bar.c foo.h)
 add_executable(other_xp ${OTHER_SOURCES})
-target_link_libraries(other_xp simgrid)
+target_link_libraries(other_xp ${SimGrid_LIBRARY})
 @endverbatim
 
 @section install_yours_makefile Building your project with Makefile
@@ -84,7 +91,17 @@ clean:
 .PHONY: clean
 @endverbatim
 
-@section install_yours_javaexamples Building the Java examples in Eclipse
+@section install_yours_cppeclipsedevenv Develop in C++ with SimGrid with Eclipse
+
+If you wish to develop your plugin or modify SimGrid using Eclipse. You have to run cmake and import it as a Makefile project. 
+
+Next you have to activate C++11 in your build settings, add -std=c++11 in the CDT GCC Built-in compiler settings.
+
+ \image html eclipseScreenShot.png "Eclipse preference page" width=10cm
+
+
+
+@section install_yours_javaexample  Building the Java examples in Eclipse
 
 If you want to build our Java examples in Eclipse, get the whole
 source code and open the archive on your disk. In Eclipse, select
index 7ee18cf..abd1c3c 100644 (file)
@@ -6,9 +6,11 @@ The S4U API is currently under heavy work, but will eventually
 deprecate the MSG and SimDag APIs. Everything that you can do in
 SimGrid will be possible in S4U. 
 
-@warning <b>S4U is not ready for public use yet</b>. You should not go
-        that path unless you know what you are doing.  If unsure,
-        proceed to @ref MSG_API instead.
+@warning <b>S4U is not as rock stable as the rest of SimGrid yet</b>. 
+        You are really welcome to test it, but be warned that the API
+        may change without notice between releases. This is however
+        the way to go if you want to create a new long-term project.
+        If you want to play safe, proceed to @ref MSG_API instead. 
 
 Unsurprisingly, the S4U interface matches the concepts presented in 
 @ref starting_components "the introduction". You should read this page
index 811a399..238ba47 100644 (file)
@@ -118,7 +118,7 @@ selector algorithms, that were collected directly in the source code
 of the targeted MPI implementations.
 
 You can switch the automatic selector through the
-\c smpi/coll_selector configuration item. Possible values:
+\c smpi/coll-selector configuration item. Possible values:
 
  - <b>ompi</b>: default selection logic of OpenMPI (version 1.7)
  - <b>mpich</b>: default selection logic of MPICH (version 3.0.4)
@@ -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 395f744..d2ce9de 100644 (file)
@@ -17,7 +17,6 @@
       - \ref XBT_dynar
       - \ref XBT_dict
       - \ref XBT_swag
-      - \ref XBT_heap
     - \ref XBT_misc
       - \ref XBT_graph
 
@@ -66,7 +65,6 @@
      /** @defgroup XBT_dynar  Dynar: generic dynamic array */
      /** @defgroup XBT_dict   Dict: generic dictionnary */
      /** @defgroup XBT_swag   Swag: O(1) set datatype */
-     /** @defgroup XBT_heap Heap: generic heap data structure */
 /** @} */
 
 
index 879a1bf..17acadd 100644 (file)
@@ -73,7 +73,7 @@ int main(int argc, char *argv[]) {
 - \c contexts/factory: \ref options_virt_factory
 - \c contexts/guard-size: \ref options_virt_guard_size
 - \c contexts/nthreads: \ref options_virt_parallel
-- \c contexts/parallel_threshold: \ref options_virt_parallel
+- \c contexts/parallel-threshold: \ref options_virt_parallel
 - \c contexts/stack-size: \ref options_virt_stacksize
 - \c contexts/synchro: \ref options_virt_parallel
 
@@ -112,7 +112,6 @@ int main(int argc, char *argv[]) {
 - \c network/maxmin-selective-update: \ref options_model_optim
 - \c network/model: \ref options_model_select
 - \c network/optim: \ref options_model_optim
-- \c network/sender_gap: \ref options_model_network_sendergap
 - \c network/TCP-gamma: \ref options_model_network_gamma
 - \c network/weight-S: \ref options_model_network_coefs
 
@@ -317,7 +316,7 @@ setting on regular (less constrained) scenarios so it is off by default.
 \subsubsection options_model_network_gamma Maximal TCP window size
 
 The analytical models need to know the maximal TCP window size to take
-the TCP congestion mechanism into account. This is set to 20000 by
+the TCP congestion mechanism into account. This is set to 4194304 by
 default, but can be changed using the \b network/TCP-gamma item.
 
 On linux, this value can be retrieved using the following
@@ -373,15 +372,6 @@ can be set to 0 (disable this feature) or 1 (enable it).
 
 Note that with the default host model this option is activated by default.
 
-\subsubsection options_model_network_sendergap Simulating sender gap
-
-(this configuration item is experimental and may change or disapear)
-
-It is possible to specify a timing gap between consecutive emission on
-the same network card through the \b network/sender-gap item. This
-is still under investigation as of writting, and the default value is
-to wait 10 microseconds (1e-5 seconds) between emissions.
-
 \subsubsection options_model_network_asyncsend Simulating asyncronous send
 
 (this configuration item is experimental and may change or disapear)
@@ -515,7 +505,7 @@ liveness violation) as well as the cycle for liveness properties. This dot file
 can then fed to the graphviz dot tool to generate an corresponding graphical
 representation.
 
-\subsection options_modelchecking_max_depth model-check/max_depth, Depth limit
+\subsection options_modelchecking_max_depth model-check/max-depth, Depth limit
 
 The \b model-checker/max-depth can set the maximum depth of the exploration
 graph of the model-checker. If this limit is reached, a logging message is
@@ -1282,10 +1272,10 @@ is registered and will clean up some variables and terminate/cleanup the tracing
 
 TODO: Add when this should be used.
 
-\subsection options_generic_path XML file inclusion path
+\subsection options_generic_path Profile files' search path
 
 It is possible to specify a list of directories to search into for the
-\<include\> tag in XML files by using the \b path configuration
+trace files (see @ref pf_trace) by using the \b path configuration
 item. To add several directory to the path, set the configuration
 item several times, as in \verbatim
 --cfg=path:toto --cfg=path:tutu
@@ -1302,7 +1292,7 @@ when \b verbose-exit is set to 0 (it is to 1 by default).
 \subsection options_exception_cutpath Truncate local path from exception backtrace
 
 \verbatim
---cfg=exceptions/cutpath:1
+--cfg=exception/cutpath:1
 \endverbatim
 
 This configuration option is used to remove the path from the
index d8a7ad3..59f5958 100644 (file)
@@ -121,9 +121,8 @@ tracing/uncategorized
 tracing/filename
 </b>:
   A file with this name will be created to register the simulation. The file
-  is in the Paje format and can be analyzed using Viva or Paje visualization
+  is in the Paje format and can be analyzed using Paje visualization
   tools. More information can be found in these webpages:
-     <a href="http://github.com/schnorr/viva/">http://github.com/schnorr/viva/</a>
      <a href="http://github.com/schnorr/pajeng/">http://github.com/schnorr/pajeng/</a>
 \verbatim
 --cfg=tracing/filename:mytracefile.trace
@@ -326,24 +325,6 @@ TODO
 TODO
 \endverbatim
 
-\li <b>\c
-viva/categorized
-</b>:
-  This option generates a graph configuration file for Viva considering
-  categorized resource utilization.
-\verbatim
---cfg=viva/categorized:graph_categorized.plist
-\endverbatim
-
-\li <b>\c
-viva/uncategorized
-</b>:
-  This option generates a graph configuration file for Viva considering
-  uncategorized resource utilization.
-\verbatim
---cfg=viva/uncategorized:graph_uncategorized.plist
-\endverbatim
-
 Please pass \verbatim --help-tracing \endverbatim to your simulator
 for the updated list of tracing options.
 
@@ -362,7 +343,6 @@ simulator):
           --cfg=tracing:yes \
           --cfg=tracing/uncategorized:yes \
           --cfg=tracing/filename:mytracefile.trace \
-          --cfg=viva/uncategorized:uncat.plist
 \endverbatim
 
 \li I want to trace only a subset of my MSG (or SimDAG) tasks.
@@ -377,7 +357,6 @@ recompiling, run your simulator with the following parameters:
           --cfg=tracing:yes \
           --cfg=tracing/categorized:yes \
           --cfg=tracing/filename:mytracefile.trace \
-          --cfg=viva/categorized:cat.plist
 \endverbatim
 
 
@@ -453,23 +432,6 @@ several options to analyze this trace file:
   file format</a>. Consider this option if you need to understand the
   causality of your distributed simulation.
 
-- Visualize the behavior of your simulation with treemaps (specially
-  if your simulation has a platform with several thousand resources),
-  provided by the <a href="http://github.com/schnorr/viva/">Viva</a>
-  visualization tool. See <a
-  href="https://github.com/schnorr/viva/wiki">Viva's wiki</a> for
-  further details on what is a treemap and how to use it.
-
-- Correlate the behavior of your simulator with the platform topology
-  with an interactive, force-directed, and hierarchical graph
-  visualization, provided by <a
-  href="http://github.com/schnorr/viva/">Viva</a>.  Check <a
-  href="https://github.com/schnorr/viva/wiki">Viva's wiki</a> for
-  further details. This <a
-  href="http://hal.inria.fr/hal-00738321/">research report</a>,
-  published at ISPASS 2013, has a detailed description of this
-  visualization technique.
-
 - You can also check our online <a
   href="http://simgrid.gforge.inria.fr/tutorials.html"> tutorial
   section</a> that contains a dedicated tutorial with several
@@ -484,123 +446,4 @@ several options to analyze this trace file:
   href="http://lists.gforge.inria.fr/pipermail/simgrid-user/">mailing
   list archive</a> for old messages regarding tracing and analysis.
 
-\subsection tracing_viva_analysis Viva Visualization Tool
-
-This subsection describe some of the concepts regarding the <a
-href="http://github.com/schnorr/viva/">Viva Visualization Tool</a> and
-its relation with SimGrid traces. You should refer to Viva's website
-for further details on all its visualization techniques.
-
-\subsubsection tracing_viva_time_slice Time Slice
-
-The analysis of a trace file using the tool always takes into account
-the concept of the <em>time-slice</em>.  This concept means that what
-is being visualized in the screen is always calculated considering a
-specific time frame, with its beggining and end timestamp. The
-time-slice is configured by the user and can be changed dynamically
-through the window called <em>Time Interval</em> that is opened
-whenever a trace file is being analyzed. Users are capable to select
-the beggining and size of the time slice.
-
-\subsubsection tracing_viva_graph Hierarchical Graph View
-
-As stated above (see section \ref tracing_tracing_analyzing), one
-possibility to analyze SimGrid traces is to use Viva's graph view with
-a graph configuration to customize the graph according to the
-traces. A valid graph configuration (we are using the non-XML <a
-href="http://en.wikipedia.org/wiki/Property_list">Property List
-Format</a> to describe the configuration) can be created for any
-SimGrid-based simulator using the
-<em>--cfg=viva/uncategorized:graph_uncategorized.plist</em> or
-<em>--cfg=viva/categorized:graph_categorized.plist</em> (if the
-simulator defines resource utilization categories) when executing the
-simulation.
-
-\subsubsection basic_conf Basic Graph Configuration
-
-The basic description of the configuration is as follows:
-\verbatim
-{
-  node = (LINK, HOST, );
-  edge = (HOST-LINK, LINK-HOST, LINK-LINK, );
-\endverbatim
-
-The nodes of the graph will be created based on the <i>node</i>
-parameter, which in this case is the different <em>"HOST"</em>s and
-<em>"LINK"</em>s of the platform used to simulate. The <i>edge</i>
-parameter indicates that the edges of the graph will be created based
-on the <em>"HOST-LINK"</em>s, <em>"LINK-HOST"</em>s, and
-<em>"LINK-LINK"</em>s of the platform.  After the definition of these
-two parameters, the configuration must detail how the nodes
-(<em>HOST</em>s and <em>LINK</em>s) should be drawn.
-
-For that, the configuration must have an entry for each of
-the types used. For <em>HOST</em>, as basic configuration, we have:
-
-\verbatim
-  HOST = {
-    type = square;
-    size = power;
-    values = (power_used);
-  };
-\endverbatim
-
-The parameter <em>size</em> indicates which variable from the trace
-file will be used to define the size of the node HOST in the
-visualization. If the simulation was executed with availability
-traces, the size of the nodes will be changed according to these
-traces. The parameter <em>type</em> indicates which geometrical shape
-will be used to represent HOST, and the <em>values</em> parameter
-indicates which values from the trace will be used to fill the shape.
-
-For <em>LINK</em> we have:
-
-\verbatim
-  LINK = {
-    type = rhombus;
-    size = bandwidth;
-    values = (bandwidth_used);
-  };
-}
-\endverbatim
-
-The same configuration parameters are used here: <em>type</em> (with a
-rhombus), the <em>size</em> (whose value is from trace's bandwidth
-variable) and the <em>values</em>.
-
-\subsubsection custom_graph Customizing the Graph Representation
-
-Viva is capable to handle a customized graph representation based on
-the variables present in the trace file. In the case of SimGrid, every
-time a category is created for tasks, two variables in the trace file
-are defined: one to indicate node utilization (how much power was used
-by that task category), and another to indicate link utilization (how
-much bandwidth was used by that category). For instance, if the user
-declares a category named <i>request</i>, there will be variables
-named <b>p</b><i>request</i> and a <b>b</b><i>request</i> (<b>p</b>
-for power and <b>b</b> for bandwidth). It is important to notice that
-the variable <i>prequest</i> in this case is only available for HOST,
-and <i>brequest</i> is only available for LINK. <b>Example</b>:
-suppose there are two categories for tasks: request and compute. To
-create a customized graph representation with a proportional
-separation of host and link utilization, use as configuration for HOST
-and LINK this:
-
-\verbatim
-  HOST = {
-    type = square;
-    size = power;
-    values = (prequest, pcomputation);
-  };
-  LINK = {
-    type = rhombus;
-    size = bandwidth;
-    values = (brequest, bcomputation);
-  };
-\endverbatim
-
-This configuration enables the analysis of resource utilization by MSG
-tasks through the identification of load-balancing issues and network
-bottlenecks, for instance.
-
 */
index 6adb7d3..3149ffc 100644 (file)
@@ -113,7 +113,6 @@ provided by the [online documentation][fn:4] and by several tutorials:
 Several tools can be used to visualize the result of SimGrid
 simulations and get a better understanding of simulations.
 
-- [viva][fn:1] will be useful to make fancy graph or treemap visualizations.
 - [pajeng][fn:5] provides a Gantt-chart visualization.
 - [Vite][fn:6] also provides a Gantt-chart visualization.
 
@@ -122,7 +121,7 @@ may have to install from the source on other systems. Check the
 documentation of each software for more details.
 
 ~~~~{.sh}
-sudo apt-get install viva pajeng vite
+sudo apt-get install pajeng vite
 ~~~~
 
 \section intro_start Let's get started
@@ -158,16 +157,7 @@ specify the full path to simgrid-colorizer on the above line, such as
 \c /opt/simgrid/bin/simgrid-colorizer. If you did not install it at all,
 you can find it in <simgrid_root_directory>/bin/colorize.
 
-For a really fancy output, you should use [viva/triva][fn:1]:
-
-~~~~{.sh}
-./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:yes \
-    --cfg=tracing/uncategorized:yes --cfg=viva/uncategorized:uncat.plist
-LANG=C ; viva simgrid.trace uncat.plist
-~~~~
-
-For a more classical Gantt-Chart visualization, you can produce a
-[Paje][fn:5] trace:
+For a classical Gantt-Chart visualization, you can produce a [Paje][fn:5] trace:
 
 ~~~~{.sh}
 ./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:yes \
@@ -317,7 +307,7 @@ tasks processed). These debug messages can be activated as follows:
 ## Using the Tracing Mechanism
 
 SimGrid can trace all resource consumption and the outcome can be
-displayed with viva as illustrated in the section \ref intro_setup. However, when several
+displayed as illustrated in the section \ref intro_setup. However, when several
 masters are deployed, it is hard to understand what happens.
 
 ~~~~{.xml}
@@ -349,18 +339,7 @@ void TRACE_category(const char *category);
 void MSG_task_set_category (msg_task_t task, const char *category);
 ~~~~
 
-The outcome can then be visualized as follows:
-
-~~~~{.sh}
-./masterworker3 platforms/platform.xml deployment3.xml --cfg=tracing:yes\
-    --cfg=tracing/categorized:yes --cfg=viva/categorized:viva_cat.plist
-LANG=C; viva simgrid.trace viva_cat.plist
-~~~~
-
-Right now, you should realize that nothing is behaving like you
-expect. Most workers are idle even though input data are ridiculous
-and there are several masters deployed on the platform. Using a
-Gantt-chart visualization may help:
+The outcome can then be visualized as a Gantt-chart as follows:
 
 ~~~~{.sh}
 ./masterworker3 platforms/platform.xml deployment3.xml --cfg=tracing:yes \
@@ -368,8 +347,10 @@ Gantt-chart visualization may help:
 pajeng simgrid.trace
 ~~~~
 
-OK, so it should now be obvious that round robin is actually
-very bad.
+Right now, you should realize that nothing is behaving like you expect. Most
+workers are idle even though input data are ridiculous and there are several
+masters deployed on the platform. So it should now be obvious that round robin
+is actually very bad.
 
 ## Improving the Scheduling
 
@@ -436,8 +417,8 @@ bytes that you manage to distribute and process in one hour on
 \section intro_todo TODO: Points to improve for the next time
 
 - Propose equivalent exercises and skeleton in java.
-- Propose a virtualbox image with everything (simgrid, pajeng, viva,
-  ...) already set up.
+- Propose a virtualbox image with everything (simgrid, pajeng, ...) already set
+  up.
 - Ease the installation on mac OS X (binary installer) and
   windows.
 - Explain that programming in C or java and having a working
index 7a750df..67632a5 100644 (file)
@@ -208,7 +208,7 @@ The current implementation of the model-checker uses two distinct processes:
  - it spaws a child process for the SimGrid simulator/maestro and the simulated
    processes.
 
-They communicate using a `AF_UNIX` `SOCK_DGRAM` socket and exchange messages
+They communicate using a `AF_UNIX` `SOCK_SEQPACKET` socket and exchange messages
 defined in `mc_protocol.h`. The `SIMGRID_MC_SOCKET_FD` environment variable it
 set to the file descriptor of this socket in the child process.
 
index 9c0e265..e75eb78 100644 (file)
@@ -75,7 +75,7 @@ It is a portable library providing some grounding features such as \ref
 XBT_log, \ref XBT_ex and \ref XBT_config.
 
 XBT also encompass the following convenient C data structures:
-\ref XBT_dynar, \ref XBT_dict, \ref XBT_heap, and
+\ref XBT_dynar, \ref XBT_dict, and
 \ref XBT_swag. The code is being migrated in C++ so you should probably want
 to use standard C++ containers instead of them if possible.
 
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 89783e1..abdf45c 100644 (file)
@@ -64,9 +64,6 @@ Group MPI processes by location.
 \fB\-trace-resource\fR
 Trace resource utilization.
 .TP
-\fB\-trace-viva\fR
-Generate configuration for Viva's GraphView.
-.TP
 \fB\-trace-file\fR <tracefile>
 Name of the tracefile
 
index 0c8162e..0e1967b 100644 (file)
@@ -1,34 +1,34 @@
-set(app_bittorrent_files        Main  Common  Connection MessageTask Peer  Tracker TrackerTask)
-set(app_centralizedmutex_files  Main  Coordinator  GrantTask Node ReleaseTask  RequestTask)
-set(app_masterworker_files      Main  Master Worker) 
-set(app_pingpong_files          Main  PingPongTask Receiver Sender) 
-set(app_tokenring_files         Main RelayRunner)
-set(async_waitall_files         Main  Receiver Sender)
-set(async_yield_files           Main  Yielder)
-set(async_dsend_files           Main  Receiver Sender)
-set(cloud_masterworker_files    Main  Master Worker)
-set(cloud_migration_files       Main  Daemon Test TestHostOnOff XVM)
-set(dht_chord_files             Main  ChordTask  Common FindSuccessorAnswerTask  FindSuccessorTask
+set(app-bittorrent_files        Main  Common  Connection MessageTask Peer  Tracker TrackerTask)
+set(app-centralizedmutex_files  Main  Coordinator  GrantTask Node ReleaseTask  RequestTask)
+set(app-masterworker_files      Main  Master Worker)
+set(app-pingpong_files          Main  PingPongTask Receiver Sender)
+set(app-tokenring_files         Main  RelayRunner)
+set(async-waitall_files         Main  Receiver Sender)
+set(async-yield_files           Main  Yielder)
+set(async-dsend_files           Main  Receiver Sender)
+set(cloud-masterworker_files    Main  Master Worker)
+set(cloud-migration_files       Main  Daemon Test TestHostOnOff XVM)
+set(dht-chord_files             Main  ChordTask  Common FindSuccessorAnswerTask  FindSuccessorTask
                                       GetPredecessorAnswerTask GetPredecessorTask Node  NotifyTask)
-set(dht_kademlia_files          Main  Answer  Bucket  Common Contact FindNodeAnswerTask  FindNodeTask
+set(dht-kademlia_files          Main  Answer  Bucket  Common Contact FindNodeAnswerTask  FindNodeTask
                                       KademliaTask  Node  PingAnswerTask PingTask  RoutingTable)
-set(trace_pingpong_files        Main  PingPongTask Receiver Sender) 
-set(energy_consumption_files    Main  EnergyConsumer)
-set(energy_pstate_files         Main  PstateRunner)
-set(energy_vm_files             Main  EnergyVMRunner)
-set(io_file_files               Main  Node)
-set(io_storage_files            Main  Client)
-set(process_kill_files          Main  Killer  Victim)
-set(process_migration_files     Main  Emigrant  Policeman)
-set(process_startkilltime_files Main Sleeper)
-set(process_suspend_files       Main  DreamMaster  LazyGuy)
-set(task_priority_files         Main  Test)
+set(trace-pingpong_files        Main  PingPongTask Receiver Sender)
+set(energy-consumption_files    Main  EnergyConsumer)
+set(energy-pstate_files         Main  PstateRunner)
+set(energy-vm_files             Main  EnergyVMRunner)
+set(io-file_files               Main  Node)
+set(io-storage_files            Main  Client)
+set(process-kill_files          Main  Killer  Victim)
+set(process-migration_files     Main  Emigrant  Policeman)
+set(process-startkilltime_files Main  Sleeper)
+set(process-suspend_files       Main  DreamMaster  LazyGuy)
+set(task-priority_files         Main  Test)
 
 
-foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong app_tokenring async_yield async_waitall async_dsend
-         cloud_migration cloud_masterworker dht_chord dht_kademlia energy_consumption energy_pstate energy_vm io_file io_storage 
-         process_kill process_migration process_startkilltime process_suspend task_priority trace_pingpong)
-  string (REPLACE "_" "/" example_dir ${example})
+foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpong app-tokenring async-yield async-waitall async-dsend
+         cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm io-file io-storage
+         process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong)
+  string (REPLACE "-" "/" example_dir ${example})
   set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir})
   foreach (filename ${${example}_files} )
     set( ${example}_sources "${${example}_sources}" "${srcdir}/${filename}.java")
@@ -36,15 +36,15 @@ foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpo
 
   if(enable_java)
     add_custom_command(
-      COMMENT "Building java_${example}..."
-      OUTPUT ${example_dir}/java_${example}_compiled
+      COMMENT "Building java-${example}..."
+      OUTPUT ${example_dir}/java-${example}_compiled
       DEPENDS ${example_sources} simgrid-java_jar ${SIMGRID_JAR}
       COMMAND ${CMAKE_COMMAND} -E make_directory ${example_dir}
       COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${${example}_sources}
-      COMMAND ${CMAKE_COMMAND} -E remove ${example_dir}/java_${example}_compiled
-      COMMAND ${CMAKE_COMMAND} -E touch ${example_dir}/java_${example}_compiled
+      COMMAND ${CMAKE_COMMAND} -E remove ${example_dir}/java-${example}_compiled
+      COMMAND ${CMAKE_COMMAND} -E touch ${example_dir}/java-${example}_compiled
     )
-    add_custom_target(${example} ALL DEPENDS ${example_dir}/java_${example}_compiled)
+    add_custom_target(java-${example} ALL DEPENDS ${example_dir}/java-${example}_compiled)
   endif()
   set(examples_src  ${examples_src}  ${${example}_sources})
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh)
@@ -64,10 +64,10 @@ set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bi
                                    ${CMAKE_CURRENT_SOURCE_DIR}/task/priority/priority.xml                  PARENT_SCOPE)
 
 if(enable_java)
-  foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong app_tokenring async_yield async_waitall async_dsend
-           cloud_migration cloud_masterworker dht_chord dht_kademlia energy_consumption energy_pstate energy_vm io_file io_storage 
-           process_kill process_migration process_startkilltime process_suspend task_priority trace_pingpong)
-    string (REPLACE "_" "/" example_dir ${example})
+  foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpong app-tokenring async-yield async-waitall async-dsend
+           cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm io-file io-storage
+           process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong)
+    string (REPLACE "-" "/" example_dir ${example})
     ADD_TESH(java-${example}  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
   endforeach()
 endif()
index 0eb1eaa..b7f7718 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
@@ -18,7 +18,7 @@ class Common {
   public static final int MESSAGE_SIZE = 1; /* Information message size */
   public static final int MAXIMUM_PEERS = 50;  /* Max number of peers sent by the tracker to clients */
   public static final int TRACKER_QUERY_INTERVAL = 1000;  /* Interval of time where the peer should send a request to the tracker */
-  public static final double TRACKER_COMM_SIZE = 0.01;  /* Communication size for a task to the tracker */
+  public static final double TRACKER_COMM_SIZE = 1;  /* Communication size for a task to the tracker */
   public static final int GET_PEERS_TIMEOUT = 10000;  /* Timeout for the get peers data */
   public static final int TIMEOUT_MESSAGE = 10;
   public static final int TRACKER_RECEIVE_TIMEOUT = 10;
index 668283a..1bd47eb 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
@@ -32,7 +32,6 @@ public class Connection {
   // Add a new value to the peer speed average
   public void addSpeedValue(double speed) {
     peerSpeed = peerSpeed * 0.55 + speed * 0.45;
-    // peerSpeed = (peerSpeed * messagesCount + speed) / (++messagesCount);    
   }
 
   @Override
index b918505..352addb 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014,2016. 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. */
@@ -7,7 +6,6 @@
 package app.bittorrent;
 
 import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
 import org.simgrid.msg.RngStream;
 
 class Main{
@@ -15,7 +13,7 @@ class Main{
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     int[] seed = { 12345, 12345, 12345, 12345, 12345, 12345 };
     RngStream.setPackageSeed(seed);
 
index 94d0a68..8c07d84 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
@@ -325,6 +325,9 @@ public class Peer extends Process {
           }
         }
       break;
+      default:
+        Msg.error("Unexpected message type: " + message.type);
+        break;
     }
     if (remotePeer != null) {
       remotePeer.addSpeedValue(1 / (Msg.getClock() - beginReceiveTime));
@@ -384,14 +387,12 @@ public class Peer extends Process {
     if (currentPieces.size() >= (Common.FILE_PIECES - pieces)) {
       return;
     }
-//    if (pieces < 3) {
-      do {
-        currentPiece = stream.randInt(0,Common.FILE_PIECES - 1);
-      } while (!(bitfield[currentPiece] == '0' && !currentPieces.contains(currentPiece)));
-//    }
-//    else {
-      //TODO trivial min algorithm.
-//    }
+
+    //TODO: trivial min algorithm when pieces >= 3
+    do {
+      currentPiece = stream.randInt(0,Common.FILE_PIECES - 1);
+    } while (!(bitfield[currentPiece] == '0' && !currentPieces.contains(currentPiece)));
+
     currentPieces.add(currentPiece);
     Msg.debug("New interested piece: " + currentPiece);
     assert currentPiece >= 0 && currentPiece < Common.FILE_PIECES;
index d252ee4..4c051d6 100644 (file)
@@ -21,8 +21,8 @@ class Main {
     /* initialize the MSG simulation. Must be done before anything else (even logging). */
     Msg.init(args);
 
-    String platf  = args.length > 1 ? args[0] : "examples/java/platform.xml";
-    String deploy =  args.length > 1 ? args[1] : "examples/java/masterworker/masterworkerDeployment.xml";
+    String platf  = args.length > 1 ? args[0] : "../platforms/small_platform.xml";
+    String deploy =  args.length > 1 ? args[1] : "app/masterworker/masterworker.xml";
 
     Msg.verb("Platform: "+platf+"; Deployment:"+deploy+"; Current directory: "+new File(".").getAbsolutePath());
 
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 754dad0..e633676 100644 (file)
@@ -1,11 +1,10 @@
-/* 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. */
 
 package app.tokenring;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Process;
 
@@ -15,7 +14,7 @@ class Main {
                throw new IllegalAccessError("Utility class");
        }
 
-       public static void main(String[] args) throws HostNotFoundException {
+       public static void main(String[] args) {
                Msg.init(args);
                
                String platform = "../platforms/small_platform.xml";
index 0822c42..cbdf523 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006-2014, 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. */
@@ -13,7 +12,6 @@ package async.dsend;
  */
 
 import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.Msg;
 
 class Main {
@@ -22,7 +20,7 @@ class Main {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws HostNotFoundException {
+  public static void main(String[] args) {
     Msg.init(args);
 
     String platform = "../platforms/small_platform.xml";
similarity index 100%
rename from examples/java/async/dsend/async_dsend.tesh
rename to examples/java/async/dsend/async-dsend.tesh
index c886a64..94b0015 100644 (file)
@@ -17,9 +17,9 @@ $ java -classpath ${classpath:=.} async/dsend/Main ${srcdir:=.}/../platforms/sma
 > [  0.000000] (1:Sender@Boivin) Sending "Task_5" to "Jupiter"
 > [  0.000000] (1:Sender@Boivin) Sending "Task_6" to "Tremblay"
 > [  0.000000] (1:Sender@Boivin) All tasks have been (asynchronously) dispatched. Let's sleep for 20s so that nobody gets a message from a terminated process.
-> [  1.933362] (2:Receiver@Bourassa) Received a task. I'm done. See you!
-> [  1.933362] (4:Receiver@Ginette) Received a task. I'm done. See you!
 > [  1.933362] (6:Receiver@Jupiter) Received a task. I'm done. See you!
+> [  1.933362] (4:Receiver@Ginette) Received a task. I'm done. See you!
+> [  1.933362] (2:Receiver@Bourassa) Received a task. I'm done. See you!
 > [  2.449247] (7:Receiver@Tremblay) Received a task. I'm done. See you!
 > [  2.964768] (3:Receiver@Fafard) Received a task. I'm done. See you!
 > [  4.162002] (5:Receiver@Jacquelin) Received a task. I'm done. See you!
index 208e554..0a54479 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006-2014, 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. */
@@ -20,14 +19,13 @@ package async.waitall;
 
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.MsgException;
 
 class Main {
   private Main() {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     Msg.init(args);
 
     String platform = "../platforms/small_platform.xml";
@@ -16,9 +16,9 @@ $ java -classpath ${classpath:=.} async/waitall/Main ${srcdir:=.}/../platforms/s
 > [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_5' to 'Jupiter'
 > [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_6' to 'Tremblay'
 > [  0.000000] (1:Sender@Boivin) All tasks have been (asynchronously) dispatched. Let's wait for their completion.
-> [  1.933362] (2:Receiver@Bourassa) I got my task, good bye.
-> [  1.933362] (4:Receiver@Ginette) I got my task, good bye.
 > [  1.933362] (6:Receiver@Jupiter) I got my task, good bye.
+> [  1.933362] (4:Receiver@Ginette) I got my task, good bye.
+> [  1.933362] (2:Receiver@Bourassa) I got my task, good bye.
 > [  2.449247] (7:Receiver@Tremblay) I got my task, good bye.
 > [  2.964768] (3:Receiver@Fafard) I got my task, good bye.
 > [  4.162002] (5:Receiver@Jacquelin) I got my task, good bye.
index 6e044a5..475fd39 100644 (file)
@@ -12,7 +12,6 @@ package async.yield;
  */
 
 import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.Msg;
 
 class Main {
@@ -21,7 +20,7 @@ class Main {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws HostNotFoundException {
+  public static void main(String[] args) {
     Msg.init(args);
 
     String platform = "../platforms/small_platform.xml";
index e78204c..5623ffa 100644 (file)
@@ -9,7 +9,6 @@ import java.io.File;
 
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.MsgException;
 
 class Main {
   public static final double TASK_COMP_SIZE = 10;
@@ -21,7 +20,7 @@ class Main {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     Msg.init(args); 
 
     String platfFile = "../../examples/platforms/small_platform.xml";
@@ -30,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 ea80d77..b005c1f 100644 (file)
@@ -55,16 +55,6 @@ public class Master extends Process {
                        Msg.verb("Sleep long enough for everyone to be done with previous batch of work");
                        waitFor(1000*step - Msg.getClock());
 
-                       /*    Msg.info("Add one more process per VM.");
-    for (int i = 0; i < vms.size(); i++) {
-      VM vm = vms.get(i);
-      Worker worker = new Worker(vm,i + vms.size());
-      worker.start();
-    }
-
-    workBatch(workersCount * 2);
-                        */
-
                        Msg.verb("Migrate everyone to "+hosts[3].getName());
                        for (VM vm : vms) {
                                Msg.verb("Migrate "+vm.getName()+" to "+hosts[3].getName());
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 3cc30ea..10407a6 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* 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. */
@@ -9,7 +8,6 @@ package cloud.migration;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.VM;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.HostFailureException;
 
 public class XVM extends VM {
@@ -30,7 +28,6 @@ public class XVM extends VM {
   public void setLoad(int load){  
     if (load >0) {
       this.setBound(this.getSpeed()*load/100);
-      //    this.getDaemon().setLoad(load);
       daemon.resume();
     } else{
       daemon.suspend();
@@ -38,13 +35,10 @@ public class XVM extends VM {
     currentLoad = load ;
   }
 
-  public void start(){
+  @Override
+  public void start() {
     super.start();
-    try {
-      daemon.start();
-    } catch (HostNotFoundException e) {
-      e.printStackTrace();
-    }
+    daemon.start();
     this.setLoad(0);
   }
 
@@ -53,10 +47,11 @@ 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;
   }
 
+  @Override
   public void migrate(Host host) throws HostFailureException {
     Msg.info("Start migration of VM " + this.getName() + " to " + host.getName());
     Msg.info("    currentLoad:" + this.currentLoad + "/ramSize:" + this.ramsize + "/dpIntensity:" + this.dpIntensity 
index f29ead5..94e8112 100644 (file)
@@ -64,47 +64,49 @@ public class Node extends Process {
 
       joinSuccess = join(knownId);
     }
-    if (joinSuccess) {
-      double currentClock = Msg.getClock();
-      while (currentClock < (initTime + deadline) && currentClock < Common.MAX_SIMULATION_TIME) {
-        if (commReceive == null) {
-          commReceive = Task.irecv(this.mailbox);
-        }
-        try {
-          if (!commReceive.test()) {
-            if (currentClock >= nextStabilizeDate) {
-              stabilize();
-              nextStabilizeDate = Msg.getClock() + Common.PERIODIC_STABILIZE_DELAY;
-            } else if (currentClock >= nextFixFingersDate) {
-              fixFingers();
-              nextFixFingersDate = Msg.getClock() + Common.PERIODIC_FIX_FINGERS_DELAY;
-            } else if (currentClock >= nextCheckPredecessorDate) {
-              this.checkPredecessor();
-              nextCheckPredecessorDate = Msg.getClock() + Common.PERIODIC_CHECK_PREDECESSOR_DELAY;
-            } else if (currentClock >= nextLookupDate) {
-              this.randomLookup();
-              nextLookupDate = Msg.getClock() + Common.PERIODIC_LOOKUP_DELAY;
-            } else {
-              waitFor(5);
-            }
-            currentClock = Msg.getClock();
+
+    if (!joinSuccess) {
+      Msg.info("I couldn't join the ring");
+      return;
+    }
+
+    double currentClock = Msg.getClock();
+    while (currentClock < (initTime + deadline) && currentClock < Common.MAX_SIMULATION_TIME) {
+      if (commReceive == null) {
+        commReceive = Task.irecv(this.mailbox);
+      }
+      try {
+        if (!commReceive.test()) {
+          if (currentClock >= nextStabilizeDate) {
+            stabilize();
+            nextStabilizeDate = Msg.getClock() + Common.PERIODIC_STABILIZE_DELAY;
+          } else if (currentClock >= nextFixFingersDate) {
+            fixFingers();
+            nextFixFingersDate = Msg.getClock() + Common.PERIODIC_FIX_FINGERS_DELAY;
+          } else if (currentClock >= nextCheckPredecessorDate) {
+            this.checkPredecessor();
+            nextCheckPredecessorDate = Msg.getClock() + Common.PERIODIC_CHECK_PREDECESSOR_DELAY;
+          } else if (currentClock >= nextLookupDate) {
+            this.randomLookup();
+            nextLookupDate = Msg.getClock() + Common.PERIODIC_LOOKUP_DELAY;
           } else {
-            handleTask(commReceive.getTask());
-            currentClock = Msg.getClock();
-            commReceive = null;
+            waitFor(5);
           }
-        }
-        catch (Exception e) {
+          currentClock = Msg.getClock();
+        } else {
+          handleTask(commReceive.getTask());
           currentClock = Msg.getClock();
           commReceive = null;
         }
       }
-      leave();
-      if (commReceive != null) {
+      catch (Exception e) {
+        currentClock = Msg.getClock();
         commReceive = null;
       }
-    } else {
-      Msg.info("I couldn't join the ring");
+    }
+    leave();
+    if (commReceive != null) {
+      commReceive = null;
     }
   }
 
@@ -330,7 +332,6 @@ public class Node extends Process {
   // Performs a find successor request to a random id.
   private void randomLookup() {
     int dest = 1337;
-    //Msg.info("Making a lookup request for id " + dest);
     findSuccessor(dest);
   }
 
similarity index 95%
rename from examples/java/dht/chord/dht_chord.tesh
rename to examples/java/dht/chord/dht-chord.tesh
index 85328dc..4ab498e 100644 (file)
@@ -4,7 +4,7 @@
 
 $ java -classpath ${classpath:=.} dht/chord/Main ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/dht/chord/chord.xml
 > [0.000000] [java/INFO] Using regular java threads.
-> [1046.787586] [java/INFO] MSG_main finished; Cleaning up the simulation...
+> [1046.732943] [java/INFO] MSG_main finished; Cleaning up the simulation...
 > [node-1.acme.org:dht.chord.Node:(2) 0.000000] [java/INFO] Joining the ring with id 366680 knowing node 42
 > [node-2.acme.org:dht.chord.Node:(3) 0.000000] [java/INFO] Joining the ring with id 533744 knowing node 366680
 > [node-3.acme.org:dht.chord.Node:(4) 0.000000] [java/INFO] Joining the ring with id 1319738 knowing node 42
index dacbfae..9032779 100644 (file)
@@ -1,19 +1,17 @@
-/* Copyright (c) 2012-2014, 2016. 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. */
 
 package dht.kademlia;
 import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
 
 class Main {
   private Main() {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     Msg.init(args);
     if(args.length < 2) {
       Msg.info("Usage   : Kademlia platform_file deployment_file");
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 c5f88b2..ed1552e 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
@@ -67,7 +67,8 @@ public class RoutingTable {
       Msg.debug("Adding " + id + " to my routing table");
       bucket.add(id);
       if (bucket.size() > Common.BUCKET_SIZE)  {
-        //TODO: Ping the least seen guy and remove him if he is offline.
+        // TODO
+        Msg.debug("Should ping the least seen guy and remove him if he is offline.");
       }
     }
   }
index f6c3afa..01eedb8 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. */
@@ -6,7 +6,6 @@
 package energy.pstate;
 
 import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.Msg;
 
 class Main {
@@ -14,7 +13,7 @@ class Main {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws HostNotFoundException {
+  public static void main(String[] args) {
     Msg.energyInit();
     Msg.init(args);
 
similarity index 100%
rename from examples/java/energy/vm/energy_vm.tesh
rename to examples/java/energy/vm/energy-vm.tesh
index 3afdf2d..7bae428 100644 (file)
@@ -8,12 +8,12 @@ $ java -classpath ${classpath:=.} energy/vm/Main ${srcdir:=.}/../platforms/energ
 > [MyHost1:energy VM runner:(1) 0.000000] [java/INFO] Create two tasks on Host3: both inside a VM
 > [MyHost1:energy VM runner:(1) 0.000000] [java/INFO] Wait 5 seconds. The tasks are still running (they run for 3 seconds, but 2 tasks are co-located, so they run for 6 seconds)
 > [MyHost1:energy VM runner:(1) 5.000000] [java/INFO] Wait another 5 seconds. The tasks stop at some point in between
-> [MyHost3:p31:(6) 6.000000] [java/INFO] This worker is done.
-> [MyHost3:p312:(7) 6.000000] [java/INFO] This worker is done.
 > [MyHost2:p22:(5) 6.000000] [java/INFO] This worker is done.
+> [MyHost3:p312:(7) 6.000000] [java/INFO] This worker is done.
+> [MyHost3:p31:(6) 6.000000] [java/INFO] This worker is done.
 > [vmHost1:p12:(3) 6.000000] [java/INFO] This worker is done.
-> [vmHost3:p21:(4) 6.000000] [java/INFO] This worker is done.
 > [vmHost1:p11:(2) 6.000000] [java/INFO] This worker is done.
+> [vmHost3:p21:(4) 6.000000] [java/INFO] This worker is done.
 > [10.000000] [surf_energy/INFO] Total energy consumption: 4320.000000 Joules (used hosts: 4320.000000 Joules; unused/idle hosts: 0.000000)
 > [10.000000] [java/INFO] MSG_main finished; Cleaning up the simulation...
 > [10.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 1120.000000 Joules
index c1b72dd..d0dd64c 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014. 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. */
@@ -8,15 +7,15 @@ package io.file;
 
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.MsgException;
 
 public class Main {
   private Main() {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     Msg.init(args);
+    Msg.fileSystemInit();
     if(args.length < 1) {
       Msg.info("Usage   : IO platform_file ");
       Msg.info("example : IO ../platforms/storage/storage.xml ");
index 82ce689..edffbbc 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014. 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. */
@@ -22,7 +21,6 @@ import org.simgrid.msg.Msg;
 import org.simgrid.msg.File;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.Process;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.MsgException;
 
 public class Node extends Process {
@@ -33,17 +31,16 @@ public class Node extends Process {
 
   protected int rank;
 
-  public Node(Host host, int number) throws HostNotFoundException {
+  public Node(Host host, int number) {
     super(host, Integer.toString(number), null);
     this.rank = number;
   }
 
   public void main(String[] args) throws MsgException {
-    String mount;
+    String mount = "/home";
     String fileName;
     switch (rank) {
       case 4:
-        mount = "/home";
         fileName = mount + file1;
       break;
       case 0:
@@ -51,16 +48,14 @@ public class Node extends Process {
         fileName = mount + file2;
       break;
       case 2:
-        mount = "/home";
         fileName = mount + file3;
       break;
       case 1:
-        mount = "/home";
         fileName = mount + file4;
       break;
       default:
-        mount = "/home";
         fileName = mount + file1;
+      break;
     }
 
     Msg.info("Open file " + fileName);
index e3e6fcd..2239ffb 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014. 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. */
 
 package io.storage;
 
+import java.util.Arrays;
+import java.util.Comparator;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.Process;
 import org.simgrid.msg.Storage;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.MsgException;
 
 public class Client extends Process {
-  public Client(Host host, int number) throws HostNotFoundException {
+  public Client(Host host, int number) {
     super(host, Integer.toString(number), null);
   }
 
@@ -32,6 +32,11 @@ public class Client extends Process {
    // Retrieve all mount points of current host
     Storage[] storages = getHost().getMountedStorage();
 
+    Arrays.sort(storages, new Comparator<Storage>() {
+        public int compare(Storage a, Storage b) {
+          return a.getName().compareTo(b.getName());
+        }
+      });
     for (int i = 0; i < storages.length; i++) {
       // For each disk mounted on host
       Msg.info("------------------------------------");
@@ -63,4 +68,4 @@ public class Client extends Process {
       Msg.info("Disk: "+ stos[i].getName());
     }
   }
-}
\ No newline at end of file
+}
index 6755fa4..0e8392e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014. 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. */
@@ -7,15 +6,15 @@
 package io.storage;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.MsgException;
 
 public class Main {
   private Main() {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     Msg.init(args);
+    Msg.fileSystemInit();
     if(args.length < 1) {
       Msg.info("Usage   : Storage platform_file ");
       Msg.info("example : Storage ../platforms/storage/storage.xml ");
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 fd301f3..272898f 100644 (file)
@@ -17,7 +17,7 @@ public class Main {
     Msg.init(args);
     if(args.length < 2) {
       Msg.info("Usage   : Priority platform_file deployment_file");
-      Msg.info("example : Priority ../platforms/platform.xml priorityDeployment.xml");
+      Msg.info("example : Priority ../platforms/small_platform.xml priority.xml");
       System.exit(1);
     }
 
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 ca06ab3..af786dc 100644 (file)
@@ -30,13 +30,6 @@ if(SIMGRID_HAVE_NS3)
   set_target_properties(network-ns3  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
 endif()
 
-add_executable       (bittorrent app-bittorrent/bittorrent.c app-bittorrent/messages.c app-bittorrent/peer.c app-bittorrent/tracker.c app-bittorrent/connection.c)
-target_link_libraries(bittorrent simgrid)
-set_target_properties(bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
-foreach (file bittorrent connection messages peer tracker)
-  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.c  ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.h)
-endforeach()
-
 add_executable       (chainsend app-chainsend/chainsend.c app-chainsend/iterator.c app-chainsend/common.c app-chainsend/messages.c app-chainsend/broadcaster.c app-chainsend/peer.c)
 target_link_libraries(chainsend simgrid)
 set_target_properties(chainsend PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-chainsend)
@@ -51,21 +44,19 @@ foreach (file answer dht-kademlia node routing_table task)
   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.c  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.h)
 endforeach()
 
-foreach (file app-bittorrent app-chainsend app-masterworker app-pingpong async-wait
+foreach (file app-chainsend app-masterworker app-pingpong async-wait
          async-waitall async-waitany dht-kademlia dht-pastry io-remote platform-properties process-yield 
          task-priority)
   set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml)
 endforeach()
 
 set(txt_files    ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/README.doc          PARENT_SCOPE)
-set(bin_files    ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/generate.py
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py
+set(bin_files    ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py
                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-pastry/generate.py                       PARENT_SCOPE)
 set(examples_src ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/chainsend.c
                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/common.h
                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/network-ns3.c                    PARENT_SCOPE)
-set(tesh_files   ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent.tesh
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/app-chainsend.tesh
+set(tesh_files   ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/app-chainsend.tesh
                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/dht-kademlia.tesh
                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore.tesh
                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi.tesh
@@ -89,7 +80,7 @@ set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/a
                                   ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_kill_d.xml       PARENT_SCOPE)
 
-foreach(x app-bittorrent app-chainsend app-masterworker app-pingpong app-token-ring
+foreach(x app-chainsend app-masterworker app-pingpong app-token-ring
           async-wait async-waitall async-waitany cloud-capping cloud-masterworker cloud-migration cloud-simple 
           cloud-two-tasks dht-pastry dht-kademlia platform-failures io-file io-remote io-storage task-priority 
           process-create process-daemon process-join process-kill process-migration process-startkilltime process-suspend process-yield
@@ -105,11 +96,10 @@ foreach (x categories route-user-variables link-user-variables masterworker plat
   ADD_TESH(msg-trace-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/trace-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/trace-${x} trace-${x}.tesh)
 endforeach()
 
-ADD_TESH_FACTORIES(msg-app-bittorrent-parallel         "thread;ucontext;raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/app-bittorrent --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/app-bittorrent app-bittorrent.tesh)
-ADD_TESH_FACTORIES(msg-dht-kademlia-parallel           "thread;ucontext;raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/dht-kademlia --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia dht-kademlia.tesh)
+ADD_TESH_FACTORIES(msg-dht-kademlia-parallel           "thread;ucontext;raw;boost" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/dht-kademlia --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia dht-kademlia.tesh)
 ADD_TESH_FACTORIES(msg-energy-pstate-ptask             "thread;ucontext;raw;boost" --cfg host/model:ptask_L07 --log xbt_cfg.threshold:critical --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy-pstate/energy-pstate.tesh)
 ADD_TESH_FACTORIES(msg-energy-consumption-ptask        "thread;ucontext;raw;boost" --cfg host/model:ptask_L07 --log xbt_cfg.threshold:critical --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy-consumption/energy-consumption.tesh)
-ADD_TESH_FACTORIES(msg-energy-ptask                    "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy-ptask/energy-ptask.tesh)
+ADD_TESH_FACTORIES(msg-energy-ptask                    "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy-ptask/energy-ptask.tesh)
 ADD_TESH_FACTORIES(msg-plugin-hostload "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/ ${CMAKE_HOME_DIRECTORY}/examples/msg/plugin-hostload/plugin-hostload.tesh)
 if(NOT WIN32)
   ADD_TESH_FACTORIES(msg-maestro-set                     "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/maestro-set/maestro-set.tesh)
index 0e5654a..63afa51 100644 (file)
@@ -117,7 +117,7 @@ options to see the task executions:
     to that are used to classify its tasks. When the program is executed,
     the tracing mechanism registers the resource utilization of hosts
     and links according to these categories. Recommanded options:
-    @verbatim --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes --cfg=viva/categorized:viva_cat.plist --cfg=viva/uncategorized:viva_uncat.plist
+    @verbatim --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes
     @endverbatim
     
   - <b>Master Workers tracing</b>.
@@ -126,7 +126,7 @@ options to see the task executions:
     using several tracing features. It traces resource usage, sorted
     out in several categories; Trace marks and user variables are also
     used. Recommanded options:
-    @verbatim --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes --cfg=viva/categorized:viva_cat.plist --cfg=viva/uncategorized:viva_uncat.plist
+    @verbatim --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes
     @endverbatim
     
   - <b>Process migration tracing</b>.
@@ -139,7 +139,7 @@ options to see the task executions:
 
 TODO: These tracing examples should be integrated in the examples to
 not duplicate the C files. A full command line to see the result in
-the right tool (viva/vite/FrameSoc) should be given along with some
+the right tool (vite/FrameSoc) should be given along with some
 screenshots.
 
 @subsection msg_ex_tracing_user_variables Tracing user variables
diff --git a/examples/msg/app-bittorrent/messages.c b/examples/msg/app-bittorrent/messages.c
deleted file mode 100644 (file)
index d4c7c2b..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "messages.h"
-#include "bittorrent.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_messages, "Messages specific for the message factory");
-
-#define BITS_TO_BYTES(x) ((x / 8) + (x % 8) ? 1 : 0)
-
-/** @brief Build a new empty message
- * @param type type of the message
- * @param issuer_host_name hostname of the issuer, for debugging purposes
- * @param mailbox mailbox where the peer should answer
- * @param peer_id id of the issuer
- * @param size message size in bytes
- */
-msg_task_t task_message_new(e_message_type type, const char *issuer_host_name, const char *mailbox, int peer_id,
-                            int size)
-{
-  message_t message = xbt_new(s_message_t, 1);
-  message->issuer_host_name = issuer_host_name;
-  message->peer_id = peer_id;
-  message->mailbox = mailbox;
-  message->type = type;
-  msg_task_t task = MSG_task_create(NULL, 0, size, message);
-  XBT_DEBUG("type: %d size: %d", (int) type, size);
-  return task;
-}
-
-/** Builds a message containing an index. */
-msg_task_t task_message_index_new(e_message_type type, const char *issuer_host_name, const char *mailbox, int peer_id,
-                                  int index, int varsize)
-{
-  msg_task_t task = task_message_new(type, issuer_host_name, mailbox, peer_id, task_message_size(type) + varsize);
-  message_t message = MSG_task_get_data(task);
-  message->index = index;
-  return task;
-}
-
-msg_task_t task_message_bitfield_new(const char *issuer_host_name, const char *mailbox, int peer_id,
-                                     unsigned int bitfield, int bitfield_size)
-{
-  msg_task_t task = task_message_new(MESSAGE_BITFIELD, issuer_host_name, mailbox, peer_id,
-                                     task_message_size(MESSAGE_BITFIELD) + BITS_TO_BYTES(bitfield_size));
-  message_t message = MSG_task_get_data(task);
-  message->bitfield = bitfield;
-  return task;
-}
-
-msg_task_t task_message_request_new(const char *issuer_host_name, const char *mailbox, int peer_id, int index,
-                                    int block_index, int block_length)
-{
-  msg_task_t task = task_message_index_new(MESSAGE_REQUEST, issuer_host_name, mailbox, peer_id, index, 0);
-  message_t message = MSG_task_get_data(task);
-  message->block_index = block_index;
-  message->block_length = block_length;
-  return task;
-}
-
-msg_task_t task_message_piece_new(const char *issuer_host_name, const char *mailbox, int peer_id, int index,
-                                  int block_index, int block_length, int block_size)
-{
-  msg_task_t task = task_message_index_new(MESSAGE_PIECE, issuer_host_name, mailbox, peer_id, index,
-                                           block_length * block_size);
-  message_t message = MSG_task_get_data(task);
-  message->block_index = block_index;
-  message->block_length = block_length;
-  return task;
-}
-
-void task_message_free(void *task)
-{
-  message_t message = MSG_task_get_data(task);
-  xbt_free(message);
-  MSG_task_destroy(task);
-}
-
-int task_message_size(e_message_type type)
-{
-  int size = 0;
-  switch (type) {
-  case MESSAGE_HANDSHAKE:
-    size = MESSAGE_HANDSHAKE_SIZE;
-    break;
-  case MESSAGE_CHOKE:
-    size = MESSAGE_CHOKE_SIZE;
-    break;
-  case MESSAGE_UNCHOKE:
-    size = MESSAGE_UNCHOKE_SIZE;
-    break;
-  case MESSAGE_INTERESTED:
-  case MESSAGE_NOTINTERESTED:
-    size = MESSAGE_INTERESTED_SIZE;
-    break;
-  case MESSAGE_HAVE:
-    size = MESSAGE_HAVE_SIZE;
-    break;
-  case MESSAGE_BITFIELD:
-    size = MESSAGE_BITFIELD_SIZE;
-    break;
-  case MESSAGE_REQUEST:
-    size = MESSAGE_REQUEST_SIZE;
-    break;
-  case MESSAGE_PIECE:
-    size = MESSAGE_PIECE_SIZE;
-    break;
-  case MESSAGE_CANCEL:
-    size = MESSAGE_CANCEL_SIZE;
-    break;
-  default:
-    THROW_IMPOSSIBLE;
-  }
-  return size;
-}
diff --git a/examples/msg/app-bittorrent/tracker.h b/examples/msg/app-bittorrent/tracker.h
deleted file mode 100644 (file)
index 40e7d9d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program 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 BITTORRENT_TRACKER_H_
-#define BITTORRENT_TRACKER_H_
-#include <xbt/dynar.h>
-#include "bittorrent.h"
-/**
- * Tracker main function
- */
-int tracker(int argc, char *argv[]);
-/**
- * Task types exchanged between a node and the tracker
- */
-typedef enum {
-  TRACKER_TASK_QUERY,
-  TRACKER_TASK_ANSWER
-} e_tracker_task_type_t;
-/**
- * Tasks exchanged between a tracker and peers.
- */
-typedef struct s_tracker_task_data {
-  e_tracker_task_type_t type;   //type of the task
-  const char *mailbox;          //mailbox where the tracker should answer
-  const char *issuer_host_name; //hostname, for debug purposes
-  //Query data
-  int peer_id;                  //peer id
-  int uploaded;                 //how much the peer has already uploaded
-  int downloaded;               //how much the peer has downloaded
-  int left;                     //how much the peer has left
-  //Answer data
-  int interval;                 //how often the peer should contact the tracker (unused for now)
-  xbt_dynar_t peers;            //the peer list the peer has asked for.
-} s_tracker_task_data_t;
-typedef s_tracker_task_data_t *tracker_task_data_t;
-
-tracker_task_data_t tracker_task_data_new(const char *issuer_host_name, const char *mailbox, int peer_id,
-                                          int uploaded, int downloaded, int left);
-void tracker_task_data_free(tracker_task_data_t task);
-
-int is_in_list(xbt_dynar_t peers, int id);
-#endif                          /* BITTORRENT_TRACKER_H */
index 61a1aca..23c4484 100644 (file)
@@ -79,6 +79,7 @@ broadcaster_t broadcaster_init(xbt_dynar_t host_list, unsigned int piece_count)
   int status;
   broadcaster_t bc = xbt_new(s_broadcaster_t, 1);
 
+  bc->first             = NULL;
   bc->piece_count = piece_count;
   bc->current_piece = 0;
   bc->host_list = host_list;
@@ -114,9 +115,9 @@ int broadcaster(int argc, char *argv[])
   /* argv[2] is the number of pieces */
   if (argc > 2) {
     piece_count = xbt_str_parse_int(argv[2], "Invalid number of pieces: %s");
-    XBT_DEBUG("piece_count set to %d", piece_count);
+    XBT_DEBUG("piece_count set to %u", piece_count);
   } else {
-    XBT_DEBUG("No piece_count specified, defaulting to %d", piece_count);
+    XBT_DEBUG("No piece_count specified, defaulting to %u", piece_count);
   }
   broadcaster_t bc = broadcaster_init(host_list, piece_count);
 
index de72e55..1201149 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. 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
@@ -29,11 +29,11 @@ int peer_execute_task(peer_t peer, msg_task_t task)
   int done = 0;
   message_t msg = MSG_task_get_data(task);
 
-  XBT_DEBUG("Peer %s got message of type %d\n", peer->me, msg->type);
+  XBT_DEBUG("Peer %s got message of type %u\n", peer->me, msg->type);
   if (msg->type == MESSAGE_BUILD_CHAIN)
     peer_init_chain(peer, msg);
   else if (msg->type == MESSAGE_SEND_DATA) {
-    xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %d before initialization", msg->type);
+    xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %u before initialization", msg->type);
     if (peer->next != NULL)
       peer_forward_msg(peer, msg);
     peer->pieces++;
@@ -63,7 +63,7 @@ msg_error_t peer_wait_for_message(peer_t peer)
     if (idx != -1) {
       comm = xbt_dynar_get_as(peer->pending_recvs, idx, msg_comm_t);
       status = MSG_comm_get_status(comm);
-      XBT_DEBUG("peer_wait_for_message: error code = %d", status);
+      XBT_DEBUG("peer_wait_for_message: error code = %u", status);
       xbt_assert(status == MSG_OK, "peer_wait_for_message() failed");
 
       task = MSG_comm_get_task(comm);
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 6637734..97c19dd 100644 (file)
@@ -17,18 +17,18 @@ $ $SG_TEST_EXENV ${bindir:=.}/async-waitany ${srcdir:=.}/small_platform.xml ${sr
 > [ 10.000000] (3:receiver@Jupiter) Wait to receive task 1
 > [ 10.000000] (3:receiver@Jupiter) Wait to receive task 2
 > [ 10.423774] (2:receiver@Fafard) Processing "Task_4"
-> [ 10.469435] (3:receiver@Jupiter) Processing "Task_3"
+> [ 10.469435] (3:receiver@Jupiter) Processing "Task_5"
 > [ 11.079116] (2:receiver@Fafard) "Task_4" done
 > [ 11.079116] (2:receiver@Fafard) Processing "Task_0"
-> [ 11.124778] (3:receiver@Jupiter) "Task_3" done
+> [ 11.124778] (3:receiver@Jupiter) "Task_5" done
 > [ 11.124778] (3:receiver@Jupiter) Processing "Task_1"
 > [ 11.734459] (2:receiver@Fafard) "Task_0" done
 > [ 11.734459] (2:receiver@Fafard) Processing "Task_2"
 > [ 11.780120] (3:receiver@Jupiter) "Task_1" done
-> [ 11.780120] (3:receiver@Jupiter) Processing "Task_5"
+> [ 11.780120] (3:receiver@Jupiter) Processing "Task_3"
 > [ 12.389801] (2:receiver@Fafard) "Task_2" done
 > [ 12.415509] (2:receiver@Fafard) I'm done. See you!
-> [ 12.435462] (3:receiver@Jupiter) "Task_5" done
+> [ 12.435462] (3:receiver@Jupiter) "Task_3" done
 > [ 12.454477] (0:maestro@) Simulation time 12.4545
 > [ 12.454477] (1:sender@Tremblay) Goodbye now!
 > [ 12.454477] (3:receiver@Jupiter) I'm done. See you!
index 73b3eda..e84ac2c 100644 (file)
@@ -76,8 +76,8 @@ static void test_dynamic_change(void)
   MSG_process_create("worker0", worker_busy_loop_main, &task0, (msg_host_t)vm0);
   MSG_process_create("worker1", worker_busy_loop_main, &task1, (msg_host_t)vm1);
 
-  double task0_remain_prev = MSG_task_get_flops_amount(task0);
-  double task1_remain_prev = MSG_task_get_flops_amount(task1);
+  double task0_remain_prev = MSG_task_get_remaining_work_ratio(task0);
+  double task1_remain_prev = MSG_task_get_remaining_work_ratio(task1);
 
   const double cpu_speed = MSG_host_get_speed(pm0);
   for (int i = 0; i < 10; i++) {
@@ -86,8 +86,8 @@ static void test_dynamic_change(void)
     MSG_vm_set_bound(vm1, new_bound);
     MSG_process_sleep(100);
 
-    double task0_remain_now = MSG_task_get_flops_amount(task0);
-    double task1_remain_now = MSG_task_get_flops_amount(task1);
+    double task0_remain_now = MSG_task_get_remaining_work_ratio(task0);
+    double task1_remain_now = MSG_task_get_remaining_work_ratio(task1);
 
     double task0_flops_per_sec = task0_remain_prev - task0_remain_now;
     double task1_flops_per_sec = task1_remain_prev - task1_remain_now;
index 17242ba..86449a4 100644 (file)
@@ -122,8 +122,8 @@ static int master_fun(int argc, char *argv[])
   XBT_INFO("# Add one more process on each VM");
   xbt_dynar_foreach(vms, i, vm) {
     unsigned int index = i + xbt_dynar_length(vms);
-    char *vm_name = bprintf("VM%02d", i);
-    char *pr_name = bprintf("WRK%02d", index);
+    char* vm_name      = bprintf("VM%02u", i);
+    char* pr_name      = bprintf("WRK%02u", index);
 
     XBT_INFO("put a process (%s) on %s", pr_name, vm_name);
     MSG_process_create(pr_name, worker_fun, NULL, (msg_host_t)vm);
index e8b2d0b..1b0f499 100644 (file)
@@ -63,7 +63,7 @@ static int master_main(int argc, char *argv[])
 
   while(MSG_get_clock()<100) {
     if (atask != NULL)
-      XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask));
+      XBT_INFO("aTask remaining duration: %g", MSG_task_get_remaining_work_ratio(atask));
     MSG_process_sleep(1);
   }
 
index 6fb5f75..14b9020 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. 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
@@ -35,9 +35,9 @@ void answer_print(answer_t answer)
 {
   unsigned int cpt;
   node_contact_t contact;
-  XBT_INFO("Searching %08x, size %d", answer->destination_id, answer->size);
+  XBT_INFO("Searching %08x, size %u", answer->destination_id, answer->size);
   xbt_dynar_foreach(answer->nodes, cpt, contact) {
-    XBT_INFO("Node %08x: %08x is at distance %d", cpt, contact->id, contact->distance);
+    XBT_INFO("Node %08x: %08x is at distance %u", cpt, contact->id, contact->distance);
   }
 }
 
index c0c6999..d40ca6c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@ static int node(int argc, char *argv[])
     XBT_INFO("I couldn't join the network :(");
   }
   XBT_DEBUG("I'm leaving the network");
-  XBT_INFO("%d/%d FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
+  XBT_INFO("%u/%u FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
   node_free(node);
 
   return 0;
@@ -229,8 +229,8 @@ unsigned int find_node(node_t node, unsigned int id_to_find, unsigned int count_
               answers++;
 
               nodes_added = answer_merge(node_list, data->answer);
-              XBT_DEBUG("Received an answer from %s (%s) with %ld nodes on it",
-                        data->answer_to, data->issuer_host_name, xbt_dynar_length(data->answer->nodes));
+              XBT_DEBUG("Received an answer from %s (%s) with %lu nodes on it", data->answer_to, data->issuer_host_name,
+                        xbt_dynar_length(data->answer->nodes));
 
               task_free(node->task_received);
             } else {
@@ -254,12 +254,12 @@ unsigned int find_node(node_t node, unsigned int id_to_find, unsigned int count_
     if (count_in_stats)
       node->find_node_success++;
     if (queries > 4)
-      XBT_VERB("FIND_NODE on %08x success in %d steps", id_to_find, steps);
+      XBT_VERB("FIND_NODE on %08x success in %u steps", id_to_find, steps);
     node_routing_table_update(node, id_to_find);
   } else {
     if (count_in_stats) {
       node->find_node_failed++;
-      XBT_VERB("%08x not found in %d steps", id_to_find, steps);
+      XBT_VERB("%08x not found in %u steps", id_to_find, steps);
     }
   }
   answer_free(node_list);
index 17c786b..cecf9b6 100644 (file)
@@ -18,10 +18,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/dht-kademlia ${srcdir:=.}/cluster.xml ${srcdir:=.}
 > [  0.000000] (12:node@node-11.acme.org) Hi, I'm going to join the network with id 2047
 > [  0.000000] (13:node@node-12.acme.org) Hi, I'm going to join the network with id 4095
 > [780.000000] ( 7:node@node-6.acme.org) 5/5 FIND_NODE have succeeded
-> [780.000000] ( 9:node@node-8.acme.org) 5/5 FIND_NODE have succeeded
-> [780.000000] ( 3:node@node-2.acme.org) 6/6 FIND_NODE have succeeded
+> [780.000000] ( 9:node@node-8.acme.org) 6/6 FIND_NODE have succeeded
+> [780.000000] ( 3:node@node-2.acme.org) 5/5 FIND_NODE have succeeded
 > [780.000000] ( 2:node@node-1.acme.org) 6/6 FIND_NODE have succeeded
-> [780.000000] (11:node@node-10.acme.org) 5/5 FIND_NODE have succeeded
+> [780.000000] (11:node@node-10.acme.org) 6/6 FIND_NODE have succeeded
 > [780.000000] ( 1:node@node-0.acme.org) 7/7 FIND_NODE have succeeded
 > [780.000000] ( 5:node@node-4.acme.org) 6/6 FIND_NODE have succeeded
 > [780.000000] (13:node@node-12.acme.org) 6/6 FIND_NODE have succeeded
index c0741d6..2d8c22f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2012-2016. 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
@@ -20,7 +20,7 @@ node_t node_init(unsigned int node_id)
 
   node->id = node_id;
   node->table = routing_table_init(node_id);
-  snprintf(node->mailbox,MAILBOX_NAME_SIZE-1, "%d", node_id);
+  snprintf(node->mailbox, MAILBOX_NAME_SIZE - 1, "%u", node_id);
   node->find_node_failed = 0;
   node->find_node_success = 0;
 
@@ -139,7 +139,7 @@ unsigned int get_node_prefix(unsigned int id, unsigned int nb_bits)
 /** @brief Gets the mailbox name of a host given its identifier */
 void get_node_mailbox(unsigned int id, char *mailbox)
 {
-  snprintf(mailbox,MAILBOX_NAME_SIZE-1, "%d", id);
+  snprintf(mailbox, MAILBOX_NAME_SIZE - 1, "%u", id);
 }
 
 /** Constructor, build a new contact information. */
index d39741e..a109676 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2016. 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
@@ -51,9 +51,9 @@ void routing_table_print(routing_table_t table)
 
   for (unsigned int i = 0; i <= identifier_size; i++) {
     if (!xbt_dynar_is_empty(table->buckets[i].nodes)) {
-      XBT_INFO("Bucket number %d: ", i);
+      XBT_INFO("Bucket number %u: ", i);
       xbt_dynar_foreach(table->buckets[i].nodes, j, value) {
-        XBT_INFO("Element %d: %08x", j, value);
+        XBT_INFO("Element %u: %08x", j, value);
       }
     }
   }
@@ -90,7 +90,7 @@ bucket_t routing_table_find_bucket(routing_table_t table, unsigned int id)
 {
   unsigned int xor_number = table->id ^ id;
   unsigned int prefix = get_node_prefix(xor_number, identifier_size);
-  xbt_assert(prefix >= 0 && prefix <= identifier_size, "Tried to return a  bucket that doesn't exist.");
+  xbt_assert(prefix <= identifier_size, "Tried to return a  bucket that doesn't exist.");
   bucket_t bucket = &table->buckets[prefix];
   return bucket;
 }
index 517797e..c19cd35 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
@@ -190,27 +190,27 @@ static state_t node_get_state(node_t node) {
 }
 
 static void print_node_id(node_t node) {
-  XBT_INFO(" Id: %i '%08x' ", node->id, node->id);
+  XBT_INFO(" Id: %i '%08x' ", node->id, (unsigned)node->id);
 }
 
 static void print_node_neighborood_set(node_t node) {
   XBT_INFO(" Neighborhood:");
   for (int i=0; i<NEIGHBORHOOD_SIZE; i++)
-    XBT_INFO("  %08x", node->neighborhood_set[i]);
+    XBT_INFO("  %08x", (unsigned)node->neighborhood_set[i]);
 }
 
 static void print_node_routing_table(node_t node) {
   XBT_INFO(" Routing table:");
   for (int i=0; i<LEVELS_COUNT; i++){
     for (int j=0; j<LEVEL_SIZE; j++)
-      XBT_INFO("  %08x ", node->routing_table[i][j]);
+      XBT_INFO("  %08x ", (unsigned)node->routing_table[i][j]);
   }
 }
 /* Print the node namespace set */
 static void print_node_namespace_set(node_t node) {
   XBT_INFO(" Namespace:");
   for (int i=0; i<NAMESPACE_SIZE; i++)
-    XBT_INFO("  %08x", node->namespace_set[i]);
+    XBT_INFO("  %08x", (unsigned)node->namespace_set[i]);
 }
 
 /* Print the node information */
@@ -237,7 +237,7 @@ static void handle_task(node_t node, msg_task_t task) {
   e_task_type_t type = task_data->type;
   // If the node is not ready keep the task for later
   if (node->ready != 0 && !(type==TASK_JOIN_LAST_REPLY || type==TASK_JOIN_REPLY)) {
-    XBT_DEBUG("Task pending %i", type);
+    XBT_DEBUG("Task pending %u", type);
     xbt_dynar_push(node->pending_tasks, &task);
     return;
   }
@@ -245,7 +245,7 @@ static void handle_task(node_t node, msg_task_t task) {
     /* Try to join the ring */
     case TASK_JOIN:
       next = routing_next(node, task_data->answer_id);
-      XBT_DEBUG("Join request from %08x forwarding to %08x", task_data->answer_id, next);
+      XBT_DEBUG("Join request from %08x forwarding to %08x", (unsigned)task_data->answer_id, (unsigned)next);
       type = TASK_JOIN_LAST_REPLY;
 
       req_data = xbt_new0(s_task_data_t,1);
@@ -378,16 +378,13 @@ static void handle_task(node_t node, msg_task_t task) {
       // add lower elements
       j = NAMESPACE_SIZE/2-1;
       for (i=NAMESPACE_SIZE/2-1; i>=0; i--) {
-        if (min<0) {
+        if (min < 0 || curr_namespace_set[j] > task_namespace_set[min]) {
           node->namespace_set[i] = curr_namespace_set[j];
           j--;
         } else if (curr_namespace_set[j] == task_namespace_set[min]) {
           node->namespace_set[i] = curr_namespace_set[j];
           j--;
           min--;
-        } else if (curr_namespace_set[j] > task_namespace_set[min]) {
-          node->namespace_set[i] = curr_namespace_set[j];
-          j--;
         } else {
           node->namespace_set[i] = task_namespace_set[min];
           min--;
@@ -401,19 +398,16 @@ static void handle_task(node_t node, msg_task_t task) {
          node->namespace_set[i] = curr_namespace_set[j];
          j++;
         } else if (max >= 0){
-          if (curr_namespace_set[j] == -1) {
+          if (curr_namespace_set[j] == -1 || curr_namespace_set[j] > task_namespace_set[max]) {
             node->namespace_set[i] = task_namespace_set[max];
             max++;
           } else if (curr_namespace_set[j] == task_namespace_set[max]) {
             node->namespace_set[i] = curr_namespace_set[j];
             j++;
             max++;
-          } else if (curr_namespace_set[j] < task_namespace_set[max]) {
+          } else {
             node->namespace_set[i] = curr_namespace_set[j];
             j++;
-          } else {
-            node->namespace_set[i] = task_namespace_set[max];
-            max++;
           }
         }
       }
@@ -475,7 +469,7 @@ static int node(int argc, char *argv[])
   node.ready = -1;
   node.pending_tasks = xbt_dynar_new(sizeof(msg_task_t), NULL);
   get_mailbox(node.id, node.mailbox);
-  XBT_DEBUG("New node with id %s (%08x)", node.mailbox, node.id);
+  XBT_DEBUG("New node with id %s (%08x)", node.mailbox, (unsigned)node.id);
 
   for (int i=0; i<LEVELS_COUNT; i++){
     int d = domain(node.id, i);
index cf5c638..19b93a6 100644 (file)
@@ -26,7 +26,7 @@ static int dvfs(int argc, char *argv[])
   // Run a task
   start = MSG_get_clock();
   msg_task_t task1 = MSG_task_create ("t1", 100E6, 0, NULL);
-  XBT_INFO("Run a task of %.0E flops",MSG_task_get_flops_amount(task1));
+  XBT_INFO("Run a task of %.0E flops", MSG_task_get_initial_flops_amount(task1));
   MSG_task_execute (task1);
   MSG_task_destroy(task1);
   XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW"
@@ -43,7 +43,7 @@ static int dvfs(int argc, char *argv[])
   // Run a second task
   start = MSG_get_clock();
   task1 = MSG_task_create ("t2", 100E6, 0, NULL);
-  XBT_INFO("Run a task of %.0E flops",MSG_task_get_flops_amount(task1));
+  XBT_INFO("Run a task of %.0E flops", MSG_task_get_initial_flops_amount(task1));
   MSG_task_execute (task1);
   MSG_task_destroy(task1);
   XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
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 965e8ac..2735dac 100644 (file)
@@ -9,12 +9,12 @@ $ ${bindir:=.}/energy-vm/energy-vm$EXEEXT ${srcdir:=.}/../platforms/energy_platf
 > [  0.000000] (1:dvfs@MyHost1) Create two tasks on Host3: both inside a VM
 > [  0.000000] (1:dvfs@MyHost1) Wait 5 seconds. The tasks are still running (they run for 3 seconds, but 2 tasks are co-located, so they run for 6 seconds)
 > [  5.000000] (1:dvfs@MyHost1) Wait another 5 seconds. The tasks stop at some point in between
-> [  6.000000] (6:p31@MyHost3) This worker is done.
-> [  6.000000] (7:p32@MyHost3) This worker is done.
 > [  6.000000] (5:p22@MyHost2) This worker is done.
+> [  6.000000] (7:p32@MyHost3) This worker is done.
+> [  6.000000] (6:p31@MyHost3) This worker is done.
 > [  6.000000] (3:p12@vm_host1) This worker is done.
-> [  6.000000] (4:p21@vm_host3) This worker is done.
 > [  6.000000] (2:p11@vm_host1) This worker is done.
+> [  6.000000] (4:p21@vm_host3) This worker is done.
 > [ 10.000000] (0:maestro@) Total energy consumption: 4320.000000 Joules (used hosts: 4320.000000 Joules; unused/idle hosts: 0.000000)
 > [ 10.000000] (0:maestro@) Total simulation time: 10.00; Host2 and Host3 must have the exact same energy consumption; Host1 is multi-core and will differ.
 > [ 10.000000] (0:maestro@) Energy consumption of host MyHost1: 1120.000000 Joules
index c0ad633..ec15057 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/msg.h"
+#include "simgrid/plugins/file_system.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(io_file, "Messages specific for this io example");
 
@@ -88,6 +89,8 @@ static int host(int argc, char *argv[])
 int main(int argc, char **argv)
 {
   MSG_init(&argc, argv);
+  MSG_storage_file_system_init();
+
   MSG_create_environment(argv[1]);
   xbt_dynar_t hosts =  MSG_hosts_as_dynar();
   MSG_function_register("host", host);
index e0483eb..34f4ef0 100644 (file)
@@ -3,10 +3,10 @@
 $ ${bindir:=.}/io-file ${srcdir:=.}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Number of host '4'
 > [  0.000000] (1:host@alice)  Open file 'c:\Windows\setupact.log'
-> [  0.000000] (2:host@bob)    Open file '/home/doc/simgrid/examples/platforms/nancy.xml'
-> [  0.000000] (3:host@carl)   Open file '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml'
 > [  0.000000] (1:host@alice)  Capacity of the storage element 'c:\Windows\setupact.log' is stored on: 2391537133 / 536870912000
+> [  0.000000] (2:host@bob)    Open file '/home/doc/simgrid/examples/platforms/nancy.xml'
 > [  0.000000] (2:host@bob)    Capacity of the storage element '/home/doc/simgrid/examples/platforms/nancy.xml' is stored on: 36933331 / 536870912000
+> [  0.000000] (3:host@carl)   Open file '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml'
 > [  0.000000] (3:host@carl)   Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' is stored on: 36933331 / 536870912000
 > [  0.000000] (4:host@denise) File Descriptor information:
 >              Full path: '/home/doc/simgrid/examples/platforms/g5k.xml'
index 948950b..aaece80 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/msg.h"
+#include "simgrid/plugins/file_system.h"
 
 #define INMEGA (1024*1024)
 
@@ -55,6 +56,8 @@ int main(int argc, char **argv)
   msg_storage_t st;
 
   MSG_init(&argc, argv);
+  MSG_storage_file_system_init();
+
   MSG_create_environment(argv[1]);
   MSG_function_register("host", host);
   MSG_launch_application(argv[2]);
index 46b251e..390369c 100644 (file)
@@ -4,9 +4,6 @@ $ ${bindir:=.}/io-remote$EXEEXT ${srcdir:=.}/storage/remote_io.xml ${srcdir:=.}/
 > [  0.000000] (0@     ) Init: 12 MiB used on 'Disk1'
 > [  0.000000] (0@     ) Init: 2280 MiB used on 'Disk2'
 > [  0.000000] (1@alice) Opened file 'c:\Windows\setupact.log'
-> [  0.000000] (2@  bob) Opened file '/scratch/lib/libsimgrid.so.3.6.2'
-> [  0.000000] (3@ carl) Opened file '/scratch/lib/libsimgrid.so.3.6.2'
-> [  0.000000] (4@ dave) Opened file 'c:\Windows\bootstat.dat'
 > [  0.000000] (1@alice) File Descriptor information:
 >              Full path: 'c:\Windows\setupact.log'
 >              Size: 101663
@@ -14,6 +11,8 @@ $ ${bindir:=.}/io-remote$EXEEXT ${srcdir:=.}/storage/remote_io.xml ${srcdir:=.}/
 >              Storage Id: 'Disk2'
 >              Storage Type: 'SATA-II_HDD'
 >              File Descriptor Id: 0
+> [  0.000000] (1@alice) Try to read 101663 from 'c:\Windows\setupact.log'
+> [  0.000000] (2@  bob) Opened file '/scratch/lib/libsimgrid.so.3.6.2'
 > [  0.000000] (2@  bob) File Descriptor information:
 >              Full path: '/scratch/lib/libsimgrid.so.3.6.2'
 >              Size: 12710497
@@ -21,6 +20,8 @@ $ ${bindir:=.}/io-remote$EXEEXT ${srcdir:=.}/storage/remote_io.xml ${srcdir:=.}/
 >              Storage Id: 'Disk1'
 >              Storage Type: 'SATA-II_HDD'
 >              File Descriptor Id: 0
+> [  0.000000] (2@  bob) Try to read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'
+> [  0.000000] (3@ carl) Opened file '/scratch/lib/libsimgrid.so.3.6.2'
 > [  0.000000] (3@ carl) File Descriptor information:
 >              Full path: '/scratch/lib/libsimgrid.so.3.6.2'
 >              Size: 12710497
@@ -28,6 +29,8 @@ $ ${bindir:=.}/io-remote$EXEEXT ${srcdir:=.}/storage/remote_io.xml ${srcdir:=.}/
 >              Storage Id: 'Disk1'
 >              Storage Type: 'SATA-II_HDD'
 >              File Descriptor Id: 0
+> [  0.000000] (3@ carl) Try to read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'
+> [  0.000000] (4@ dave) Opened file 'c:\Windows\bootstat.dat'
 > [  0.000000] (4@ dave) File Descriptor information:
 >              Full path: 'c:\Windows\bootstat.dat'
 >              Size: 67584
@@ -35,9 +38,6 @@ $ ${bindir:=.}/io-remote$EXEEXT ${srcdir:=.}/storage/remote_io.xml ${srcdir:=.}/
 >              Storage Id: 'Disk2'
 >              Storage Type: 'SATA-II_HDD'
 >              File Descriptor Id: 0
-> [  0.000000] (1@alice) Try to read 101663 from 'c:\Windows\setupact.log'
-> [  0.000000] (2@  bob) Try to read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'
-> [  0.000000] (3@ carl) Try to read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'
 > [  0.000000] (4@ dave) Try to read 67584 from 'c:\Windows\bootstat.dat'
 > [  0.001469] (4@ dave) Have read 67584 from 'c:\Windows\bootstat.dat'. Offset is now at: 67584
 > [  0.001469] (4@ dave) Seek back to the begining of the stream...
index 298e6e6..69d0713 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/msg.h"
+#include "simgrid/plugins/file_system.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(storage,"Messages specific for this simulation");
 
@@ -114,6 +115,8 @@ static int host(int argc, char *argv[]){
 int main(int argc, char *argv[])
 {
   MSG_init(&argc, argv);
+  MSG_storage_file_system_init();
+
   MSG_create_environment(argv[1]);
   MSG_function_register("host", host);
   xbt_dynar_t hosts =  MSG_hosts_as_dynar();
index 298d92e..0ff51f6 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect return 1
 ! timeout 20
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack_size:256
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack-size:256
 > [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
 > [  0.000000] (2:client@HostB) Sent!
 > [  0.000000] (3:client@HostC) Sent!
index f816cd3..519a86e 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256 --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack-size:256 --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index cdd83a9..76be52f 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256 --cfg=model-check/sparse-checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack-size:256 --cfg=model-check/sparse-checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index a1619a4..09d5f66 100755 (executable)
@@ -34,7 +34,7 @@ run() {
     ${srcdir:=.}/deploy_bugged1_liveness.xml \
     "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" \
     --cfg=contexts/factory:ucontext \
-    --cfg=contexts/stack_size:256
+    --cfg=contexts/stack-size:256
   assert 'test $? = 134'
 }
 
index 20b4b49..8966f6d 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack_size:256  --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack-size:256  --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index 01f6827..c584098 100644 (file)
@@ -3,7 +3,7 @@
 ! expect return 2
 ! timeout 20
 ! output ignore
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack_size:256 --cfg=model-check/sparse-checkpoint:yes  --cfg=model-check/property:promela_bugged1_liveness
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack-size:256 --cfg=model-check/sparse-checkpoint:yes  --cfg=model-check/property:promela_bugged1_liveness
 > [  0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
index 90dba11..fdcc4ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2015. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -23,25 +23,25 @@ static int server(int argc, char *argv[])
   long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task1);
   task1 = NULL;
-  XBT_INFO("Received %lu", val1);
+  XBT_INFO("Received %ld", val1);
 
   MSG_task_receive(&task2, "mymailbox");
   long val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task2);
   task2 = NULL;
-  XBT_INFO("Received %lu", val2);
+  XBT_INFO("Received %ld", val2);
 
   MC_assert(MIN(val1, val2) == 1);
 
   MSG_task_receive(&task1, "mymailbox");
   val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task1);
-  XBT_INFO("Received %lu", val1);
+  XBT_INFO("Received %ld", val1);
 
   MSG_task_receive(&task2, "mymailbox");
   val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task2);
-  XBT_INFO("Received %lu", val2);
+  XBT_INFO("Received %ld", val2);
 
   XBT_INFO("OK");
   return 0;
index ba13938..4609e75 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect return 1
 ! timeout 20
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged2 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack_size:256
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged2 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=contexts/stack-size:256
 > [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
 > [  0.000000] (2:client@HostB) Send 1
 > [  0.000000] (3:client@HostC) Send 2
index 879c37d..5e805d9 100644 (file)
@@ -29,7 +29,7 @@ static int server(int argc, char *argv[])
   MSG_comm_wait(comm2, -1);
 
   long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
-  XBT_INFO("Received %lu", val1);
+  XBT_INFO("Received %ld", val1);
 
   MC_assert(val1 == 2);
 
index 7729c38..d8f74df 100644 (file)
@@ -7,7 +7,7 @@
 /* This example implements one process which receives messages from two other */
 /* processes. There is no bug on it, it is just provided to test the soundness*/
 /* of the state space reduction with DPOR, if the maximum depth (defined with */
-/* --cfg=model-check/max_depth:) is reached.                                  */
+/* --cfg=model-check/max-depth:) is reached.                                  */
 /******************************************************************************/
 
 #include <simgrid/msg.h>
index a7b4d59..5158498 100644 (file)
@@ -33,7 +33,7 @@ static void test_host(const char*hostname)
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   XBT_INFO("== Trying to modify a host property");
-  MSG_host_set_property_value(thehost, exist, xbt_strdup("250"));
+  MSG_host_set_property_value(thehost, exist, (char*)"250");
 
   /* Test if we have changed the value */
   value = MSG_host_get_property_value(thehost, exist);
@@ -42,7 +42,9 @@ static void test_host(const char*hostname)
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   /* Restore the value for the next test */
-  MSG_host_set_property_value(thehost, exist, xbt_strdup("180"));
+  MSG_host_set_property_value(thehost, exist, (char*)"180");
+
+  xbt_dict_free(&props);
 }
 
 static int alice(int argc, char *argv[]) { /* Dump what we have on the current host */
@@ -87,6 +89,7 @@ static int bob(int argc, char *argv[])
 
   value = MSG_process_get_property_value(MSG_process_self(), noexist);
   xbt_assert(!value, "The property is defined (it shouldnt)");
+  xbt_dict_free(&props);
 
   return 0;
 }
index 717c54b..e458d27 100644 (file)
@@ -27,7 +27,7 @@ static int execute_load_test(int argc, char* argv[])
   // Run a task
   start            = MSG_get_clock();
   msg_task_t task1 = MSG_task_create("t1", 100E6, 0, NULL);
-  XBT_INFO("Run a task of %.0E flops", MSG_task_get_flops_amount(task1));
+  XBT_INFO("Run a task of %.0E flops", MSG_task_get_initial_flops_amount(task1));
   MSG_task_execute(task1);
   MSG_task_destroy(task1);
 
@@ -44,7 +44,7 @@ static int execute_load_test(int argc, char* argv[])
   // Run a second task
   start = MSG_get_clock();
   task1 = MSG_task_create("t2", 100E6, 0, NULL);
-  XBT_INFO("Run a task of %.0E flops", MSG_task_get_flops_amount(task1));
+  XBT_INFO("Run a task of %.0E flops", MSG_task_get_initial_flops_amount(task1));
   MSG_task_execute(task1);
   MSG_task_destroy(task1);
   XBT_INFO("Done working on my task; this took %.2fs; current peak speed: %.0E flop/s; number of flops computed so "
index 6e12c39..cb11383 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. */
@@ -8,7 +8,8 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 /* Executed on process termination*/
-static int my_onexit(void* ignored1, void *ignored2) {
+static int my_onexit(XBT_ATTRIB_UNUSED void* ignored1, XBT_ATTRIB_UNUSED void* ignored2)
+{
   XBT_INFO("Exiting now (done sleeping or got killed)."); /* - Just display an informative message (see tesh file) */
   return 0;
 }
index b7c58ae..220fffc 100644 (file)
@@ -33,6 +33,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${srcdir:=.}/cluster.xml ${s
 
 p Test1 Process with kill time
 
+! output sort
 $ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${srcdir:=.}/cluster.xml ${srcdir:=.}/../msg/process-startkilltime/kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sleeper@node-1.acme.org) Hello! I go to sleep.
 > [  0.000000] (2:sleeper@node-2.acme.org) Hello! I go to sleep.
@@ -45,6 +46,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${srcdir:=.}/cluster.xml ${s
 
 p Test2 Process with start and kill times
 
+! output sort
 $ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${srcdir:=.}/cluster.xml ${srcdir:=.}/../msg/process-startkilltime/start_kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sleeper@node-0.acme.org) Hello! I go to sleep.
 > [  1.000000] (2:sleeper@node-1.acme.org) Hello! I go to sleep.
index b58419e..ebe181c 100644 (file)
@@ -2,43 +2,9 @@
 
 p Tracing multiple categories master/worker application
 
-$ $SG_TEST_EXENV ${bindir:=.}/trace-categories$EXEEXT --cfg=tracing:yes --cfg=tracing/buffer:yes --cfg=tracing/filename:categories.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes --cfg=viva/categorized:categories.cat.plist --cfg=viva/uncategorized:categories.uncat.plist ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
+$ $SG_TEST_EXENV ${bindir:=.}/trace-categories$EXEEXT --cfg=tracing:yes --cfg=tracing/buffer:yes --cfg=tracing/filename:categories.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/buffer' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'categories.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/categorized' to 'categories.cat.plist'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/uncategorized' to 'categories.uncat.plist'
-
-$ $SG_TEST_EXENV cat categories.cat.plist
->   node = ("HOST","LINK");
->   edge = ("0-LINK4-LINK4","0-HOST1-LINK4","0-LINK4-HOST1");
->
->   host = {
->     type = "square";
->     size = "power";
->     values = ("pdata","pcompute","pfinalize","prequest");
->   };
->   link = {
->     type = "rhombus";
->     size = "bandwidth";
->     values = ("bdata","bcompute","bfinalize","brequest");
->   };
-
-$ $SG_TEST_EXENV cat categories.uncat.plist
->   node = ("HOST","LINK");
->   edge = ("0-LINK4-LINK4","0-HOST1-LINK4","0-LINK4-HOST1");
->
->   host = {
->     type = "square";
->     size = "power";
->     values = ("power_used");
->   };
->   link = {
->     type = "rhombus";
->     size = "bandwidth";
->     values = ("bandwidth_used");
->   };
-
-$ rm -rf categories.trace categories.cat.plist categories.uncat.plist
index 89ec48d..4917717 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
+/* 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. */
@@ -77,38 +77,24 @@ int main(int argc, char *argv[])
     xbt_dynar_free (&link_variables);
   }
 
-  //create a customized viva graph configuration file
-  FILE *fp = fopen ("viva_graph.plist", "w");
-  if (fp == NULL){
-    return 1;
-  }
-  fprintf (fp, "{\n node = (");
   xbt_dynar_t nodes_type = TRACE_get_node_types ();
   if (nodes_type){
     XBT_INFO ("Node types in the trace:");
     char *node_type;
     xbt_dynar_foreach (nodes_type, cursor, node_type){
       XBT_INFO ("%s", node_type);
-      fprintf (fp, "%s, ", node_type);
     }
     xbt_dynar_free (&nodes_type);
   }
-  fprintf (fp, ");\n edge = (");
   xbt_dynar_t edges_type = TRACE_get_edge_types ();
   if (edges_type){
     XBT_INFO ("Node types in the trace:");
     char *edge_type;
     xbt_dynar_foreach (edges_type, cursor, edge_type){
       XBT_INFO ("%s", edge_type);
-      fprintf (fp, "%s, ", edge_type);
     }
     xbt_dynar_free (&edges_type);
   }
-  fprintf (fp, ");\n");
-  fprintf (fp, " host = {\n  type = square;\n  size = HDD_capacity; \n  values = (HDD_utilization);\n };\n");
-  fprintf (fp, " link = {\n  type = rhombus;\n  size = bandwidth;\n };\n");
-  fprintf (fp, "}\n");
-  fclose (fp);
 
   return 0;
 }
index d537d35..4331c82 100644 (file)
@@ -9,14 +9,14 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace-host-user-variables$EXEEXT --cfg=tracing:yes
 > [0.004078] [msg_test/INFO] HDD_utilization
 > [0.004078] [msg_test/INFO] Declared link variables:
 > [0.004078] [msg_test/INFO] Node types in the trace:
-> [0.004078] [msg_test/INFO] LINK
 > [0.004078] [msg_test/INFO] HOST
+> [0.004078] [msg_test/INFO] LINK
 > [0.004078] [msg_test/INFO] Node types in the trace:
-> [0.004078] [msg_test/INFO] 0-LINK3-LINK3
 > [0.004078] [msg_test/INFO] 0-HOST1-LINK3
 > [0.004078] [msg_test/INFO] 0-LINK3-HOST1
+> [0.004078] [msg_test/INFO] 0-LINK3-LINK3
 
-$ rm -f viva_graph.plist
+$ rm -f simgrid.trace
 
 p Not tracing user variables
 $ $SG_TEST_EXENV ${bindir:=.}/trace-host-user-variables$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
index 130aff3..9cf7435 100644 (file)
@@ -208,98 +208,98 @@ $ tail -n +3 simgrid.trace
 > 8 0 5 30 0.035083
 > 8 0 4 31 498000000.000000
 > 8 0 5 31 0.000015
-> 15 0 6 0 topology 19 0
-> 16 0 6 0 topology 20 0
-> 15 0 6 0 topology 15 1
-> 16 0 6 0 topology 9 1
-> 15 0 6 0 topology 27 2
-> 16 0 6 0 topology 18 2
-> 15 0 7 0 topology 5 3
-> 16 0 7 0 topology 24 3
+> 15 0 6 0 topology 12 0
+> 16 0 6 0 topology 16 0
+> 15 0 6 0 topology 9 1
+> 16 0 6 0 topology 16 1
+> 15 0 6 0 topology 16 2
+> 16 0 6 0 topology 14 2
+> 15 0 6 0 topology 21 3
+> 16 0 6 0 topology 19 3
 > 15 0 6 0 topology 8 4
-> 16 0 6 0 topology 10 4
-> 15 0 6 0 topology 21 5
-> 16 0 6 0 topology 22 5
-> 15 0 7 0 topology 1 6
-> 16 0 7 0 topology 9 6
-> 15 0 6 0 topology 23 7
-> 16 0 6 0 topology 24 7
-> 15 0 7 0 topology 1 8
-> 16 0 7 0 topology 15 8
-> 15 0 7 0 topology 1 9
-> 16 0 7 0 topology 11 9
-> 15 0 6 0 topology 26 10
-> 16 0 6 0 topology 27 10
-> 15 0 7 0 topology 5 11
-> 16 0 7 0 topology 18 11
-> 15 0 8 0 topology 11 12
-> 16 0 8 0 topology 2 12
-> 15 0 6 0 topology 28 13
-> 16 0 6 0 topology 29 13
-> 15 0 6 0 topology 12 14
-> 16 0 6 0 topology 16 14
-> 15 0 6 0 topology 9 15
-> 16 0 6 0 topology 16 15
-> 15 0 6 0 topology 14 16
-> 16 0 6 0 topology 13 16
-> 15 0 6 0 topology 29 17
-> 16 0 6 0 topology 11 17
-> 15 0 7 0 topology 3 18
-> 16 0 7 0 topology 30 18
-> 15 0 6 0 topology 11 19
-> 16 0 6 0 topology 15 19
+> 16 0 6 0 topology 19 4
+> 15 0 6 0 topology 19 5
+> 16 0 6 0 topology 20 5
+> 15 0 6 0 topology 8 6
+> 16 0 6 0 topology 20 6
+> 15 0 6 0 topology 27 7
+> 16 0 6 0 topology 18 7
+> 15 0 7 0 topology 5 8
+> 16 0 7 0 topology 18 8
+> 15 0 7 0 topology 4 9
+> 16 0 7 0 topology 18 9
+> 15 0 7 0 topology 2 10
+> 16 0 7 0 topology 18 10
+> 15 0 6 0 topology 16 11
+> 16 0 6 0 topology 21 11
+> 15 0 6 0 topology 21 12
+> 16 0 6 0 topology 22 12
+> 15 0 6 0 topology 9 13
+> 16 0 6 0 topology 12 13
+> 15 0 6 0 topology 15 14
+> 16 0 6 0 topology 9 14
+> 15 0 7 0 topology 1 15
+> 16 0 7 0 topology 9 15
+> 15 0 6 0 topology 20 16
+> 16 0 6 0 topology 23 16
+> 15 0 6 0 topology 23 17
+> 16 0 6 0 topology 24 17
+> 15 0 7 0 topology 5 18
+> 16 0 7 0 topology 24 18
+> 15 0 7 0 topology 4 19
+> 16 0 7 0 topology 24 19
 > 15 0 7 0 topology 2 20
 > 16 0 7 0 topology 24 20
-> 15 0 8 0 topology 18 21
-> 16 0 8 0 topology 6 21
-> 15 0 8 0 topology 10 22
-> 16 0 8 0 topology 5 22
-> 15 0 6 0 topology 8 23
-> 16 0 6 0 topology 19 23
-> 15 0 6 0 topology 12 24
-> 16 0 6 0 topology 25 24
-> 15 0 7 0 topology 4 25
-> 16 0 7 0 topology 24 25
-> 15 0 6 0 topology 16 26
-> 16 0 6 0 topology 14 26
-> 15 0 8 0 topology 17 27
-> 16 0 8 0 topology 4 27
-> 15 0 6 0 topology 12 28
-> 16 0 6 0 topology 17 28
-> 15 0 6 0 topology 9 29
-> 16 0 6 0 topology 17 29
-> 15 0 6 0 topology 21 30
-> 16 0 6 0 topology 19 30
-> 15 0 6 0 topology 22 31
-> 16 0 6 0 topology 25 31
-> 15 0 8 0 topology 24 32
-> 16 0 8 0 topology 7 32
-> 15 0 7 0 topology 3 33
-> 16 0 7 0 topology 28 33
-> 15 0 6 0 topology 25 34
-> 16 0 6 0 topology 26 34
-> 15 0 6 0 topology 8 35
-> 16 0 6 0 topology 20 35
-> 15 0 8 0 topology 13 36
-> 16 0 8 0 topology 3 36
-> 15 0 7 0 topology 2 37
-> 16 0 7 0 topology 18 37
-> 15 0 6 0 topology 9 38
-> 16 0 6 0 topology 12 38
-> 15 0 6 0 topology 14 39
-> 16 0 6 0 topology 8 39
-> 15 0 6 0 topology 20 40
-> 16 0 6 0 topology 23 40
-> 15 0 7 0 topology 4 41
-> 16 0 7 0 topology 18 41
-> 15 0 6 0 topology 13 42
-> 16 0 6 0 topology 8 42
-> 15 0 6 0 topology 11 43
-> 16 0 6 0 topology 8 43
-> 15 0 6 0 topology 16 44
-> 16 0 6 0 topology 21 44
-> 15 0 6 0 topology 30 45
-> 16 0 6 0 topology 28 45
+> 15 0 6 0 topology 11 21
+> 16 0 6 0 topology 15 21
+> 15 0 7 0 topology 1 22
+> 16 0 7 0 topology 15 22
+> 15 0 6 0 topology 12 23
+> 16 0 6 0 topology 17 23
+> 15 0 6 0 topology 9 24
+> 16 0 6 0 topology 17 24
+> 15 0 6 0 topology 22 25
+> 16 0 6 0 topology 25 25
+> 15 0 6 0 topology 12 26
+> 16 0 6 0 topology 25 26
+> 15 0 6 0 topology 25 27
+> 16 0 6 0 topology 26 27
+> 15 0 6 0 topology 26 28
+> 16 0 6 0 topology 27 28
+> 15 0 6 0 topology 14 29
+> 16 0 6 0 topology 8 29
+> 15 0 6 0 topology 13 30
+> 16 0 6 0 topology 8 30
+> 15 0 6 0 topology 11 31
+> 16 0 6 0 topology 8 31
+> 15 0 6 0 topology 8 32
+> 16 0 6 0 topology 10 32
+> 15 0 6 0 topology 30 33
+> 16 0 6 0 topology 28 33
+> 15 0 7 0 topology 3 34
+> 16 0 7 0 topology 28 34
+> 15 0 6 0 topology 28 35
+> 16 0 6 0 topology 29 35
+> 15 0 7 0 topology 3 36
+> 16 0 7 0 topology 30 36
+> 15 0 6 0 topology 14 37
+> 16 0 6 0 topology 13 37
+> 15 0 6 0 topology 29 38
+> 16 0 6 0 topology 11 38
+> 15 0 7 0 topology 1 39
+> 16 0 7 0 topology 11 39
+> 15 0 8 0 topology 24 40
+> 16 0 8 0 topology 7 40
+> 15 0 8 0 topology 10 41
+> 16 0 8 0 topology 5 41
+> 15 0 8 0 topology 13 42
+> 16 0 8 0 topology 3 42
+> 15 0 8 0 topology 17 43
+> 16 0 8 0 topology 4 43
+> 15 0 8 0 topology 18 44
+> 16 0 8 0 topology 6 44
+> 15 0 8 0 topology 11 45
+> 16 0 8 0 topology 2 45
 > 1 9 3 Link_Capacity "1 1 1"
 > 1 10 3 Link_Utilization "0.9 0.1 0.1"
 > 8 0 9 8 12.340000
@@ -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 2ebf78d..56cb7a3 100644 (file)
@@ -53,9 +53,9 @@ static int worker(int argc, char *argv[])
       MSG_task_destroy(task);
       break;
     }
-    //adding the value returned by MSG_task_get_compute_duration(task)
-    //to the variable "task_computation"
-    TRACE_host_variable_add(MSG_host_get_name(MSG_host_self()), "task_computation", MSG_task_get_flops_amount(task));
+    // adding the value returned by MSG_task_get_compute_duration(task) to the variable "task_computation"
+    TRACE_host_variable_add(MSG_host_get_name(MSG_host_self()), "task_computation",
+                            MSG_task_get_initial_flops_amount(task));
     MSG_task_execute(task);
     MSG_task_destroy(task);
     task = NULL;
index 5e639c6..0ce739d 100644 (file)
@@ -1,36 +1,32 @@
 #! ./tesh
 
 p Tracing master/worker application
-$ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT --cfg=tracing:yes --cfg=tracing/buffer:yes --cfg=tracing/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes --cfg=viva/categorized:trace-masterworker.cat.plist --cfg=viva/uncategorized:trace-masterworker.uncat.plist ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
+$ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT --cfg=tracing:yes --cfg=tracing/buffer:yes --cfg=tracing/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/buffer' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'trace-masterworker.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/categorized' to 'trace-masterworker.cat.plist'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/uncategorized' to 'trace-masterworker.uncat.plist'
 > [4.214821] [msg_trace_masterworker/INFO] Declared tracing categories:
-> [4.214821] [msg_trace_masterworker/INFO] request
+> [4.214821] [msg_trace_masterworker/INFO] compute
 > [4.214821] [msg_trace_masterworker/INFO] finalize
 > [4.214821] [msg_trace_masterworker/INFO] report
-> [4.214821] [msg_trace_masterworker/INFO] compute
+> [4.214821] [msg_trace_masterworker/INFO] request
 > [4.214821] [msg_trace_masterworker/INFO] Declared marks:
 > [4.214821] [msg_trace_masterworker/INFO] msmark
 
 p Tracing master/worker application with xml config
 $ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT ${srcdir:=.}/config_tracing.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/buffer' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/categorized' to 'trace-masterworker.cat.plist'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'trace-masterworker.trace'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/uncategorized' to 'trace-masterworker.uncat.plist'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/buffer' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'trace-masterworker.trace'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes'
 > [4.214821] [msg_trace_masterworker/INFO] Declared tracing categories:
-> [4.214821] [msg_trace_masterworker/INFO] request
+> [4.214821] [msg_trace_masterworker/INFO] compute
 > [4.214821] [msg_trace_masterworker/INFO] finalize
 > [4.214821] [msg_trace_masterworker/INFO] report
-> [4.214821] [msg_trace_masterworker/INFO] compute
+> [4.214821] [msg_trace_masterworker/INFO] request
 > [4.214821] [msg_trace_masterworker/INFO] Declared marks:
 > [4.214821] [msg_trace_masterworker/INFO] msmark
 
@@ -38,51 +34,20 @@ p Not tracing master/worker application
 $ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
 
 p Testing tracing by process
-$ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT --cfg=tracing:yes --cfg=tracing/msg/process:yes --cfg=tracing/buffer:yes --cfg=tracing/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes --cfg=viva/categorized:trace-masterworker.cat.plist --cfg=viva/uncategorized:trace-masterworker.uncat.plist ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
+$ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT --cfg=tracing:yes --cfg=tracing/msg/process:yes --cfg=tracing/buffer:yes --cfg=tracing/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes  ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-masterworker/app-masterworker_d.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/msg/process' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/buffer' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'trace-masterworker.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/categorized' to 'trace-masterworker.cat.plist'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/uncategorized' to 'trace-masterworker.uncat.plist'
 > [4.214821] [msg_trace_masterworker/INFO] Declared tracing categories:
-> [4.214821] [msg_trace_masterworker/INFO] request
+> [4.214821] [msg_trace_masterworker/INFO] compute
 > [4.214821] [msg_trace_masterworker/INFO] finalize
 > [4.214821] [msg_trace_masterworker/INFO] report
-> [4.214821] [msg_trace_masterworker/INFO] compute
+> [4.214821] [msg_trace_masterworker/INFO] request
 > [4.214821] [msg_trace_masterworker/INFO] Declared marks:
 > [4.214821] [msg_trace_masterworker/INFO] msmark
 
-$ $SG_TEST_EXENV cat trace-masterworker.uncat.plist
->   node = ("HOST","LINK");
->   edge = ("0-LINK13-LINK13","0-LINK13-HOST1","0-HOST1-LINK13");
-> 
->   host = {
->     type = "square";
->     size = "power";
->     values = ("power_used");
->   };
->   link = {
->     type = "rhombus";
->     size = "bandwidth";
->     values = ("bandwidth_used");
->   };
-
-$ $SG_TEST_EXENV cat trace-masterworker.cat.plist
->   node = ("HOST","LINK");
->   edge = ("0-LINK13-LINK13","0-LINK13-HOST1","0-HOST1-LINK13");
-> 
->   host = {
->     type = "square";
->     size = "power";
->     values = ("pcompute","preport","pfinalize","prequest");
->   };
->   link = {
->     type = "rhombus";
->     size = "bandwidth";
->     values = ("bcompute","breport","bfinalize","brequest");
->   };
 
-$ rm -rf trace-masterworker.trace trace-masterworker.cat.plist trace-masterworker.uncat.plist
+$ rm -rf trace-masterworker.trace
index 1be528a..92cd632 100644 (file)
@@ -209,129 +209,129 @@ $ tail -n +3 trace_platform.trace
 > 8 0 5 30 0.035083
 > 8 0 4 31 498000000.000000
 > 8 0 5 31 0.000015
-> 15 0 6 0 topology 19 0
-> 16 0 6 0 topology 20 0
-> 15 0 6 0 topology 15 1
-> 16 0 6 0 topology 9 1
-> 15 0 6 0 topology 27 2
-> 16 0 6 0 topology 18 2
-> 15 0 7 0 topology 5 3
-> 16 0 7 0 topology 24 3
+> 15 0 6 0 topology 12 0
+> 16 0 6 0 topology 16 0
+> 15 0 6 0 topology 9 1
+> 16 0 6 0 topology 16 1
+> 15 0 6 0 topology 16 2
+> 16 0 6 0 topology 14 2
+> 15 0 6 0 topology 21 3
+> 16 0 6 0 topology 19 3
 > 15 0 6 0 topology 8 4
-> 16 0 6 0 topology 10 4
-> 15 0 6 0 topology 21 5
-> 16 0 6 0 topology 22 5
-> 15 0 7 0 topology 1 6
-> 16 0 7 0 topology 9 6
-> 15 0 6 0 topology 23 7
-> 16 0 6 0 topology 24 7
-> 15 0 7 0 topology 1 8
-> 16 0 7 0 topology 15 8
-> 15 0 7 0 topology 1 9
-> 16 0 7 0 topology 11 9
-> 15 0 6 0 topology 26 10
-> 16 0 6 0 topology 27 10
-> 15 0 7 0 topology 5 11
-> 16 0 7 0 topology 18 11
-> 15 0 8 0 topology 11 12
-> 16 0 8 0 topology 2 12
-> 15 0 6 0 topology 28 13
-> 16 0 6 0 topology 29 13
-> 15 0 6 0 topology 12 14
-> 16 0 6 0 topology 16 14
-> 15 0 6 0 topology 9 15
-> 16 0 6 0 topology 16 15
-> 15 0 6 0 topology 14 16
-> 16 0 6 0 topology 13 16
-> 15 0 6 0 topology 29 17
-> 16 0 6 0 topology 11 17
-> 15 0 7 0 topology 3 18
-> 16 0 7 0 topology 30 18
-> 15 0 6 0 topology 11 19
-> 16 0 6 0 topology 15 19
+> 16 0 6 0 topology 19 4
+> 15 0 6 0 topology 19 5
+> 16 0 6 0 topology 20 5
+> 15 0 6 0 topology 8 6
+> 16 0 6 0 topology 20 6
+> 15 0 6 0 topology 27 7
+> 16 0 6 0 topology 18 7
+> 15 0 7 0 topology 5 8
+> 16 0 7 0 topology 18 8
+> 15 0 7 0 topology 4 9
+> 16 0 7 0 topology 18 9
+> 15 0 7 0 topology 2 10
+> 16 0 7 0 topology 18 10
+> 15 0 6 0 topology 16 11
+> 16 0 6 0 topology 21 11
+> 15 0 6 0 topology 21 12
+> 16 0 6 0 topology 22 12
+> 15 0 6 0 topology 9 13
+> 16 0 6 0 topology 12 13
+> 15 0 6 0 topology 15 14
+> 16 0 6 0 topology 9 14
+> 15 0 7 0 topology 1 15
+> 16 0 7 0 topology 9 15
+> 15 0 6 0 topology 20 16
+> 16 0 6 0 topology 23 16
+> 15 0 6 0 topology 23 17
+> 16 0 6 0 topology 24 17
+> 15 0 7 0 topology 5 18
+> 16 0 7 0 topology 24 18
+> 15 0 7 0 topology 4 19
+> 16 0 7 0 topology 24 19
 > 15 0 7 0 topology 2 20
 > 16 0 7 0 topology 24 20
-> 15 0 8 0 topology 18 21
-> 16 0 8 0 topology 6 21
-> 15 0 8 0 topology 10 22
-> 16 0 8 0 topology 5 22
-> 15 0 6 0 topology 8 23
-> 16 0 6 0 topology 19 23
-> 15 0 6 0 topology 12 24
-> 16 0 6 0 topology 25 24
-> 15 0 7 0 topology 4 25
-> 16 0 7 0 topology 24 25
-> 15 0 6 0 topology 16 26
-> 16 0 6 0 topology 14 26
-> 15 0 8 0 topology 17 27
-> 16 0 8 0 topology 4 27
-> 15 0 6 0 topology 12 28
-> 16 0 6 0 topology 17 28
-> 15 0 6 0 topology 9 29
-> 16 0 6 0 topology 17 29
-> 15 0 6 0 topology 21 30
-> 16 0 6 0 topology 19 30
-> 15 0 6 0 topology 22 31
-> 16 0 6 0 topology 25 31
-> 15 0 8 0 topology 24 32
-> 16 0 8 0 topology 7 32
-> 15 0 7 0 topology 3 33
-> 16 0 7 0 topology 28 33
-> 15 0 6 0 topology 25 34
-> 16 0 6 0 topology 26 34
-> 15 0 6 0 topology 8 35
-> 16 0 6 0 topology 20 35
-> 15 0 8 0 topology 13 36
-> 16 0 8 0 topology 3 36
-> 15 0 7 0 topology 2 37
-> 16 0 7 0 topology 18 37
-> 15 0 6 0 topology 9 38
-> 16 0 6 0 topology 12 38
-> 15 0 6 0 topology 14 39
-> 16 0 6 0 topology 8 39
-> 15 0 6 0 topology 20 40
-> 16 0 6 0 topology 23 40
-> 15 0 7 0 topology 4 41
-> 16 0 7 0 topology 18 41
-> 15 0 6 0 topology 13 42
-> 16 0 6 0 topology 8 42
-> 15 0 6 0 topology 11 43
-> 16 0 6 0 topology 8 43
-> 15 0 6 0 topology 16 44
-> 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
+> 15 0 6 0 topology 11 21
+> 16 0 6 0 topology 15 21
+> 15 0 7 0 topology 1 22
+> 16 0 7 0 topology 15 22
+> 15 0 6 0 topology 12 23
+> 16 0 6 0 topology 17 23
+> 15 0 6 0 topology 9 24
+> 16 0 6 0 topology 17 24
+> 15 0 6 0 topology 22 25
+> 16 0 6 0 topology 25 25
+> 15 0 6 0 topology 12 26
+> 16 0 6 0 topology 25 26
+> 15 0 6 0 topology 25 27
+> 16 0 6 0 topology 26 27
+> 15 0 6 0 topology 26 28
+> 16 0 6 0 topology 27 28
+> 15 0 6 0 topology 14 29
+> 16 0 6 0 topology 8 29
+> 15 0 6 0 topology 13 30
+> 16 0 6 0 topology 8 30
+> 15 0 6 0 topology 11 31
+> 16 0 6 0 topology 8 31
+> 15 0 6 0 topology 8 32
+> 16 0 6 0 topology 10 32
+> 15 0 6 0 topology 30 33
+> 16 0 6 0 topology 28 33
+> 15 0 7 0 topology 3 34
+> 16 0 7 0 topology 28 34
+> 15 0 6 0 topology 28 35
+> 16 0 6 0 topology 29 35
+> 15 0 7 0 topology 3 36
+> 16 0 7 0 topology 30 36
+> 15 0 6 0 topology 14 37
+> 16 0 6 0 topology 13 37
+> 15 0 6 0 topology 29 38
+> 16 0 6 0 topology 11 38
+> 15 0 7 0 topology 1 39
+> 16 0 7 0 topology 11 39
+> 15 0 8 0 topology 24 40
+> 16 0 8 0 topology 7 40
+> 15 0 8 0 topology 10 41
+> 16 0 8 0 topology 5 41
+> 15 0 8 0 topology 13 42
+> 16 0 8 0 topology 3 42
+> 15 0 8 0 topology 17 43
+> 16 0 8 0 topology 4 43
+> 15 0 8 0 topology 18 44
+> 16 0 8 0 topology 6 44
+> 15 0 8 0 topology 11 45
+> 16 0 8 0 topology 2 45
+> 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
 
@@ -5265,21 +5265,21 @@ $ tail -n +3 trace_platform.trace
 > 6 0 4795 6 4390 "gw_AS_toulouse"
 > 6 0 4796 12 4795 "gw_toulouse"
 > 6 0 4797 3 4390 "link_gw_toulouse"
-> 4 20 1 3 2 L1-LINK3-ROUTER2
-> 4 21 1 3 3 L1-LINK3-LINK3
-> 4 22 1 2 3 L1-ROUTER2-LINK3
+> 4 20 1 3 3 L1-LINK3-LINK3
+> 4 21 1 2 3 L1-ROUTER2-LINK3
+> 4 22 1 3 2 L1-LINK3-ROUTER2
 > 4 23 6 9 9 L2-LINK9-LINK9
-> 4 24 6 7 9 L2-HOST7-LINK9
-> 4 25 6 12 9 L2-ROUTER12-LINK9
+> 4 24 6 12 9 L2-ROUTER12-LINK9
+> 4 25 6 7 9 L2-HOST7-LINK9
 > 4 26 1 3 12 L1-LINK3-ROUTER12
 > 4 27 1 12 3 L1-ROUTER12-LINK3
 > 4 28 13 16 16 L3-LINK16-LINK16
-> 4 29 13 14 16 L3-HOST14-LINK16
-> 4 30 13 19 16 L3-ROUTER19-LINK16
+> 4 29 13 19 16 L3-ROUTER19-LINK16
+> 4 30 13 14 16 L3-HOST14-LINK16
 > 4 31 6 9 19 L2-LINK9-ROUTER19
 > 4 32 6 19 9 L2-ROUTER19-LINK9
-> 4 33 1 19 3 L1-ROUTER19-LINK3
-> 4 34 1 3 19 L1-LINK3-ROUTER19
+> 4 33 1 3 19 L1-LINK3-ROUTER19
+> 4 34 1 19 3 L1-ROUTER19-LINK3
 > 4 35 0 3 3 0-LINK3-LINK3
 > 4 36 0 2 3 0-ROUTER2-LINK3
 > 8 0 4 12 1250000000.000000
@@ -13094,5386 +13094,5386 @@ $ tail -n +3 trace_platform.trace
 > 8 0 5 4794 0.000100
 > 8 0 4 4797 1250000000.000000
 > 8 0 5 4797 0.000100
-> 15 0 20 1 topology 17 0
-> 16 0 20 1 topology 8 0
-> 15 0 20 1 topology 18 1
-> 16 0 20 1 topology 9 1
-> 15 0 21 1 topology 15 2
-> 16 0 21 1 topology 18 2
-> 15 0 22 1 topology 3 3
-> 16 0 22 1 topology 15 3
-> 15 0 22 1 topology 2 4
-> 16 0 22 1 topology 12 4
-> 15 0 21 1 topology 14 5
-> 16 0 21 1 topology 15 5
-> 15 0 21 1 topology 15 6
-> 16 0 21 1 topology 17 6
-> 15 0 21 1 topology 12 7
-> 16 0 21 1 topology 14 7
-> 15 0 21 1 topology 16 8
-> 16 0 21 1 topology 18 8
-> 15 0 22 1 topology 6 9
-> 16 0 22 1 topology 16 9
-> 15 0 22 1 topology 9 10
-> 16 0 22 1 topology 19 10
-> 15 0 20 1 topology 15 11
-> 16 0 20 1 topology 6 11
-> 15 0 21 1 topology 12 12
-> 16 0 21 1 topology 13 12
-> 15 0 22 1 topology 3 13
-> 16 0 22 1 topology 14 13
-> 15 0 21 1 topology 16 14
-> 16 0 21 1 topology 17 14
-> 15 0 21 1 topology 12 15
-> 16 0 21 1 topology 15 15
-> 15 0 20 1 topology 14 16
-> 16 0 20 1 topology 5 16
-> 15 0 22 1 topology 3 17
-> 16 0 22 1 topology 13 17
-> 15 0 21 1 topology 15 18
-> 16 0 21 1 topology 16 18
-> 15 0 22 1 topology 9 19
-> 16 0 22 1 topology 20 19
-> 15 0 20 1 topology 20 20
-> 16 0 20 1 topology 10 20
-> 15 0 21 1 topology 18 21
-> 16 0 21 1 topology 19 21
-> 15 0 21 1 topology 13 22
-> 16 0 21 1 topology 14 22
-> 15 0 20 1 topology 19 23
-> 16 0 20 1 topology 11 23
-> 15 0 20 1 topology 12 24
-> 16 0 20 1 topology 3 24
-> 15 0 20 1 topology 16 25
-> 16 0 20 1 topology 7 25
-> 15 0 21 1 topology 13 26
-> 16 0 21 1 topology 15 26
-> 15 0 21 1 topology 18 27
-> 16 0 21 1 topology 20 27
-> 15 0 21 1 topology 20 28
-> 16 0 21 1 topology 19 28
-> 15 0 22 1 topology 6 29
-> 16 0 22 1 topology 18 29
-> 15 0 21 1 topology 17 30
-> 16 0 21 1 topology 18 30
-> 15 0 20 1 topology 13 31
-> 16 0 20 1 topology 4 31
-> 15 0 22 1 topology 6 32
-> 16 0 22 1 topology 17 32
-> 15 0 23 22 topology 96 33
+> 15 0 20 1 topology 15 0
+> 16 0 20 1 topology 16 0
+> 15 0 21 1 topology 6 1
+> 16 0 21 1 topology 16 1
+> 15 0 21 1 topology 2 2
+> 16 0 21 1 topology 12 2
+> 15 0 20 1 topology 16 3
+> 16 0 20 1 topology 17 3
+> 15 0 20 1 topology 15 4
+> 16 0 20 1 topology 17 4
+> 15 0 21 1 topology 6 5
+> 16 0 21 1 topology 17 5
+> 15 0 20 1 topology 16 6
+> 16 0 20 1 topology 18 6
+> 15 0 20 1 topology 17 7
+> 16 0 20 1 topology 18 7
+> 15 0 20 1 topology 15 8
+> 16 0 20 1 topology 18 8
+> 15 0 21 1 topology 6 9
+> 16 0 21 1 topology 18 9
+> 15 0 20 1 topology 18 10
+> 16 0 20 1 topology 19 10
+> 15 0 20 1 topology 20 11
+> 16 0 20 1 topology 19 11
+> 15 0 21 1 topology 9 12
+> 16 0 21 1 topology 19 12
+> 15 0 20 1 topology 18 13
+> 16 0 20 1 topology 20 13
+> 15 0 21 1 topology 9 14
+> 16 0 21 1 topology 20 14
+> 15 0 20 1 topology 12 15
+> 16 0 20 1 topology 15 15
+> 15 0 20 1 topology 13 16
+> 16 0 20 1 topology 15 16
+> 15 0 20 1 topology 14 17
+> 16 0 20 1 topology 15 17
+> 15 0 21 1 topology 3 18
+> 16 0 21 1 topology 15 18
+> 15 0 20 1 topology 12 19
+> 16 0 20 1 topology 13 19
+> 15 0 21 1 topology 3 20
+> 16 0 21 1 topology 13 20
+> 15 0 20 1 topology 12 21
+> 16 0 20 1 topology 14 21
+> 15 0 20 1 topology 13 22
+> 16 0 20 1 topology 14 22
+> 15 0 21 1 topology 3 23
+> 16 0 21 1 topology 14 23
+> 15 0 22 1 topology 16 24
+> 16 0 22 1 topology 7 24
+> 15 0 22 1 topology 17 25
+> 16 0 22 1 topology 8 25
+> 15 0 22 1 topology 15 26
+> 16 0 22 1 topology 6 26
+> 15 0 22 1 topology 18 27
+> 16 0 22 1 topology 9 27
+> 15 0 22 1 topology 13 28
+> 16 0 22 1 topology 4 28
+> 15 0 22 1 topology 12 29
+> 16 0 22 1 topology 3 29
+> 15 0 22 1 topology 14 30
+> 16 0 22 1 topology 5 30
+> 15 0 22 1 topology 19 31
+> 16 0 22 1 topology 11 31
+> 15 0 22 1 topology 20 32
+> 16 0 22 1 topology 10 32
+> 15 0 23 22 topology 52 33
 > 16 0 23 22 topology 177 33
-> 15 0 24 22 topology 32 34
-> 16 0 24 22 topology 34 34
-> 15 0 24 22 topology 113 35
-> 16 0 24 22 topology 115 35
-> 15 0 23 22 topology 156 36
+> 15 0 23 22 topology 51 34
+> 16 0 23 22 topology 177 34
+> 15 0 23 22 topology 55 35
+> 16 0 23 22 topology 177 35
+> 15 0 23 22 topology 54 36
 > 16 0 23 22 topology 177 36
-> 15 0 24 22 topology 62 37
-> 16 0 24 22 topology 64 37
-> 15 0 23 22 topology 78 38
+> 15 0 23 22 topology 58 37
+> 16 0 23 22 topology 177 37
+> 15 0 23 22 topology 57 38
 > 16 0 23 22 topology 177 38
-> 15 0 24 22 topology 170 39
-> 16 0 24 22 topology 172 39
-> 15 0 23 22 topology 49 40
+> 15 0 23 22 topology 61 39
+> 16 0 23 22 topology 177 39
+> 15 0 23 22 topology 60 40
 > 16 0 23 22 topology 177 40
-> 15 0 24 22 topology 119 41
-> 16 0 24 22 topology 121 41
-> 15 0 23 22 topology 138 42
+> 15 0 23 22 topology 64 41
+> 16 0 23 22 topology 177 41
+> 15 0 23 22 topology 63 42
 > 16 0 23 22 topology 177 42
-> 15 0 24 22 topology 68 43
-> 16 0 24 22 topology 70 43
-> 15 0 24 22 topology 125 44
-> 16 0 24 22 topology 127 44
-> 15 0 23 22 topology 27 45
+> 15 0 23 22 topology 67 43
+> 16 0 23 22 topology 177 43
+> 15 0 23 22 topology 66 44
+> 16 0 23 22 topology 177 44
+> 15 0 23 22 topology 70 45
 > 16 0 23 22 topology 177 45
-> 15 0 24 22 topology 74 46
-> 16 0 24 22 topology 76 46
-> 15 0 24 22 topology 131 47
-> 16 0 24 22 topology 133 47
-> 15 0 23 22 topology 115 48
+> 15 0 23 22 topology 69 46
+> 16 0 23 22 topology 177 46
+> 15 0 23 22 topology 73 47
+> 16 0 23 22 topology 177 47
+> 15 0 23 22 topology 72 48
 > 16 0 23 22 topology 177 48
-> 15 0 24 22 topology 137 49
-> 16 0 24 22 topology 139 49
-> 15 0 23 22 topology 67 50
+> 15 0 23 22 topology 76 49
+> 16 0 23 22 topology 177 49
+> 15 0 23 22 topology 75 50
 > 16 0 23 22 topology 177 50
-> 15 0 23 22 topology 151 51
+> 15 0 23 22 topology 79 51
 > 16 0 23 22 topology 177 51
-> 15 0 23 22 topology 103 52
+> 15 0 23 22 topology 78 52
 > 16 0 23 22 topology 177 52
-> 15 0 24 22 topology 44 53
-> 16 0 24 22 topology 45 53
-> 15 0 23 22 topology 139 54
+> 15 0 23 22 topology 25 53
+> 16 0 23 22 topology 177 53
+> 15 0 23 22 topology 24 54
 > 16 0 23 22 topology 177 54
-> 15 0 23 22 topology 81 55
+> 15 0 23 22 topology 82 55
 > 16 0 23 22 topology 177 55
-> 15 0 23 22 topology 141 56
+> 15 0 23 22 topology 81 56
 > 16 0 23 22 topology 177 56
-> 15 0 23 22 topology 63 57
+> 15 0 23 22 topology 85 57
 > 16 0 23 22 topology 177 57
-> 15 0 23 22 topology 123 58
+> 15 0 23 22 topology 84 58
 > 16 0 23 22 topology 177 58
-> 15 0 23 22 topology 40 59
+> 15 0 23 22 topology 88 59
 > 16 0 23 22 topology 177 59
-> 15 0 23 22 topology 105 60
+> 15 0 23 22 topology 87 60
 > 16 0 23 22 topology 177 60
-> 15 0 23 22 topology 165 61
+> 15 0 23 22 topology 91 61
 > 16 0 23 22 topology 177 61
-> 15 0 24 22 topology 41 62
-> 16 0 24 22 topology 43 62
-> 15 0 24 22 topology 23 63
-> 16 0 24 22 topology 24 63
-> 15 0 24 22 topology 53 64
-> 16 0 24 22 topology 54 64
-> 15 0 23 22 topology 36 65
+> 15 0 23 22 topology 90 62
+> 16 0 23 22 topology 177 62
+> 15 0 23 22 topology 94 63
+> 16 0 23 22 topology 177 63
+> 15 0 23 22 topology 93 64
+> 16 0 23 22 topology 177 64
+> 15 0 23 22 topology 97 65
 > 16 0 23 22 topology 177 65
-> 15 0 24 22 topology 113 66
-> 16 0 24 22 topology 114 66
-> 15 0 23 22 topology 58 67
+> 15 0 23 22 topology 96 66
+> 16 0 23 22 topology 177 66
+> 15 0 23 22 topology 100 67
 > 16 0 23 22 topology 177 67
-> 15 0 24 22 topology 89 68
-> 16 0 24 22 topology 90 68
-> 15 0 23 22 topology 142 69
+> 15 0 23 22 topology 99 68
+> 16 0 23 22 topology 177 68
+> 15 0 23 22 topology 103 69
 > 16 0 23 22 topology 177 69
-> 15 0 24 22 topology 65 70
-> 16 0 24 22 topology 66 70
-> 15 0 23 22 topology 94 71
+> 15 0 23 22 topology 102 70
+> 16 0 23 22 topology 177 70
+> 15 0 23 22 topology 106 71
 > 16 0 23 22 topology 177 71
-> 15 0 24 22 topology 173 72
-> 16 0 24 22 topology 174 72
-> 15 0 24 22 topology 149 73
-> 16 0 24 22 topology 150 73
-> 15 0 23 22 topology 130 74
+> 15 0 23 22 topology 105 72
+> 16 0 23 22 topology 177 72
+> 15 0 23 22 topology 109 73
+> 16 0 23 22 topology 177 73
+> 15 0 23 22 topology 108 74
 > 16 0 23 22 topology 177 74
-> 15 0 24 22 topology 125 75
-> 16 0 24 22 topology 126 75
-> 15 0 24 22 topology 47 76
-> 16 0 24 22 topology 48 76
-> 15 0 24 22 topology 101 77
-> 16 0 24 22 topology 102 77
-> 15 0 23 22 topology 166 78
+> 15 0 23 22 topology 28 75
+> 16 0 23 22 topology 177 75
+> 15 0 23 22 topology 27 76
+> 16 0 23 22 topology 177 76
+> 15 0 23 22 topology 112 77
+> 16 0 23 22 topology 177 77
+> 15 0 23 22 topology 111 78
 > 16 0 23 22 topology 177 78
-> 15 0 24 22 topology 77 79
-> 16 0 24 22 topology 78 79
-> 15 0 24 22 topology 161 80
-> 16 0 24 22 topology 162 80
-> 15 0 24 22 topology 26 81
-> 16 0 24 22 topology 28 81
-> 15 0 23 22 topology 90 82
+> 15 0 23 22 topology 115 79
+> 16 0 23 22 topology 177 79
+> 15 0 23 22 topology 114 80
+> 16 0 23 22 topology 177 80
+> 15 0 23 22 topology 118 81
+> 16 0 23 22 topology 177 81
+> 15 0 23 22 topology 117 82
 > 16 0 23 22 topology 177 82
-> 15 0 24 22 topology 137 83
-> 16 0 24 22 topology 138 83
-> 15 0 23 22 topology 31 84
+> 15 0 23 22 topology 121 83
+> 16 0 23 22 topology 177 83
+> 15 0 23 22 topology 120 84
 > 16 0 23 22 topology 177 84
-> 15 0 24 22 topology 83 85
-> 16 0 24 22 topology 85 85
-> 15 0 23 22 topology 150 86
+> 15 0 23 22 topology 124 85
+> 16 0 23 22 topology 177 85
+> 15 0 23 22 topology 123 86
 > 16 0 23 22 topology 177 86
-> 15 0 23 22 topology 72 87
+> 15 0 23 22 topology 127 87
 > 16 0 23 22 topology 177 87
-> 15 0 24 22 topology 140 88
-> 16 0 24 22 topology 142 88
-> 15 0 24 22 topology 89 89
-> 16 0 24 22 topology 91 89
-> 15 0 23 22 topology 132 90
+> 15 0 23 22 topology 126 88
+> 16 0 23 22 topology 177 88
+> 15 0 23 22 topology 130 89
+> 16 0 23 22 topology 177 89
+> 15 0 23 22 topology 129 90
 > 16 0 23 22 topology 177 90
-> 15 0 24 22 topology 146 91
-> 16 0 24 22 topology 148 91
-> 15 0 24 22 topology 95 92
-> 16 0 24 22 topology 97 92
-> 15 0 24 22 topology 152 93
-> 16 0 24 22 topology 154 93
-> 15 0 24 22 topology 26 94
-> 16 0 24 22 topology 27 94
-> 15 0 24 22 topology 101 95
-> 16 0 24 22 topology 103 95
-> 15 0 24 22 topology 158 96
-> 16 0 24 22 topology 160 96
-> 15 0 23 22 topology 85 97
+> 15 0 23 22 topology 133 91
+> 16 0 23 22 topology 177 91
+> 15 0 23 22 topology 132 92
+> 16 0 23 22 topology 177 92
+> 15 0 23 22 topology 136 93
+> 16 0 23 22 topology 177 93
+> 15 0 23 22 topology 135 94
+> 16 0 23 22 topology 177 94
+> 15 0 23 22 topology 139 95
+> 16 0 23 22 topology 177 95
+> 15 0 23 22 topology 138 96
+> 16 0 23 22 topology 177 96
+> 15 0 23 22 topology 31 97
 > 16 0 23 22 topology 177 97
-> 15 0 24 22 topology 107 98
-> 16 0 24 22 topology 109 98
-> 15 0 23 22 topology 45 99
+> 15 0 23 22 topology 30 98
+> 16 0 23 22 topology 177 98
+> 15 0 23 22 topology 142 99
 > 16 0 23 22 topology 177 99
-> 15 0 24 22 topology 164 100
-> 16 0 24 22 topology 166 100
-> 15 0 23 22 topology 121 101
+> 15 0 23 22 topology 141 100
+> 16 0 23 22 topology 177 100
+> 15 0 23 22 topology 145 101
 > 16 0 23 22 topology 177 101
-> 15 0 23 22 topology 73 102
+> 15 0 23 22 topology 144 102
 > 16 0 23 22 topology 177 102
-> 15 0 23 22 topology 157 103
+> 15 0 23 22 topology 148 103
 > 16 0 23 22 topology 177 103
-> 15 0 23 22 topology 109 104
+> 15 0 23 22 topology 147 104
 > 16 0 23 22 topology 177 104
-> 15 0 23 22 topology 57 105
+> 15 0 23 22 topology 151 105
 > 16 0 23 22 topology 177 105
-> 15 0 23 22 topology 117 106
+> 15 0 23 22 topology 150 106
 > 16 0 23 22 topology 177 106
-> 15 0 23 22 topology 99 107
+> 15 0 23 22 topology 154 107
 > 16 0 23 22 topology 177 107
-> 15 0 24 22 topology 35 108
-> 16 0 24 22 topology 37 108
-> 15 0 23 22 topology 159 109
+> 15 0 23 22 topology 153 108
+> 16 0 23 22 topology 177 108
+> 15 0 23 22 topology 157 109
 > 16 0 23 22 topology 177 109
-> 15 0 23 22 topology 46 110
+> 15 0 23 22 topology 156 110
 > 16 0 23 22 topology 177 110
-> 15 0 24 22 topology 80 111
-> 16 0 24 22 topology 81 111
-> 15 0 24 22 topology 29 112
-> 16 0 24 22 topology 30 112
-> 15 0 23 22 topology 30 113
+> 15 0 23 22 topology 160 111
+> 16 0 23 22 topology 177 111
+> 15 0 23 22 topology 159 112
+> 16 0 23 22 topology 177 112
+> 15 0 23 22 topology 163 113
 > 16 0 23 22 topology 177 113
-> 15 0 24 22 topology 56 114
-> 16 0 24 22 topology 57 114
-> 15 0 24 22 topology 140 115
-> 16 0 24 22 topology 141 115
-> 15 0 23 22 topology 112 116
+> 15 0 23 22 topology 162 114
+> 16 0 23 22 topology 177 114
+> 15 0 23 22 topology 166 115
+> 16 0 23 22 topology 177 115
+> 15 0 23 22 topology 165 116
 > 16 0 23 22 topology 177 116
-> 15 0 24 22 topology 116 117
-> 16 0 24 22 topology 117 117
-> 15 0 23 22 topology 64 118
+> 15 0 23 22 topology 169 117
+> 16 0 23 22 topology 177 117
+> 15 0 23 22 topology 168 118
 > 16 0 23 22 topology 177 118
-> 15 0 24 22 topology 92 119
-> 16 0 24 22 topology 93 119
-> 15 0 23 22 topology 148 120
+> 15 0 23 22 topology 34 119
+> 16 0 23 22 topology 177 119
+> 15 0 23 22 topology 33 120
 > 16 0 23 22 topology 177 120
-> 15 0 24 22 topology 68 121
-> 16 0 24 22 topology 69 121
-> 15 0 23 22 topology 100 122
+> 15 0 23 22 topology 172 121
+> 16 0 23 22 topology 177 121
+> 15 0 23 22 topology 171 122
 > 16 0 23 22 topology 177 122
-> 15 0 24 22 topology 152 123
-> 16 0 24 22 topology 153 123
-> 15 0 23 22 topology 136 124
+> 15 0 23 22 topology 175 123
+> 16 0 23 22 topology 177 123
+> 15 0 23 22 topology 174 124
 > 16 0 23 22 topology 177 124
-> 15 0 24 22 topology 128 125
-> 16 0 24 22 topology 129 125
-> 15 0 24 22 topology 104 126
-> 16 0 24 22 topology 105 126
-> 15 0 23 22 topology 84 127
+> 15 0 23 22 topology 37 125
+> 16 0 23 22 topology 177 125
+> 15 0 23 22 topology 36 126
+> 16 0 23 22 topology 177 126
+> 15 0 23 22 topology 40 127
 > 16 0 23 22 topology 177 127
-> 15 0 24 22 topology 53 128
-> 16 0 24 22 topology 55 128
-> 15 0 23 22 topology 144 129
+> 15 0 23 22 topology 39 128
+> 16 0 23 22 topology 177 128
+> 15 0 23 22 topology 43 129
 > 16 0 23 22 topology 177 129
-> 15 0 24 22 topology 164 130
-> 16 0 24 22 topology 165 130
-> 15 0 23 22 topology 66 131
+> 15 0 23 22 topology 42 130
+> 16 0 23 22 topology 177 130
+> 15 0 23 22 topology 46 131
 > 16 0 23 22 topology 177 131
-> 15 0 24 22 topology 110 132
-> 16 0 24 22 topology 112 132
-> 15 0 23 22 topology 126 133
+> 15 0 23 22 topology 45 132
+> 16 0 23 22 topology 177 132
+> 15 0 23 22 topology 49 133
 > 16 0 23 22 topology 177 133
-> 15 0 24 22 topology 59 134
-> 16 0 24 22 topology 61 134
-> 15 0 23 22 topology 37 135
-> 16 0 23 22 topology 177 135
-> 15 0 24 22 topology 116 136
-> 16 0 24 22 topology 118 136
-> 15 0 23 22 topology 108 137
-> 16 0 23 22 topology 177 137
-> 15 0 24 22 topology 65 138
-> 16 0 24 22 topology 67 138
-> 15 0 24 22 topology 173 139
-> 16 0 24 22 topology 175 139
-> 15 0 23 22 topology 168 140
-> 16 0 23 22 topology 177 140
-> 15 0 24 22 topology 122 141
-> 16 0 24 22 topology 124 141
-> 15 0 24 22 topology 71 142
-> 16 0 24 22 topology 73 142
-> 15 0 24 22 topology 44 143
-> 16 0 24 22 topology 46 143
-> 15 0 24 22 topology 128 144
-> 16 0 24 22 topology 130 144
-> 15 0 24 22 topology 77 145
-> 16 0 24 22 topology 79 145
-> 15 0 23 22 topology 55 146
-> 16 0 23 22 topology 177 146
-> 15 0 24 22 topology 32 147
-> 16 0 24 22 topology 33 147
-> 15 0 24 22 topology 134 148
-> 16 0 24 22 topology 136 148
-> 15 0 23 22 topology 39 149
-> 16 0 23 22 topology 177 149
-> 15 0 23 22 topology 91 150
-> 16 0 23 22 topology 177 150
-> 15 0 25 22 topology 176 151
-> 16 0 25 22 topology 177 151
-> 15 0 23 22 topology 175 152
-> 16 0 23 22 topology 177 152
-> 15 0 23 22 topology 127 153
-> 16 0 23 22 topology 177 153
-> 15 0 23 22 topology 79 154
-> 16 0 23 22 topology 177 154
-> 15 0 23 22 topology 163 155
-> 16 0 23 22 topology 177 155
-> 15 0 23 22 topology 51 156
-> 16 0 23 22 topology 177 156
-> 15 0 23 22 topology 111 157
-> 16 0 23 22 topology 177 157
-> 15 0 23 22 topology 28 158
-> 16 0 23 22 topology 177 158
-> 15 0 23 22 topology 171 159
-> 16 0 23 22 topology 177 159
-> 15 0 23 22 topology 93 160
-> 16 0 23 22 topology 177 160
-> 15 0 24 22 topology 29 161
-> 16 0 24 22 topology 31 161
-> 15 0 23 22 topology 153 162
-> 16 0 23 22 topology 177 162
-> 15 0 23 22 topology 75 163
-> 16 0 23 22 topology 177 163
-> 15 0 23 22 topology 135 164
-> 16 0 23 22 topology 177 164
-> 15 0 23 22 topology 24 165
-> 16 0 23 22 topology 177 165
-> 15 0 24 22 topology 83 166
-> 16 0 24 22 topology 84 166
-> 15 0 23 22 topology 82 167
-> 16 0 23 22 topology 177 167
-> 15 0 24 22 topology 59 168
-> 16 0 24 22 topology 60 168
-> 15 0 24 22 topology 143 169
-> 16 0 24 22 topology 144 169
-> 15 0 24 22 topology 35 170
-> 16 0 24 22 topology 36 170
-> 15 0 23 22 topology 118 171
-> 16 0 23 22 topology 177 171
-> 15 0 24 22 topology 119 172
-> 16 0 24 22 topology 120 172
-> 15 0 23 22 topology 48 173
-> 16 0 23 22 topology 177 173
-> 15 0 23 22 topology 70 174
-> 16 0 23 22 topology 177 174
-> 15 0 23 22 topology 154 175
-> 16 0 23 22 topology 177 175
-> 15 0 24 22 topology 95 176
-> 16 0 24 22 topology 96 176
-> 15 0 23 22 topology 106 177
-> 16 0 23 22 topology 177 177
-> 15 0 24 22 topology 71 178
-> 16 0 24 22 topology 72 178
-> 15 0 24 22 topology 155 179
-> 16 0 24 22 topology 156 179
-> 15 0 24 22 topology 131 180
-> 16 0 24 22 topology 132 180
-> 15 0 24 22 topology 107 181
-> 16 0 24 22 topology 108 181
-> 15 0 24 22 topology 80 182
-> 16 0 24 22 topology 82 182
-> 15 0 23 22 topology 60 183
-> 16 0 23 22 topology 177 183
-> 15 0 23 22 topology 120 184
-> 16 0 23 22 topology 177 184
-> 15 0 24 22 topology 167 185
-> 16 0 24 22 topology 168 185
-> 15 0 24 22 topology 86 186
-> 16 0 24 22 topology 88 186
-> 15 0 23 22 topology 102 187
-> 16 0 23 22 topology 177 187
-> 15 0 24 22 topology 143 188
-> 16 0 24 22 topology 145 188
-> 15 0 23 22 topology 43 189
-> 16 0 23 22 topology 177 189
-> 15 0 23 22 topology 162 190
-> 16 0 23 22 topology 177 190
-> 15 0 24 22 topology 92 191
-> 16 0 24 22 topology 94 191
-> 15 0 24 22 topology 38 192
-> 16 0 24 22 topology 40 192
-> 15 0 24 22 topology 149 193
-> 16 0 24 22 topology 151 193
-> 15 0 24 22 topology 98 194
-> 16 0 24 22 topology 100 194
-> 15 0 24 22 topology 155 195
-> 16 0 24 22 topology 157 195
-> 15 0 24 22 topology 104 196
-> 16 0 24 22 topology 106 196
-> 15 0 23 22 topology 33 197
-> 16 0 23 22 topology 177 197
-> 15 0 24 22 topology 161 198
-> 16 0 24 22 topology 163 198
-> 15 0 23 22 topology 61 199
-> 16 0 23 22 topology 177 199
-> 15 0 23 22 topology 145 200
-> 16 0 23 22 topology 177 200
-> 15 0 24 22 topology 38 201
-> 16 0 24 22 topology 39 201
-> 15 0 23 22 topology 97 202
-> 16 0 23 22 topology 177 202
-> 15 0 24 22 topology 167 203
-> 16 0 24 22 topology 169 203
-> 15 0 23 22 topology 133 204
-> 16 0 23 22 topology 177 204
-> 15 0 23 22 topology 169 205
-> 16 0 23 22 topology 177 205
-> 15 0 24 22 topology 23 206
-> 16 0 24 22 topology 25 206
-> 15 0 23 22 topology 87 207
-> 16 0 23 22 topology 177 207
-> 15 0 23 22 topology 147 208
-> 16 0 23 22 topology 177 208
-> 15 0 23 22 topology 69 209
-> 16 0 23 22 topology 177 209
-> 15 0 23 22 topology 34 210
-> 16 0 23 22 topology 177 210
-> 15 0 23 22 topology 129 211
-> 16 0 23 22 topology 177 211
-> 15 0 24 22 topology 50 212
-> 16 0 24 22 topology 51 212
-> 15 0 24 22 topology 47 213
-> 16 0 24 22 topology 49 213
-> 15 0 24 22 topology 110 214
-> 16 0 24 22 topology 111 214
-> 15 0 23 22 topology 52 215
-> 16 0 23 22 topology 177 215
-> 15 0 24 22 topology 86 216
-> 16 0 24 22 topology 87 216
-> 15 0 23 22 topology 88 217
-> 16 0 23 22 topology 177 217
-> 15 0 24 22 topology 62 218
-> 16 0 24 22 topology 63 218
-> 15 0 23 22 topology 42 219
-> 16 0 23 22 topology 177 219
-> 15 0 24 22 topology 170 220
-> 16 0 24 22 topology 171 220
-> 15 0 23 22 topology 172 221
-> 16 0 23 22 topology 177 221
-> 15 0 24 22 topology 146 222
-> 16 0 24 22 topology 147 222
-> 15 0 23 22 topology 124 223
-> 16 0 23 22 topology 177 223
-> 15 0 24 22 topology 122 224
-> 16 0 24 22 topology 123 224
-> 15 0 24 22 topology 41 225
-> 16 0 24 22 topology 42 225
-> 15 0 23 22 topology 76 226
-> 16 0 23 22 topology 177 226
-> 15 0 23 22 topology 160 227
-> 16 0 23 22 topology 177 227
-> 15 0 24 22 topology 98 228
-> 16 0 24 22 topology 99 228
-> 15 0 24 22 topology 74 229
-> 16 0 24 22 topology 75 229
-> 15 0 24 22 topology 158 230
-> 16 0 24 22 topology 159 230
-> 15 0 23 22 topology 54 231
-> 16 0 23 22 topology 177 231
-> 15 0 24 22 topology 50 232
-> 16 0 24 22 topology 52 232
-> 15 0 24 22 topology 134 233
-> 16 0 24 22 topology 135 233
-> 15 0 23 22 topology 114 234
-> 16 0 23 22 topology 177 234
-> 15 0 23 22 topology 25 235
-> 16 0 23 22 topology 177 235
-> 15 0 24 22 topology 56 236
-> 16 0 24 22 topology 58 236
-> 15 0 23 22 topology 174 237
-> 16 0 23 22 topology 177 237
-> 15 0 24 179 topology 285 238
-> 16 0 24 179 topology 286 238
-> 15 0 23 179 topology 383 239
+> 15 0 23 22 topology 48 134
+> 16 0 23 22 topology 177 134
+> 15 0 24 22 topology 176 135
+> 16 0 24 22 topology 177 135
+> 15 0 25 22 topology 50 136
+> 16 0 25 22 topology 52 136
+> 15 0 25 22 topology 50 137
+> 16 0 25 22 topology 51 137
+> 15 0 25 22 topology 53 138
+> 16 0 25 22 topology 55 138
+> 15 0 25 22 topology 53 139
+> 16 0 25 22 topology 54 139
+> 15 0 25 22 topology 56 140
+> 16 0 25 22 topology 58 140
+> 15 0 25 22 topology 56 141
+> 16 0 25 22 topology 57 141
+> 15 0 25 22 topology 59 142
+> 16 0 25 22 topology 61 142
+> 15 0 25 22 topology 59 143
+> 16 0 25 22 topology 60 143
+> 15 0 25 22 topology 62 144
+> 16 0 25 22 topology 64 144
+> 15 0 25 22 topology 62 145
+> 16 0 25 22 topology 63 145
+> 15 0 25 22 topology 65 146
+> 16 0 25 22 topology 67 146
+> 15 0 25 22 topology 65 147
+> 16 0 25 22 topology 66 147
+> 15 0 25 22 topology 68 148
+> 16 0 25 22 topology 70 148
+> 15 0 25 22 topology 68 149
+> 16 0 25 22 topology 69 149
+> 15 0 25 22 topology 71 150
+> 16 0 25 22 topology 73 150
+> 15 0 25 22 topology 71 151
+> 16 0 25 22 topology 72 151
+> 15 0 25 22 topology 74 152
+> 16 0 25 22 topology 76 152
+> 15 0 25 22 topology 74 153
+> 16 0 25 22 topology 75 153
+> 15 0 25 22 topology 77 154
+> 16 0 25 22 topology 79 154
+> 15 0 25 22 topology 77 155
+> 16 0 25 22 topology 78 155
+> 15 0 25 22 topology 23 156
+> 16 0 25 22 topology 25 156
+> 15 0 25 22 topology 23 157
+> 16 0 25 22 topology 24 157
+> 15 0 25 22 topology 80 158
+> 16 0 25 22 topology 82 158
+> 15 0 25 22 topology 80 159
+> 16 0 25 22 topology 81 159
+> 15 0 25 22 topology 83 160
+> 16 0 25 22 topology 85 160
+> 15 0 25 22 topology 83 161
+> 16 0 25 22 topology 84 161
+> 15 0 25 22 topology 86 162
+> 16 0 25 22 topology 88 162
+> 15 0 25 22 topology 86 163
+> 16 0 25 22 topology 87 163
+> 15 0 25 22 topology 89 164
+> 16 0 25 22 topology 91 164
+> 15 0 25 22 topology 89 165
+> 16 0 25 22 topology 90 165
+> 15 0 25 22 topology 92 166
+> 16 0 25 22 topology 94 166
+> 15 0 25 22 topology 92 167
+> 16 0 25 22 topology 93 167
+> 15 0 25 22 topology 95 168
+> 16 0 25 22 topology 97 168
+> 15 0 25 22 topology 95 169
+> 16 0 25 22 topology 96 169
+> 15 0 25 22 topology 98 170
+> 16 0 25 22 topology 100 170
+> 15 0 25 22 topology 98 171
+> 16 0 25 22 topology 99 171
+> 15 0 25 22 topology 101 172
+> 16 0 25 22 topology 103 172
+> 15 0 25 22 topology 101 173
+> 16 0 25 22 topology 102 173
+> 15 0 25 22 topology 104 174
+> 16 0 25 22 topology 106 174
+> 15 0 25 22 topology 104 175
+> 16 0 25 22 topology 105 175
+> 15 0 25 22 topology 107 176
+> 16 0 25 22 topology 109 176
+> 15 0 25 22 topology 107 177
+> 16 0 25 22 topology 108 177
+> 15 0 25 22 topology 26 178
+> 16 0 25 22 topology 28 178
+> 15 0 25 22 topology 26 179
+> 16 0 25 22 topology 27 179
+> 15 0 25 22 topology 110 180
+> 16 0 25 22 topology 112 180
+> 15 0 25 22 topology 110 181
+> 16 0 25 22 topology 111 181
+> 15 0 25 22 topology 113 182
+> 16 0 25 22 topology 115 182
+> 15 0 25 22 topology 113 183
+> 16 0 25 22 topology 114 183
+> 15 0 25 22 topology 116 184
+> 16 0 25 22 topology 118 184
+> 15 0 25 22 topology 116 185
+> 16 0 25 22 topology 117 185
+> 15 0 25 22 topology 119 186
+> 16 0 25 22 topology 121 186
+> 15 0 25 22 topology 119 187
+> 16 0 25 22 topology 120 187
+> 15 0 25 22 topology 122 188
+> 16 0 25 22 topology 124 188
+> 15 0 25 22 topology 122 189
+> 16 0 25 22 topology 123 189
+> 15 0 25 22 topology 125 190
+> 16 0 25 22 topology 127 190
+> 15 0 25 22 topology 125 191
+> 16 0 25 22 topology 126 191
+> 15 0 25 22 topology 128 192
+> 16 0 25 22 topology 130 192
+> 15 0 25 22 topology 128 193
+> 16 0 25 22 topology 129 193
+> 15 0 25 22 topology 131 194
+> 16 0 25 22 topology 133 194
+> 15 0 25 22 topology 131 195
+> 16 0 25 22 topology 132 195
+> 15 0 25 22 topology 134 196
+> 16 0 25 22 topology 136 196
+> 15 0 25 22 topology 134 197
+> 16 0 25 22 topology 135 197
+> 15 0 25 22 topology 137 198
+> 16 0 25 22 topology 139 198
+> 15 0 25 22 topology 137 199
+> 16 0 25 22 topology 138 199
+> 15 0 25 22 topology 29 200
+> 16 0 25 22 topology 31 200
+> 15 0 25 22 topology 29 201
+> 16 0 25 22 topology 30 201
+> 15 0 25 22 topology 140 202
+> 16 0 25 22 topology 142 202
+> 15 0 25 22 topology 140 203
+> 16 0 25 22 topology 141 203
+> 15 0 25 22 topology 143 204
+> 16 0 25 22 topology 145 204
+> 15 0 25 22 topology 143 205
+> 16 0 25 22 topology 144 205
+> 15 0 25 22 topology 146 206
+> 16 0 25 22 topology 148 206
+> 15 0 25 22 topology 146 207
+> 16 0 25 22 topology 147 207
+> 15 0 25 22 topology 149 208
+> 16 0 25 22 topology 151 208
+> 15 0 25 22 topology 149 209
+> 16 0 25 22 topology 150 209
+> 15 0 25 22 topology 152 210
+> 16 0 25 22 topology 154 210
+> 15 0 25 22 topology 152 211
+> 16 0 25 22 topology 153 211
+> 15 0 25 22 topology 155 212
+> 16 0 25 22 topology 157 212
+> 15 0 25 22 topology 155 213
+> 16 0 25 22 topology 156 213
+> 15 0 25 22 topology 158 214
+> 16 0 25 22 topology 160 214
+> 15 0 25 22 topology 158 215
+> 16 0 25 22 topology 159 215
+> 15 0 25 22 topology 161 216
+> 16 0 25 22 topology 163 216
+> 15 0 25 22 topology 161 217
+> 16 0 25 22 topology 162 217
+> 15 0 25 22 topology 164 218
+> 16 0 25 22 topology 166 218
+> 15 0 25 22 topology 164 219
+> 16 0 25 22 topology 165 219
+> 15 0 25 22 topology 167 220
+> 16 0 25 22 topology 169 220
+> 15 0 25 22 topology 167 221
+> 16 0 25 22 topology 168 221
+> 15 0 25 22 topology 32 222
+> 16 0 25 22 topology 34 222
+> 15 0 25 22 topology 32 223
+> 16 0 25 22 topology 33 223
+> 15 0 25 22 topology 170 224
+> 16 0 25 22 topology 172 224
+> 15 0 25 22 topology 170 225
+> 16 0 25 22 topology 171 225
+> 15 0 25 22 topology 173 226
+> 16 0 25 22 topology 175 226
+> 15 0 25 22 topology 173 227
+> 16 0 25 22 topology 174 227
+> 15 0 25 22 topology 35 228
+> 16 0 25 22 topology 37 228
+> 15 0 25 22 topology 35 229
+> 16 0 25 22 topology 36 229
+> 15 0 25 22 topology 38 230
+> 16 0 25 22 topology 40 230
+> 15 0 25 22 topology 38 231
+> 16 0 25 22 topology 39 231
+> 15 0 25 22 topology 41 232
+> 16 0 25 22 topology 43 232
+> 15 0 25 22 topology 41 233
+> 16 0 25 22 topology 42 233
+> 15 0 25 22 topology 44 234
+> 16 0 25 22 topology 46 234
+> 15 0 25 22 topology 44 235
+> 16 0 25 22 topology 45 235
+> 15 0 25 22 topology 47 236
+> 16 0 25 22 topology 49 236
+> 15 0 25 22 topology 47 237
+> 16 0 25 22 topology 48 237
+> 15 0 23 179 topology 209 238
+> 16 0 23 179 topology 460 238
+> 15 0 23 179 topology 208 239
 > 16 0 23 179 topology 460 239
-> 15 0 24 179 topology 444 240
-> 16 0 24 179 topology 446 240
-> 15 0 24 179 topology 264 241
-> 16 0 24 179 topology 265 241
-> 15 0 23 179 topology 277 242
+> 15 0 23 179 topology 212 240
+> 16 0 23 179 topology 460 240
+> 15 0 23 179 topology 211 241
+> 16 0 23 179 topology 460 241
+> 15 0 23 179 topology 215 242
 > 16 0 23 179 topology 460 242
-> 15 0 23 179 topology 397 243
+> 15 0 23 179 topology 214 243
 > 16 0 23 179 topology 460 243
-> 15 0 23 179 topology 319 244
+> 15 0 23 179 topology 218 244
 > 16 0 23 179 topology 460 244
-> 15 0 24 179 topology 438 245
-> 16 0 24 179 topology 439 245
-> 15 0 24 179 topology 330 246
-> 16 0 24 179 topology 332 246
-> 15 0 24 179 topology 198 247
-> 16 0 24 179 topology 200 247
-> 15 0 23 179 topology 439 248
+> 15 0 23 179 topology 217 245
+> 16 0 23 179 topology 460 245
+> 15 0 23 179 topology 221 246
+> 16 0 23 179 topology 460 246
+> 15 0 23 179 topology 220 247
+> 16 0 23 179 topology 460 247
+> 15 0 23 179 topology 224 248
 > 16 0 23 179 topology 460 248
-> 15 0 24 179 topology 255 249
-> 16 0 24 179 topology 257 249
-> 15 0 24 179 topology 396 250
-> 16 0 24 179 topology 398 250
-> 15 0 24 179 topology 243 251
-> 16 0 24 179 topology 244 251
-> 15 0 23 179 topology 302 252
+> 15 0 23 179 topology 223 249
+> 16 0 23 179 topology 460 249
+> 15 0 23 179 topology 227 250
+> 16 0 23 179 topology 460 250
+> 15 0 23 179 topology 226 251
+> 16 0 23 179 topology 460 251
+> 15 0 23 179 topology 230 252
 > 16 0 23 179 topology 460 252
-> 15 0 24 179 topology 321 253
-> 16 0 24 179 topology 323 253
-> 15 0 24 179 topology 222 254
-> 16 0 24 179 topology 223 254
-> 15 0 23 179 topology 338 255
+> 15 0 23 179 topology 229 253
+> 16 0 23 179 topology 460 253
+> 15 0 23 179 topology 233 254
+> 16 0 23 179 topology 460 254
+> 15 0 23 179 topology 232 255
 > 16 0 23 179 topology 460 255
-> 15 0 24 179 topology 417 256
-> 16 0 24 179 topology 418 256
-> 15 0 23 179 topology 374 257
+> 15 0 23 179 topology 236 256
+> 16 0 23 179 topology 460 256
+> 15 0 23 179 topology 235 257
 > 16 0 23 179 topology 460 257
-> 15 0 24 179 topology 396 258
-> 16 0 24 179 topology 397 258
-> 15 0 23 179 topology 410 259
+> 15 0 23 179 topology 182 258
+> 16 0 23 179 topology 460 258
+> 15 0 23 179 topology 181 259
 > 16 0 23 179 topology 460 259
-> 15 0 24 179 topology 207 260
-> 16 0 24 179 topology 209 260
-> 15 0 23 179 topology 446 261
+> 15 0 23 179 topology 239 260
+> 16 0 23 179 topology 460 260
+> 15 0 23 179 topology 238 261
 > 16 0 23 179 topology 460 261
-> 15 0 24 179 topology 375 262
-> 16 0 24 179 topology 376 262
-> 15 0 23 179 topology 304 263
+> 15 0 23 179 topology 242 262
+> 16 0 23 179 topology 460 262
+> 15 0 23 179 topology 241 263
 > 16 0 23 179 topology 460 263
-> 15 0 23 179 topology 226 264
+> 15 0 23 179 topology 245 264
 > 16 0 23 179 topology 460 264
-> 15 0 24 179 topology 354 265
-> 16 0 24 179 topology 355 265
-> 15 0 24 179 topology 273 266
-> 16 0 24 179 topology 275 266
-> 15 0 23 179 topology 424 267
+> 15 0 23 179 topology 244 265
+> 16 0 23 179 topology 460 265
+> 15 0 23 179 topology 248 266
+> 16 0 23 179 topology 460 266
+> 15 0 23 179 topology 247 267
 > 16 0 23 179 topology 460 267
-> 15 0 23 179 topology 346 268
+> 15 0 23 179 topology 251 268
 > 16 0 23 179 topology 460 268
-> 15 0 24 179 topology 183 269
-> 16 0 24 179 topology 184 269
-> 15 0 24 179 topology 339 270
-> 16 0 24 179 topology 341 270
-> 15 0 24 179 topology 189 271
-> 16 0 24 179 topology 190 271
-> 15 0 24 179 topology 264 272
-> 16 0 24 179 topology 266 272
-> 15 0 23 179 topology 199 273
+> 15 0 23 179 topology 250 269
+> 16 0 23 179 topology 460 269
+> 15 0 23 179 topology 254 270
+> 16 0 23 179 topology 460 270
+> 15 0 23 179 topology 253 271
+> 16 0 23 179 topology 460 271
+> 15 0 23 179 topology 257 272
+> 16 0 23 179 topology 460 272
+> 15 0 23 179 topology 256 273
 > 16 0 23 179 topology 460 273
-> 15 0 23 179 topology 329 274
+> 15 0 23 179 topology 260 274
 > 16 0 23 179 topology 460 274
-> 15 0 24 179 topology 195 275
-> 16 0 24 179 topology 196 275
-> 15 0 24 179 topology 405 276
-> 16 0 24 179 topology 407 276
-> 15 0 24 179 topology 333 277
-> 16 0 24 179 topology 334 277
-> 15 0 23 179 topology 365 278
+> 15 0 23 179 topology 259 275
+> 16 0 23 179 topology 460 275
+> 15 0 23 179 topology 263 276
+> 16 0 23 179 topology 460 276
+> 15 0 23 179 topology 262 277
+> 16 0 23 179 topology 460 277
+> 15 0 23 179 topology 266 278
 > 16 0 23 179 topology 460 278
-> 15 0 23 179 topology 233 279
+> 15 0 23 179 topology 265 279
 > 16 0 23 179 topology 460 279
-> 15 0 24 179 topology 201 280
-> 16 0 24 179 topology 202 280
-> 15 0 23 179 topology 401 281
+> 15 0 23 179 topology 185 280
+> 16 0 23 179 topology 460 280
+> 15 0 23 179 topology 184 281
 > 16 0 23 179 topology 460 281
-> 15 0 24 179 topology 312 282
-> 16 0 24 179 topology 313 282
-> 15 0 23 179 topology 437 283
+> 15 0 23 179 topology 269 282
+> 16 0 23 179 topology 460 282
+> 15 0 23 179 topology 268 283
 > 16 0 23 179 topology 460 283
-> 15 0 23 179 topology 211 284
+> 15 0 23 179 topology 272 284
 > 16 0 23 179 topology 460 284
-> 15 0 24 179 topology 291 285
-> 16 0 24 179 topology 292 285
-> 15 0 23 179 topology 331 286
+> 15 0 23 179 topology 271 285
+> 16 0 23 179 topology 460 285
+> 15 0 23 179 topology 275 286
 > 16 0 23 179 topology 460 286
-> 15 0 23 179 topology 253 287
+> 15 0 23 179 topology 274 287
 > 16 0 23 179 topology 460 287
-> 15 0 24 179 topology 189 288
-> 16 0 24 179 topology 191 288
-> 15 0 24 179 topology 216 289
-> 16 0 24 179 topology 218 289
-> 15 0 23 179 topology 451 290
+> 15 0 23 179 topology 278 288
+> 16 0 23 179 topology 460 288
+> 15 0 23 179 topology 277 289
+> 16 0 23 179 topology 460 289
+> 15 0 23 179 topology 281 290
 > 16 0 23 179 topology 460 290
-> 15 0 23 179 topology 373 291
+> 15 0 23 179 topology 280 291
 > 16 0 23 179 topology 460 291
-> 15 0 23 179 topology 206 292
+> 15 0 23 179 topology 284 292
 > 16 0 23 179 topology 460 292
-> 15 0 23 179 topology 295 293
+> 15 0 23 179 topology 283 293
 > 16 0 23 179 topology 460 293
-> 15 0 24 179 topology 357 294
-> 16 0 24 179 topology 359 294
-> 15 0 24 179 topology 444 295
-> 16 0 24 179 topology 445 295
-> 15 0 24 179 topology 282 296
-> 16 0 24 179 topology 284 296
-> 15 0 23 179 topology 415 297
+> 15 0 23 179 topology 287 294
+> 16 0 23 179 topology 460 294
+> 15 0 23 179 topology 286 295
+> 16 0 23 179 topology 460 295
+> 15 0 23 179 topology 290 296
+> 16 0 23 179 topology 460 296
+> 15 0 23 179 topology 289 297
 > 16 0 23 179 topology 460 297
-> 15 0 23 179 topology 184 298
+> 15 0 23 179 topology 293 298
 > 16 0 23 179 topology 460 298
-> 15 0 24 179 topology 423 299
-> 16 0 24 179 topology 425 299
-> 15 0 24 179 topology 270 300
-> 16 0 24 179 topology 271 300
-> 15 0 24 179 topology 348 301
-> 16 0 24 179 topology 350 301
-> 15 0 23 179 topology 224 302
+> 15 0 23 179 topology 292 299
+> 16 0 23 179 topology 460 299
+> 15 0 23 179 topology 296 300
+> 16 0 23 179 topology 460 300
+> 15 0 23 179 topology 295 301
+> 16 0 23 179 topology 460 301
+> 15 0 23 179 topology 188 302
 > 16 0 23 179 topology 460 302
-> 15 0 24 179 topology 249 303
-> 16 0 24 179 topology 250 303
-> 15 0 23 179 topology 392 304
+> 15 0 23 179 topology 187 303
+> 16 0 23 179 topology 460 303
+> 15 0 23 179 topology 299 304
 > 16 0 23 179 topology 460 304
-> 15 0 23 179 topology 260 305
+> 15 0 23 179 topology 298 305
 > 16 0 23 179 topology 460 305
-> 15 0 24 179 topology 228 306
-> 16 0 24 179 topology 229 306
-> 15 0 23 179 topology 428 307
+> 15 0 23 179 topology 302 306
+> 16 0 23 179 topology 460 306
+> 15 0 23 179 topology 301 307
 > 16 0 23 179 topology 460 307
-> 15 0 23 179 topology 296 308
+> 15 0 23 179 topology 305 308
 > 16 0 23 179 topology 460 308
-> 15 0 24 179 topology 414 309
-> 16 0 24 179 topology 416 309
-> 15 0 24 179 topology 423 310
-> 16 0 24 179 topology 424 310
-> 15 0 23 179 topology 238 311
+> 15 0 23 179 topology 304 309
+> 16 0 23 179 topology 460 309
+> 15 0 23 179 topology 308 310
+> 16 0 23 179 topology 460 310
+> 15 0 23 179 topology 307 311
 > 16 0 23 179 topology 460 311
-> 15 0 24 179 topology 402 312
-> 16 0 24 179 topology 403 312
-> 15 0 23 179 topology 358 313
+> 15 0 23 179 topology 311 312
+> 16 0 23 179 topology 460 312
+> 15 0 23 179 topology 310 313
 > 16 0 23 179 topology 460 313
-> 15 0 23 179 topology 280 314
+> 15 0 23 179 topology 314 314
 > 16 0 23 179 topology 460 314
-> 15 0 23 179 topology 197 315
+> 15 0 23 179 topology 313 315
 > 16 0 23 179 topology 460 315
-> 15 0 24 179 topology 381 316
-> 16 0 24 179 topology 382 316
-> 15 0 24 179 topology 300 317
-> 16 0 24 179 topology 302 317
-> 15 0 23 179 topology 400 318
+> 15 0 23 179 topology 317 316
+> 16 0 23 179 topology 460 316
+> 15 0 23 179 topology 316 317
+> 16 0 23 179 topology 460 317
+> 15 0 23 179 topology 320 318
 > 16 0 23 179 topology 460 318
-> 15 0 23 179 topology 322 319
+> 15 0 23 179 topology 319 319
 > 16 0 23 179 topology 460 319
-> 15 0 24 179 topology 225 320
-> 16 0 24 179 topology 227 320
-> 15 0 24 179 topology 207 321
-> 16 0 24 179 topology 208 321
-> 15 0 23 179 topology 442 322
+> 15 0 23 179 topology 323 320
+> 16 0 23 179 topology 460 320
+> 15 0 23 179 topology 322 321
+> 16 0 23 179 topology 460 321
+> 15 0 23 179 topology 326 322
 > 16 0 23 179 topology 460 322
-> 15 0 24 179 topology 366 323
-> 16 0 24 179 topology 368 323
-> 15 0 23 179 topology 215 324
+> 15 0 23 179 topology 325 323
+> 16 0 23 179 topology 460 323
+> 15 0 23 179 topology 191 324
 > 16 0 23 179 topology 460 324
-> 15 0 24 179 topology 291 325
-> 16 0 24 179 topology 293 325
-> 15 0 23 179 topology 251 326
+> 15 0 23 179 topology 190 325
+> 16 0 23 179 topology 460 325
+> 15 0 23 179 topology 329 326
 > 16 0 23 179 topology 460 326
-> 15 0 24 179 topology 432 327
-> 16 0 24 179 topology 434 327
-> 15 0 24 179 topology 360 328
-> 16 0 24 179 topology 361 328
-> 15 0 23 179 topology 419 329
+> 15 0 23 179 topology 328 327
+> 16 0 23 179 topology 460 327
+> 15 0 23 179 topology 332 328
+> 16 0 23 179 topology 460 328
+> 15 0 23 179 topology 331 329
 > 16 0 23 179 topology 460 329
-> 15 0 23 179 topology 287 330
+> 15 0 23 179 topology 335 330
 > 16 0 23 179 topology 460 330
-> 15 0 23 179 topology 455 331
+> 15 0 23 179 topology 334 331
 > 16 0 23 179 topology 460 331
-> 15 0 23 179 topology 323 332
+> 15 0 23 179 topology 338 332
 > 16 0 23 179 topology 460 332
-> 15 0 24 179 topology 339 333
-> 16 0 24 179 topology 340 333
-> 15 0 24 179 topology 180 334
-> 16 0 24 179 topology 182 334
-> 15 0 24 179 topology 318 335
-> 16 0 24 179 topology 319 335
-> 15 0 23 179 topology 188 336
+> 15 0 23 179 topology 337 333
+> 16 0 23 179 topology 460 333
+> 15 0 23 179 topology 341 334
+> 16 0 23 179 topology 460 334
+> 15 0 23 179 topology 340 335
+> 16 0 23 179 topology 460 335
+> 15 0 23 179 topology 344 336
 > 16 0 23 179 topology 460 336
-> 15 0 23 179 topology 307 337
+> 15 0 23 179 topology 343 337
 > 16 0 23 179 topology 460 337
-> 15 0 24 179 topology 243 338
-> 16 0 24 179 topology 245 338
-> 15 0 23 179 topology 229 339
+> 15 0 23 179 topology 347 338
+> 16 0 23 179 topology 460 338
+> 15 0 23 179 topology 346 339
 > 16 0 23 179 topology 460 339
-> 15 0 23 179 topology 427 340
+> 15 0 23 179 topology 350 340
 > 16 0 23 179 topology 460 340
 > 15 0 23 179 topology 349 341
 > 16 0 23 179 topology 460 341
-> 15 0 24 179 topology 309 342
-> 16 0 24 179 topology 311 342
-> 15 0 24 179 topology 204 343
-> 16 0 24 179 topology 206 343
-> 15 0 24 179 topology 234 344
-> 16 0 24 179 topology 236 344
-> 15 0 24 179 topology 450 345
-> 16 0 24 179 topology 452 345
-> 15 0 24 179 topology 297 346
-> 16 0 24 179 topology 298 346
-> 15 0 23 179 topology 242 347
+> 15 0 23 179 topology 353 342
+> 16 0 23 179 topology 460 342
+> 15 0 23 179 topology 352 343
+> 16 0 23 179 topology 460 343
+> 15 0 23 179 topology 356 344
+> 16 0 23 179 topology 460 344
+> 15 0 23 179 topology 355 345
+> 16 0 23 179 topology 460 345
+> 15 0 23 179 topology 194 346
+> 16 0 23 179 topology 460 346
+> 15 0 23 179 topology 193 347
 > 16 0 23 179 topology 460 347
-> 15 0 23 179 topology 202 348
+> 15 0 23 179 topology 359 348
 > 16 0 23 179 topology 460 348
-> 15 0 24 179 topology 375 349
-> 16 0 24 179 topology 377 349
-> 15 0 23 179 topology 278 350
+> 15 0 23 179 topology 358 349
+> 16 0 23 179 topology 460 349
+> 15 0 23 179 topology 362 350
 > 16 0 23 179 topology 460 350
-> 15 0 24 179 topology 276 351
-> 16 0 24 179 topology 277 351
-> 15 0 23 179 topology 314 352
+> 15 0 23 179 topology 361 351
+> 16 0 23 179 topology 460 351
+> 15 0 23 179 topology 365 352
 > 16 0 23 179 topology 460 352
-> 15 0 24 179 topology 255 353
-> 16 0 24 179 topology 256 353
-> 15 0 25 179 topology 459 354
-> 16 0 25 179 topology 460 354
-> 15 0 23 179 topology 350 355
+> 15 0 23 179 topology 364 353
+> 16 0 23 179 topology 460 353
+> 15 0 23 179 topology 368 354
+> 16 0 23 179 topology 460 354
+> 15 0 23 179 topology 367 355
 > 16 0 23 179 topology 460 355
-> 15 0 24 179 topology 441 356
-> 16 0 24 179 topology 443 356
-> 15 0 24 179 topology 234 357
-> 16 0 24 179 topology 235 357
-> 15 0 24 179 topology 450 358
-> 16 0 24 179 topology 451 358
-> 15 0 23 179 topology 386 359
+> 15 0 23 179 topology 371 356
+> 16 0 23 179 topology 460 356
+> 15 0 23 179 topology 370 357
+> 16 0 23 179 topology 460 357
+> 15 0 23 179 topology 374 358
+> 16 0 23 179 topology 460 358
+> 15 0 23 179 topology 373 359
 > 16 0 23 179 topology 460 359
-> 15 0 23 179 topology 214 360
+> 15 0 23 179 topology 377 360
 > 16 0 23 179 topology 460 360
-> 15 0 24 179 topology 429 361
-> 16 0 24 179 topology 430 361
-> 15 0 23 179 topology 334 362
+> 15 0 23 179 topology 376 361
+> 16 0 23 179 topology 460 361
+> 15 0 23 179 topology 380 362
 > 16 0 23 179 topology 460 362
-> 15 0 23 179 topology 256 363
+> 15 0 23 179 topology 379 363
 > 16 0 23 179 topology 460 363
-> 15 0 24 179 topology 408 364
-> 16 0 24 179 topology 409 364
-> 15 0 24 179 topology 327 365
-> 16 0 24 179 topology 329 365
-> 15 0 23 179 topology 454 366
+> 15 0 23 179 topology 383 364
+> 16 0 23 179 topology 460 364
+> 15 0 23 179 topology 382 365
+> 16 0 23 179 topology 460 365
+> 15 0 23 179 topology 386 366
 > 16 0 23 179 topology 460 366
-> 15 0 23 179 topology 376 367
+> 15 0 23 179 topology 385 367
 > 16 0 23 179 topology 460 367
-> 15 0 24 179 topology 252 368
-> 16 0 24 179 topology 254 368
-> 15 0 24 179 topology 393 369
-> 16 0 24 179 topology 395 369
-> 15 0 24 179 topology 213 370
-> 16 0 24 179 topology 214 370
-> 15 0 23 179 topology 187 371
+> 15 0 23 179 topology 197 368
+> 16 0 23 179 topology 460 368
+> 15 0 23 179 topology 196 369
+> 16 0 23 179 topology 460 369
+> 15 0 23 179 topology 389 370
+> 16 0 23 179 topology 460 370
+> 15 0 23 179 topology 388 371
 > 16 0 23 179 topology 460 371
-> 15 0 23 179 topology 269 372
+> 15 0 23 179 topology 392 372
 > 16 0 23 179 topology 460 372
-> 15 0 24 179 topology 318 373
-> 16 0 24 179 topology 320 373
-> 15 0 23 179 topology 305 374
+> 15 0 23 179 topology 391 373
+> 16 0 23 179 topology 460 373
+> 15 0 23 179 topology 395 374
 > 16 0 23 179 topology 460 374
-> 15 0 24 179 topology 387 375
-> 16 0 24 179 topology 388 375
-> 15 0 23 179 topology 341 376
+> 15 0 23 179 topology 394 375
+> 16 0 23 179 topology 460 375
+> 15 0 23 179 topology 398 376
 > 16 0 23 179 topology 460 376
-> 15 0 24 179 topology 384 377
-> 16 0 24 179 topology 386 377
-> 15 0 24 179 topology 366 378
-> 16 0 24 179 topology 367 378
-> 15 0 23 179 topology 377 379
+> 15 0 23 179 topology 397 377
+> 16 0 23 179 topology 460 377
+> 15 0 23 179 topology 401 378
+> 16 0 23 179 topology 460 378
+> 15 0 23 179 topology 400 379
 > 16 0 23 179 topology 460 379
-> 15 0 23 179 topology 413 380
+> 15 0 23 179 topology 404 380
 > 16 0 23 179 topology 460 380
-> 15 0 23 179 topology 241 381
+> 15 0 23 179 topology 403 381
 > 16 0 23 179 topology 460 381
-> 15 0 24 179 topology 345 382
-> 16 0 24 179 topology 346 382
-> 15 0 24 179 topology 324 383
-> 16 0 24 179 topology 325 383
-> 15 0 23 179 topology 361 384
+> 15 0 23 179 topology 407 382
+> 16 0 23 179 topology 460 382
+> 15 0 23 179 topology 406 383
+> 16 0 23 179 topology 460 383
+> 15 0 23 179 topology 410 384
 > 16 0 23 179 topology 460 384
-> 15 0 23 179 topology 283 385
+> 15 0 23 179 topology 409 385
 > 16 0 23 179 topology 460 385
-> 15 0 24 179 topology 270 386
-> 16 0 24 179 topology 272 386
-> 15 0 24 179 topology 195 387
-> 16 0 24 179 topology 197 387
-> 15 0 23 179 topology 403 388
+> 15 0 23 179 topology 413 386
+> 16 0 23 179 topology 460 386
+> 15 0 23 179 topology 412 387
+> 16 0 23 179 topology 460 387
+> 15 0 23 179 topology 416 388
 > 16 0 23 179 topology 460 388
-> 15 0 23 179 topology 325 389
+> 15 0 23 179 topology 415 389
 > 16 0 23 179 topology 460 389
-> 15 0 24 179 topology 336 390
-> 16 0 24 179 topology 338 390
-> 15 0 23 179 topology 445 391
+> 15 0 23 179 topology 200 390
+> 16 0 23 179 topology 460 390
+> 15 0 23 179 topology 199 391
 > 16 0 23 179 topology 460 391
-> 15 0 24 179 topology 261 392
-> 16 0 24 179 topology 263 392
-> 15 0 24 179 topology 402 393
-> 16 0 24 179 topology 404 393
-> 15 0 24 179 topology 303 394
-> 16 0 24 179 topology 304 394
-> 15 0 23 179 topology 332 395
+> 15 0 23 179 topology 419 392
+> 16 0 23 179 topology 460 392
+> 15 0 23 179 topology 418 393
+> 16 0 23 179 topology 460 393
+> 15 0 23 179 topology 422 394
+> 16 0 23 179 topology 460 394
+> 15 0 23 179 topology 421 395
 > 16 0 23 179 topology 460 395
-> 15 0 23 179 topology 368 396
+> 15 0 23 179 topology 425 396
 > 16 0 23 179 topology 460 396
-> 15 0 24 179 topology 282 397
-> 16 0 24 179 topology 283 397
-> 15 0 23 179 topology 236 398
+> 15 0 23 179 topology 424 397
+> 16 0 23 179 topology 460 397
+> 15 0 23 179 topology 428 398
 > 16 0 23 179 topology 460 398
-> 15 0 23 179 topology 404 399
+> 15 0 23 179 topology 427 399
 > 16 0 23 179 topology 460 399
-> 15 0 24 179 topology 261 400
-> 16 0 24 179 topology 262 400
-> 15 0 23 179 topology 440 401
+> 15 0 23 179 topology 431 400
+> 16 0 23 179 topology 460 400
+> 15 0 23 179 topology 430 401
 > 16 0 23 179 topology 460 401
-> 15 0 23 179 topology 268 402
+> 15 0 23 179 topology 434 402
 > 16 0 23 179 topology 460 402
-> 15 0 24 179 topology 456 403
-> 16 0 24 179 topology 457 403
-> 15 0 24 179 topology 213 404
-> 16 0 24 179 topology 215 404
-> 15 0 23 179 topology 388 405
+> 15 0 23 179 topology 433 403
+> 16 0 23 179 topology 460 403
+> 15 0 23 179 topology 437 404
+> 16 0 23 179 topology 460 404
+> 15 0 23 179 topology 436 405
 > 16 0 23 179 topology 460 405
-> 15 0 23 179 topology 310 406
+> 15 0 23 179 topology 440 406
 > 16 0 23 179 topology 460 406
-> 15 0 23 179 topology 232 407
+> 15 0 23 179 topology 439 407
 > 16 0 23 179 topology 460 407
-> 15 0 24 179 topology 435 408
-> 16 0 24 179 topology 436 408
-> 15 0 23 179 topology 430 409
+> 15 0 23 179 topology 443 408
+> 16 0 23 179 topology 460 408
+> 15 0 23 179 topology 442 409
 > 16 0 23 179 topology 460 409
-> 15 0 23 179 topology 352 410
+> 15 0 23 179 topology 446 410
 > 16 0 23 179 topology 460 410
-> 15 0 24 179 topology 414 411
-> 16 0 24 179 topology 415 411
-> 15 0 24 179 topology 279 412
-> 16 0 24 179 topology 281 412
-> 15 0 24 179 topology 420 413
-> 16 0 24 179 topology 422 413
-> 15 0 24 179 topology 240 414
-> 16 0 24 179 topology 241 414
-> 15 0 24 179 topology 345 415
-> 16 0 24 179 topology 347 415
-> 15 0 24 179 topology 219 416
-> 16 0 24 179 topology 220 416
-> 15 0 23 179 topology 205 417
+> 15 0 23 179 topology 445 411
+> 16 0 23 179 topology 460 411
+> 15 0 23 179 topology 203 412
+> 16 0 23 179 topology 460 412
+> 15 0 23 179 topology 202 413
+> 16 0 23 179 topology 460 413
+> 15 0 23 179 topology 449 414
+> 16 0 23 179 topology 460 414
+> 15 0 23 179 topology 448 415
+> 16 0 23 179 topology 460 415
+> 15 0 23 179 topology 452 416
+> 16 0 23 179 topology 460 416
+> 15 0 23 179 topology 451 417
 > 16 0 23 179 topology 460 417
-> 15 0 23 179 topology 359 418
+> 15 0 23 179 topology 455 418
 > 16 0 23 179 topology 460 418
-> 15 0 23 179 topology 227 419
+> 15 0 23 179 topology 454 419
 > 16 0 23 179 topology 460 419
-> 15 0 23 179 topology 395 420
+> 15 0 23 179 topology 458 420
 > 16 0 23 179 topology 460 420
-> 15 0 23 179 topology 263 421
+> 15 0 23 179 topology 457 421
 > 16 0 23 179 topology 460 421
-> 15 0 24 179 topology 411 422
-> 16 0 24 179 topology 413 422
-> 15 0 23 179 topology 431 423
+> 15 0 23 179 topology 206 422
+> 16 0 23 179 topology 460 422
+> 15 0 23 179 topology 205 423
 > 16 0 23 179 topology 460 423
-> 15 0 24 179 topology 393 424
-> 16 0 24 179 topology 394 424
-> 15 0 24 179 topology 372 425
-> 16 0 24 179 topology 373 425
-> 15 0 23 179 topology 217 426
-> 16 0 23 179 topology 460 426
-> 15 0 24 179 topology 186 427
-> 16 0 24 179 topology 188 427
-> 15 0 24 179 topology 351 428
-> 16 0 24 179 topology 352 428
-> 15 0 23 179 topology 337 429
-> 16 0 23 179 topology 460 429
-> 15 0 24 179 topology 297 430
-> 16 0 24 179 topology 299 430
-> 15 0 23 179 topology 259 431
-> 16 0 23 179 topology 460 431
-> 15 0 23 179 topology 200 432
-> 16 0 23 179 topology 460 432
-> 15 0 24 179 topology 222 433
-> 16 0 24 179 topology 224 433
-> 15 0 23 179 topology 457 434
-> 16 0 23 179 topology 460 434
-> 15 0 23 179 topology 379 435
-> 16 0 23 179 topology 460 435
-> 15 0 24 179 topology 363 436
-> 16 0 24 179 topology 365 436
-> 15 0 24 179 topology 288 437
-> 16 0 24 179 topology 290 437
-> 15 0 23 179 topology 190 438
-> 16 0 23 179 topology 460 438
-> 15 0 23 179 topology 218 439
-> 16 0 23 179 topology 460 439
-> 15 0 24 179 topology 429 440
-> 16 0 24 179 topology 431 440
-> 15 0 24 179 topology 330 441
-> 16 0 24 179 topology 331 441
-> 15 0 23 179 topology 254 442
-> 16 0 23 179 topology 460 442
-> 15 0 23 179 topology 422 443
-> 16 0 23 179 topology 460 443
-> 15 0 24 179 topology 354 444
-> 16 0 24 179 topology 356 444
-> 15 0 24 179 topology 309 445
-> 16 0 24 179 topology 310 445
-> 15 0 23 179 topology 290 446
-> 16 0 23 179 topology 460 446
-> 15 0 23 179 topology 458 447
-> 16 0 23 179 topology 460 447
-> 15 0 23 179 topology 326 448
-> 16 0 23 179 topology 460 448
-> 15 0 24 179 topology 288 449
-> 16 0 24 179 topology 289 449
-> 15 0 23 179 topology 244 450
-> 16 0 23 179 topology 460 450
-> 15 0 24 179 topology 240 451
-> 16 0 24 179 topology 242 451
-> 15 0 23 179 topology 191 452
-> 16 0 23 179 topology 460 452
-> 15 0 23 179 topology 364 453
-> 16 0 23 179 topology 460 453
-> 15 0 23 179 topology 286 454
-> 16 0 23 179 topology 460 454
-> 15 0 23 179 topology 406 455
-> 16 0 23 179 topology 460 455
-> 15 0 24 179 topology 441 456
-> 16 0 24 179 topology 442 456
-> 15 0 24 179 topology 306 457
-> 16 0 24 179 topology 308 457
-> 15 0 24 179 topology 180 458
-> 16 0 24 179 topology 181 458
-> 15 0 24 179 topology 231 459
-> 16 0 24 179 topology 233 459
-> 15 0 24 179 topology 447 460
-> 16 0 24 179 topology 449 460
-> 15 0 24 179 topology 267 461
-> 16 0 24 179 topology 268 461
-> 15 0 24 179 topology 186 462
-> 16 0 24 179 topology 187 462
-> 15 0 23 179 topology 209 463
-> 16 0 23 179 topology 460 463
-> 15 0 24 179 topology 372 464
-> 16 0 24 179 topology 374 464
-> 15 0 24 179 topology 246 465
-> 16 0 24 179 topology 247 465
-> 15 0 23 179 topology 245 466
-> 16 0 23 179 topology 460 466
-> 15 0 24 179 topology 192 467
-> 16 0 24 179 topology 193 467
-> 15 0 23 179 topology 281 468
-> 16 0 23 179 topology 460 468
-> 15 0 24 179 topology 225 469
-> 16 0 24 179 topology 226 469
-> 15 0 24 179 topology 198 470
-> 16 0 24 179 topology 199 470
-> 15 0 23 179 topology 449 471
-> 16 0 23 179 topology 460 471
-> 15 0 23 179 topology 317 472
-> 16 0 23 179 topology 460 472
-> 15 0 24 179 topology 438 473
-> 16 0 24 179 topology 440 473
-> 15 0 24 179 topology 420 474
-> 16 0 24 179 topology 421 474
-> 15 0 24 179 topology 204 475
-> 16 0 24 179 topology 205 475
-> 15 0 23 179 topology 353 476
-> 16 0 23 179 topology 460 476
-> 15 0 24 179 topology 399 477
-> 16 0 24 179 topology 400 477
-> 15 0 23 179 topology 271 478
-> 16 0 23 179 topology 460 478
-> 15 0 23 179 topology 182 479
-> 16 0 23 179 topology 460 479
-> 15 0 24 179 topology 378 480
-> 16 0 24 179 topology 379 480
-> 15 0 23 179 topology 391 481
-> 16 0 23 179 topology 460 481
-> 15 0 23 179 topology 313 482
-> 16 0 23 179 topology 460 482
-> 15 0 23 179 topology 235 483
-> 16 0 23 179 topology 460 483
-> 15 0 24 179 topology 249 484
-> 16 0 24 179 topology 251 484
-> 15 0 23 179 topology 433 485
-> 16 0 23 179 topology 460 485
-> 15 0 23 179 topology 355 486
-> 16 0 23 179 topology 460 486
-> 15 0 24 179 topology 390 487
-> 16 0 24 179 topology 392 487
-> 15 0 24 179 topology 201 488
-> 16 0 24 179 topology 203 488
-> 15 0 24 179 topology 315 489
-> 16 0 24 179 topology 317 489
-> 15 0 23 179 topology 272 490
-> 16 0 23 179 topology 460 490
-> 15 0 24 179 topology 456 491
-> 16 0 24 179 topology 458 491
-> 15 0 24 179 topology 357 492
-> 16 0 24 179 topology 358 492
-> 15 0 23 179 topology 308 493
-> 16 0 23 179 topology 460 493
-> 15 0 24 179 topology 381 494
-> 16 0 24 179 topology 383 494
-> 15 0 23 179 topology 344 495
-> 16 0 23 179 topology 460 495
-> 15 0 24 179 topology 336 496
-> 16 0 24 179 topology 337 496
-> 15 0 23 179 topology 380 497
-> 16 0 23 179 topology 460 497
-> 15 0 24 179 topology 315 498
-> 16 0 24 179 topology 316 498
-> 15 0 23 179 topology 416 499
-> 16 0 23 179 topology 460 499
-> 15 0 23 179 topology 298 500
-> 16 0 23 179 topology 460 500
-> 15 0 24 179 topology 294 501
-> 16 0 24 179 topology 295 501
-> 15 0 23 179 topology 220 502
-> 16 0 23 179 topology 460 502
-> 15 0 24 179 topology 267 503
-> 16 0 24 179 topology 269 503
-> 15 0 23 179 topology 418 504
-> 16 0 23 179 topology 460 504
-> 15 0 23 179 topology 340 505
-> 16 0 23 179 topology 460 505
-> 15 0 23 179 topology 262 506
-> 16 0 23 179 topology 460 506
-> 15 0 23 179 topology 382 507
-> 16 0 23 179 topology 460 507
-> 15 0 24 179 topology 333 508
-> 16 0 24 179 topology 335 508
-> 15 0 24 179 topology 258 509
-> 16 0 24 179 topology 260 509
-> 15 0 23 179 topology 193 510
-> 16 0 23 179 topology 460 510
-> 15 0 24 179 topology 399 511
-> 16 0 24 179 topology 401 511
-> 15 0 23 179 topology 299 512
-> 16 0 23 179 topology 460 512
-> 15 0 24 179 topology 273 513
-> 16 0 24 179 topology 274 513
-> 15 0 23 179 topology 335 514
-> 16 0 23 179 topology 460 514
-> 15 0 24 179 topology 324 515
-> 16 0 24 179 topology 326 515
-> 15 0 24 179 topology 252 516
-> 16 0 24 179 topology 253 516
-> 15 0 23 179 topology 371 517
-> 16 0 23 179 topology 460 517
-> 15 0 24 179 topology 231 518
-> 16 0 24 179 topology 232 518
-> 15 0 24 179 topology 447 519
-> 16 0 24 179 topology 448 519
-> 15 0 23 179 topology 407 520
-> 16 0 23 179 topology 460 520
-> 15 0 24 179 topology 426 521
-> 16 0 24 179 topology 427 521
-> 15 0 23 179 topology 443 522
-> 16 0 23 179 topology 460 522
-> 15 0 24 179 topology 210 523
-> 16 0 24 179 topology 212 523
-> 15 0 23 179 topology 247 524
-> 16 0 23 179 topology 460 524
-> 15 0 24 179 topology 405 525
-> 16 0 24 179 topology 406 525
-> 15 0 23 179 topology 367 526
-> 16 0 23 179 topology 460 526
-> 15 0 24 179 topology 192 527
-> 16 0 24 179 topology 194 527
-> 15 0 23 179 topology 289 528
-> 16 0 23 179 topology 460 528
-> 15 0 24 179 topology 384 529
-> 16 0 24 179 topology 385 529
-> 15 0 24 179 topology 276 530
-> 16 0 24 179 topology 278 530
-> 15 0 23 179 topology 409 531
-> 16 0 23 179 topology 460 531
-> 15 0 24 179 topology 417 532
-> 16 0 24 179 topology 419 532
-> 15 0 24 179 topology 210 533
-> 16 0 24 179 topology 211 533
-> 15 0 24 179 topology 342 534
-> 16 0 24 179 topology 344 534
-> 15 0 23 179 topology 362 535
-> 16 0 23 179 topology 460 535
-> 15 0 23 179 topology 230 536
-> 16 0 23 179 topology 460 536
-> 15 0 24 179 topology 408 537
-> 16 0 24 179 topology 410 537
-> 15 0 23 179 topology 398 538
-> 16 0 23 179 topology 460 538
-> 15 0 24 179 topology 363 539
-> 16 0 24 179 topology 364 539
-> 15 0 23 179 topology 266 540
-> 16 0 23 179 topology 460 540
-> 15 0 23 179 topology 434 541
-> 16 0 23 179 topology 460 541
-> 15 0 24 179 topology 342 542
-> 16 0 24 179 topology 343 542
-> 15 0 24 179 topology 321 543
-> 16 0 24 179 topology 322 543
-> 15 0 23 179 topology 274 544
-> 16 0 23 179 topology 460 544
-> 15 0 23 179 topology 394 545
-> 16 0 23 179 topology 460 545
-> 15 0 23 179 topology 316 546
-> 16 0 23 179 topology 460 546
-> 15 0 24 179 topology 219 547
-> 16 0 24 179 topology 221 547
-> 15 0 23 179 topology 203 548
-> 16 0 23 179 topology 460 548
-> 15 0 23 179 topology 436 549
-> 16 0 23 179 topology 460 549
-> 15 0 24 179 topology 360 550
-> 16 0 24 179 topology 362 550
-> 15 0 24 179 topology 285 551
-> 16 0 24 179 topology 287 551
-> 15 0 24 179 topology 426 552
-> 16 0 24 179 topology 428 552
-> 15 0 24 179 topology 300 553
-> 16 0 24 179 topology 301 553
-> 15 0 23 179 topology 221 554
-> 16 0 23 179 topology 460 554
-> 15 0 23 179 topology 389 555
-> 16 0 23 179 topology 460 555
-> 15 0 24 179 topology 351 556
-> 16 0 24 179 topology 353 556
-> 15 0 23 179 topology 257 557
-> 16 0 23 179 topology 460 557
-> 15 0 24 179 topology 279 558
-> 16 0 24 179 topology 280 558
-> 15 0 23 179 topology 425 559
-> 16 0 23 179 topology 460 559
-> 15 0 23 179 topology 293 560
-> 16 0 23 179 topology 460 560
-> 15 0 24 179 topology 258 561
-> 16 0 24 179 topology 259 561
-> 15 0 24 179 topology 453 562
-> 16 0 24 179 topology 454 562
-> 15 0 24 179 topology 183 563
-> 16 0 24 179 topology 185 563
-> 15 0 24 179 topology 237 564
-> 16 0 24 179 topology 239 564
-> 15 0 23 179 topology 301 565
-> 16 0 23 179 topology 460 565
-> 15 0 23 179 topology 223 566
-> 16 0 23 179 topology 460 566
-> 15 0 24 179 topology 432 567
-> 16 0 24 179 topology 433 567
-> 15 0 23 179 topology 194 568
-> 16 0 23 179 topology 460 568
-> 15 0 23 179 topology 421 569
-> 16 0 23 179 topology 460 569
-> 15 0 23 179 topology 343 570
-> 16 0 23 179 topology 460 570
-> 15 0 24 179 topology 411 571
-> 16 0 24 179 topology 412 571
-> 15 0 23 179 topology 265 572
-> 16 0 23 179 topology 460 572
-> 15 0 24 179 topology 303 573
-> 16 0 24 179 topology 305 573
-> 15 0 23 179 topology 385 574
-> 16 0 23 179 topology 460 574
-> 15 0 24 179 topology 228 575
-> 16 0 24 179 topology 230 575
-> 15 0 24 179 topology 237 576
-> 16 0 24 179 topology 238 576
-> 15 0 24 179 topology 369 577
-> 16 0 24 179 topology 371 577
-> 15 0 23 179 topology 212 578
-> 16 0 23 179 topology 460 578
-> 15 0 24 179 topology 216 579
-> 16 0 24 179 topology 217 579
-> 15 0 23 179 topology 196 580
-> 16 0 23 179 topology 460 580
-> 15 0 23 179 topology 248 581
-> 16 0 23 179 topology 460 581
-> 15 0 24 179 topology 294 582
-> 16 0 24 179 topology 296 582
-> 15 0 23 179 topology 284 583
-> 16 0 23 179 topology 460 583
-> 15 0 24 179 topology 435 584
-> 16 0 24 179 topology 437 584
-> 15 0 24 179 topology 390 585
-> 16 0 24 179 topology 391 585
-> 15 0 23 179 topology 452 586
-> 16 0 23 179 topology 460 586
-> 15 0 23 179 topology 320 587
-> 16 0 23 179 topology 460 587
-> 15 0 24 179 topology 369 588
-> 16 0 24 179 topology 370 588
-> 15 0 23 179 topology 356 589
-> 16 0 23 179 topology 460 589
-> 15 0 23 179 topology 208 590
-> 16 0 23 179 topology 460 590
-> 15 0 24 179 topology 348 591
-> 16 0 24 179 topology 349 591
-> 15 0 23 179 topology 328 592
-> 16 0 23 179 topology 460 592
-> 15 0 23 179 topology 185 593
-> 16 0 23 179 topology 460 593
-> 15 0 23 179 topology 250 594
-> 16 0 23 179 topology 460 594
-> 15 0 23 179 topology 448 595
-> 16 0 23 179 topology 460 595
-> 15 0 23 179 topology 370 596
-> 16 0 23 179 topology 460 596
-> 15 0 24 179 topology 246 597
-> 16 0 24 179 topology 248 597
-> 15 0 23 179 topology 292 598
-> 16 0 23 179 topology 460 598
-> 15 0 24 179 topology 387 599
-> 16 0 24 179 topology 389 599
-> 15 0 23 179 topology 412 600
-> 16 0 23 179 topology 460 600
-> 15 0 23 179 topology 181 601
-> 16 0 23 179 topology 460 601
-> 15 0 24 179 topology 312 602
-> 16 0 24 179 topology 314 602
-> 15 0 23 179 topology 239 603
-> 16 0 23 179 topology 460 603
-> 15 0 24 179 topology 453 604
-> 16 0 24 179 topology 455 604
-> 15 0 24 179 topology 327 605
-> 16 0 24 179 topology 328 605
-> 15 0 23 179 topology 275 606
-> 16 0 23 179 topology 460 606
-> 15 0 24 179 topology 378 607
-> 16 0 24 179 topology 380 607
-> 15 0 24 179 topology 306 608
-> 16 0 24 179 topology 307 608
-> 15 0 23 179 topology 311 609
-> 16 0 23 179 topology 460 609
-> 15 0 23 179 topology 347 610
-> 16 0 23 179 topology 460 610
-> 15 0 24 462 topology 469 611
-> 16 0 24 462 topology 471 611
-> 15 0 23 462 topology 474 612
+> 15 0 24 179 topology 459 424
+> 16 0 24 179 topology 460 424
+> 15 0 25 179 topology 207 425
+> 16 0 25 179 topology 209 425
+> 15 0 25 179 topology 207 426
+> 16 0 25 179 topology 208 426
+> 15 0 25 179 topology 210 427
+> 16 0 25 179 topology 212 427
+> 15 0 25 179 topology 210 428
+> 16 0 25 179 topology 211 428
+> 15 0 25 179 topology 213 429
+> 16 0 25 179 topology 215 429
+> 15 0 25 179 topology 213 430
+> 16 0 25 179 topology 214 430
+> 15 0 25 179 topology 216 431
+> 16 0 25 179 topology 218 431
+> 15 0 25 179 topology 216 432
+> 16 0 25 179 topology 217 432
+> 15 0 25 179 topology 219 433
+> 16 0 25 179 topology 221 433
+> 15 0 25 179 topology 219 434
+> 16 0 25 179 topology 220 434
+> 15 0 25 179 topology 222 435
+> 16 0 25 179 topology 224 435
+> 15 0 25 179 topology 222 436
+> 16 0 25 179 topology 223 436
+> 15 0 25 179 topology 225 437
+> 16 0 25 179 topology 227 437
+> 15 0 25 179 topology 225 438
+> 16 0 25 179 topology 226 438
+> 15 0 25 179 topology 228 439
+> 16 0 25 179 topology 230 439
+> 15 0 25 179 topology 228 440
+> 16 0 25 179 topology 229 440
+> 15 0 25 179 topology 231 441
+> 16 0 25 179 topology 233 441
+> 15 0 25 179 topology 231 442
+> 16 0 25 179 topology 232 442
+> 15 0 25 179 topology 234 443
+> 16 0 25 179 topology 236 443
+> 15 0 25 179 topology 234 444
+> 16 0 25 179 topology 235 444
+> 15 0 25 179 topology 180 445
+> 16 0 25 179 topology 182 445
+> 15 0 25 179 topology 180 446
+> 16 0 25 179 topology 181 446
+> 15 0 25 179 topology 237 447
+> 16 0 25 179 topology 239 447
+> 15 0 25 179 topology 237 448
+> 16 0 25 179 topology 238 448
+> 15 0 25 179 topology 240 449
+> 16 0 25 179 topology 242 449
+> 15 0 25 179 topology 240 450
+> 16 0 25 179 topology 241 450
+> 15 0 25 179 topology 243 451
+> 16 0 25 179 topology 245 451
+> 15 0 25 179 topology 243 452
+> 16 0 25 179 topology 244 452
+> 15 0 25 179 topology 246 453
+> 16 0 25 179 topology 248 453
+> 15 0 25 179 topology 246 454
+> 16 0 25 179 topology 247 454
+> 15 0 25 179 topology 249 455
+> 16 0 25 179 topology 251 455
+> 15 0 25 179 topology 249 456
+> 16 0 25 179 topology 250 456
+> 15 0 25 179 topology 252 457
+> 16 0 25 179 topology 254 457
+> 15 0 25 179 topology 252 458
+> 16 0 25 179 topology 253 458
+> 15 0 25 179 topology 255 459
+> 16 0 25 179 topology 257 459
+> 15 0 25 179 topology 255 460
+> 16 0 25 179 topology 256 460
+> 15 0 25 179 topology 258 461
+> 16 0 25 179 topology 260 461
+> 15 0 25 179 topology 258 462
+> 16 0 25 179 topology 259 462
+> 15 0 25 179 topology 261 463
+> 16 0 25 179 topology 263 463
+> 15 0 25 179 topology 261 464
+> 16 0 25 179 topology 262 464
+> 15 0 25 179 topology 264 465
+> 16 0 25 179 topology 266 465
+> 15 0 25 179 topology 264 466
+> 16 0 25 179 topology 265 466
+> 15 0 25 179 topology 183 467
+> 16 0 25 179 topology 185 467
+> 15 0 25 179 topology 183 468
+> 16 0 25 179 topology 184 468
+> 15 0 25 179 topology 267 469
+> 16 0 25 179 topology 269 469
+> 15 0 25 179 topology 267 470
+> 16 0 25 179 topology 268 470
+> 15 0 25 179 topology 270 471
+> 16 0 25 179 topology 272 471
+> 15 0 25 179 topology 270 472
+> 16 0 25 179 topology 271 472
+> 15 0 25 179 topology 273 473
+> 16 0 25 179 topology 275 473
+> 15 0 25 179 topology 273 474
+> 16 0 25 179 topology 274 474
+> 15 0 25 179 topology 276 475
+> 16 0 25 179 topology 278 475
+> 15 0 25 179 topology 276 476
+> 16 0 25 179 topology 277 476
+> 15 0 25 179 topology 279 477
+> 16 0 25 179 topology 281 477
+> 15 0 25 179 topology 279 478
+> 16 0 25 179 topology 280 478
+> 15 0 25 179 topology 282 479
+> 16 0 25 179 topology 284 479
+> 15 0 25 179 topology 282 480
+> 16 0 25 179 topology 283 480
+> 15 0 25 179 topology 285 481
+> 16 0 25 179 topology 287 481
+> 15 0 25 179 topology 285 482
+> 16 0 25 179 topology 286 482
+> 15 0 25 179 topology 288 483
+> 16 0 25 179 topology 290 483
+> 15 0 25 179 topology 288 484
+> 16 0 25 179 topology 289 484
+> 15 0 25 179 topology 291 485
+> 16 0 25 179 topology 293 485
+> 15 0 25 179 topology 291 486
+> 16 0 25 179 topology 292 486
+> 15 0 25 179 topology 294 487
+> 16 0 25 179 topology 296 487
+> 15 0 25 179 topology 294 488
+> 16 0 25 179 topology 295 488
+> 15 0 25 179 topology 186 489
+> 16 0 25 179 topology 188 489
+> 15 0 25 179 topology 186 490
+> 16 0 25 179 topology 187 490
+> 15 0 25 179 topology 297 491
+> 16 0 25 179 topology 299 491
+> 15 0 25 179 topology 297 492
+> 16 0 25 179 topology 298 492
+> 15 0 25 179 topology 300 493
+> 16 0 25 179 topology 302 493
+> 15 0 25 179 topology 300 494
+> 16 0 25 179 topology 301 494
+> 15 0 25 179 topology 303 495
+> 16 0 25 179 topology 305 495
+> 15 0 25 179 topology 303 496
+> 16 0 25 179 topology 304 496
+> 15 0 25 179 topology 306 497
+> 16 0 25 179 topology 308 497
+> 15 0 25 179 topology 306 498
+> 16 0 25 179 topology 307 498
+> 15 0 25 179 topology 309 499
+> 16 0 25 179 topology 311 499
+> 15 0 25 179 topology 309 500
+> 16 0 25 179 topology 310 500
+> 15 0 25 179 topology 312 501
+> 16 0 25 179 topology 314 501
+> 15 0 25 179 topology 312 502
+> 16 0 25 179 topology 313 502
+> 15 0 25 179 topology 315 503
+> 16 0 25 179 topology 317 503
+> 15 0 25 179 topology 315 504
+> 16 0 25 179 topology 316 504
+> 15 0 25 179 topology 318 505
+> 16 0 25 179 topology 320 505
+> 15 0 25 179 topology 318 506
+> 16 0 25 179 topology 319 506
+> 15 0 25 179 topology 321 507
+> 16 0 25 179 topology 323 507
+> 15 0 25 179 topology 321 508
+> 16 0 25 179 topology 322 508
+> 15 0 25 179 topology 324 509
+> 16 0 25 179 topology 326 509
+> 15 0 25 179 topology 324 510
+> 16 0 25 179 topology 325 510
+> 15 0 25 179 topology 189 511
+> 16 0 25 179 topology 191 511
+> 15 0 25 179 topology 189 512
+> 16 0 25 179 topology 190 512
+> 15 0 25 179 topology 327 513
+> 16 0 25 179 topology 329 513
+> 15 0 25 179 topology 327 514
+> 16 0 25 179 topology 328 514
+> 15 0 25 179 topology 330 515
+> 16 0 25 179 topology 332 515
+> 15 0 25 179 topology 330 516
+> 16 0 25 179 topology 331 516
+> 15 0 25 179 topology 333 517
+> 16 0 25 179 topology 335 517
+> 15 0 25 179 topology 333 518
+> 16 0 25 179 topology 334 518
+> 15 0 25 179 topology 336 519
+> 16 0 25 179 topology 338 519
+> 15 0 25 179 topology 336 520
+> 16 0 25 179 topology 337 520
+> 15 0 25 179 topology 339 521
+> 16 0 25 179 topology 341 521
+> 15 0 25 179 topology 339 522
+> 16 0 25 179 topology 340 522
+> 15 0 25 179 topology 342 523
+> 16 0 25 179 topology 344 523
+> 15 0 25 179 topology 342 524
+> 16 0 25 179 topology 343 524
+> 15 0 25 179 topology 345 525
+> 16 0 25 179 topology 347 525
+> 15 0 25 179 topology 345 526
+> 16 0 25 179 topology 346 526
+> 15 0 25 179 topology 348 527
+> 16 0 25 179 topology 350 527
+> 15 0 25 179 topology 348 528
+> 16 0 25 179 topology 349 528
+> 15 0 25 179 topology 351 529
+> 16 0 25 179 topology 353 529
+> 15 0 25 179 topology 351 530
+> 16 0 25 179 topology 352 530
+> 15 0 25 179 topology 354 531
+> 16 0 25 179 topology 356 531
+> 15 0 25 179 topology 354 532
+> 16 0 25 179 topology 355 532
+> 15 0 25 179 topology 192 533
+> 16 0 25 179 topology 194 533
+> 15 0 25 179 topology 192 534
+> 16 0 25 179 topology 193 534
+> 15 0 25 179 topology 357 535
+> 16 0 25 179 topology 359 535
+> 15 0 25 179 topology 357 536
+> 16 0 25 179 topology 358 536
+> 15 0 25 179 topology 360 537
+> 16 0 25 179 topology 362 537
+> 15 0 25 179 topology 360 538
+> 16 0 25 179 topology 361 538
+> 15 0 25 179 topology 363 539
+> 16 0 25 179 topology 365 539
+> 15 0 25 179 topology 363 540
+> 16 0 25 179 topology 364 540
+> 15 0 25 179 topology 366 541
+> 16 0 25 179 topology 368 541
+> 15 0 25 179 topology 366 542
+> 16 0 25 179 topology 367 542
+> 15 0 25 179 topology 369 543
+> 16 0 25 179 topology 371 543
+> 15 0 25 179 topology 369 544
+> 16 0 25 179 topology 370 544
+> 15 0 25 179 topology 372 545
+> 16 0 25 179 topology 374 545
+> 15 0 25 179 topology 372 546
+> 16 0 25 179 topology 373 546
+> 15 0 25 179 topology 375 547
+> 16 0 25 179 topology 377 547
+> 15 0 25 179 topology 375 548
+> 16 0 25 179 topology 376 548
+> 15 0 25 179 topology 378 549
+> 16 0 25 179 topology 380 549
+> 15 0 25 179 topology 378 550
+> 16 0 25 179 topology 379 550
+> 15 0 25 179 topology 381 551
+> 16 0 25 179 topology 383 551
+> 15 0 25 179 topology 381 552
+> 16 0 25 179 topology 382 552
+> 15 0 25 179 topology 384 553
+> 16 0 25 179 topology 386 553
+> 15 0 25 179 topology 384 554
+> 16 0 25 179 topology 385 554
+> 15 0 25 179 topology 195 555
+> 16 0 25 179 topology 197 555
+> 15 0 25 179 topology 195 556
+> 16 0 25 179 topology 196 556
+> 15 0 25 179 topology 387 557
+> 16 0 25 179 topology 389 557
+> 15 0 25 179 topology 387 558
+> 16 0 25 179 topology 388 558
+> 15 0 25 179 topology 390 559
+> 16 0 25 179 topology 392 559
+> 15 0 25 179 topology 390 560
+> 16 0 25 179 topology 391 560
+> 15 0 25 179 topology 393 561
+> 16 0 25 179 topology 395 561
+> 15 0 25 179 topology 393 562
+> 16 0 25 179 topology 394 562
+> 15 0 25 179 topology 396 563
+> 16 0 25 179 topology 398 563
+> 15 0 25 179 topology 396 564
+> 16 0 25 179 topology 397 564
+> 15 0 25 179 topology 399 565
+> 16 0 25 179 topology 401 565
+> 15 0 25 179 topology 399 566
+> 16 0 25 179 topology 400 566
+> 15 0 25 179 topology 402 567
+> 16 0 25 179 topology 404 567
+> 15 0 25 179 topology 402 568
+> 16 0 25 179 topology 403 568
+> 15 0 25 179 topology 405 569
+> 16 0 25 179 topology 407 569
+> 15 0 25 179 topology 405 570
+> 16 0 25 179 topology 406 570
+> 15 0 25 179 topology 408 571
+> 16 0 25 179 topology 410 571
+> 15 0 25 179 topology 408 572
+> 16 0 25 179 topology 409 572
+> 15 0 25 179 topology 411 573
+> 16 0 25 179 topology 413 573
+> 15 0 25 179 topology 411 574
+> 16 0 25 179 topology 412 574
+> 15 0 25 179 topology 414 575
+> 16 0 25 179 topology 416 575
+> 15 0 25 179 topology 414 576
+> 16 0 25 179 topology 415 576
+> 15 0 25 179 topology 198 577
+> 16 0 25 179 topology 200 577
+> 15 0 25 179 topology 198 578
+> 16 0 25 179 topology 199 578
+> 15 0 25 179 topology 417 579
+> 16 0 25 179 topology 419 579
+> 15 0 25 179 topology 417 580
+> 16 0 25 179 topology 418 580
+> 15 0 25 179 topology 420 581
+> 16 0 25 179 topology 422 581
+> 15 0 25 179 topology 420 582
+> 16 0 25 179 topology 421 582
+> 15 0 25 179 topology 423 583
+> 16 0 25 179 topology 425 583
+> 15 0 25 179 topology 423 584
+> 16 0 25 179 topology 424 584
+> 15 0 25 179 topology 426 585
+> 16 0 25 179 topology 428 585
+> 15 0 25 179 topology 426 586
+> 16 0 25 179 topology 427 586
+> 15 0 25 179 topology 429 587
+> 16 0 25 179 topology 431 587
+> 15 0 25 179 topology 429 588
+> 16 0 25 179 topology 430 588
+> 15 0 25 179 topology 432 589
+> 16 0 25 179 topology 434 589
+> 15 0 25 179 topology 432 590
+> 16 0 25 179 topology 433 590
+> 15 0 25 179 topology 435 591
+> 16 0 25 179 topology 437 591
+> 15 0 25 179 topology 435 592
+> 16 0 25 179 topology 436 592
+> 15 0 25 179 topology 438 593
+> 16 0 25 179 topology 440 593
+> 15 0 25 179 topology 438 594
+> 16 0 25 179 topology 439 594
+> 15 0 25 179 topology 441 595
+> 16 0 25 179 topology 443 595
+> 15 0 25 179 topology 441 596
+> 16 0 25 179 topology 442 596
+> 15 0 25 179 topology 444 597
+> 16 0 25 179 topology 446 597
+> 15 0 25 179 topology 444 598
+> 16 0 25 179 topology 445 598
+> 15 0 25 179 topology 201 599
+> 16 0 25 179 topology 203 599
+> 15 0 25 179 topology 201 600
+> 16 0 25 179 topology 202 600
+> 15 0 25 179 topology 447 601
+> 16 0 25 179 topology 449 601
+> 15 0 25 179 topology 447 602
+> 16 0 25 179 topology 448 602
+> 15 0 25 179 topology 450 603
+> 16 0 25 179 topology 452 603
+> 15 0 25 179 topology 450 604
+> 16 0 25 179 topology 451 604
+> 15 0 25 179 topology 453 605
+> 16 0 25 179 topology 455 605
+> 15 0 25 179 topology 453 606
+> 16 0 25 179 topology 454 606
+> 15 0 25 179 topology 456 607
+> 16 0 25 179 topology 458 607
+> 15 0 25 179 topology 456 608
+> 16 0 25 179 topology 457 608
+> 15 0 25 179 topology 204 609
+> 16 0 25 179 topology 206 609
+> 15 0 25 179 topology 204 610
+> 16 0 25 179 topology 205 610
+> 15 0 23 462 topology 492 611
+> 16 0 23 462 topology 494 611
+> 15 0 23 462 topology 491 612
 > 16 0 23 462 topology 494 612
-> 15 0 23 462 topology 486 613
+> 15 0 23 462 topology 465 613
 > 16 0 23 462 topology 494 613
-> 15 0 24 462 topology 481 614
-> 16 0 24 462 topology 483 614
-> 15 0 24 462 topology 469 615
-> 16 0 24 462 topology 470 615
-> 15 0 23 462 topology 470 616
+> 15 0 23 462 topology 464 614
+> 16 0 23 462 topology 494 614
+> 15 0 23 462 topology 468 615
+> 16 0 23 462 topology 494 615
+> 15 0 23 462 topology 467 616
 > 16 0 23 462 topology 494 616
-> 15 0 23 462 topology 482 617
+> 15 0 23 462 topology 471 617
 > 16 0 23 462 topology 494 617
-> 15 0 24 462 topology 481 618
-> 16 0 24 462 topology 482 618
-> 15 0 23 462 topology 465 619
+> 15 0 23 462 topology 470 618
+> 16 0 23 462 topology 494 618
+> 15 0 23 462 topology 474 619
 > 16 0 23 462 topology 494 619
-> 15 0 24 462 topology 466 620
-> 16 0 24 462 topology 468 620
+> 15 0 23 462 topology 473 620
+> 16 0 23 462 topology 494 620
 > 15 0 23 462 topology 477 621
 > 16 0 23 462 topology 494 621
-> 15 0 24 462 topology 478 622
-> 16 0 24 462 topology 480 622
-> 15 0 23 462 topology 489 623
+> 15 0 23 462 topology 476 622
+> 16 0 23 462 topology 494 622
+> 15 0 23 462 topology 480 623
 > 16 0 23 462 topology 494 623
-> 15 0 23 462 topology 467 624
+> 15 0 23 462 topology 479 624
 > 16 0 23 462 topology 494 624
-> 15 0 24 462 topology 472 625
-> 16 0 24 462 topology 473 625
-> 15 0 23 462 topology 479 626
+> 15 0 23 462 topology 483 625
+> 16 0 23 462 topology 494 625
+> 15 0 23 462 topology 482 626
 > 16 0 23 462 topology 494 626
-> 15 0 24 462 topology 484 627
-> 16 0 24 462 topology 485 627
-> 15 0 24 462 topology 463 628
-> 16 0 24 462 topology 465 628
-> 15 0 24 462 topology 490 629
-> 16 0 24 462 topology 492 629
-> 15 0 23 462 topology 468 630
+> 15 0 23 462 topology 486 627
+> 16 0 23 462 topology 494 627
+> 15 0 23 462 topology 485 628
+> 16 0 23 462 topology 494 628
+> 15 0 23 462 topology 489 629
+> 16 0 23 462 topology 494 629
+> 15 0 23 462 topology 488 630
 > 16 0 23 462 topology 494 630
-> 15 0 23 462 topology 480 631
-> 16 0 23 462 topology 494 631
-> 15 0 25 462 topology 493 632
-> 16 0 25 462 topology 494 632
-> 15 0 24 462 topology 475 633
-> 16 0 24 462 topology 477 633
-> 15 0 24 462 topology 463 634
-> 16 0 24 462 topology 464 634
-> 15 0 23 462 topology 464 635
-> 16 0 23 462 topology 494 635
-> 15 0 24 462 topology 487 636
-> 16 0 24 462 topology 489 636
-> 15 0 23 462 topology 492 637
-> 16 0 23 462 topology 494 637
-> 15 0 23 462 topology 476 638
-> 16 0 23 462 topology 494 638
-> 15 0 24 462 topology 475 639
-> 16 0 24 462 topology 476 639
-> 15 0 23 462 topology 488 640
-> 16 0 23 462 topology 494 640
-> 15 0 24 462 topology 487 641
-> 16 0 24 462 topology 488 641
-> 15 0 23 462 topology 471 642
-> 16 0 23 462 topology 494 642
-> 15 0 24 462 topology 472 643
-> 16 0 24 462 topology 474 643
-> 15 0 23 462 topology 483 644
-> 16 0 23 462 topology 494 644
-> 15 0 24 462 topology 490 645
-> 16 0 24 462 topology 491 645
-> 15 0 24 462 topology 484 646
-> 16 0 24 462 topology 486 646
-> 15 0 24 462 topology 466 647
-> 16 0 24 462 topology 467 647
-> 15 0 23 462 topology 473 648
-> 16 0 23 462 topology 494 648
-> 15 0 23 462 topology 485 649
-> 16 0 23 462 topology 494 649
-> 15 0 24 462 topology 478 650
-> 16 0 24 462 topology 479 650
-> 15 0 23 462 topology 491 651
-> 16 0 23 462 topology 494 651
+> 15 0 24 462 topology 493 631
+> 16 0 24 462 topology 494 631
+> 15 0 25 462 topology 490 632
+> 16 0 25 462 topology 492 632
+> 15 0 25 462 topology 490 633
+> 16 0 25 462 topology 491 633
+> 15 0 25 462 topology 463 634
+> 16 0 25 462 topology 465 634
+> 15 0 25 462 topology 463 635
+> 16 0 25 462 topology 464 635
+> 15 0 25 462 topology 466 636
+> 16 0 25 462 topology 468 636
+> 15 0 25 462 topology 466 637
+> 16 0 25 462 topology 467 637
+> 15 0 25 462 topology 469 638
+> 16 0 25 462 topology 471 638
+> 15 0 25 462 topology 469 639
+> 16 0 25 462 topology 470 639
+> 15 0 25 462 topology 472 640
+> 16 0 25 462 topology 474 640
+> 15 0 25 462 topology 472 641
+> 16 0 25 462 topology 473 641
+> 15 0 25 462 topology 475 642
+> 16 0 25 462 topology 477 642
+> 15 0 25 462 topology 475 643
+> 16 0 25 462 topology 476 643
+> 15 0 25 462 topology 478 644
+> 16 0 25 462 topology 480 644
+> 15 0 25 462 topology 478 645
+> 16 0 25 462 topology 479 645
+> 15 0 25 462 topology 481 646
+> 16 0 25 462 topology 483 646
+> 15 0 25 462 topology 481 647
+> 16 0 25 462 topology 482 647
+> 15 0 25 462 topology 484 648
+> 16 0 25 462 topology 486 648
+> 15 0 25 462 topology 484 649
+> 16 0 25 462 topology 485 649
+> 15 0 25 462 topology 487 650
+> 16 0 25 462 topology 489 650
+> 15 0 25 462 topology 487 651
+> 16 0 25 462 topology 488 651
 > 15 0 26 21 topology 461 652
-> 16 0 26 21 topology 497 652
-> 15 0 21 21 topology 178 653
-> 16 0 21 21 topology 495 653
-> 15 0 21 21 topology 461 654
-> 16 0 21 21 topology 495 654
-> 15 0 21 21 topology 178 655
-> 16 0 21 21 topology 461 655
-> 15 0 27 21 topology 176 656
-> 16 0 27 21 topology 178 656
-> 15 0 26 21 topology 461 657
-> 16 0 26 21 topology 459 657
-> 15 0 26 21 topology 495 658
-> 16 0 26 21 topology 493 658
-> 15 0 26 21 topology 495 659
-> 16 0 26 21 topology 497 659
-> 15 0 26 21 topology 178 660
-> 16 0 26 21 topology 497 660
-> 15 0 23 500 topology 514 661
+> 16 0 26 21 topology 459 652
+> 15 0 26 21 topology 495 653
+> 16 0 26 21 topology 493 653
+> 15 0 26 21 topology 178 654
+> 16 0 26 21 topology 497 654
+> 15 0 26 21 topology 461 655
+> 16 0 26 21 topology 497 655
+> 15 0 26 21 topology 495 656
+> 16 0 26 21 topology 497 656
+> 15 0 27 21 topology 176 657
+> 16 0 27 21 topology 178 657
+> 15 0 20 21 topology 178 658
+> 16 0 20 21 topology 461 658
+> 15 0 20 21 topology 178 659
+> 16 0 20 21 topology 495 659
+> 15 0 20 21 topology 461 660
+> 16 0 20 21 topology 495 660
+> 15 0 23 500 topology 530 661
 > 16 0 23 500 topology 538 661
-> 15 0 23 500 topology 526 662
+> 15 0 23 500 topology 529 662
 > 16 0 23 500 topology 538 662
-> 15 0 24 500 topology 507 663
-> 16 0 24 500 topology 509 663
-> 15 0 24 500 topology 519 664
-> 16 0 24 500 topology 521 664
-> 15 0 23 500 topology 532 665
+> 15 0 23 500 topology 533 663
+> 16 0 23 500 topology 538 663
+> 15 0 23 500 topology 532 664
+> 16 0 23 500 topology 538 664
+> 15 0 23 500 topology 536 665
 > 16 0 23 500 topology 538 665
-> 15 0 23 500 topology 509 666
+> 15 0 23 500 topology 535 666
 > 16 0 23 500 topology 538 666
-> 15 0 24 500 topology 507 667
-> 16 0 24 500 topology 508 667
-> 15 0 23 500 topology 521 668
+> 15 0 23 500 topology 503 667
+> 16 0 23 500 topology 538 667
+> 15 0 23 500 topology 502 668
 > 16 0 23 500 topology 538 668
-> 15 0 24 500 topology 519 669
-> 16 0 24 500 topology 520 669
-> 15 0 23 500 topology 511 670
+> 15 0 23 500 topology 506 669
+> 16 0 23 500 topology 538 669
+> 15 0 23 500 topology 505 670
 > 16 0 23 500 topology 538 670
-> 15 0 23 500 topology 533 671
+> 15 0 23 500 topology 509 671
 > 16 0 23 500 topology 538 671
-> 15 0 24 500 topology 504 672
-> 16 0 24 500 topology 506 672
-> 15 0 23 500 topology 523 673
+> 15 0 23 500 topology 508 672
+> 16 0 23 500 topology 538 672
+> 15 0 23 500 topology 512 673
 > 16 0 23 500 topology 538 673
-> 15 0 24 500 topology 516 674
-> 16 0 24 500 topology 518 674
-> 15 0 23 500 topology 529 675
+> 15 0 23 500 topology 511 674
+> 16 0 23 500 topology 538 674
+> 15 0 23 500 topology 515 675
 > 16 0 23 500 topology 538 675
-> 15 0 24 500 topology 531 676
-> 16 0 24 500 topology 532 676
-> 15 0 23 500 topology 512 677
+> 15 0 23 500 topology 514 676
+> 16 0 23 500 topology 538 676
+> 15 0 23 500 topology 518 677
 > 16 0 23 500 topology 538 677
-> 15 0 24 500 topology 510 678
-> 16 0 24 500 topology 511 678
-> 15 0 23 500 topology 524 679
+> 15 0 23 500 topology 517 678
+> 16 0 23 500 topology 538 678
+> 15 0 23 500 topology 521 679
 > 16 0 23 500 topology 538 679
-> 15 0 24 500 topology 522 680
-> 16 0 24 500 topology 523 680
-> 15 0 23 500 topology 508 681
+> 15 0 23 500 topology 520 680
+> 16 0 23 500 topology 538 680
+> 15 0 23 500 topology 524 681
 > 16 0 23 500 topology 538 681
-> 15 0 24 500 topology 501 682
-> 16 0 24 500 topology 503 682
-> 15 0 24 500 topology 528 683
-> 16 0 24 500 topology 530 683
-> 15 0 23 500 topology 536 684
+> 15 0 23 500 topology 523 682
+> 16 0 23 500 topology 538 682
+> 15 0 23 500 topology 527 683
+> 16 0 23 500 topology 538 683
+> 15 0 23 500 topology 526 684
 > 16 0 23 500 topology 538 684
-> 15 0 23 500 topology 520 685
-> 16 0 23 500 topology 538 685
-> 15 0 24 500 topology 531 686
-> 16 0 24 500 topology 533 686
-> 15 0 24 500 topology 534 687
-> 16 0 24 500 topology 536 687
-> 15 0 24 500 topology 513 688
-> 16 0 24 500 topology 515 688
-> 15 0 24 500 topology 501 689
-> 16 0 24 500 topology 502 689
-> 15 0 23 500 topology 503 690
-> 16 0 23 500 topology 538 690
-> 15 0 24 500 topology 525 691
-> 16 0 24 500 topology 527 691
-> 15 0 23 500 topology 515 692
-> 16 0 23 500 topology 538 692
-> 15 0 24 500 topology 513 693
-> 16 0 24 500 topology 514 693
-> 15 0 23 500 topology 527 694
-> 16 0 23 500 topology 538 694
-> 15 0 23 500 topology 505 695
-> 16 0 23 500 topology 538 695
-> 15 0 24 500 topology 525 696
-> 16 0 24 500 topology 526 696
-> 15 0 25 500 topology 537 697
-> 16 0 25 500 topology 538 697
-> 15 0 23 500 topology 517 698
-> 16 0 23 500 topology 538 698
-> 15 0 24 500 topology 510 699
-> 16 0 24 500 topology 512 699
-> 15 0 24 500 topology 528 700
-> 16 0 24 500 topology 529 700
-> 15 0 23 500 topology 535 701
-> 16 0 23 500 topology 538 701
-> 15 0 24 500 topology 522 702
-> 16 0 24 500 topology 524 702
-> 15 0 24 500 topology 504 703
-> 16 0 24 500 topology 505 703
-> 15 0 23 500 topology 506 704
-> 16 0 23 500 topology 538 704
-> 15 0 24 500 topology 534 705
-> 16 0 24 500 topology 535 705
-> 15 0 23 500 topology 518 706
-> 16 0 23 500 topology 538 706
-> 15 0 24 500 topology 516 707
-> 16 0 24 500 topology 517 707
-> 15 0 23 500 topology 502 708
-> 16 0 23 500 topology 538 708
-> 15 0 23 500 topology 530 709
-> 16 0 23 500 topology 538 709
-> 15 0 23 540 topology 732 710
+> 15 0 24 500 topology 537 685
+> 16 0 24 500 topology 538 685
+> 15 0 25 500 topology 528 686
+> 16 0 25 500 topology 530 686
+> 15 0 25 500 topology 528 687
+> 16 0 25 500 topology 529 687
+> 15 0 25 500 topology 531 688
+> 16 0 25 500 topology 533 688
+> 15 0 25 500 topology 531 689
+> 16 0 25 500 topology 532 689
+> 15 0 25 500 topology 534 690
+> 16 0 25 500 topology 536 690
+> 15 0 25 500 topology 534 691
+> 16 0 25 500 topology 535 691
+> 15 0 25 500 topology 501 692
+> 16 0 25 500 topology 503 692
+> 15 0 25 500 topology 501 693
+> 16 0 25 500 topology 502 693
+> 15 0 25 500 topology 504 694
+> 16 0 25 500 topology 506 694
+> 15 0 25 500 topology 504 695
+> 16 0 25 500 topology 505 695
+> 15 0 25 500 topology 507 696
+> 16 0 25 500 topology 509 696
+> 15 0 25 500 topology 507 697
+> 16 0 25 500 topology 508 697
+> 15 0 25 500 topology 510 698
+> 16 0 25 500 topology 512 698
+> 15 0 25 500 topology 510 699
+> 16 0 25 500 topology 511 699
+> 15 0 25 500 topology 513 700
+> 16 0 25 500 topology 515 700
+> 15 0 25 500 topology 513 701
+> 16 0 25 500 topology 514 701
+> 15 0 25 500 topology 516 702
+> 16 0 25 500 topology 518 702
+> 15 0 25 500 topology 516 703
+> 16 0 25 500 topology 517 703
+> 15 0 25 500 topology 519 704
+> 16 0 25 500 topology 521 704
+> 15 0 25 500 topology 519 705
+> 16 0 25 500 topology 520 705
+> 15 0 25 500 topology 522 706
+> 16 0 25 500 topology 524 706
+> 15 0 25 500 topology 522 707
+> 16 0 25 500 topology 523 707
+> 15 0 25 500 topology 525 708
+> 16 0 25 500 topology 527 708
+> 15 0 25 500 topology 525 709
+> 16 0 25 500 topology 526 709
+> 15 0 23 540 topology 570 710
 > 16 0 23 540 topology 758 710
-> 15 0 24 540 topology 607 711
-> 16 0 24 540 topology 609 711
-> 15 0 23 540 topology 684 712
+> 15 0 23 540 topology 569 711
+> 16 0 23 540 topology 758 711
+> 15 0 23 540 topology 573 712
 > 16 0 23 540 topology 758 712
-> 15 0 24 540 topology 745 713
-> 16 0 24 540 topology 746 713
-> 15 0 24 540 topology 637 714
-> 16 0 24 540 topology 639 714
-> 15 0 24 540 topology 667 715
-> 16 0 24 540 topology 669 715
-> 15 0 24 540 topology 541 716
-> 16 0 24 540 topology 542 716
+> 15 0 23 540 topology 572 713
+> 16 0 23 540 topology 758 713
+> 15 0 23 540 topology 576 714
+> 16 0 23 540 topology 758 714
+> 15 0 23 540 topology 575 715
+> 16 0 23 540 topology 758 715
+> 15 0 23 540 topology 579 716
+> 16 0 23 540 topology 758 716
 > 15 0 23 540 topology 578 717
 > 16 0 23 540 topology 758 717
-> 15 0 24 540 topology 589 718
-> 16 0 24 540 topology 591 718
-> 15 0 24 540 topology 697 719
-> 16 0 24 540 topology 699 719
-> 15 0 24 540 topology 619 720
-> 16 0 24 540 topology 621 720
-> 15 0 23 540 topology 638 721
+> 15 0 23 540 topology 582 718
+> 16 0 23 540 topology 758 718
+> 15 0 23 540 topology 581 719
+> 16 0 23 540 topology 758 719
+> 15 0 23 540 topology 585 720
+> 16 0 23 540 topology 758 720
+> 15 0 23 540 topology 584 721
 > 16 0 23 540 topology 758 721
-> 15 0 24 540 topology 727 722
-> 16 0 24 540 topology 729 722
-> 15 0 23 540 topology 555 723
+> 15 0 23 540 topology 588 722
+> 16 0 23 540 topology 758 722
+> 15 0 23 540 topology 587 723
 > 16 0 23 540 topology 758 723
-> 15 0 24 540 topology 649 724
-> 16 0 24 540 topology 651 724
-> 15 0 23 540 topology 698 725
+> 15 0 23 540 topology 591 724
+> 16 0 23 540 topology 758 724
+> 15 0 23 540 topology 590 725
 > 16 0 23 540 topology 758 725
-> 15 0 23 540 topology 620 726
+> 15 0 23 540 topology 594 726
 > 16 0 23 540 topology 758 726
-> 15 0 24 540 topology 679 727
-> 16 0 24 540 topology 681 727
-> 15 0 23 540 topology 680 728
+> 15 0 23 540 topology 593 727
+> 16 0 23 540 topology 758 727
+> 15 0 23 540 topology 597 728
 > 16 0 23 540 topology 758 728
-> 15 0 24 540 topology 709 729
-> 16 0 24 540 topology 711 729
-> 15 0 23 540 topology 740 730
+> 15 0 23 540 topology 596 729
+> 16 0 23 540 topology 758 729
+> 15 0 23 540 topology 543 730
 > 16 0 23 540 topology 758 730
-> 15 0 24 540 topology 739 731
-> 16 0 24 540 topology 741 731
-> 15 0 25 540 topology 757 732
-> 16 0 25 540 topology 758 732
-> 15 0 23 540 topology 545 733
+> 15 0 23 540 topology 542 731
+> 16 0 23 540 topology 758 731
+> 15 0 23 540 topology 600 732
+> 16 0 23 540 topology 758 732
+> 15 0 23 540 topology 599 733
 > 16 0 23 540 topology 758 733
-> 15 0 24 540 topology 565 734
-> 16 0 24 540 topology 566 734
-> 15 0 23 540 topology 603 735
+> 15 0 23 540 topology 603 734
+> 16 0 23 540 topology 758 734
+> 15 0 23 540 topology 602 735
 > 16 0 23 540 topology 758 735
-> 15 0 23 540 topology 639 736
+> 15 0 23 540 topology 606 736
 > 16 0 23 540 topology 758 736
-> 15 0 23 540 topology 723 737
+> 15 0 23 540 topology 605 737
 > 16 0 23 540 topology 758 737
-> 15 0 23 540 topology 591 738
+> 15 0 23 540 topology 609 738
 > 16 0 23 540 topology 758 738
-> 15 0 23 540 topology 675 739
+> 15 0 23 540 topology 608 739
 > 16 0 23 540 topology 758 739
-> 15 0 23 540 topology 627 740
+> 15 0 23 540 topology 612 740
 > 16 0 23 540 topology 758 740
-> 15 0 23 540 topology 711 741
+> 15 0 23 540 topology 611 741
 > 16 0 23 540 topology 758 741
-> 15 0 23 540 topology 747 742
+> 15 0 23 540 topology 615 742
 > 16 0 23 540 topology 758 742
-> 15 0 24 540 topology 562 743
-> 16 0 24 540 topology 564 743
-> 15 0 23 540 topology 605 744
+> 15 0 23 540 topology 614 743
+> 16 0 23 540 topology 758 743
+> 15 0 23 540 topology 618 744
 > 16 0 23 540 topology 758 744
-> 15 0 23 540 topology 546 745
+> 15 0 23 540 topology 617 745
 > 16 0 23 540 topology 758 745
-> 15 0 24 540 topology 571 746
-> 16 0 24 540 topology 572 746
-> 15 0 23 540 topology 665 747
+> 15 0 23 540 topology 621 746
+> 16 0 23 540 topology 758 746
+> 15 0 23 540 topology 620 747
 > 16 0 23 540 topology 758 747
-> 15 0 23 540 topology 587 748
+> 15 0 23 540 topology 624 748
 > 16 0 23 540 topology 758 748
-> 15 0 24 540 topology 628 749
-> 16 0 24 540 topology 629 749
-> 15 0 23 540 topology 725 750
+> 15 0 23 540 topology 623 749
+> 16 0 23 540 topology 758 749
+> 15 0 23 540 topology 627 750
 > 16 0 23 540 topology 758 750
-> 15 0 24 540 topology 550 751
-> 16 0 24 540 topology 551 751
-> 15 0 24 540 topology 577 752
-> 16 0 24 540 topology 578 752
-> 15 0 23 540 topology 647 753
+> 15 0 23 540 topology 626 751
+> 16 0 23 540 topology 758 751
+> 15 0 23 540 topology 546 752
+> 16 0 23 540 topology 758 752
+> 15 0 23 540 topology 545 753
 > 16 0 23 540 topology 758 753
-> 15 0 24 540 topology 634 754
-> 16 0 24 540 topology 635 754
-> 15 0 23 540 topology 707 755
+> 15 0 23 540 topology 630 754
+> 16 0 23 540 topology 758 754
+> 15 0 23 540 topology 629 755
 > 16 0 23 540 topology 758 755
-> 15 0 24 540 topology 583 756
-> 16 0 24 540 topology 584 756
-> 15 0 24 540 topology 691 757
-> 16 0 24 540 topology 692 757
-> 15 0 24 540 topology 640 758
-> 16 0 24 540 topology 641 758
-> 15 0 24 540 topology 748 759
-> 16 0 24 540 topology 749 759
-> 15 0 24 540 topology 589 760
-> 16 0 24 540 topology 590 760
-> 15 0 24 540 topology 697 761
-> 16 0 24 540 topology 698 761
-> 15 0 24 540 topology 646 762
-> 16 0 24 540 topology 647 762
-> 15 0 24 540 topology 754 763
-> 16 0 24 540 topology 755 763
-> 15 0 23 540 topology 554 764
+> 15 0 23 540 topology 633 756
+> 16 0 23 540 topology 758 756
+> 15 0 23 540 topology 632 757
+> 16 0 23 540 topology 758 757
+> 15 0 23 540 topology 636 758
+> 16 0 23 540 topology 758 758
+> 15 0 23 540 topology 635 759
+> 16 0 23 540 topology 758 759
+> 15 0 23 540 topology 639 760
+> 16 0 23 540 topology 758 760
+> 15 0 23 540 topology 638 761
+> 16 0 23 540 topology 758 761
+> 15 0 23 540 topology 642 762
+> 16 0 23 540 topology 758 762
+> 15 0 23 540 topology 641 763
+> 16 0 23 540 topology 758 763
+> 15 0 23 540 topology 645 764
 > 16 0 23 540 topology 758 764
-> 15 0 24 540 topology 595 765
-> 16 0 24 540 topology 596 765
-> 15 0 24 540 topology 703 766
-> 16 0 24 540 topology 704 766
-> 15 0 23 540 topology 630 767
+> 15 0 23 540 topology 644 765
+> 16 0 23 540 topology 758 765
+> 15 0 23 540 topology 648 766
+> 16 0 23 540 topology 758 766
+> 15 0 23 540 topology 647 767
 > 16 0 23 540 topology 758 767
-> 15 0 24 540 topology 652 768
-> 16 0 24 540 topology 653 768
-> 15 0 23 540 topology 582 769
+> 15 0 23 540 topology 651 768
+> 16 0 23 540 topology 758 768
+> 15 0 23 540 topology 650 769
 > 16 0 23 540 topology 758 769
-> 15 0 23 540 topology 666 770
+> 15 0 23 540 topology 654 770
 > 16 0 23 540 topology 758 770
-> 15 0 24 540 topology 709 771
-> 16 0 24 540 topology 710 771
-> 15 0 24 540 topology 574 772
-> 16 0 24 540 topology 576 772
-> 15 0 23 540 topology 750 773
+> 15 0 23 540 topology 653 771
+> 16 0 23 540 topology 758 771
+> 15 0 23 540 topology 657 772
+> 16 0 23 540 topology 758 772
+> 15 0 23 540 topology 656 773
 > 16 0 23 540 topology 758 773
-> 15 0 23 540 topology 618 774
+> 15 0 23 540 topology 549 774
 > 16 0 23 540 topology 758 774
-> 15 0 24 540 topology 604 775
-> 16 0 24 540 topology 606 775
-> 15 0 23 540 topology 702 776
+> 15 0 23 540 topology 548 775
+> 16 0 23 540 topology 758 775
+> 15 0 23 540 topology 660 776
 > 16 0 23 540 topology 758 776
-> 15 0 24 540 topology 715 777
-> 16 0 24 540 topology 716 777
-> 15 0 24 540 topology 553 778
-> 16 0 24 540 topology 555 778
-> 15 0 24 540 topology 634 779
-> 16 0 24 540 topology 636 779
-> 15 0 23 540 topology 654 780
+> 15 0 23 540 topology 659 777
+> 16 0 23 540 topology 758 777
+> 15 0 23 540 topology 663 778
+> 16 0 23 540 topology 758 778
+> 15 0 23 540 topology 662 779
+> 16 0 23 540 topology 758 779
+> 15 0 23 540 topology 666 780
 > 16 0 23 540 topology 758 780
-> 15 0 23 540 topology 738 781
+> 15 0 23 540 topology 665 781
 > 16 0 23 540 topology 758 781
-> 15 0 24 540 topology 664 782
-> 16 0 24 540 topology 666 782
-> 15 0 23 540 topology 572 783
+> 15 0 23 540 topology 669 782
+> 16 0 23 540 topology 758 782
+> 15 0 23 540 topology 668 783
 > 16 0 23 540 topology 758 783
-> 15 0 24 540 topology 586 784
-> 16 0 24 540 topology 588 784
-> 15 0 24 540 topology 694 785
-> 16 0 24 540 topology 696 785
-> 15 0 24 540 topology 616 786
-> 16 0 24 540 topology 618 786
-> 15 0 23 540 topology 632 787
+> 15 0 23 540 topology 672 784
+> 16 0 23 540 topology 758 784
+> 15 0 23 540 topology 671 785
+> 16 0 23 540 topology 758 785
+> 15 0 23 540 topology 675 786
+> 16 0 23 540 topology 758 786
+> 15 0 23 540 topology 674 787
 > 16 0 23 540 topology 758 787
-> 15 0 24 540 topology 724 788
-> 16 0 24 540 topology 726 788
-> 15 0 24 540 topology 646 789
-> 16 0 24 540 topology 648 789
-> 15 0 23 540 topology 692 790
+> 15 0 23 540 topology 678 788
+> 16 0 23 540 topology 758 788
+> 15 0 23 540 topology 677 789
+> 16 0 23 540 topology 758 789
+> 15 0 23 540 topology 681 790
 > 16 0 23 540 topology 758 790
-> 15 0 24 540 topology 754 791
-> 16 0 24 540 topology 756 791
-> 15 0 23 540 topology 614 792
+> 15 0 23 540 topology 680 791
+> 16 0 23 540 topology 758 791
+> 15 0 23 540 topology 684 792
 > 16 0 23 540 topology 758 792
-> 15 0 24 540 topology 676 793
-> 16 0 24 540 topology 678 793
-> 15 0 23 540 topology 752 794
+> 15 0 23 540 topology 683 793
+> 16 0 23 540 topology 758 793
+> 15 0 23 540 topology 687 794
 > 16 0 23 540 topology 758 794
-> 15 0 23 540 topology 674 795
+> 15 0 23 540 topology 686 795
 > 16 0 23 540 topology 758 795
-> 15 0 23 540 topology 561 796
+> 15 0 23 540 topology 552 796
 > 16 0 23 540 topology 758 796
-> 15 0 23 540 topology 596 797
+> 15 0 23 540 topology 551 797
 > 16 0 23 540 topology 758 797
-> 15 0 24 540 topology 706 798
-> 16 0 24 540 topology 708 798
-> 15 0 23 540 topology 734 799
+> 15 0 23 540 topology 690 798
+> 16 0 23 540 topology 758 798
+> 15 0 23 540 topology 689 799
 > 16 0 23 540 topology 758 799
-> 15 0 23 540 topology 656 800
+> 15 0 23 540 topology 693 800
 > 16 0 23 540 topology 758 800
-> 15 0 24 540 topology 736 801
-> 16 0 24 540 topology 738 801
-> 15 0 23 540 topology 716 802
+> 15 0 23 540 topology 692 801
+> 16 0 23 540 topology 758 801
+> 15 0 23 540 topology 696 802
 > 16 0 23 540 topology 758 802
-> 15 0 24 540 topology 559 803
-> 16 0 24 540 topology 560 803
-> 15 0 23 540 topology 573 804
+> 15 0 23 540 topology 695 803
+> 16 0 23 540 topology 758 803
+> 15 0 23 540 topology 699 804
 > 16 0 23 540 topology 758 804
-> 15 0 24 540 topology 544 805
-> 16 0 24 540 topology 546 805
-> 15 0 23 540 topology 563 806
+> 15 0 23 540 topology 698 805
+> 16 0 23 540 topology 758 805
+> 15 0 23 540 topology 702 806
 > 16 0 23 540 topology 758 806
-> 15 0 23 540 topology 609 807
+> 15 0 23 540 topology 701 807
 > 16 0 23 540 topology 758 807
-> 15 0 23 540 topology 693 808
+> 15 0 23 540 topology 705 808
 > 16 0 23 540 topology 758 808
-> 15 0 23 540 topology 645 809
+> 15 0 23 540 topology 704 809
 > 16 0 23 540 topology 758 809
-> 15 0 23 540 topology 729 810
+> 15 0 23 540 topology 708 810
 > 16 0 23 540 topology 758 810
-> 15 0 23 540 topology 597 811
+> 15 0 23 540 topology 707 811
 > 16 0 23 540 topology 758 811
-> 15 0 23 540 topology 681 812
+> 15 0 23 540 topology 711 812
 > 16 0 23 540 topology 758 812
-> 15 0 23 540 topology 717 813
+> 15 0 23 540 topology 710 813
 > 16 0 23 540 topology 758 813
-> 15 0 23 540 topology 599 814
+> 15 0 23 540 topology 714 814
 > 16 0 23 540 topology 758 814
-> 15 0 23 540 topology 659 815
+> 15 0 23 540 topology 713 815
 > 16 0 23 540 topology 758 815
-> 15 0 24 540 topology 544 816
-> 16 0 24 540 topology 545 816
-> 15 0 23 540 topology 581 817
+> 15 0 23 540 topology 717 816
+> 16 0 23 540 topology 758 816
+> 15 0 23 540 topology 716 817
 > 16 0 23 540 topology 758 817
-> 15 0 24 540 topology 598 818
-> 16 0 24 540 topology 599 818
-> 15 0 23 540 topology 719 819
+> 15 0 23 540 topology 555 818
+> 16 0 23 540 topology 758 818
+> 15 0 23 540 topology 554 819
 > 16 0 23 540 topology 758 819
-> 15 0 23 540 topology 552 820
+> 15 0 23 540 topology 720 820
 > 16 0 23 540 topology 758 820
-> 15 0 23 540 topology 641 821
+> 15 0 23 540 topology 719 821
 > 16 0 23 540 topology 758 821
-> 15 0 24 540 topology 604 822
-> 16 0 24 540 topology 605 822
-> 15 0 23 540 topology 701 823
+> 15 0 23 540 topology 723 822
+> 16 0 23 540 topology 758 822
+> 15 0 23 540 topology 722 823
 > 16 0 23 540 topology 758 823
-> 15 0 23 540 topology 623 824
+> 15 0 23 540 topology 726 824
 > 16 0 23 540 topology 758 824
-> 15 0 24 540 topology 661 825
-> 16 0 24 540 topology 662 825
-> 15 0 23 540 topology 683 826
+> 15 0 23 540 topology 725 825
+> 16 0 23 540 topology 758 825
+> 15 0 23 540 topology 729 826
 > 16 0 23 540 topology 758 826
-> 15 0 24 540 topology 610 827
-> 16 0 24 540 topology 611 827
-> 15 0 24 540 topology 718 828
-> 16 0 24 540 topology 719 828
-> 15 0 23 540 topology 743 829
+> 15 0 23 540 topology 728 827
+> 16 0 23 540 topology 758 827
+> 15 0 23 540 topology 732 828
+> 16 0 23 540 topology 758 828
+> 15 0 23 540 topology 731 829
 > 16 0 23 540 topology 758 829
-> 15 0 24 540 topology 667 830
-> 16 0 24 540 topology 668 830
-> 15 0 24 540 topology 616 831
-> 16 0 24 540 topology 617 831
-> 15 0 24 540 topology 724 832
-> 16 0 24 540 topology 725 832
-> 15 0 23 540 topology 548 833
+> 15 0 23 540 topology 735 830
+> 16 0 23 540 topology 758 830
+> 15 0 23 540 topology 734 831
+> 16 0 23 540 topology 758 831
+> 15 0 23 540 topology 738 832
+> 16 0 23 540 topology 758 832
+> 15 0 23 540 topology 737 833
 > 16 0 23 540 topology 758 833
-> 15 0 24 540 topology 673 834
-> 16 0 24 540 topology 674 834
-> 15 0 23 540 topology 600 835
+> 15 0 23 540 topology 741 834
+> 16 0 23 540 topology 758 834
+> 15 0 23 540 topology 740 835
 > 16 0 23 540 topology 758 835
-> 15 0 24 540 topology 622 836
-> 16 0 24 540 topology 623 836
-> 15 0 24 540 topology 730 837
-> 16 0 24 540 topology 731 837
-> 15 0 24 540 topology 679 838
-> 16 0 24 540 topology 680 838
-> 15 0 24 540 topology 571 839
-> 16 0 24 540 topology 573 839
-> 15 0 23 540 topology 636 840
+> 15 0 23 540 topology 744 836
+> 16 0 23 540 topology 758 836
+> 15 0 23 540 topology 743 837
+> 16 0 23 540 topology 758 837
+> 15 0 23 540 topology 747 838
+> 16 0 23 540 topology 758 838
+> 15 0 23 540 topology 746 839
+> 16 0 23 540 topology 758 839
+> 15 0 23 540 topology 558 840
 > 16 0 23 540 topology 758 840
-> 15 0 23 540 topology 720 841
+> 15 0 23 540 topology 557 841
 > 16 0 23 540 topology 758 841
-> 15 0 24 540 topology 736 842
-> 16 0 24 540 topology 737 842
-> 15 0 23 540 topology 588 843
+> 15 0 23 540 topology 750 842
+> 16 0 23 540 topology 758 842
+> 15 0 23 540 topology 749 843
 > 16 0 23 540 topology 758 843
-> 15 0 24 540 topology 601 844
-> 16 0 24 540 topology 603 844
-> 15 0 23 540 topology 672 845
+> 15 0 23 540 topology 753 844
+> 16 0 23 540 topology 758 844
+> 15 0 23 540 topology 752 845
 > 16 0 23 540 topology 758 845
-> 15 0 24 540 topology 685 846
-> 16 0 24 540 topology 686 846
-> 15 0 24 540 topology 631 847
-> 16 0 24 540 topology 633 847
-> 15 0 23 540 topology 756 848
+> 15 0 23 540 topology 756 846
+> 16 0 23 540 topology 758 846
+> 15 0 23 540 topology 755 847
+> 16 0 23 540 topology 758 847
+> 15 0 23 540 topology 561 848
 > 16 0 23 540 topology 758 848
-> 15 0 23 540 topology 624 849
+> 15 0 23 540 topology 560 849
 > 16 0 23 540 topology 758 849
-> 15 0 24 540 topology 742 850
-> 16 0 24 540 topology 743 850
-> 15 0 23 540 topology 708 851
+> 15 0 23 540 topology 564 850
+> 16 0 23 540 topology 758 850
+> 15 0 23 540 topology 563 851
 > 16 0 23 540 topology 758 851
-> 15 0 24 540 topology 661 852
-> 16 0 24 540 topology 663 852
-> 15 0 24 540 topology 691 853
-> 16 0 24 540 topology 693 853
-> 15 0 24 540 topology 583 854
-> 16 0 24 540 topology 585 854
-> 15 0 23 540 topology 744 855
-> 16 0 23 540 topology 758 855
-> 15 0 24 540 topology 613 856
-> 16 0 24 540 topology 615 856
-> 15 0 24 540 topology 559 857
-> 16 0 24 540 topology 561 857
-> 15 0 24 540 topology 721 858
-> 16 0 24 540 topology 723 858
-> 15 0 24 540 topology 643 859
-> 16 0 24 540 topology 645 859
-> 15 0 23 540 topology 543 860
-> 16 0 23 540 topology 758 860
-> 15 0 24 540 topology 751 861
-> 16 0 24 540 topology 753 861
-> 15 0 23 540 topology 608 862
-> 16 0 23 540 topology 758 862
-> 15 0 24 540 topology 673 863
-> 16 0 24 540 topology 675 863
-> 15 0 23 540 topology 668 864
-> 16 0 23 540 topology 758 864
-> 15 0 24 540 topology 703 865
-> 16 0 24 540 topology 705 865
-> 15 0 24 540 topology 595 866
-> 16 0 24 540 topology 597 866
-> 15 0 23 540 topology 590 867
-> 16 0 23 540 topology 758 867
-> 15 0 23 540 topology 728 868
-> 16 0 23 540 topology 758 868
-> 15 0 23 540 topology 650 869
-> 16 0 23 540 topology 758 869
-> 15 0 24 540 topology 625 870
-> 16 0 24 540 topology 627 870
-> 15 0 24 540 topology 733 871
-> 16 0 24 540 topology 735 871
-> 15 0 24 540 topology 553 872
-> 16 0 24 540 topology 554 872
-> 15 0 23 540 topology 710 873
-> 16 0 23 540 topology 758 873
-> 15 0 24 540 topology 655 874
-> 16 0 24 540 topology 657 874
-> 15 0 23 540 topology 567 875
-> 16 0 23 540 topology 758 875
-> 15 0 24 540 topology 685 876
-> 16 0 24 540 topology 687 876
-> 15 0 24 540 topology 715 877
-> 16 0 24 540 topology 717 877
-> 15 0 24 540 topology 745 878
-> 16 0 24 540 topology 747 878
-> 15 0 23 540 topology 557 879
-> 16 0 23 540 topology 758 879
-> 15 0 23 540 topology 579 880
-> 16 0 23 540 topology 758 880
-> 15 0 23 540 topology 663 881
-> 16 0 23 540 topology 758 881
-> 15 0 23 540 topology 615 882
-> 16 0 23 540 topology 758 882
-> 15 0 23 540 topology 699 883
-> 16 0 23 540 topology 758 883
-> 15 0 24 540 topology 550 884
-> 16 0 24 540 topology 552 884
-> 15 0 23 540 topology 651 885
-> 16 0 23 540 topology 758 885
-> 15 0 23 540 topology 735 886
-> 16 0 23 540 topology 758 886
-> 15 0 23 540 topology 687 887
-> 16 0 23 540 topology 758 887
-> 15 0 23 540 topology 575 888
-> 16 0 23 540 topology 758 888
-> 15 0 24 540 topology 568 889
-> 16 0 24 540 topology 569 889
-> 15 0 23 540 topology 635 890
-> 16 0 23 540 topology 758 890
-> 15 0 23 540 topology 695 891
-> 16 0 23 540 topology 758 891
-> 15 0 24 540 topology 574 892
-> 16 0 24 540 topology 575 892
-> 15 0 23 540 topology 617 893
-> 16 0 23 540 topology 758 893
-> 15 0 24 540 topology 631 894
-> 16 0 24 540 topology 632 894
-> 15 0 23 540 topology 558 895
-> 16 0 23 540 topology 758 895
-> 15 0 23 540 topology 755 896
-> 16 0 23 540 topology 758 896
-> 15 0 23 540 topology 677 897
-> 16 0 23 540 topology 758 897
-> 15 0 24 540 topology 688 898
-> 16 0 24 540 topology 689 898
-> 15 0 24 540 topology 580 899
-> 16 0 24 540 topology 581 899
-> 15 0 23 540 topology 737 900
-> 16 0 23 540 topology 758 900
-> 15 0 24 540 topology 637 901
-> 16 0 24 540 topology 638 901
-> 15 0 24 540 topology 694 902
-> 16 0 24 540 topology 695 902
-> 15 0 24 540 topology 586 903
-> 16 0 24 540 topology 587 903
-> 15 0 24 540 topology 643 904
-> 16 0 24 540 topology 644 904
-> 15 0 24 540 topology 562 905
-> 16 0 24 540 topology 563 905
-> 15 0 23 540 topology 542 906
-> 16 0 23 540 topology 758 906
-> 15 0 24 540 topology 751 907
-> 16 0 24 540 topology 752 907
-> 15 0 24 540 topology 700 908
-> 16 0 24 540 topology 701 908
-> 15 0 24 540 topology 592 909
-> 16 0 24 540 topology 593 909
-> 15 0 23 540 topology 570 910
-> 16 0 23 540 topology 758 910
-> 15 0 24 540 topology 649 911
-> 16 0 24 540 topology 650 911
-> 15 0 24 540 topology 568 912
-> 16 0 24 540 topology 570 912
-> 15 0 24 540 topology 541 913
-> 16 0 24 540 topology 543 913
-> 15 0 24 540 topology 706 914
-> 16 0 24 540 topology 707 914
-> 15 0 23 540 topology 606 915
-> 16 0 23 540 topology 758 915
-> 15 0 23 540 topology 690 916
-> 16 0 23 540 topology 758 916
-> 15 0 24 540 topology 598 917
-> 16 0 24 540 topology 600 917
-> 15 0 24 540 topology 655 918
-> 16 0 24 540 topology 656 918
-> 15 0 23 540 topology 566 919
-> 16 0 23 540 topology 758 919
-> 15 0 23 540 topology 642 920
-> 16 0 23 540 topology 758 920
-> 15 0 24 540 topology 628 921
-> 16 0 24 540 topology 630 921
-> 15 0 24 540 topology 712 922
-> 16 0 24 540 topology 713 922
-> 15 0 23 540 topology 726 923
-> 16 0 23 540 topology 758 923
-> 15 0 24 540 topology 658 924
-> 16 0 24 540 topology 660 924
-> 15 0 23 540 topology 594 925
-> 16 0 23 540 topology 758 925
-> 15 0 23 540 topology 678 926
-> 16 0 23 540 topology 758 926
-> 15 0 24 540 topology 688 927
-> 16 0 24 540 topology 690 927
-> 15 0 24 540 topology 580 928
-> 16 0 24 540 topology 582 928
-> 15 0 24 540 topology 610 929
-> 16 0 24 540 topology 612 929
-> 15 0 23 540 topology 714 930
-> 16 0 23 540 topology 758 930
-> 15 0 24 540 topology 718 931
-> 16 0 24 540 topology 720 931
-> 15 0 24 540 topology 640 932
-> 16 0 24 540 topology 642 932
-> 15 0 24 540 topology 748 933
-> 16 0 24 540 topology 750 933
-> 15 0 23 540 topology 602 934
-> 16 0 23 540 topology 758 934
-> 15 0 24 540 topology 670 935
-> 16 0 24 540 topology 672 935
-> 15 0 23 540 topology 662 936
-> 16 0 23 540 topology 758 936
-> 15 0 24 540 topology 700 937
-> 16 0 24 540 topology 702 937
-> 15 0 24 540 topology 592 938
-> 16 0 24 540 topology 594 938
-> 15 0 23 540 topology 584 939
-> 16 0 23 540 topology 758 939
-> 15 0 24 540 topology 565 940
-> 16 0 24 540 topology 567 940
-> 15 0 23 540 topology 549 941
-> 16 0 23 540 topology 758 941
-> 15 0 24 540 topology 547 942
-> 16 0 24 540 topology 548 942
-> 15 0 23 540 topology 722 943
-> 16 0 23 540 topology 758 943
-> 15 0 23 540 topology 644 944
-> 16 0 23 540 topology 758 944
-> 15 0 24 540 topology 622 945
-> 16 0 24 540 topology 624 945
-> 15 0 24 540 topology 730 946
-> 16 0 24 540 topology 732 946
-> 15 0 23 540 topology 704 947
-> 16 0 23 540 topology 758 947
-> 15 0 24 540 topology 652 948
-> 16 0 24 540 topology 654 948
-> 15 0 23 540 topology 626 949
-> 16 0 23 540 topology 758 949
-> 15 0 24 540 topology 682 950
-> 16 0 24 540 topology 684 950
-> 15 0 23 540 topology 686 951
-> 16 0 23 540 topology 758 951
-> 15 0 24 540 topology 712 952
-> 16 0 24 540 topology 714 952
-> 15 0 23 540 topology 746 953
-> 16 0 23 540 topology 758 953
-> 15 0 24 540 topology 742 954
-> 16 0 24 540 topology 744 954
-> 15 0 23 540 topology 551 955
-> 16 0 23 540 topology 758 955
-> 15 0 23 540 topology 633 956
-> 16 0 23 540 topology 758 956
-> 15 0 23 540 topology 585 957
-> 16 0 23 540 topology 758 957
-> 15 0 23 540 topology 669 958
-> 16 0 23 540 topology 758 958
-> 15 0 23 540 topology 753 959
-> 16 0 23 540 topology 758 959
-> 15 0 23 540 topology 621 960
-> 16 0 23 540 topology 758 960
-> 15 0 23 540 topology 705 961
-> 16 0 23 540 topology 758 961
-> 15 0 23 540 topology 657 962
-> 16 0 23 540 topology 758 962
-> 15 0 24 540 topology 556 963
-> 16 0 24 540 topology 558 963
-> 15 0 23 540 topology 741 964
-> 16 0 23 540 topology 758 964
-> 15 0 23 540 topology 569 965
-> 16 0 23 540 topology 758 965
-> 15 0 23 540 topology 629 966
-> 16 0 23 540 topology 758 966
-> 15 0 23 540 topology 689 967
-> 16 0 23 540 topology 758 967
-> 15 0 23 540 topology 611 968
-> 16 0 23 540 topology 758 968
-> 15 0 24 540 topology 601 969
-> 16 0 24 540 topology 602 969
-> 15 0 23 540 topology 749 970
-> 16 0 23 540 topology 758 970
-> 15 0 23 540 topology 671 971
-> 16 0 23 540 topology 758 971
-> 15 0 24 540 topology 658 972
-> 16 0 24 540 topology 659 972
-> 15 0 23 540 topology 593 973
-> 16 0 23 540 topology 758 973
-> 15 0 23 540 topology 731 974
-> 16 0 23 540 topology 758 974
-> 15 0 23 540 topology 653 975
-> 16 0 23 540 topology 758 975
-> 15 0 24 540 topology 607 976
-> 16 0 24 540 topology 608 976
-> 15 0 23 540 topology 564 977
-> 16 0 23 540 topology 758 977
-> 15 0 23 540 topology 713 978
-> 16 0 23 540 topology 758 978
-> 15 0 24 540 topology 664 979
-> 16 0 24 540 topology 665 979
-> 15 0 24 540 topology 556 980
-> 16 0 24 540 topology 557 980
-> 15 0 24 540 topology 613 981
-> 16 0 24 540 topology 614 981
-> 15 0 24 540 topology 721 982
-> 16 0 24 540 topology 722 982
-> 15 0 24 540 topology 670 983
-> 16 0 24 540 topology 671 983
-> 15 0 24 540 topology 619 984
-> 16 0 24 540 topology 620 984
-> 15 0 24 540 topology 727 985
-> 16 0 24 540 topology 728 985
-> 15 0 24 540 topology 676 986
-> 16 0 24 540 topology 677 986
-> 15 0 23 540 topology 576 987
-> 16 0 23 540 topology 758 987
-> 15 0 23 540 topology 660 988
-> 16 0 23 540 topology 758 988
-> 15 0 24 540 topology 625 989
-> 16 0 24 540 topology 626 989
-> 15 0 23 540 topology 560 990
-> 16 0 23 540 topology 758 990
-> 15 0 24 540 topology 733 991
-> 16 0 24 540 topology 734 991
-> 15 0 24 540 topology 682 992
-> 16 0 24 540 topology 683 992
-> 15 0 23 540 topology 612 993
-> 16 0 23 540 topology 758 993
-> 15 0 23 540 topology 696 994
-> 16 0 23 540 topology 758 994
-> 15 0 24 540 topology 547 995
-> 16 0 24 540 topology 549 995
-> 15 0 24 540 topology 739 996
-> 16 0 24 540 topology 740 996
-> 15 0 23 540 topology 648 997
-> 16 0 23 540 topology 758 997
-> 15 0 24 540 topology 577 998
-> 16 0 24 540 topology 579 998
-> 15 0 24 760 topology 779 999
-> 16 0 24 760 topology 781 999
-> 15 0 23 760 topology 792 1000
+> 15 0 23 540 topology 567 852
+> 16 0 23 540 topology 758 852
+> 15 0 23 540 topology 566 853
+> 16 0 23 540 topology 758 853
+> 15 0 24 540 topology 757 854
+> 16 0 24 540 topology 758 854
+> 15 0 25 540 topology 568 855
+> 16 0 25 540 topology 570 855
+> 15 0 25 540 topology 568 856
+> 16 0 25 540 topology 569 856
+> 15 0 25 540 topology 571 857
+> 16 0 25 540 topology 573 857
+> 15 0 25 540 topology 571 858
+> 16 0 25 540 topology 572 858
+> 15 0 25 540 topology 574 859
+> 16 0 25 540 topology 576 859
+> 15 0 25 540 topology 574 860
+> 16 0 25 540 topology 575 860
+> 15 0 25 540 topology 577 861
+> 16 0 25 540 topology 579 861
+> 15 0 25 540 topology 577 862
+> 16 0 25 540 topology 578 862
+> 15 0 25 540 topology 580 863
+> 16 0 25 540 topology 582 863
+> 15 0 25 540 topology 580 864
+> 16 0 25 540 topology 581 864
+> 15 0 25 540 topology 583 865
+> 16 0 25 540 topology 585 865
+> 15 0 25 540 topology 583 866
+> 16 0 25 540 topology 584 866
+> 15 0 25 540 topology 586 867
+> 16 0 25 540 topology 588 867
+> 15 0 25 540 topology 586 868
+> 16 0 25 540 topology 587 868
+> 15 0 25 540 topology 589 869
+> 16 0 25 540 topology 591 869
+> 15 0 25 540 topology 589 870
+> 16 0 25 540 topology 590 870
+> 15 0 25 540 topology 592 871
+> 16 0 25 540 topology 594 871
+> 15 0 25 540 topology 592 872
+> 16 0 25 540 topology 593 872
+> 15 0 25 540 topology 595 873
+> 16 0 25 540 topology 597 873
+> 15 0 25 540 topology 595 874
+> 16 0 25 540 topology 596 874
+> 15 0 25 540 topology 541 875
+> 16 0 25 540 topology 543 875
+> 15 0 25 540 topology 541 876
+> 16 0 25 540 topology 542 876
+> 15 0 25 540 topology 598 877
+> 16 0 25 540 topology 600 877
+> 15 0 25 540 topology 598 878
+> 16 0 25 540 topology 599 878
+> 15 0 25 540 topology 601 879
+> 16 0 25 540 topology 603 879
+> 15 0 25 540 topology 601 880
+> 16 0 25 540 topology 602 880
+> 15 0 25 540 topology 604 881
+> 16 0 25 540 topology 606 881
+> 15 0 25 540 topology 604 882
+> 16 0 25 540 topology 605 882
+> 15 0 25 540 topology 607 883
+> 16 0 25 540 topology 609 883
+> 15 0 25 540 topology 607 884
+> 16 0 25 540 topology 608 884
+> 15 0 25 540 topology 610 885
+> 16 0 25 540 topology 612 885
+> 15 0 25 540 topology 610 886
+> 16 0 25 540 topology 611 886
+> 15 0 25 540 topology 613 887
+> 16 0 25 540 topology 615 887
+> 15 0 25 540 topology 613 888
+> 16 0 25 540 topology 614 888
+> 15 0 25 540 topology 616 889
+> 16 0 25 540 topology 618 889
+> 15 0 25 540 topology 616 890
+> 16 0 25 540 topology 617 890
+> 15 0 25 540 topology 619 891
+> 16 0 25 540 topology 621 891
+> 15 0 25 540 topology 619 892
+> 16 0 25 540 topology 620 892
+> 15 0 25 540 topology 622 893
+> 16 0 25 540 topology 624 893
+> 15 0 25 540 topology 622 894
+> 16 0 25 540 topology 623 894
+> 15 0 25 540 topology 625 895
+> 16 0 25 540 topology 627 895
+> 15 0 25 540 topology 625 896
+> 16 0 25 540 topology 626 896
+> 15 0 25 540 topology 544 897
+> 16 0 25 540 topology 546 897
+> 15 0 25 540 topology 544 898
+> 16 0 25 540 topology 545 898
+> 15 0 25 540 topology 628 899
+> 16 0 25 540 topology 630 899
+> 15 0 25 540 topology 628 900
+> 16 0 25 540 topology 629 900
+> 15 0 25 540 topology 631 901
+> 16 0 25 540 topology 633 901
+> 15 0 25 540 topology 631 902
+> 16 0 25 540 topology 632 902
+> 15 0 25 540 topology 634 903
+> 16 0 25 540 topology 636 903
+> 15 0 25 540 topology 634 904
+> 16 0 25 540 topology 635 904
+> 15 0 25 540 topology 637 905
+> 16 0 25 540 topology 639 905
+> 15 0 25 540 topology 637 906
+> 16 0 25 540 topology 638 906
+> 15 0 25 540 topology 640 907
+> 16 0 25 540 topology 642 907
+> 15 0 25 540 topology 640 908
+> 16 0 25 540 topology 641 908
+> 15 0 25 540 topology 643 909
+> 16 0 25 540 topology 645 909
+> 15 0 25 540 topology 643 910
+> 16 0 25 540 topology 644 910
+> 15 0 25 540 topology 646 911
+> 16 0 25 540 topology 648 911
+> 15 0 25 540 topology 646 912
+> 16 0 25 540 topology 647 912
+> 15 0 25 540 topology 649 913
+> 16 0 25 540 topology 651 913
+> 15 0 25 540 topology 649 914
+> 16 0 25 540 topology 650 914
+> 15 0 25 540 topology 652 915
+> 16 0 25 540 topology 654 915
+> 15 0 25 540 topology 652 916
+> 16 0 25 540 topology 653 916
+> 15 0 25 540 topology 655 917
+> 16 0 25 540 topology 657 917
+> 15 0 25 540 topology 655 918
+> 16 0 25 540 topology 656 918
+> 15 0 25 540 topology 547 919
+> 16 0 25 540 topology 549 919
+> 15 0 25 540 topology 547 920
+> 16 0 25 540 topology 548 920
+> 15 0 25 540 topology 658 921
+> 16 0 25 540 topology 660 921
+> 15 0 25 540 topology 658 922
+> 16 0 25 540 topology 659 922
+> 15 0 25 540 topology 661 923
+> 16 0 25 540 topology 663 923
+> 15 0 25 540 topology 661 924
+> 16 0 25 540 topology 662 924
+> 15 0 25 540 topology 664 925
+> 16 0 25 540 topology 666 925
+> 15 0 25 540 topology 664 926
+> 16 0 25 540 topology 665 926
+> 15 0 25 540 topology 667 927
+> 16 0 25 540 topology 669 927
+> 15 0 25 540 topology 667 928
+> 16 0 25 540 topology 668 928
+> 15 0 25 540 topology 670 929
+> 16 0 25 540 topology 672 929
+> 15 0 25 540 topology 670 930
+> 16 0 25 540 topology 671 930
+> 15 0 25 540 topology 673 931
+> 16 0 25 540 topology 675 931
+> 15 0 25 540 topology 673 932
+> 16 0 25 540 topology 674 932
+> 15 0 25 540 topology 676 933
+> 16 0 25 540 topology 678 933
+> 15 0 25 540 topology 676 934
+> 16 0 25 540 topology 677 934
+> 15 0 25 540 topology 679 935
+> 16 0 25 540 topology 681 935
+> 15 0 25 540 topology 679 936
+> 16 0 25 540 topology 680 936
+> 15 0 25 540 topology 682 937
+> 16 0 25 540 topology 684 937
+> 15 0 25 540 topology 682 938
+> 16 0 25 540 topology 683 938
+> 15 0 25 540 topology 685 939
+> 16 0 25 540 topology 687 939
+> 15 0 25 540 topology 685 940
+> 16 0 25 540 topology 686 940
+> 15 0 25 540 topology 550 941
+> 16 0 25 540 topology 552 941
+> 15 0 25 540 topology 550 942
+> 16 0 25 540 topology 551 942
+> 15 0 25 540 topology 688 943
+> 16 0 25 540 topology 690 943
+> 15 0 25 540 topology 688 944
+> 16 0 25 540 topology 689 944
+> 15 0 25 540 topology 691 945
+> 16 0 25 540 topology 693 945
+> 15 0 25 540 topology 691 946
+> 16 0 25 540 topology 692 946
+> 15 0 25 540 topology 694 947
+> 16 0 25 540 topology 696 947
+> 15 0 25 540 topology 694 948
+> 16 0 25 540 topology 695 948
+> 15 0 25 540 topology 697 949
+> 16 0 25 540 topology 699 949
+> 15 0 25 540 topology 697 950
+> 16 0 25 540 topology 698 950
+> 15 0 25 540 topology 700 951
+> 16 0 25 540 topology 702 951
+> 15 0 25 540 topology 700 952
+> 16 0 25 540 topology 701 952
+> 15 0 25 540 topology 703 953
+> 16 0 25 540 topology 705 953
+> 15 0 25 540 topology 703 954
+> 16 0 25 540 topology 704 954
+> 15 0 25 540 topology 706 955
+> 16 0 25 540 topology 708 955
+> 15 0 25 540 topology 706 956
+> 16 0 25 540 topology 707 956
+> 15 0 25 540 topology 709 957
+> 16 0 25 540 topology 711 957
+> 15 0 25 540 topology 709 958
+> 16 0 25 540 topology 710 958
+> 15 0 25 540 topology 712 959
+> 16 0 25 540 topology 714 959
+> 15 0 25 540 topology 712 960
+> 16 0 25 540 topology 713 960
+> 15 0 25 540 topology 715 961
+> 16 0 25 540 topology 717 961
+> 15 0 25 540 topology 715 962
+> 16 0 25 540 topology 716 962
+> 15 0 25 540 topology 553 963
+> 16 0 25 540 topology 555 963
+> 15 0 25 540 topology 553 964
+> 16 0 25 540 topology 554 964
+> 15 0 25 540 topology 718 965
+> 16 0 25 540 topology 720 965
+> 15 0 25 540 topology 718 966
+> 16 0 25 540 topology 719 966
+> 15 0 25 540 topology 721 967
+> 16 0 25 540 topology 723 967
+> 15 0 25 540 topology 721 968
+> 16 0 25 540 topology 722 968
+> 15 0 25 540 topology 724 969
+> 16 0 25 540 topology 726 969
+> 15 0 25 540 topology 724 970
+> 16 0 25 540 topology 725 970
+> 15 0 25 540 topology 727 971
+> 16 0 25 540 topology 729 971
+> 15 0 25 540 topology 727 972
+> 16 0 25 540 topology 728 972
+> 15 0 25 540 topology 730 973
+> 16 0 25 540 topology 732 973
+> 15 0 25 540 topology 730 974
+> 16 0 25 540 topology 731 974
+> 15 0 25 540 topology 733 975
+> 16 0 25 540 topology 735 975
+> 15 0 25 540 topology 733 976
+> 16 0 25 540 topology 734 976
+> 15 0 25 540 topology 736 977
+> 16 0 25 540 topology 738 977
+> 15 0 25 540 topology 736 978
+> 16 0 25 540 topology 737 978
+> 15 0 25 540 topology 739 979
+> 16 0 25 540 topology 741 979
+> 15 0 25 540 topology 739 980
+> 16 0 25 540 topology 740 980
+> 15 0 25 540 topology 742 981
+> 16 0 25 540 topology 744 981
+> 15 0 25 540 topology 742 982
+> 16 0 25 540 topology 743 982
+> 15 0 25 540 topology 745 983
+> 16 0 25 540 topology 747 983
+> 15 0 25 540 topology 745 984
+> 16 0 25 540 topology 746 984
+> 15 0 25 540 topology 556 985
+> 16 0 25 540 topology 558 985
+> 15 0 25 540 topology 556 986
+> 16 0 25 540 topology 557 986
+> 15 0 25 540 topology 748 987
+> 16 0 25 540 topology 750 987
+> 15 0 25 540 topology 748 988
+> 16 0 25 540 topology 749 988
+> 15 0 25 540 topology 751 989
+> 16 0 25 540 topology 753 989
+> 15 0 25 540 topology 751 990
+> 16 0 25 540 topology 752 990
+> 15 0 25 540 topology 754 991
+> 16 0 25 540 topology 756 991
+> 15 0 25 540 topology 754 992
+> 16 0 25 540 topology 755 992
+> 15 0 25 540 topology 559 993
+> 16 0 25 540 topology 561 993
+> 15 0 25 540 topology 559 994
+> 16 0 25 540 topology 560 994
+> 15 0 25 540 topology 562 995
+> 16 0 25 540 topology 564 995
+> 15 0 25 540 topology 562 996
+> 16 0 25 540 topology 563 996
+> 15 0 25 540 topology 565 997
+> 16 0 25 540 topology 567 997
+> 15 0 25 540 topology 565 998
+> 16 0 25 540 topology 566 998
+> 15 0 23 760 topology 790 999
+> 16 0 23 760 topology 864 999
+> 15 0 23 760 topology 789 1000
 > 16 0 23 760 topology 864 1000
-> 15 0 24 760 topology 806 1001
-> 16 0 24 760 topology 808 1001
-> 15 0 24 760 topology 860 1002
-> 16 0 24 760 topology 862 1002
-> 15 0 23 760 topology 822 1003
+> 15 0 23 760 topology 793 1001
+> 16 0 23 760 topology 864 1001
+> 15 0 23 760 topology 792 1002
+> 16 0 23 760 topology 864 1002
+> 15 0 23 760 topology 796 1003
 > 16 0 23 760 topology 864 1003
-> 15 0 24 760 topology 809 1004
-> 16 0 24 760 topology 811 1004
-> 15 0 23 760 topology 852 1005
+> 15 0 23 760 topology 795 1004
+> 16 0 23 760 topology 864 1004
+> 15 0 23 760 topology 799 1005
 > 16 0 23 760 topology 864 1005
-> 15 0 23 760 topology 769 1006
+> 15 0 23 760 topology 798 1006
 > 16 0 23 760 topology 864 1006
-> 15 0 23 760 topology 804 1007
+> 15 0 23 760 topology 802 1007
 > 16 0 23 760 topology 864 1007
-> 15 0 24 760 topology 812 1008
-> 16 0 24 760 topology 814 1008
-> 15 0 24 760 topology 767 1009
-> 16 0 24 760 topology 768 1009
-> 15 0 23 760 topology 834 1010
+> 15 0 23 760 topology 801 1008
+> 16 0 23 760 topology 864 1008
+> 15 0 23 760 topology 805 1009
+> 16 0 23 760 topology 864 1009
+> 15 0 23 760 topology 804 1010
 > 16 0 23 760 topology 864 1010
-> 15 0 24 760 topology 815 1011
-> 16 0 24 760 topology 817 1011
-> 15 0 23 760 topology 781 1012
+> 15 0 23 760 topology 808 1011
+> 16 0 23 760 topology 864 1011
+> 15 0 23 760 topology 807 1012
 > 16 0 23 760 topology 864 1012
-> 15 0 23 760 topology 816 1013
+> 15 0 23 760 topology 811 1013
 > 16 0 23 760 topology 864 1013
-> 15 0 23 760 topology 846 1014
+> 15 0 23 760 topology 810 1014
 > 16 0 23 760 topology 864 1014
-> 15 0 24 760 topology 779 1015
-> 16 0 24 760 topology 780 1015
-> 15 0 25 760 topology 863 1016
-> 16 0 25 760 topology 864 1016
-> 15 0 23 760 topology 771 1017
+> 15 0 23 760 topology 814 1015
+> 16 0 23 760 topology 864 1015
+> 15 0 23 760 topology 813 1016
+> 16 0 23 760 topology 864 1016
+> 15 0 23 760 topology 817 1017
 > 16 0 23 760 topology 864 1017
-> 15 0 23 760 topology 793 1018
+> 15 0 23 760 topology 816 1018
 > 16 0 23 760 topology 864 1018
-> 15 0 23 760 topology 853 1019
+> 15 0 23 760 topology 763 1019
 > 16 0 23 760 topology 864 1019
-> 15 0 24 760 topology 764 1020
-> 16 0 24 760 topology 766 1020
-> 15 0 23 760 topology 783 1021
+> 15 0 23 760 topology 762 1020
+> 16 0 23 760 topology 864 1020
+> 15 0 23 760 topology 820 1021
 > 16 0 23 760 topology 864 1021
-> 15 0 23 760 topology 829 1022
+> 15 0 23 760 topology 819 1022
 > 16 0 23 760 topology 864 1022
-> 15 0 23 760 topology 805 1023
+> 15 0 23 760 topology 823 1023
 > 16 0 23 760 topology 864 1023
-> 15 0 23 760 topology 841 1024
+> 15 0 23 760 topology 822 1024
 > 16 0 23 760 topology 864 1024
-> 15 0 23 760 topology 817 1025
+> 15 0 23 760 topology 826 1025
 > 16 0 23 760 topology 864 1025
-> 15 0 24 760 topology 776 1026
-> 16 0 24 760 topology 778 1026
-> 15 0 23 760 topology 789 1027
+> 15 0 23 760 topology 825 1026
+> 16 0 23 760 topology 864 1026
+> 15 0 23 760 topology 829 1027
 > 16 0 23 760 topology 864 1027
-> 15 0 23 760 topology 819 1028
+> 15 0 23 760 topology 828 1028
 > 16 0 23 760 topology 864 1028
-> 15 0 24 760 topology 788 1029
-> 16 0 24 760 topology 789 1029
-> 15 0 23 760 topology 849 1030
+> 15 0 23 760 topology 832 1029
+> 16 0 23 760 topology 864 1029
+> 15 0 23 760 topology 831 1030
 > 16 0 23 760 topology 864 1030
-> 15 0 23 760 topology 801 1031
+> 15 0 23 760 topology 835 1031
 > 16 0 23 760 topology 864 1031
-> 15 0 24 760 topology 818 1032
-> 16 0 24 760 topology 819 1032
-> 15 0 23 760 topology 831 1033
+> 15 0 23 760 topology 834 1032
+> 16 0 23 760 topology 864 1032
+> 15 0 23 760 topology 838 1033
 > 16 0 23 760 topology 864 1033
-> 15 0 23 760 topology 772 1034
+> 15 0 23 760 topology 837 1034
 > 16 0 23 760 topology 864 1034
-> 15 0 24 760 topology 794 1035
-> 16 0 24 760 topology 795 1035
-> 15 0 24 760 topology 848 1036
-> 16 0 24 760 topology 849 1036
-> 15 0 23 760 topology 861 1037
+> 15 0 23 760 topology 841 1035
+> 16 0 23 760 topology 864 1035
+> 15 0 23 760 topology 840 1036
+> 16 0 23 760 topology 864 1036
+> 15 0 23 760 topology 844 1037
 > 16 0 23 760 topology 864 1037
-> 15 0 24 760 topology 770 1038
-> 16 0 24 760 topology 771 1038
-> 15 0 23 760 topology 813 1039
+> 15 0 23 760 topology 843 1038
+> 16 0 23 760 topology 864 1038
+> 15 0 23 760 topology 847 1039
 > 16 0 23 760 topology 864 1039
-> 15 0 24 760 topology 824 1040
-> 16 0 24 760 topology 825 1040
-> 15 0 23 760 topology 843 1041
+> 15 0 23 760 topology 846 1040
+> 16 0 23 760 topology 864 1040
+> 15 0 23 760 topology 766 1041
 > 16 0 23 760 topology 864 1041
-> 15 0 23 760 topology 784 1042
+> 15 0 23 760 topology 765 1042
 > 16 0 23 760 topology 864 1042
-> 15 0 24 760 topology 800 1043
-> 16 0 24 760 topology 801 1043
-> 15 0 24 760 topology 854 1044
-> 16 0 24 760 topology 855 1044
-> 15 0 24 760 topology 830 1045
-> 16 0 24 760 topology 831 1045
-> 15 0 24 760 topology 806 1046
-> 16 0 24 760 topology 807 1046
-> 15 0 24 760 topology 860 1047
-> 16 0 24 760 topology 861 1047
-> 15 0 24 760 topology 782 1048
-> 16 0 24 760 topology 783 1048
-> 15 0 24 760 topology 836 1049
-> 16 0 24 760 topology 837 1049
-> 15 0 23 760 topology 768 1050
+> 15 0 23 760 topology 850 1043
+> 16 0 23 760 topology 864 1043
+> 15 0 23 760 topology 849 1044
+> 16 0 23 760 topology 864 1044
+> 15 0 23 760 topology 853 1045
+> 16 0 23 760 topology 864 1045
+> 15 0 23 760 topology 852 1046
+> 16 0 23 760 topology 864 1046
+> 15 0 23 760 topology 856 1047
+> 16 0 23 760 topology 864 1047
+> 15 0 23 760 topology 855 1048
+> 16 0 23 760 topology 864 1048
+> 15 0 23 760 topology 859 1049
+> 16 0 23 760 topology 864 1049
+> 15 0 23 760 topology 858 1050
 > 16 0 23 760 topology 864 1050
-> 15 0 24 760 topology 812 1051
-> 16 0 24 760 topology 813 1051
-> 15 0 23 760 topology 820 1052
+> 15 0 23 760 topology 862 1051
+> 16 0 23 760 topology 864 1051
+> 15 0 23 760 topology 861 1052
 > 16 0 23 760 topology 864 1052
-> 15 0 24 760 topology 842 1053
-> 16 0 24 760 topology 843 1053
-> 15 0 24 760 topology 761 1054
-> 16 0 24 760 topology 763 1054
-> 15 0 23 760 topology 796 1055
+> 15 0 23 760 topology 769 1053
+> 16 0 23 760 topology 864 1053
+> 15 0 23 760 topology 768 1054
+> 16 0 23 760 topology 864 1054
+> 15 0 23 760 topology 772 1055
 > 16 0 23 760 topology 864 1055
-> 15 0 23 760 topology 780 1056
+> 15 0 23 760 topology 771 1056
 > 16 0 23 760 topology 864 1056
-> 15 0 24 760 topology 818 1057
-> 16 0 24 760 topology 820 1057
-> 15 0 23 760 topology 856 1058
+> 15 0 23 760 topology 775 1057
+> 16 0 23 760 topology 864 1057
+> 15 0 23 760 topology 774 1058
 > 16 0 23 760 topology 864 1058
-> 15 0 23 760 topology 832 1059
+> 15 0 23 760 topology 778 1059
 > 16 0 23 760 topology 864 1059
-> 15 0 23 760 topology 808 1060
+> 15 0 23 760 topology 777 1060
 > 16 0 23 760 topology 864 1060
-> 15 0 24 760 topology 821 1061
-> 16 0 24 760 topology 823 1061
-> 15 0 24 760 topology 824 1062
-> 16 0 24 760 topology 826 1062
-> 15 0 23 760 topology 844 1063
+> 15 0 23 760 topology 781 1061
+> 16 0 23 760 topology 864 1061
+> 15 0 23 760 topology 780 1062
+> 16 0 23 760 topology 864 1062
+> 15 0 23 760 topology 784 1063
 > 16 0 23 760 topology 864 1063
-> 15 0 24 760 topology 773 1064
-> 16 0 24 760 topology 775 1064
-> 15 0 24 760 topology 827 1065
-> 16 0 24 760 topology 829 1065
-> 15 0 24 760 topology 830 1066
-> 16 0 24 760 topology 832 1066
-> 15 0 24 760 topology 833 1067
-> 16 0 24 760 topology 835 1067
-> 15 0 24 760 topology 761 1068
-> 16 0 24 760 topology 762 1068
-> 15 0 23 760 topology 763 1069
-> 16 0 23 760 topology 864 1069
-> 15 0 23 760 topology 798 1070
-> 16 0 23 760 topology 864 1070
-> 15 0 24 760 topology 836 1071
-> 16 0 24 760 topology 838 1071
-> 15 0 23 760 topology 828 1072
-> 16 0 23 760 topology 864 1072
-> 15 0 24 760 topology 785 1073
-> 16 0 24 760 topology 787 1073
-> 15 0 24 760 topology 839 1074
-> 16 0 24 760 topology 841 1074
-> 15 0 23 760 topology 858 1075
-> 16 0 23 760 topology 864 1075
-> 15 0 23 760 topology 775 1076
-> 16 0 23 760 topology 864 1076
-> 15 0 23 760 topology 810 1077
-> 16 0 23 760 topology 864 1077
-> 15 0 24 760 topology 842 1078
-> 16 0 24 760 topology 844 1078
-> 15 0 23 760 topology 840 1079
-> 16 0 23 760 topology 864 1079
-> 15 0 24 760 topology 845 1080
-> 16 0 24 760 topology 847 1080
-> 15 0 24 760 topology 773 1081
-> 16 0 24 760 topology 774 1081
-> 15 0 23 760 topology 787 1082
-> 16 0 23 760 topology 864 1082
-> 15 0 23 760 topology 765 1083
-> 16 0 23 760 topology 864 1083
-> 15 0 24 760 topology 785 1084
-> 16 0 24 760 topology 786 1084
-> 15 0 23 760 topology 777 1085
-> 16 0 23 760 topology 864 1085
-> 15 0 23 760 topology 823 1086
-> 16 0 23 760 topology 864 1086
-> 15 0 23 760 topology 799 1087
-> 16 0 23 760 topology 864 1087
-> 15 0 23 760 topology 859 1088
-> 16 0 23 760 topology 864 1088
-> 15 0 23 760 topology 835 1089
-> 16 0 23 760 topology 864 1089
-> 15 0 23 760 topology 811 1090
-> 16 0 23 760 topology 864 1090
-> 15 0 24 760 topology 770 1091
-> 16 0 24 760 topology 772 1091
-> 15 0 23 760 topology 847 1092
-> 16 0 23 760 topology 864 1092
-> 15 0 23 760 topology 795 1093
-> 16 0 23 760 topology 864 1093
-> 15 0 24 760 topology 782 1094
-> 16 0 24 760 topology 784 1094
-> 15 0 23 760 topology 825 1095
-> 16 0 23 760 topology 864 1095
-> 15 0 24 760 topology 764 1096
-> 16 0 24 760 topology 765 1096
-> 15 0 23 760 topology 766 1097
-> 16 0 23 760 topology 864 1097
-> 15 0 24 760 topology 791 1098
-> 16 0 24 760 topology 792 1098
-> 15 0 23 760 topology 855 1099
-> 16 0 23 760 topology 864 1099
-> 15 0 23 760 topology 807 1100
-> 16 0 23 760 topology 864 1100
-> 15 0 24 760 topology 821 1101
-> 16 0 24 760 topology 822 1101
-> 15 0 23 760 topology 837 1102
-> 16 0 23 760 topology 864 1102
-> 15 0 23 760 topology 778 1103
-> 16 0 23 760 topology 864 1103
-> 15 0 24 760 topology 797 1104
-> 16 0 24 760 topology 798 1104
-> 15 0 24 760 topology 851 1105
-> 16 0 24 760 topology 852 1105
-> 15 0 24 760 topology 827 1106
-> 16 0 24 760 topology 828 1106
-> 15 0 24 760 topology 776 1107
-> 16 0 24 760 topology 777 1107
-> 15 0 24 760 topology 803 1108
-> 16 0 24 760 topology 804 1108
-> 15 0 24 760 topology 857 1109
-> 16 0 24 760 topology 858 1109
-> 15 0 24 760 topology 833 1110
-> 16 0 24 760 topology 834 1110
-> 15 0 23 760 topology 762 1111
-> 16 0 23 760 topology 864 1111
-> 15 0 24 760 topology 809 1112
-> 16 0 24 760 topology 810 1112
-> 15 0 24 760 topology 839 1113
-> 16 0 24 760 topology 840 1113
-> 15 0 23 760 topology 790 1114
-> 16 0 23 760 topology 864 1114
-> 15 0 23 760 topology 774 1115
-> 16 0 23 760 topology 864 1115
-> 15 0 24 760 topology 815 1116
-> 16 0 24 760 topology 816 1116
-> 15 0 24 760 topology 788 1117
-> 16 0 24 760 topology 790 1117
-> 15 0 23 760 topology 850 1118
-> 16 0 23 760 topology 864 1118
-> 15 0 23 760 topology 826 1119
-> 16 0 23 760 topology 864 1119
-> 15 0 24 760 topology 845 1120
-> 16 0 24 760 topology 846 1120
-> 15 0 24 760 topology 791 1121
-> 16 0 24 760 topology 793 1121
-> 15 0 23 760 topology 802 1122
-> 16 0 23 760 topology 864 1122
-> 15 0 23 760 topology 786 1123
-> 16 0 23 760 topology 864 1123
-> 15 0 24 760 topology 767 1124
-> 16 0 24 760 topology 769 1124
-> 15 0 24 760 topology 794 1125
-> 16 0 24 760 topology 796 1125
-> 15 0 24 760 topology 848 1126
-> 16 0 24 760 topology 850 1126
-> 15 0 23 760 topology 862 1127
-> 16 0 23 760 topology 864 1127
-> 15 0 23 760 topology 838 1128
-> 16 0 23 760 topology 864 1128
-> 15 0 24 760 topology 797 1129
-> 16 0 24 760 topology 799 1129
-> 15 0 23 760 topology 814 1130
-> 16 0 23 760 topology 864 1130
-> 15 0 24 760 topology 851 1131
-> 16 0 24 760 topology 853 1131
-> 15 0 24 760 topology 800 1132
-> 16 0 24 760 topology 802 1132
-> 15 0 24 760 topology 854 1133
-> 16 0 24 760 topology 856 1133
-> 15 0 24 760 topology 803 1134
-> 16 0 24 760 topology 805 1134
-> 15 0 24 760 topology 857 1135
-> 16 0 24 760 topology 859 1135
-> 15 0 26 499 topology 865 1136
-> 16 0 26 499 topology 867 1136
-> 15 0 26 499 topology 759 1137
-> 16 0 26 499 topology 867 1137
+> 15 0 23 760 topology 783 1064
+> 16 0 23 760 topology 864 1064
+> 15 0 23 760 topology 787 1065
+> 16 0 23 760 topology 864 1065
+> 15 0 23 760 topology 786 1066
+> 16 0 23 760 topology 864 1066
+> 15 0 24 760 topology 863 1067
+> 16 0 24 760 topology 864 1067
+> 15 0 25 760 topology 788 1068
+> 16 0 25 760 topology 790 1068
+> 15 0 25 760 topology 788 1069
+> 16 0 25 760 topology 789 1069
+> 15 0 25 760 topology 791 1070
+> 16 0 25 760 topology 793 1070
+> 15 0 25 760 topology 791 1071
+> 16 0 25 760 topology 792 1071
+> 15 0 25 760 topology 794 1072
+> 16 0 25 760 topology 796 1072
+> 15 0 25 760 topology 794 1073
+> 16 0 25 760 topology 795 1073
+> 15 0 25 760 topology 797 1074
+> 16 0 25 760 topology 799 1074
+> 15 0 25 760 topology 797 1075
+> 16 0 25 760 topology 798 1075
+> 15 0 25 760 topology 800 1076
+> 16 0 25 760 topology 802 1076
+> 15 0 25 760 topology 800 1077
+> 16 0 25 760 topology 801 1077
+> 15 0 25 760 topology 803 1078
+> 16 0 25 760 topology 805 1078
+> 15 0 25 760 topology 803 1079
+> 16 0 25 760 topology 804 1079
+> 15 0 25 760 topology 806 1080
+> 16 0 25 760 topology 808 1080
+> 15 0 25 760 topology 806 1081
+> 16 0 25 760 topology 807 1081
+> 15 0 25 760 topology 809 1082
+> 16 0 25 760 topology 811 1082
+> 15 0 25 760 topology 809 1083
+> 16 0 25 760 topology 810 1083
+> 15 0 25 760 topology 812 1084
+> 16 0 25 760 topology 814 1084
+> 15 0 25 760 topology 812 1085
+> 16 0 25 760 topology 813 1085
+> 15 0 25 760 topology 815 1086
+> 16 0 25 760 topology 817 1086
+> 15 0 25 760 topology 815 1087
+> 16 0 25 760 topology 816 1087
+> 15 0 25 760 topology 761 1088
+> 16 0 25 760 topology 763 1088
+> 15 0 25 760 topology 761 1089
+> 16 0 25 760 topology 762 1089
+> 15 0 25 760 topology 818 1090
+> 16 0 25 760 topology 820 1090
+> 15 0 25 760 topology 818 1091
+> 16 0 25 760 topology 819 1091
+> 15 0 25 760 topology 821 1092
+> 16 0 25 760 topology 823 1092
+> 15 0 25 760 topology 821 1093
+> 16 0 25 760 topology 822 1093
+> 15 0 25 760 topology 824 1094
+> 16 0 25 760 topology 826 1094
+> 15 0 25 760 topology 824 1095
+> 16 0 25 760 topology 825 1095
+> 15 0 25 760 topology 827 1096
+> 16 0 25 760 topology 829 1096
+> 15 0 25 760 topology 827 1097
+> 16 0 25 760 topology 828 1097
+> 15 0 25 760 topology 830 1098
+> 16 0 25 760 topology 832 1098
+> 15 0 25 760 topology 830 1099
+> 16 0 25 760 topology 831 1099
+> 15 0 25 760 topology 833 1100
+> 16 0 25 760 topology 835 1100
+> 15 0 25 760 topology 833 1101
+> 16 0 25 760 topology 834 1101
+> 15 0 25 760 topology 836 1102
+> 16 0 25 760 topology 838 1102
+> 15 0 25 760 topology 836 1103
+> 16 0 25 760 topology 837 1103
+> 15 0 25 760 topology 839 1104
+> 16 0 25 760 topology 841 1104
+> 15 0 25 760 topology 839 1105
+> 16 0 25 760 topology 840 1105
+> 15 0 25 760 topology 842 1106
+> 16 0 25 760 topology 844 1106
+> 15 0 25 760 topology 842 1107
+> 16 0 25 760 topology 843 1107
+> 15 0 25 760 topology 845 1108
+> 16 0 25 760 topology 847 1108
+> 15 0 25 760 topology 845 1109
+> 16 0 25 760 topology 846 1109
+> 15 0 25 760 topology 764 1110
+> 16 0 25 760 topology 766 1110
+> 15 0 25 760 topology 764 1111
+> 16 0 25 760 topology 765 1111
+> 15 0 25 760 topology 848 1112
+> 16 0 25 760 topology 850 1112
+> 15 0 25 760 topology 848 1113
+> 16 0 25 760 topology 849 1113
+> 15 0 25 760 topology 851 1114
+> 16 0 25 760 topology 853 1114
+> 15 0 25 760 topology 851 1115
+> 16 0 25 760 topology 852 1115
+> 15 0 25 760 topology 854 1116
+> 16 0 25 760 topology 856 1116
+> 15 0 25 760 topology 854 1117
+> 16 0 25 760 topology 855 1117
+> 15 0 25 760 topology 857 1118
+> 16 0 25 760 topology 859 1118
+> 15 0 25 760 topology 857 1119
+> 16 0 25 760 topology 858 1119
+> 15 0 25 760 topology 860 1120
+> 16 0 25 760 topology 862 1120
+> 15 0 25 760 topology 860 1121
+> 16 0 25 760 topology 861 1121
+> 15 0 25 760 topology 767 1122
+> 16 0 25 760 topology 769 1122
+> 15 0 25 760 topology 767 1123
+> 16 0 25 760 topology 768 1123
+> 15 0 25 760 topology 770 1124
+> 16 0 25 760 topology 772 1124
+> 15 0 25 760 topology 770 1125
+> 16 0 25 760 topology 771 1125
+> 15 0 25 760 topology 773 1126
+> 16 0 25 760 topology 775 1126
+> 15 0 25 760 topology 773 1127
+> 16 0 25 760 topology 774 1127
+> 15 0 25 760 topology 776 1128
+> 16 0 25 760 topology 778 1128
+> 15 0 25 760 topology 776 1129
+> 16 0 25 760 topology 777 1129
+> 15 0 25 760 topology 779 1130
+> 16 0 25 760 topology 781 1130
+> 15 0 25 760 topology 779 1131
+> 16 0 25 760 topology 780 1131
+> 15 0 25 760 topology 782 1132
+> 16 0 25 760 topology 784 1132
+> 15 0 25 760 topology 782 1133
+> 16 0 25 760 topology 783 1133
+> 15 0 25 760 topology 785 1134
+> 16 0 25 760 topology 787 1134
+> 15 0 25 760 topology 785 1135
+> 16 0 25 760 topology 786 1135
+> 15 0 26 499 topology 759 1136
+> 16 0 26 499 topology 757 1136
+> 15 0 26 499 topology 865 1137
+> 16 0 26 499 topology 863 1137
 > 15 0 26 499 topology 539 1138
 > 16 0 26 499 topology 867 1138
-> 15 0 27 499 topology 537 1139
-> 16 0 27 499 topology 539 1139
-> 15 0 21 499 topology 759 1140
-> 16 0 21 499 topology 865 1140
-> 15 0 21 499 topology 539 1141
-> 16 0 21 499 topology 865 1141
-> 15 0 26 499 topology 865 1142
-> 16 0 26 499 topology 863 1142
-> 15 0 21 499 topology 539 1143
-> 16 0 21 499 topology 759 1143
-> 15 0 26 499 topology 759 1144
-> 16 0 26 499 topology 757 1144
-> 15 0 24 870 topology 874 1145
-> 16 0 24 870 topology 875 1145
-> 15 0 24 870 topology 901 1146
-> 16 0 24 870 topology 902 1146
-> 15 0 23 870 topology 891 1147
+> 15 0 26 499 topology 759 1139
+> 16 0 26 499 topology 867 1139
+> 15 0 26 499 topology 865 1140
+> 16 0 26 499 topology 867 1140
+> 15 0 27 499 topology 537 1141
+> 16 0 27 499 topology 539 1141
+> 15 0 20 499 topology 539 1142
+> 16 0 20 499 topology 759 1142
+> 15 0 20 499 topology 539 1143
+> 16 0 20 499 topology 865 1143
+> 15 0 20 499 topology 759 1144
+> 16 0 20 499 topology 865 1144
+> 15 0 23 870 topology 900 1145
+> 16 0 23 870 topology 950 1145
+> 15 0 23 870 topology 899 1146
+> 16 0 23 870 topology 950 1146
+> 15 0 23 870 topology 903 1147
 > 16 0 23 870 topology 950 1147
-> 15 0 24 870 topology 895 1148
-> 16 0 24 870 topology 897 1148
-> 15 0 23 870 topology 926 1149
+> 15 0 23 870 topology 902 1148
+> 16 0 23 870 topology 950 1148
+> 15 0 23 870 topology 906 1149
 > 16 0 23 870 topology 950 1149
-> 15 0 24 870 topology 904 1150
-> 16 0 24 870 topology 905 1150
-> 15 0 24 870 topology 925 1151
-> 16 0 24 870 topology 927 1151
-> 15 0 24 870 topology 907 1152
-> 16 0 24 870 topology 908 1152
-> 15 0 24 870 topology 910 1153
-> 16 0 24 870 topology 911 1153
-> 15 0 25 870 topology 949 1154
-> 16 0 25 870 topology 950 1154
-> 15 0 24 870 topology 886 1155
-> 16 0 24 870 topology 887 1155
-> 15 0 24 870 topology 913 1156
-> 16 0 24 870 topology 914 1156
-> 15 0 24 870 topology 916 1157
-> 16 0 24 870 topology 917 1157
-> 15 0 23 870 topology 881 1158
+> 15 0 23 870 topology 905 1150
+> 16 0 23 870 topology 950 1150
+> 15 0 23 870 topology 909 1151
+> 16 0 23 870 topology 950 1151
+> 15 0 23 870 topology 908 1152
+> 16 0 23 870 topology 950 1152
+> 15 0 23 870 topology 912 1153
+> 16 0 23 870 topology 950 1153
+> 15 0 23 870 topology 911 1154
+> 16 0 23 870 topology 950 1154
+> 15 0 23 870 topology 915 1155
+> 16 0 23 870 topology 950 1155
+> 15 0 23 870 topology 914 1156
+> 16 0 23 870 topology 950 1156
+> 15 0 23 870 topology 918 1157
+> 16 0 23 870 topology 950 1157
+> 15 0 23 870 topology 917 1158
 > 16 0 23 870 topology 950 1158
-> 15 0 23 870 topology 903 1159
+> 15 0 23 870 topology 921 1159
 > 16 0 23 870 topology 950 1159
-> 15 0 24 870 topology 919 1160
-> 16 0 24 870 topology 920 1160
-> 15 0 24 870 topology 922 1161
-> 16 0 24 870 topology 923 1161
-> 15 0 23 870 topology 893 1162
+> 15 0 23 870 topology 920 1160
+> 16 0 23 870 topology 950 1160
+> 15 0 23 870 topology 924 1161
+> 16 0 23 870 topology 950 1161
+> 15 0 23 870 topology 923 1162
 > 16 0 23 870 topology 950 1162
-> 15 0 23 870 topology 939 1163
+> 15 0 23 870 topology 927 1163
 > 16 0 23 870 topology 950 1163
-> 15 0 23 870 topology 915 1164
+> 15 0 23 870 topology 926 1164
 > 16 0 23 870 topology 950 1164
-> 15 0 24 870 topology 925 1165
-> 16 0 24 870 topology 926 1165
-> 15 0 24 870 topology 874 1166
-> 16 0 24 870 topology 876 1166
-> 15 0 23 870 topology 927 1167
+> 15 0 23 870 topology 873 1165
+> 16 0 23 870 topology 950 1165
+> 15 0 23 870 topology 872 1166
+> 16 0 23 870 topology 950 1166
+> 15 0 23 870 topology 930 1167
 > 16 0 23 870 topology 950 1167
-> 15 0 23 870 topology 899 1168
+> 15 0 23 870 topology 929 1168
 > 16 0 23 870 topology 950 1168
-> 15 0 23 870 topology 929 1169
+> 15 0 23 870 topology 933 1169
 > 16 0 23 870 topology 950 1169
-> 15 0 24 870 topology 886 1170
-> 16 0 24 870 topology 888 1170
-> 15 0 23 870 topology 911 1171
+> 15 0 23 870 topology 932 1170
+> 16 0 23 870 topology 950 1170
+> 15 0 23 870 topology 936 1171
 > 16 0 23 870 topology 950 1171
-> 15 0 23 870 topology 941 1172
+> 15 0 23 870 topology 935 1172
 > 16 0 23 870 topology 950 1172
-> 15 0 24 870 topology 871 1173
-> 16 0 24 870 topology 872 1173
-> 15 0 23 870 topology 882 1174
+> 15 0 23 870 topology 939 1173
+> 16 0 23 870 topology 950 1173
+> 15 0 23 870 topology 938 1174
 > 16 0 23 870 topology 950 1174
-> 15 0 23 870 topology 923 1175
+> 15 0 23 870 topology 942 1175
 > 16 0 23 870 topology 950 1175
-> 15 0 23 870 topology 894 1176
+> 15 0 23 870 topology 941 1176
 > 16 0 23 870 topology 950 1176
-> 15 0 24 870 topology 883 1177
-> 16 0 24 870 topology 884 1177
-> 15 0 23 870 topology 878 1178
+> 15 0 23 870 topology 945 1177
+> 16 0 23 870 topology 950 1177
+> 15 0 23 870 topology 944 1178
 > 16 0 23 870 topology 950 1178
-> 15 0 23 870 topology 930 1179
+> 15 0 23 870 topology 948 1179
 > 16 0 23 870 topology 950 1179
-> 15 0 23 870 topology 906 1180
+> 15 0 23 870 topology 947 1180
 > 16 0 23 870 topology 950 1180
-> 15 0 23 870 topology 890 1181
+> 15 0 23 870 topology 876 1181
 > 16 0 23 870 topology 950 1181
-> 15 0 24 870 topology 895 1182
-> 16 0 24 870 topology 896 1182
-> 15 0 23 870 topology 942 1183
+> 15 0 23 870 topology 875 1182
+> 16 0 23 870 topology 950 1182
+> 15 0 23 870 topology 879 1183
 > 16 0 23 870 topology 950 1183
-> 15 0 24 870 topology 898 1184
-> 16 0 24 870 topology 900 1184
-> 15 0 23 870 topology 918 1185
+> 15 0 23 870 topology 878 1184
+> 16 0 23 870 topology 950 1184
+> 15 0 23 870 topology 882 1185
 > 16 0 23 870 topology 950 1185
-> 15 0 24 870 topology 928 1186
-> 16 0 24 870 topology 930 1186
-> 15 0 24 870 topology 877 1187
-> 16 0 24 870 topology 879 1187
-> 15 0 24 870 topology 904 1188
-> 16 0 24 870 topology 906 1188
-> 15 0 24 870 topology 934 1189
-> 16 0 24 870 topology 936 1189
-> 15 0 24 870 topology 910 1190
-> 16 0 24 870 topology 912 1190
-> 15 0 23 870 topology 873 1191
+> 15 0 23 870 topology 881 1186
+> 16 0 23 870 topology 950 1186
+> 15 0 23 870 topology 885 1187
+> 16 0 23 870 topology 950 1187
+> 15 0 23 870 topology 884 1188
+> 16 0 23 870 topology 950 1188
+> 15 0 23 870 topology 888 1189
+> 16 0 23 870 topology 950 1189
+> 15 0 23 870 topology 887 1190
+> 16 0 23 870 topology 950 1190
+> 15 0 23 870 topology 891 1191
 > 16 0 23 870 topology 950 1191
-> 15 0 23 870 topology 908 1192
+> 15 0 23 870 topology 890 1192
 > 16 0 23 870 topology 950 1192
-> 15 0 24 870 topology 940 1193
-> 16 0 24 870 topology 942 1193
-> 15 0 23 870 topology 938 1194
+> 15 0 23 870 topology 894 1193
+> 16 0 23 870 topology 950 1193
+> 15 0 23 870 topology 893 1194
 > 16 0 23 870 topology 950 1194
-> 15 0 24 870 topology 889 1195
-> 16 0 24 870 topology 891 1195
-> 15 0 24 870 topology 916 1196
-> 16 0 24 870 topology 918 1196
-> 15 0 23 870 topology 885 1197
-> 16 0 23 870 topology 950 1197
-> 15 0 23 870 topology 920 1198
-> 16 0 23 870 topology 950 1198
-> 15 0 24 870 topology 946 1199
-> 16 0 24 870 topology 948 1199
-> 15 0 24 870 topology 928 1200
-> 16 0 24 870 topology 929 1200
-> 15 0 24 870 topology 922 1201
-> 16 0 24 870 topology 924 1201
-> 15 0 24 870 topology 931 1202
-> 16 0 24 870 topology 932 1202
-> 15 0 23 870 topology 897 1203
-> 16 0 23 870 topology 950 1203
-> 15 0 24 870 topology 880 1204
-> 16 0 24 870 topology 881 1204
-> 15 0 24 870 topology 934 1205
-> 16 0 24 870 topology 935 1205
-> 15 0 24 870 topology 937 1206
-> 16 0 24 870 topology 938 1206
-> 15 0 24 870 topology 940 1207
-> 16 0 24 870 topology 941 1207
-> 15 0 23 870 topology 875 1208
-> 16 0 23 870 topology 950 1208
-> 15 0 24 870 topology 943 1209
-> 16 0 24 870 topology 944 1209
-> 15 0 24 870 topology 892 1210
-> 16 0 24 870 topology 893 1210
-> 15 0 24 870 topology 946 1211
-> 16 0 24 870 topology 947 1211
-> 15 0 23 870 topology 887 1212
-> 16 0 23 870 topology 950 1212
-> 15 0 23 870 topology 933 1213
-> 16 0 23 870 topology 950 1213
-> 15 0 23 870 topology 909 1214
-> 16 0 23 870 topology 950 1214
-> 15 0 23 870 topology 945 1215
-> 16 0 23 870 topology 950 1215
-> 15 0 23 870 topology 921 1216
-> 16 0 23 870 topology 950 1216
-> 15 0 24 870 topology 880 1217
-> 16 0 24 870 topology 882 1217
-> 15 0 23 870 topology 905 1218
-> 16 0 23 870 topology 950 1218
-> 15 0 23 870 topology 935 1219
-> 16 0 23 870 topology 950 1219
-> 15 0 23 870 topology 876 1220
-> 16 0 23 870 topology 950 1220
-> 15 0 23 870 topology 917 1221
-> 16 0 23 870 topology 950 1221
-> 15 0 24 870 topology 892 1222
-> 16 0 24 870 topology 894 1222
-> 15 0 23 870 topology 947 1223
-> 16 0 23 870 topology 950 1223
-> 15 0 23 870 topology 888 1224
-> 16 0 23 870 topology 950 1224
-> 15 0 24 870 topology 877 1225
-> 16 0 24 870 topology 878 1225
-> 15 0 23 870 topology 872 1226
-> 16 0 23 870 topology 950 1226
-> 15 0 24 870 topology 889 1227
-> 16 0 24 870 topology 890 1227
-> 15 0 23 870 topology 900 1228
-> 16 0 23 870 topology 950 1228
-> 15 0 23 870 topology 884 1229
-> 16 0 23 870 topology 950 1229
-> 15 0 23 870 topology 936 1230
-> 16 0 23 870 topology 950 1230
-> 15 0 23 870 topology 912 1231
-> 16 0 23 870 topology 950 1231
-> 15 0 23 870 topology 896 1232
-> 16 0 23 870 topology 950 1232
-> 15 0 24 870 topology 871 1233
-> 16 0 24 870 topology 873 1233
-> 15 0 23 870 topology 948 1234
-> 16 0 23 870 topology 950 1234
-> 15 0 24 870 topology 901 1235
-> 16 0 24 870 topology 903 1235
-> 15 0 23 870 topology 924 1236
-> 16 0 23 870 topology 950 1236
-> 15 0 24 870 topology 931 1237
-> 16 0 24 870 topology 933 1237
-> 15 0 24 870 topology 907 1238
-> 16 0 24 870 topology 909 1238
-> 15 0 24 870 topology 883 1239
-> 16 0 24 870 topology 885 1239
-> 15 0 23 870 topology 902 1240
-> 16 0 23 870 topology 950 1240
-> 15 0 24 870 topology 937 1241
-> 16 0 24 870 topology 939 1241
-> 15 0 23 870 topology 932 1242
-> 16 0 23 870 topology 950 1242
-> 15 0 24 870 topology 913 1243
-> 16 0 24 870 topology 915 1243
-> 15 0 23 870 topology 879 1244
-> 16 0 23 870 topology 950 1244
-> 15 0 23 870 topology 914 1245
-> 16 0 23 870 topology 950 1245
-> 15 0 24 870 topology 943 1246
-> 16 0 24 870 topology 945 1246
-> 15 0 24 870 topology 898 1247
-> 16 0 24 870 topology 899 1247
-> 15 0 23 870 topology 944 1248
-> 16 0 23 870 topology 950 1248
-> 15 0 24 870 topology 919 1249
-> 16 0 24 870 topology 921 1249
-> 15 0 23 952 topology 1000 1250
+> 15 0 23 870 topology 897 1195
+> 16 0 23 870 topology 950 1195
+> 15 0 23 870 topology 896 1196
+> 16 0 23 870 topology 950 1196
+> 15 0 24 870 topology 949 1197
+> 16 0 24 870 topology 950 1197
+> 15 0 25 870 topology 898 1198
+> 16 0 25 870 topology 900 1198
+> 15 0 25 870 topology 898 1199
+> 16 0 25 870 topology 899 1199
+> 15 0 25 870 topology 901 1200
+> 16 0 25 870 topology 903 1200
+> 15 0 25 870 topology 901 1201
+> 16 0 25 870 topology 902 1201
+> 15 0 25 870 topology 904 1202
+> 16 0 25 870 topology 906 1202
+> 15 0 25 870 topology 904 1203
+> 16 0 25 870 topology 905 1203
+> 15 0 25 870 topology 907 1204
+> 16 0 25 870 topology 909 1204
+> 15 0 25 870 topology 907 1205
+> 16 0 25 870 topology 908 1205
+> 15 0 25 870 topology 910 1206
+> 16 0 25 870 topology 912 1206
+> 15 0 25 870 topology 910 1207
+> 16 0 25 870 topology 911 1207
+> 15 0 25 870 topology 913 1208
+> 16 0 25 870 topology 915 1208
+> 15 0 25 870 topology 913 1209
+> 16 0 25 870 topology 914 1209
+> 15 0 25 870 topology 916 1210
+> 16 0 25 870 topology 918 1210
+> 15 0 25 870 topology 916 1211
+> 16 0 25 870 topology 917 1211
+> 15 0 25 870 topology 919 1212
+> 16 0 25 870 topology 921 1212
+> 15 0 25 870 topology 919 1213
+> 16 0 25 870 topology 920 1213
+> 15 0 25 870 topology 922 1214
+> 16 0 25 870 topology 924 1214
+> 15 0 25 870 topology 922 1215
+> 16 0 25 870 topology 923 1215
+> 15 0 25 870 topology 925 1216
+> 16 0 25 870 topology 927 1216
+> 15 0 25 870 topology 925 1217
+> 16 0 25 870 topology 926 1217
+> 15 0 25 870 topology 871 1218
+> 16 0 25 870 topology 873 1218
+> 15 0 25 870 topology 871 1219
+> 16 0 25 870 topology 872 1219
+> 15 0 25 870 topology 928 1220
+> 16 0 25 870 topology 930 1220
+> 15 0 25 870 topology 928 1221
+> 16 0 25 870 topology 929 1221
+> 15 0 25 870 topology 931 1222
+> 16 0 25 870 topology 933 1222
+> 15 0 25 870 topology 931 1223
+> 16 0 25 870 topology 932 1223
+> 15 0 25 870 topology 934 1224
+> 16 0 25 870 topology 936 1224
+> 15 0 25 870 topology 934 1225
+> 16 0 25 870 topology 935 1225
+> 15 0 25 870 topology 937 1226
+> 16 0 25 870 topology 939 1226
+> 15 0 25 870 topology 937 1227
+> 16 0 25 870 topology 938 1227
+> 15 0 25 870 topology 940 1228
+> 16 0 25 870 topology 942 1228
+> 15 0 25 870 topology 940 1229
+> 16 0 25 870 topology 941 1229
+> 15 0 25 870 topology 943 1230
+> 16 0 25 870 topology 945 1230
+> 15 0 25 870 topology 943 1231
+> 16 0 25 870 topology 944 1231
+> 15 0 25 870 topology 946 1232
+> 16 0 25 870 topology 948 1232
+> 15 0 25 870 topology 946 1233
+> 16 0 25 870 topology 947 1233
+> 15 0 25 870 topology 874 1234
+> 16 0 25 870 topology 876 1234
+> 15 0 25 870 topology 874 1235
+> 16 0 25 870 topology 875 1235
+> 15 0 25 870 topology 877 1236
+> 16 0 25 870 topology 879 1236
+> 15 0 25 870 topology 877 1237
+> 16 0 25 870 topology 878 1237
+> 15 0 25 870 topology 880 1238
+> 16 0 25 870 topology 882 1238
+> 15 0 25 870 topology 880 1239
+> 16 0 25 870 topology 881 1239
+> 15 0 25 870 topology 883 1240
+> 16 0 25 870 topology 885 1240
+> 15 0 25 870 topology 883 1241
+> 16 0 25 870 topology 884 1241
+> 15 0 25 870 topology 886 1242
+> 16 0 25 870 topology 888 1242
+> 15 0 25 870 topology 886 1243
+> 16 0 25 870 topology 887 1243
+> 15 0 25 870 topology 889 1244
+> 16 0 25 870 topology 891 1244
+> 15 0 25 870 topology 889 1245
+> 16 0 25 870 topology 890 1245
+> 15 0 25 870 topology 892 1246
+> 16 0 25 870 topology 894 1246
+> 15 0 25 870 topology 892 1247
+> 16 0 25 870 topology 893 1247
+> 15 0 25 870 topology 895 1248
+> 16 0 25 870 topology 897 1248
+> 15 0 25 870 topology 895 1249
+> 16 0 25 870 topology 896 1249
+> 15 0 23 952 topology 982 1250
 > 16 0 23 952 topology 1014 1250
-> 15 0 24 952 topology 983 1251
-> 16 0 24 952 topology 985 1251
-> 15 0 23 952 topology 955 1252
+> 15 0 23 952 topology 981 1251
+> 16 0 23 952 topology 1014 1251
+> 15 0 23 952 topology 985 1252
 > 16 0 23 952 topology 1014 1252
-> 15 0 23 952 topology 990 1253
+> 15 0 23 952 topology 984 1253
 > 16 0 23 952 topology 1014 1253
-> 15 0 24 952 topology 995 1254
-> 16 0 24 952 topology 997 1254
-> 15 0 24 952 topology 980 1255
-> 16 0 24 952 topology 981 1255
-> 15 0 23 952 topology 967 1256
+> 15 0 23 952 topology 988 1254
+> 16 0 23 952 topology 1014 1254
+> 15 0 23 952 topology 987 1255
+> 16 0 23 952 topology 1014 1255
+> 15 0 23 952 topology 991 1256
 > 16 0 23 952 topology 1014 1256
-> 15 0 23 952 topology 1002 1257
+> 15 0 23 952 topology 990 1257
 > 16 0 23 952 topology 1014 1257
-> 15 0 23 952 topology 979 1258
+> 15 0 23 952 topology 994 1258
 > 16 0 23 952 topology 1014 1258
-> 15 0 24 952 topology 1007 1259
-> 16 0 24 952 topology 1009 1259
-> 15 0 24 952 topology 992 1260
-> 16 0 24 952 topology 993 1260
-> 15 0 23 952 topology 957 1261
+> 15 0 23 952 topology 993 1259
+> 16 0 23 952 topology 1014 1259
+> 15 0 23 952 topology 997 1260
+> 16 0 23 952 topology 1014 1260
+> 15 0 23 952 topology 996 1261
 > 16 0 23 952 topology 1014 1261
-> 15 0 23 952 topology 969 1262
+> 15 0 23 952 topology 1000 1262
 > 16 0 23 952 topology 1014 1262
-> 15 0 23 952 topology 991 1263
+> 15 0 23 952 topology 999 1263
 > 16 0 23 952 topology 1014 1263
-> 15 0 24 952 topology 1004 1264
-> 16 0 24 952 topology 1005 1264
-> 15 0 24 952 topology 980 1265
-> 16 0 24 952 topology 982 1265
-> 15 0 23 952 topology 1003 1266
+> 15 0 23 952 topology 1003 1264
+> 16 0 23 952 topology 1014 1264
+> 15 0 23 952 topology 1002 1265
+> 16 0 23 952 topology 1014 1265
+> 15 0 23 952 topology 1006 1266
 > 16 0 23 952 topology 1014 1266
-> 15 0 24 952 topology 956 1267
-> 16 0 24 952 topology 958 1267
-> 15 0 24 952 topology 962 1268
-> 16 0 24 952 topology 964 1268
-> 15 0 24 952 topology 992 1269
-> 16 0 24 952 topology 994 1269
-> 15 0 23 952 topology 987 1270
+> 15 0 23 952 topology 1005 1267
+> 16 0 23 952 topology 1014 1267
+> 15 0 23 952 topology 1009 1268
+> 16 0 23 952 topology 1014 1268
+> 15 0 23 952 topology 1008 1269
+> 16 0 23 952 topology 1014 1269
+> 15 0 23 952 topology 955 1270
 > 16 0 23 952 topology 1014 1270
-> 15 0 24 952 topology 968 1271
-> 16 0 24 952 topology 970 1271
-> 15 0 23 952 topology 958 1272
+> 15 0 23 952 topology 954 1271
+> 16 0 23 952 topology 1014 1271
+> 15 0 23 952 topology 1012 1272
 > 16 0 23 952 topology 1014 1272
-> 15 0 24 952 topology 953 1273
-> 16 0 24 952 topology 954 1273
-> 15 0 23 952 topology 999 1274
+> 15 0 23 952 topology 1011 1273
+> 16 0 23 952 topology 1014 1273
+> 15 0 23 952 topology 958 1274
 > 16 0 23 952 topology 1014 1274
-> 15 0 25 952 topology 1013 1275
-> 16 0 25 952 topology 1014 1275
-> 15 0 24 952 topology 974 1276
-> 16 0 24 952 topology 976 1276
-> 15 0 24 952 topology 956 1277
-> 16 0 24 952 topology 957 1277
-> 15 0 23 952 topology 970 1278
+> 15 0 23 952 topology 957 1275
+> 16 0 23 952 topology 1014 1275
+> 15 0 23 952 topology 961 1276
+> 16 0 23 952 topology 1014 1276
+> 15 0 23 952 topology 960 1277
+> 16 0 23 952 topology 1014 1277
+> 15 0 23 952 topology 964 1278
 > 16 0 23 952 topology 1014 1278
-> 15 0 24 952 topology 983 1279
-> 16 0 24 952 topology 984 1279
-> 15 0 24 952 topology 1004 1280
-> 16 0 24 952 topology 1006 1280
-> 15 0 24 952 topology 959 1281
-> 16 0 24 952 topology 960 1281
-> 15 0 24 952 topology 962 1282
-> 16 0 24 952 topology 963 1282
-> 15 0 24 952 topology 965 1283
-> 16 0 24 952 topology 966 1283
-> 15 0 23 952 topology 954 1284
+> 15 0 23 952 topology 963 1279
+> 16 0 23 952 topology 1014 1279
+> 15 0 23 952 topology 967 1280
+> 16 0 23 952 topology 1014 1280
+> 15 0 23 952 topology 966 1281
+> 16 0 23 952 topology 1014 1281
+> 15 0 23 952 topology 970 1282
+> 16 0 23 952 topology 1014 1282
+> 15 0 23 952 topology 969 1283
+> 16 0 23 952 topology 1014 1283
+> 15 0 23 952 topology 973 1284
 > 16 0 23 952 topology 1014 1284
-> 15 0 24 952 topology 968 1285
-> 16 0 24 952 topology 969 1285
-> 15 0 24 952 topology 995 1286
-> 16 0 24 952 topology 996 1286
-> 15 0 24 952 topology 971 1287
-> 16 0 24 952 topology 972 1287
-> 15 0 23 952 topology 982 1288
+> 15 0 23 952 topology 972 1285
+> 16 0 23 952 topology 1014 1285
+> 15 0 23 952 topology 976 1286
+> 16 0 23 952 topology 1014 1286
+> 15 0 23 952 topology 975 1287
+> 16 0 23 952 topology 1014 1287
+> 15 0 23 952 topology 979 1288
 > 16 0 23 952 topology 1014 1288
-> 15 0 23 952 topology 966 1289
+> 15 0 23 952 topology 978 1289
 > 16 0 23 952 topology 1014 1289
-> 15 0 24 952 topology 974 1290
-> 16 0 24 952 topology 975 1290
-> 15 0 24 952 topology 977 1291
-> 16 0 24 952 topology 978 1291
-> 15 0 23 952 topology 994 1292
-> 16 0 23 952 topology 1014 1292
-> 15 0 23 952 topology 978 1293
-> 16 0 23 952 topology 1014 1293
-> 15 0 24 952 topology 1007 1294
-> 16 0 24 952 topology 1008 1294
-> 15 0 23 952 topology 1006 1295
-> 16 0 23 952 topology 1014 1295
-> 15 0 24 952 topology 1010 1296
-> 16 0 24 952 topology 1012 1296
-> 15 0 24 952 topology 989 1297
-> 16 0 24 952 topology 991 1297
-> 15 0 23 952 topology 984 1298
-> 16 0 23 952 topology 1014 1298
-> 15 0 23 952 topology 961 1299
-> 16 0 23 952 topology 1014 1299
-> 15 0 23 952 topology 996 1300
-> 16 0 23 952 topology 1014 1300
-> 15 0 24 952 topology 1001 1301
-> 16 0 24 952 topology 1003 1301
-> 15 0 23 952 topology 973 1302
-> 16 0 23 952 topology 1014 1302
-> 15 0 23 952 topology 1008 1303
-> 16 0 23 952 topology 1014 1303
-> 15 0 24 952 topology 986 1304
-> 16 0 24 952 topology 987 1304
-> 15 0 24 952 topology 998 1305
-> 16 0 24 952 topology 999 1305
-> 15 0 23 952 topology 963 1306
-> 16 0 23 952 topology 1014 1306
-> 15 0 23 952 topology 985 1307
-> 16 0 23 952 topology 1014 1307
-> 15 0 23 952 topology 975 1308
-> 16 0 23 952 topology 1014 1308
-> 15 0 23 952 topology 997 1309
-> 16 0 23 952 topology 1014 1309
-> 15 0 24 952 topology 953 1310
-> 16 0 24 952 topology 955 1310
-> 15 0 23 952 topology 1009 1311
-> 16 0 23 952 topology 1014 1311
-> 15 0 24 952 topology 959 1312
-> 16 0 24 952 topology 961 1312
-> 15 0 24 952 topology 986 1313
-> 16 0 24 952 topology 988 1313
-> 15 0 23 952 topology 981 1314
-> 16 0 23 952 topology 1014 1314
-> 15 0 24 952 topology 965 1315
-> 16 0 24 952 topology 967 1315
-> 15 0 23 952 topology 1011 1316
-> 16 0 23 952 topology 1014 1316
-> 15 0 23 952 topology 993 1317
-> 16 0 23 952 topology 1014 1317
-> 15 0 24 952 topology 971 1318
-> 16 0 24 952 topology 973 1318
-> 15 0 24 952 topology 998 1319
-> 16 0 24 952 topology 1000 1319
-> 15 0 23 952 topology 964 1320
-> 16 0 23 952 topology 1014 1320
-> 15 0 23 952 topology 1005 1321
-> 16 0 23 952 topology 1014 1321
-> 15 0 24 952 topology 1010 1322
-> 16 0 24 952 topology 1011 1322
-> 15 0 24 952 topology 977 1323
-> 16 0 24 952 topology 979 1323
-> 15 0 23 952 topology 976 1324
-> 16 0 23 952 topology 1014 1324
-> 15 0 24 952 topology 989 1325
-> 16 0 24 952 topology 990 1325
-> 15 0 23 952 topology 960 1326
-> 16 0 23 952 topology 1014 1326
-> 15 0 24 952 topology 1001 1327
-> 16 0 24 952 topology 1002 1327
-> 15 0 23 952 topology 1012 1328
-> 16 0 23 952 topology 1014 1328
-> 15 0 23 952 topology 988 1329
-> 16 0 23 952 topology 1014 1329
-> 15 0 23 952 topology 972 1330
-> 16 0 23 952 topology 1014 1330
-> 15 0 23 1016 topology 1133 1331
+> 15 0 24 952 topology 1013 1290
+> 16 0 24 952 topology 1014 1290
+> 15 0 25 952 topology 980 1291
+> 16 0 25 952 topology 982 1291
+> 15 0 25 952 topology 980 1292
+> 16 0 25 952 topology 981 1292
+> 15 0 25 952 topology 983 1293
+> 16 0 25 952 topology 985 1293
+> 15 0 25 952 topology 983 1294
+> 16 0 25 952 topology 984 1294
+> 15 0 25 952 topology 986 1295
+> 16 0 25 952 topology 988 1295
+> 15 0 25 952 topology 986 1296
+> 16 0 25 952 topology 987 1296
+> 15 0 25 952 topology 989 1297
+> 16 0 25 952 topology 991 1297
+> 15 0 25 952 topology 989 1298
+> 16 0 25 952 topology 990 1298
+> 15 0 25 952 topology 992 1299
+> 16 0 25 952 topology 994 1299
+> 15 0 25 952 topology 992 1300
+> 16 0 25 952 topology 993 1300
+> 15 0 25 952 topology 995 1301
+> 16 0 25 952 topology 997 1301
+> 15 0 25 952 topology 995 1302
+> 16 0 25 952 topology 996 1302
+> 15 0 25 952 topology 998 1303
+> 16 0 25 952 topology 1000 1303
+> 15 0 25 952 topology 998 1304
+> 16 0 25 952 topology 999 1304
+> 15 0 25 952 topology 1001 1305
+> 16 0 25 952 topology 1003 1305
+> 15 0 25 952 topology 1001 1306
+> 16 0 25 952 topology 1002 1306
+> 15 0 25 952 topology 1004 1307
+> 16 0 25 952 topology 1006 1307
+> 15 0 25 952 topology 1004 1308
+> 16 0 25 952 topology 1005 1308
+> 15 0 25 952 topology 1007 1309
+> 16 0 25 952 topology 1009 1309
+> 15 0 25 952 topology 1007 1310
+> 16 0 25 952 topology 1008 1310
+> 15 0 25 952 topology 953 1311
+> 16 0 25 952 topology 955 1311
+> 15 0 25 952 topology 953 1312
+> 16 0 25 952 topology 954 1312
+> 15 0 25 952 topology 1010 1313
+> 16 0 25 952 topology 1012 1313
+> 15 0 25 952 topology 1010 1314
+> 16 0 25 952 topology 1011 1314
+> 15 0 25 952 topology 956 1315
+> 16 0 25 952 topology 958 1315
+> 15 0 25 952 topology 956 1316
+> 16 0 25 952 topology 957 1316
+> 15 0 25 952 topology 959 1317
+> 16 0 25 952 topology 961 1317
+> 15 0 25 952 topology 959 1318
+> 16 0 25 952 topology 960 1318
+> 15 0 25 952 topology 962 1319
+> 16 0 25 952 topology 964 1319
+> 15 0 25 952 topology 962 1320
+> 16 0 25 952 topology 963 1320
+> 15 0 25 952 topology 965 1321
+> 16 0 25 952 topology 967 1321
+> 15 0 25 952 topology 965 1322
+> 16 0 25 952 topology 966 1322
+> 15 0 25 952 topology 968 1323
+> 16 0 25 952 topology 970 1323
+> 15 0 25 952 topology 968 1324
+> 16 0 25 952 topology 969 1324
+> 15 0 25 952 topology 971 1325
+> 16 0 25 952 topology 973 1325
+> 15 0 25 952 topology 971 1326
+> 16 0 25 952 topology 972 1326
+> 15 0 25 952 topology 974 1327
+> 16 0 25 952 topology 976 1327
+> 15 0 25 952 topology 974 1328
+> 16 0 25 952 topology 975 1328
+> 15 0 25 952 topology 977 1329
+> 16 0 25 952 topology 979 1329
+> 15 0 25 952 topology 977 1330
+> 16 0 25 952 topology 978 1330
+> 15 0 23 1016 topology 1046 1331
 > 16 0 23 1016 topology 1156 1331
-> 15 0 24 1016 topology 1026 1332
-> 16 0 24 1016 topology 1028 1332
-> 15 0 24 1016 topology 1053 1333
-> 16 0 24 1016 topology 1055 1333
-> 15 0 24 1016 topology 1107 1334
-> 16 0 24 1016 topology 1109 1334
-> 15 0 23 1016 topology 1045 1335
+> 15 0 23 1016 topology 1045 1332
+> 16 0 23 1016 topology 1156 1332
+> 15 0 23 1016 topology 1049 1333
+> 16 0 23 1016 topology 1156 1333
+> 15 0 23 1016 topology 1048 1334
+> 16 0 23 1016 topology 1156 1334
+> 15 0 23 1016 topology 1052 1335
 > 16 0 23 1016 topology 1156 1335
-> 15 0 23 1016 topology 1075 1336
+> 15 0 23 1016 topology 1051 1336
 > 16 0 23 1016 topology 1156 1336
-> 15 0 24 1016 topology 1083 1337
-> 16 0 24 1016 topology 1085 1337
-> 15 0 24 1016 topology 1137 1338
-> 16 0 24 1016 topology 1139 1338
-> 15 0 23 1016 topology 1105 1339
+> 15 0 23 1016 topology 1055 1337
+> 16 0 23 1016 topology 1156 1337
+> 15 0 23 1016 topology 1054 1338
+> 16 0 23 1016 topology 1156 1338
+> 15 0 23 1016 topology 1058 1339
 > 16 0 23 1016 topology 1156 1339
-> 15 0 24 1016 topology 1059 1340
-> 16 0 24 1016 topology 1061 1340
-> 15 0 24 1016 topology 1113 1341
-> 16 0 24 1016 topology 1115 1341
-> 15 0 23 1016 topology 1135 1342
+> 15 0 23 1016 topology 1057 1340
+> 16 0 23 1016 topology 1156 1340
+> 15 0 23 1016 topology 1061 1341
+> 16 0 23 1016 topology 1156 1341
+> 15 0 23 1016 topology 1060 1342
 > 16 0 23 1016 topology 1156 1342
-> 15 0 23 1016 topology 1022 1343
+> 15 0 23 1016 topology 1064 1343
 > 16 0 23 1016 topology 1156 1343
-> 15 0 23 1016 topology 1057 1344
+> 15 0 23 1016 topology 1063 1344
 > 16 0 23 1016 topology 1156 1344
-> 15 0 23 1016 topology 1087 1345
+> 15 0 23 1016 topology 1067 1345
 > 16 0 23 1016 topology 1156 1345
-> 15 0 24 1016 topology 1089 1346
-> 16 0 24 1016 topology 1091 1346
-> 15 0 24 1016 topology 1143 1347
-> 16 0 24 1016 topology 1145 1347
-> 15 0 24 1016 topology 1017 1348
-> 16 0 24 1016 topology 1018 1348
-> 15 0 23 1016 topology 1117 1349
+> 15 0 23 1016 topology 1066 1346
+> 16 0 23 1016 topology 1156 1346
+> 15 0 23 1016 topology 1070 1347
+> 16 0 23 1016 topology 1156 1347
+> 15 0 23 1016 topology 1069 1348
+> 16 0 23 1016 topology 1156 1348
+> 15 0 23 1016 topology 1073 1349
 > 16 0 23 1016 topology 1156 1349
-> 15 0 24 1016 topology 1038 1350
-> 16 0 24 1016 topology 1040 1350
-> 15 0 24 1016 topology 1065 1351
-> 16 0 24 1016 topology 1067 1351
-> 15 0 24 1016 topology 1119 1352
-> 16 0 24 1016 topology 1121 1352
-> 15 0 23 1016 topology 1147 1353
+> 15 0 23 1016 topology 1072 1350
+> 16 0 23 1016 topology 1156 1350
+> 15 0 23 1016 topology 1019 1351
+> 16 0 23 1016 topology 1156 1351
+> 15 0 23 1016 topology 1018 1352
+> 16 0 23 1016 topology 1156 1352
+> 15 0 23 1016 topology 1076 1353
 > 16 0 23 1016 topology 1156 1353
-> 15 0 23 1016 topology 1034 1354
+> 15 0 23 1016 topology 1075 1354
 > 16 0 23 1016 topology 1156 1354
-> 15 0 23 1016 topology 1069 1355
+> 15 0 23 1016 topology 1079 1355
 > 16 0 23 1016 topology 1156 1355
-> 15 0 24 1016 topology 1074 1356
-> 16 0 24 1016 topology 1075 1356
-> 15 0 24 1016 topology 1095 1357
-> 16 0 24 1016 topology 1097 1357
-> 15 0 23 1016 topology 1099 1358
+> 15 0 23 1016 topology 1078 1356
+> 16 0 23 1016 topology 1156 1356
+> 15 0 23 1016 topology 1082 1357
+> 16 0 23 1016 topology 1156 1357
+> 15 0 23 1016 topology 1081 1358
 > 16 0 23 1016 topology 1156 1358
-> 15 0 24 1016 topology 1149 1359
-> 16 0 24 1016 topology 1151 1359
-> 15 0 24 1016 topology 1077 1360
-> 16 0 24 1016 topology 1078 1360
-> 15 0 23 1016 topology 1129 1361
+> 15 0 23 1016 topology 1085 1359
+> 16 0 23 1016 topology 1156 1359
+> 15 0 23 1016 topology 1084 1360
+> 16 0 23 1016 topology 1156 1360
+> 15 0 23 1016 topology 1088 1361
 > 16 0 23 1016 topology 1156 1361
-> 15 0 24 1016 topology 1071 1362
-> 16 0 24 1016 topology 1073 1362
-> 15 0 24 1016 topology 1125 1363
-> 16 0 24 1016 topology 1127 1363
-> 15 0 24 1016 topology 1080 1364
-> 16 0 24 1016 topology 1081 1364
-> 15 0 24 1016 topology 1134 1365
-> 16 0 24 1016 topology 1135 1365
-> 15 0 24 1016 topology 1101 1366
-> 16 0 24 1016 topology 1103 1366
-> 15 0 24 1016 topology 1029 1367
-> 16 0 24 1016 topology 1030 1367
-> 15 0 24 1016 topology 1083 1368
-> 16 0 24 1016 topology 1084 1368
-> 15 0 24 1016 topology 1137 1369
-> 16 0 24 1016 topology 1138 1369
-> 15 0 24 1016 topology 1131 1370
-> 16 0 24 1016 topology 1133 1370
-> 15 0 23 1016 topology 1018 1371
+> 15 0 23 1016 topology 1087 1362
+> 16 0 23 1016 topology 1156 1362
+> 15 0 23 1016 topology 1091 1363
+> 16 0 23 1016 topology 1156 1363
+> 15 0 23 1016 topology 1090 1364
+> 16 0 23 1016 topology 1156 1364
+> 15 0 23 1016 topology 1094 1365
+> 16 0 23 1016 topology 1156 1365
+> 15 0 23 1016 topology 1093 1366
+> 16 0 23 1016 topology 1156 1366
+> 15 0 23 1016 topology 1097 1367
+> 16 0 23 1016 topology 1156 1367
+> 15 0 23 1016 topology 1096 1368
+> 16 0 23 1016 topology 1156 1368
+> 15 0 23 1016 topology 1100 1369
+> 16 0 23 1016 topology 1156 1369
+> 15 0 23 1016 topology 1099 1370
+> 16 0 23 1016 topology 1156 1370
+> 15 0 23 1016 topology 1103 1371
 > 16 0 23 1016 topology 1156 1371
-> 15 0 24 1016 topology 1086 1372
-> 16 0 24 1016 topology 1087 1372
-> 15 0 24 1016 topology 1140 1373
-> 16 0 24 1016 topology 1141 1373
-> 15 0 24 1016 topology 1089 1374
-> 16 0 24 1016 topology 1090 1374
-> 15 0 24 1016 topology 1143 1375
-> 16 0 24 1016 topology 1144 1375
-> 15 0 23 1016 topology 1030 1376
+> 15 0 23 1016 topology 1102 1372
+> 16 0 23 1016 topology 1156 1372
+> 15 0 23 1016 topology 1022 1373
+> 16 0 23 1016 topology 1156 1373
+> 15 0 23 1016 topology 1021 1374
+> 16 0 23 1016 topology 1156 1374
+> 15 0 23 1016 topology 1106 1375
+> 16 0 23 1016 topology 1156 1375
+> 15 0 23 1016 topology 1105 1376
 > 16 0 23 1016 topology 1156 1376
-> 15 0 23 1016 topology 1076 1377
+> 15 0 23 1016 topology 1109 1377
 > 16 0 23 1016 topology 1156 1377
-> 15 0 24 1016 topology 1092 1378
-> 16 0 24 1016 topology 1093 1378
-> 15 0 24 1016 topology 1146 1379
-> 16 0 24 1016 topology 1147 1379
-> 15 0 23 1016 topology 1052 1380
+> 15 0 23 1016 topology 1108 1378
+> 16 0 23 1016 topology 1156 1378
+> 15 0 23 1016 topology 1112 1379
+> 16 0 23 1016 topology 1156 1379
+> 15 0 23 1016 topology 1111 1380
 > 16 0 23 1016 topology 1156 1380
-> 15 0 24 1016 topology 1041 1381
-> 16 0 24 1016 topology 1042 1381
-> 15 0 24 1016 topology 1095 1382
-> 16 0 24 1016 topology 1096 1382
-> 15 0 23 1016 topology 1136 1383
+> 15 0 23 1016 topology 1115 1381
+> 16 0 23 1016 topology 1156 1381
+> 15 0 23 1016 topology 1114 1382
+> 16 0 23 1016 topology 1156 1382
+> 15 0 23 1016 topology 1118 1383
 > 16 0 23 1016 topology 1156 1383
-> 15 0 24 1016 topology 1149 1384
-> 16 0 24 1016 topology 1150 1384
-> 15 0 23 1016 topology 1112 1385
+> 15 0 23 1016 topology 1117 1384
+> 16 0 23 1016 topology 1156 1384
+> 15 0 23 1016 topology 1121 1385
 > 16 0 23 1016 topology 1156 1385
-> 15 0 23 1016 topology 1042 1386
+> 15 0 23 1016 topology 1120 1386
 > 16 0 23 1016 topology 1156 1386
-> 15 0 23 1016 topology 1088 1387
+> 15 0 23 1016 topology 1124 1387
 > 16 0 23 1016 topology 1156 1387
-> 15 0 24 1016 topology 1098 1388
-> 16 0 24 1016 topology 1099 1388
-> 15 0 24 1016 topology 1152 1389
-> 16 0 24 1016 topology 1153 1389
-> 15 0 24 1016 topology 1017 1390
-> 16 0 24 1016 topology 1019 1390
-> 15 0 23 1016 topology 1064 1391
+> 15 0 23 1016 topology 1123 1388
+> 16 0 23 1016 topology 1156 1388
+> 15 0 23 1016 topology 1127 1389
+> 16 0 23 1016 topology 1156 1389
+> 15 0 23 1016 topology 1126 1390
+> 16 0 23 1016 topology 1156 1390
+> 15 0 23 1016 topology 1130 1391
 > 16 0 23 1016 topology 1156 1391
-> 15 0 24 1016 topology 1101 1392
-> 16 0 24 1016 topology 1102 1392
-> 15 0 23 1016 topology 1148 1393
+> 15 0 23 1016 topology 1129 1392
+> 16 0 23 1016 topology 1156 1392
+> 15 0 23 1016 topology 1133 1393
 > 16 0 23 1016 topology 1156 1393
-> 15 0 23 1016 topology 1124 1394
+> 15 0 23 1016 topology 1132 1394
 > 16 0 23 1016 topology 1156 1394
-> 15 0 23 1016 topology 1100 1395
+> 15 0 23 1016 topology 1025 1395
 > 16 0 23 1016 topology 1156 1395
-> 15 0 24 1016 topology 1029 1396
-> 16 0 24 1016 topology 1031 1396
-> 15 0 23 1016 topology 1054 1397
+> 15 0 23 1016 topology 1024 1396
+> 16 0 23 1016 topology 1156 1396
+> 15 0 23 1016 topology 1136 1397
 > 16 0 23 1016 topology 1156 1397
-> 15 0 23 1016 topology 1084 1398
+> 15 0 23 1016 topology 1135 1398
 > 16 0 23 1016 topology 1156 1398
-> 15 0 23 1016 topology 1025 1399
+> 15 0 23 1016 topology 1139 1399
 > 16 0 23 1016 topology 1156 1399
-> 15 0 23 1016 topology 1114 1400
+> 15 0 23 1016 topology 1138 1400
 > 16 0 23 1016 topology 1156 1400
-> 15 0 23 1016 topology 1144 1401
+> 15 0 23 1016 topology 1142 1401
 > 16 0 23 1016 topology 1156 1401
-> 15 0 23 1016 topology 1066 1402
+> 15 0 23 1016 topology 1141 1402
 > 16 0 23 1016 topology 1156 1402
-> 15 0 23 1016 topology 1096 1403
+> 15 0 23 1016 topology 1145 1403
 > 16 0 23 1016 topology 1156 1403
-> 15 0 23 1016 topology 1037 1404
+> 15 0 23 1016 topology 1144 1404
 > 16 0 23 1016 topology 1156 1404
-> 15 0 24 1016 topology 1041 1405
-> 16 0 24 1016 topology 1043 1405
-> 15 0 23 1016 topology 1126 1406
+> 15 0 23 1016 topology 1148 1405
+> 16 0 23 1016 topology 1156 1405
+> 15 0 23 1016 topology 1147 1406
 > 16 0 23 1016 topology 1156 1406
-> 15 0 24 1016 topology 1026 1407
-> 16 0 24 1016 topology 1027 1407
-> 15 0 23 1016 topology 1027 1408
+> 15 0 23 1016 topology 1151 1407
+> 16 0 23 1016 topology 1156 1407
+> 15 0 23 1016 topology 1150 1408
 > 16 0 23 1016 topology 1156 1408
-> 15 0 24 1016 topology 1038 1409
-> 16 0 24 1016 topology 1039 1409
-> 15 0 23 1016 topology 1079 1410
+> 15 0 23 1016 topology 1154 1409
+> 16 0 23 1016 topology 1156 1409
+> 15 0 23 1016 topology 1153 1410
 > 16 0 23 1016 topology 1156 1410
-> 15 0 23 1016 topology 1055 1411
+> 15 0 23 1016 topology 1028 1411
 > 16 0 23 1016 topology 1156 1411
-> 15 0 23 1016 topology 1039 1412
+> 15 0 23 1016 topology 1027 1412
 > 16 0 23 1016 topology 1156 1412
-> 15 0 23 1016 topology 1139 1413
+> 15 0 23 1016 topology 1031 1413
 > 16 0 23 1016 topology 1156 1413
-> 15 0 23 1016 topology 1115 1414
+> 15 0 23 1016 topology 1030 1414
 > 16 0 23 1016 topology 1156 1414
-> 15 0 24 1016 topology 1044 1415
-> 16 0 24 1016 topology 1046 1415
-> 15 0 23 1016 topology 1091 1416
+> 15 0 23 1016 topology 1034 1415
+> 16 0 23 1016 topology 1156 1415
+> 15 0 23 1016 topology 1033 1416
 > 16 0 23 1016 topology 1156 1416
-> 15 0 23 1016 topology 1067 1417
+> 15 0 23 1016 topology 1037 1417
 > 16 0 23 1016 topology 1156 1417
-> 15 0 24 1016 topology 1020 1418
-> 16 0 24 1016 topology 1022 1418
-> 15 0 24 1016 topology 1074 1419
-> 16 0 24 1016 topology 1076 1419
-> 15 0 23 1016 topology 1151 1420
+> 15 0 23 1016 topology 1036 1418
+> 16 0 23 1016 topology 1156 1418
+> 15 0 23 1016 topology 1040 1419
+> 16 0 23 1016 topology 1156 1419
+> 15 0 23 1016 topology 1039 1420
 > 16 0 23 1016 topology 1156 1420
-> 15 0 23 1016 topology 1127 1421
+> 15 0 23 1016 topology 1043 1421
 > 16 0 23 1016 topology 1156 1421
-> 15 0 24 1016 topology 1050 1422
-> 16 0 24 1016 topology 1052 1422
-> 15 0 23 1016 topology 1103 1423
-> 16 0 23 1016 topology 1156 1423
-> 15 0 24 1016 topology 1104 1424
-> 16 0 24 1016 topology 1106 1424
-> 15 0 24 1016 topology 1080 1425
-> 16 0 24 1016 topology 1082 1425
-> 15 0 24 1016 topology 1134 1426
-> 16 0 24 1016 topology 1136 1426
-> 15 0 24 1016 topology 1056 1427
-> 16 0 24 1016 topology 1058 1427
-> 15 0 24 1016 topology 1110 1428
-> 16 0 24 1016 topology 1112 1428
-> 15 0 23 1016 topology 1051 1429
-> 16 0 23 1016 topology 1156 1429
-> 15 0 24 1016 topology 1032 1430
-> 16 0 24 1016 topology 1034 1430
-> 15 0 23 1016 topology 1081 1431
-> 16 0 23 1016 topology 1156 1431
-> 15 0 24 1016 topology 1086 1432
-> 16 0 24 1016 topology 1088 1432
-> 15 0 24 1016 topology 1140 1433
-> 16 0 24 1016 topology 1142 1433
-> 15 0 23 1016 topology 1111 1434
-> 16 0 23 1016 topology 1156 1434
-> 15 0 24 1016 topology 1062 1435
-> 16 0 24 1016 topology 1064 1435
-> 15 0 24 1016 topology 1116 1436
-> 16 0 24 1016 topology 1118 1436
-> 15 0 23 1016 topology 1141 1437
-> 16 0 23 1016 topology 1156 1437
-> 15 0 23 1016 topology 1028 1438
-> 16 0 23 1016 topology 1156 1438
-> 15 0 24 1016 topology 1044 1439
-> 16 0 24 1016 topology 1045 1439
-> 15 0 23 1016 topology 1063 1440
-> 16 0 23 1016 topology 1156 1440
-> 15 0 23 1016 topology 1093 1441
-> 16 0 23 1016 topology 1156 1441
-> 15 0 24 1016 topology 1092 1442
-> 16 0 24 1016 topology 1094 1442
-> 15 0 24 1016 topology 1146 1443
-> 16 0 24 1016 topology 1148 1443
-> 15 0 24 1016 topology 1047 1444
-> 16 0 24 1016 topology 1048 1444
-> 15 0 23 1016 topology 1123 1445
-> 16 0 23 1016 topology 1156 1445
-> 15 0 24 1016 topology 1068 1446
-> 16 0 24 1016 topology 1070 1446
-> 15 0 24 1016 topology 1122 1447
-> 16 0 24 1016 topology 1124 1447
-> 15 0 23 1016 topology 1153 1448
-> 16 0 23 1016 topology 1156 1448
-> 15 0 24 1016 topology 1023 1449
-> 16 0 24 1016 topology 1024 1449
-> 15 0 23 1016 topology 1040 1450
-> 16 0 23 1016 topology 1156 1450
-> 15 0 24 1016 topology 1050 1451
-> 16 0 24 1016 topology 1051 1451
-> 15 0 24 1016 topology 1104 1452
-> 16 0 24 1016 topology 1105 1452
-> 15 0 24 1016 topology 1098 1453
-> 16 0 24 1016 topology 1100 1453
-> 15 0 24 1016 topology 1152 1454
-> 16 0 24 1016 topology 1154 1454
-> 15 0 24 1016 topology 1053 1455
-> 16 0 24 1016 topology 1054 1455
-> 15 0 24 1016 topology 1107 1456
-> 16 0 24 1016 topology 1108 1456
-> 15 0 24 1016 topology 1128 1457
-> 16 0 24 1016 topology 1130 1457
-> 15 0 24 1016 topology 1056 1458
-> 16 0 24 1016 topology 1057 1458
-> 15 0 24 1016 topology 1110 1459
-> 16 0 24 1016 topology 1111 1459
-> 15 0 24 1016 topology 1059 1460
-> 16 0 24 1016 topology 1060 1460
-> 15 0 24 1016 topology 1113 1461
-> 16 0 24 1016 topology 1114 1461
-> 15 0 23 1016 topology 1024 1462
-> 16 0 23 1016 topology 1156 1462
-> 15 0 24 1016 topology 1035 1463
-> 16 0 24 1016 topology 1036 1463
-> 15 0 24 1016 topology 1062 1464
-> 16 0 24 1016 topology 1063 1464
-> 15 0 24 1016 topology 1116 1465
-> 16 0 24 1016 topology 1117 1465
-> 15 0 23 1016 topology 1046 1466
-> 16 0 23 1016 topology 1156 1466
-> 15 0 24 1016 topology 1065 1467
-> 16 0 24 1016 topology 1066 1467
-> 15 0 24 1016 topology 1119 1468
-> 16 0 24 1016 topology 1120 1468
-> 15 0 23 1016 topology 1106 1469
-> 16 0 23 1016 topology 1156 1469
-> 15 0 23 1016 topology 1036 1470
-> 16 0 23 1016 topology 1156 1470
-> 15 0 24 1016 topology 1068 1471
-> 16 0 24 1016 topology 1069 1471
-> 15 0 23 1016 topology 1082 1472
-> 16 0 23 1016 topology 1156 1472
-> 15 0 24 1016 topology 1122 1473
-> 16 0 24 1016 topology 1123 1473
-> 15 0 23 1016 topology 1058 1474
-> 16 0 23 1016 topology 1156 1474
-> 15 0 24 1016 topology 1071 1475
-> 16 0 24 1016 topology 1072 1475
-> 15 0 24 1016 topology 1125 1476
-> 16 0 24 1016 topology 1126 1476
-> 15 0 23 1016 topology 1142 1477
-> 16 0 23 1016 topology 1156 1477
-> 15 0 23 1016 topology 1118 1478
-> 16 0 23 1016 topology 1156 1478
-> 15 0 23 1016 topology 1094 1479
-> 16 0 23 1016 topology 1156 1479
-> 15 0 24 1016 topology 1128 1480
-> 16 0 24 1016 topology 1129 1480
-> 15 0 23 1016 topology 1070 1481
-> 16 0 23 1016 topology 1156 1481
-> 15 0 24 1016 topology 1131 1482
-> 16 0 24 1016 topology 1132 1482
-> 15 0 23 1016 topology 1154 1483
-> 16 0 23 1016 topology 1156 1483
-> 15 0 24 1016 topology 1023 1484
-> 16 0 24 1016 topology 1025 1484
-> 15 0 23 1016 topology 1130 1485
-> 16 0 23 1016 topology 1156 1485
-> 15 0 23 1016 topology 1048 1486
-> 16 0 23 1016 topology 1156 1486
-> 15 0 23 1016 topology 1078 1487
-> 16 0 23 1016 topology 1156 1487
-> 15 0 23 1016 topology 1019 1488
-> 16 0 23 1016 topology 1156 1488
-> 15 0 23 1016 topology 1108 1489
-> 16 0 23 1016 topology 1156 1489
-> 15 0 25 1016 topology 1155 1490
-> 16 0 25 1016 topology 1156 1490
-> 15 0 23 1016 topology 1138 1491
-> 16 0 23 1016 topology 1156 1491
-> 15 0 24 1016 topology 1035 1492
-> 16 0 24 1016 topology 1037 1492
-> 15 0 23 1016 topology 1060 1493
-> 16 0 23 1016 topology 1156 1493
-> 15 0 23 1016 topology 1090 1494
-> 16 0 23 1016 topology 1156 1494
-> 15 0 23 1016 topology 1031 1495
-> 16 0 23 1016 topology 1156 1495
-> 15 0 23 1016 topology 1120 1496
-> 16 0 23 1016 topology 1156 1496
-> 15 0 24 1016 topology 1020 1497
-> 16 0 24 1016 topology 1021 1497
-> 15 0 23 1016 topology 1150 1498
-> 16 0 23 1016 topology 1156 1498
-> 15 0 23 1016 topology 1072 1499
-> 16 0 23 1016 topology 1156 1499
-> 15 0 23 1016 topology 1102 1500
-> 16 0 23 1016 topology 1156 1500
-> 15 0 23 1016 topology 1043 1501
-> 16 0 23 1016 topology 1156 1501
-> 15 0 23 1016 topology 1132 1502
-> 16 0 23 1016 topology 1156 1502
-> 15 0 24 1016 topology 1032 1503
-> 16 0 24 1016 topology 1033 1503
-> 15 0 23 1016 topology 1021 1504
-> 16 0 23 1016 topology 1156 1504
-> 15 0 23 1016 topology 1049 1505
-> 16 0 23 1016 topology 1156 1505
-> 15 0 23 1016 topology 1033 1506
-> 16 0 23 1016 topology 1156 1506
-> 15 0 23 1016 topology 1109 1507
-> 16 0 23 1016 topology 1156 1507
-> 15 0 23 1016 topology 1085 1508
-> 16 0 23 1016 topology 1156 1508
-> 15 0 23 1016 topology 1061 1509
-> 16 0 23 1016 topology 1156 1509
-> 15 0 23 1016 topology 1145 1510
-> 16 0 23 1016 topology 1156 1510
-> 15 0 23 1016 topology 1121 1511
-> 16 0 23 1016 topology 1156 1511
-> 15 0 24 1016 topology 1047 1512
-> 16 0 24 1016 topology 1049 1512
-> 15 0 23 1016 topology 1097 1513
-> 16 0 23 1016 topology 1156 1513
-> 15 0 23 1016 topology 1073 1514
-> 16 0 23 1016 topology 1156 1514
-> 15 0 24 1016 topology 1077 1515
-> 16 0 24 1016 topology 1079 1515
-> 15 0 23 1158 topology 1175 1516
+> 15 0 23 1016 topology 1042 1422
+> 16 0 23 1016 topology 1156 1422
+> 15 0 24 1016 topology 1155 1423
+> 16 0 24 1016 topology 1156 1423
+> 15 0 25 1016 topology 1044 1424
+> 16 0 25 1016 topology 1046 1424
+> 15 0 25 1016 topology 1044 1425
+> 16 0 25 1016 topology 1045 1425
+> 15 0 25 1016 topology 1047 1426
+> 16 0 25 1016 topology 1049 1426
+> 15 0 25 1016 topology 1047 1427
+> 16 0 25 1016 topology 1048 1427
+> 15 0 25 1016 topology 1050 1428
+> 16 0 25 1016 topology 1052 1428
+> 15 0 25 1016 topology 1050 1429
+> 16 0 25 1016 topology 1051 1429
+> 15 0 25 1016 topology 1053 1430
+> 16 0 25 1016 topology 1055 1430
+> 15 0 25 1016 topology 1053 1431
+> 16 0 25 1016 topology 1054 1431
+> 15 0 25 1016 topology 1056 1432
+> 16 0 25 1016 topology 1058 1432
+> 15 0 25 1016 topology 1056 1433
+> 16 0 25 1016 topology 1057 1433
+> 15 0 25 1016 topology 1059 1434
+> 16 0 25 1016 topology 1061 1434
+> 15 0 25 1016 topology 1059 1435
+> 16 0 25 1016 topology 1060 1435
+> 15 0 25 1016 topology 1062 1436
+> 16 0 25 1016 topology 1064 1436
+> 15 0 25 1016 topology 1062 1437
+> 16 0 25 1016 topology 1063 1437
+> 15 0 25 1016 topology 1065 1438
+> 16 0 25 1016 topology 1067 1438
+> 15 0 25 1016 topology 1065 1439
+> 16 0 25 1016 topology 1066 1439
+> 15 0 25 1016 topology 1068 1440
+> 16 0 25 1016 topology 1070 1440
+> 15 0 25 1016 topology 1068 1441
+> 16 0 25 1016 topology 1069 1441
+> 15 0 25 1016 topology 1071 1442
+> 16 0 25 1016 topology 1073 1442
+> 15 0 25 1016 topology 1071 1443
+> 16 0 25 1016 topology 1072 1443
+> 15 0 25 1016 topology 1017 1444
+> 16 0 25 1016 topology 1019 1444
+> 15 0 25 1016 topology 1017 1445
+> 16 0 25 1016 topology 1018 1445
+> 15 0 25 1016 topology 1074 1446
+> 16 0 25 1016 topology 1076 1446
+> 15 0 25 1016 topology 1074 1447
+> 16 0 25 1016 topology 1075 1447
+> 15 0 25 1016 topology 1077 1448
+> 16 0 25 1016 topology 1079 1448
+> 15 0 25 1016 topology 1077 1449
+> 16 0 25 1016 topology 1078 1449
+> 15 0 25 1016 topology 1080 1450
+> 16 0 25 1016 topology 1082 1450
+> 15 0 25 1016 topology 1080 1451
+> 16 0 25 1016 topology 1081 1451
+> 15 0 25 1016 topology 1083 1452
+> 16 0 25 1016 topology 1085 1452
+> 15 0 25 1016 topology 1083 1453
+> 16 0 25 1016 topology 1084 1453
+> 15 0 25 1016 topology 1086 1454
+> 16 0 25 1016 topology 1088 1454
+> 15 0 25 1016 topology 1086 1455
+> 16 0 25 1016 topology 1087 1455
+> 15 0 25 1016 topology 1089 1456
+> 16 0 25 1016 topology 1091 1456
+> 15 0 25 1016 topology 1089 1457
+> 16 0 25 1016 topology 1090 1457
+> 15 0 25 1016 topology 1092 1458
+> 16 0 25 1016 topology 1094 1458
+> 15 0 25 1016 topology 1092 1459
+> 16 0 25 1016 topology 1093 1459
+> 15 0 25 1016 topology 1095 1460
+> 16 0 25 1016 topology 1097 1460
+> 15 0 25 1016 topology 1095 1461
+> 16 0 25 1016 topology 1096 1461
+> 15 0 25 1016 topology 1098 1462
+> 16 0 25 1016 topology 1100 1462
+> 15 0 25 1016 topology 1098 1463
+> 16 0 25 1016 topology 1099 1463
+> 15 0 25 1016 topology 1101 1464
+> 16 0 25 1016 topology 1103 1464
+> 15 0 25 1016 topology 1101 1465
+> 16 0 25 1016 topology 1102 1465
+> 15 0 25 1016 topology 1020 1466
+> 16 0 25 1016 topology 1022 1466
+> 15 0 25 1016 topology 1020 1467
+> 16 0 25 1016 topology 1021 1467
+> 15 0 25 1016 topology 1104 1468
+> 16 0 25 1016 topology 1106 1468
+> 15 0 25 1016 topology 1104 1469
+> 16 0 25 1016 topology 1105 1469
+> 15 0 25 1016 topology 1107 1470
+> 16 0 25 1016 topology 1109 1470
+> 15 0 25 1016 topology 1107 1471
+> 16 0 25 1016 topology 1108 1471
+> 15 0 25 1016 topology 1110 1472
+> 16 0 25 1016 topology 1112 1472
+> 15 0 25 1016 topology 1110 1473
+> 16 0 25 1016 topology 1111 1473
+> 15 0 25 1016 topology 1113 1474
+> 16 0 25 1016 topology 1115 1474
+> 15 0 25 1016 topology 1113 1475
+> 16 0 25 1016 topology 1114 1475
+> 15 0 25 1016 topology 1116 1476
+> 16 0 25 1016 topology 1118 1476
+> 15 0 25 1016 topology 1116 1477
+> 16 0 25 1016 topology 1117 1477
+> 15 0 25 1016 topology 1119 1478
+> 16 0 25 1016 topology 1121 1478
+> 15 0 25 1016 topology 1119 1479
+> 16 0 25 1016 topology 1120 1479
+> 15 0 25 1016 topology 1122 1480
+> 16 0 25 1016 topology 1124 1480
+> 15 0 25 1016 topology 1122 1481
+> 16 0 25 1016 topology 1123 1481
+> 15 0 25 1016 topology 1125 1482
+> 16 0 25 1016 topology 1127 1482
+> 15 0 25 1016 topology 1125 1483
+> 16 0 25 1016 topology 1126 1483
+> 15 0 25 1016 topology 1128 1484
+> 16 0 25 1016 topology 1130 1484
+> 15 0 25 1016 topology 1128 1485
+> 16 0 25 1016 topology 1129 1485
+> 15 0 25 1016 topology 1131 1486
+> 16 0 25 1016 topology 1133 1486
+> 15 0 25 1016 topology 1131 1487
+> 16 0 25 1016 topology 1132 1487
+> 15 0 25 1016 topology 1023 1488
+> 16 0 25 1016 topology 1025 1488
+> 15 0 25 1016 topology 1023 1489
+> 16 0 25 1016 topology 1024 1489
+> 15 0 25 1016 topology 1134 1490
+> 16 0 25 1016 topology 1136 1490
+> 15 0 25 1016 topology 1134 1491
+> 16 0 25 1016 topology 1135 1491
+> 15 0 25 1016 topology 1137 1492
+> 16 0 25 1016 topology 1139 1492
+> 15 0 25 1016 topology 1137 1493
+> 16 0 25 1016 topology 1138 1493
+> 15 0 25 1016 topology 1140 1494
+> 16 0 25 1016 topology 1142 1494
+> 15 0 25 1016 topology 1140 1495
+> 16 0 25 1016 topology 1141 1495
+> 15 0 25 1016 topology 1143 1496
+> 16 0 25 1016 topology 1145 1496
+> 15 0 25 1016 topology 1143 1497
+> 16 0 25 1016 topology 1144 1497
+> 15 0 25 1016 topology 1146 1498
+> 16 0 25 1016 topology 1148 1498
+> 15 0 25 1016 topology 1146 1499
+> 16 0 25 1016 topology 1147 1499
+> 15 0 25 1016 topology 1149 1500
+> 16 0 25 1016 topology 1151 1500
+> 15 0 25 1016 topology 1149 1501
+> 16 0 25 1016 topology 1150 1501
+> 15 0 25 1016 topology 1152 1502
+> 16 0 25 1016 topology 1154 1502
+> 15 0 25 1016 topology 1152 1503
+> 16 0 25 1016 topology 1153 1503
+> 15 0 25 1016 topology 1026 1504
+> 16 0 25 1016 topology 1028 1504
+> 15 0 25 1016 topology 1026 1505
+> 16 0 25 1016 topology 1027 1505
+> 15 0 25 1016 topology 1029 1506
+> 16 0 25 1016 topology 1031 1506
+> 15 0 25 1016 topology 1029 1507
+> 16 0 25 1016 topology 1030 1507
+> 15 0 25 1016 topology 1032 1508
+> 16 0 25 1016 topology 1034 1508
+> 15 0 25 1016 topology 1032 1509
+> 16 0 25 1016 topology 1033 1509
+> 15 0 25 1016 topology 1035 1510
+> 16 0 25 1016 topology 1037 1510
+> 15 0 25 1016 topology 1035 1511
+> 16 0 25 1016 topology 1036 1511
+> 15 0 25 1016 topology 1038 1512
+> 16 0 25 1016 topology 1040 1512
+> 15 0 25 1016 topology 1038 1513
+> 16 0 25 1016 topology 1039 1513
+> 15 0 25 1016 topology 1041 1514
+> 16 0 25 1016 topology 1043 1514
+> 15 0 25 1016 topology 1041 1515
+> 16 0 25 1016 topology 1042 1515
+> 15 0 23 1158 topology 1161 1516
 > 16 0 23 1158 topology 1184 1516
-> 15 0 24 1158 topology 1159 1517
-> 16 0 24 1158 topology 1161 1517
-> 15 0 24 1158 topology 1162 1518
-> 16 0 24 1158 topology 1164 1518
-> 15 0 24 1158 topology 1165 1519
-> 16 0 24 1158 topology 1167 1519
-> 15 0 24 1158 topology 1168 1520
-> 16 0 24 1158 topology 1170 1520
-> 15 0 24 1158 topology 1171 1521
-> 16 0 24 1158 topology 1173 1521
-> 15 0 24 1158 topology 1174 1522
-> 16 0 24 1158 topology 1176 1522
-> 15 0 23 1158 topology 1164 1523
+> 15 0 23 1158 topology 1160 1517
+> 16 0 23 1158 topology 1184 1517
+> 15 0 23 1158 topology 1164 1518
+> 16 0 23 1158 topology 1184 1518
+> 15 0 23 1158 topology 1163 1519
+> 16 0 23 1158 topology 1184 1519
+> 15 0 23 1158 topology 1167 1520
+> 16 0 23 1158 topology 1184 1520
+> 15 0 23 1158 topology 1166 1521
+> 16 0 23 1158 topology 1184 1521
+> 15 0 23 1158 topology 1170 1522
+> 16 0 23 1158 topology 1184 1522
+> 15 0 23 1158 topology 1169 1523
 > 16 0 23 1158 topology 1184 1523
-> 15 0 24 1158 topology 1177 1524
-> 16 0 24 1158 topology 1179 1524
-> 15 0 24 1158 topology 1180 1525
-> 16 0 24 1158 topology 1182 1525
-> 15 0 24 1158 topology 1162 1526
-> 16 0 24 1158 topology 1163 1526
-> 15 0 23 1158 topology 1176 1527
+> 15 0 23 1158 topology 1173 1524
+> 16 0 23 1158 topology 1184 1524
+> 15 0 23 1158 topology 1172 1525
+> 16 0 23 1158 topology 1184 1525
+> 15 0 23 1158 topology 1176 1526
+> 16 0 23 1158 topology 1184 1526
+> 15 0 23 1158 topology 1175 1527
 > 16 0 23 1158 topology 1184 1527
-> 15 0 24 1158 topology 1168 1528
-> 16 0 24 1158 topology 1169 1528
-> 15 0 23 1158 topology 1160 1529
+> 15 0 23 1158 topology 1179 1528
+> 16 0 23 1158 topology 1184 1528
+> 15 0 23 1158 topology 1178 1529
 > 16 0 23 1158 topology 1184 1529
-> 15 0 24 1158 topology 1174 1530
-> 16 0 24 1158 topology 1175 1530
-> 15 0 23 1158 topology 1172 1531
+> 15 0 23 1158 topology 1182 1530
+> 16 0 23 1158 topology 1184 1530
+> 15 0 23 1158 topology 1181 1531
 > 16 0 23 1158 topology 1184 1531
-> 15 0 24 1158 topology 1180 1532
-> 16 0 24 1158 topology 1181 1532
-> 15 0 23 1158 topology 1167 1533
-> 16 0 23 1158 topology 1184 1533
-> 15 0 23 1158 topology 1179 1534
-> 16 0 23 1158 topology 1184 1534
-> 15 0 25 1158 topology 1183 1535
-> 16 0 25 1158 topology 1184 1535
-> 15 0 23 1158 topology 1169 1536
-> 16 0 23 1158 topology 1184 1536
-> 15 0 23 1158 topology 1181 1537
-> 16 0 23 1158 topology 1184 1537
-> 15 0 24 1158 topology 1159 1538
-> 16 0 24 1158 topology 1160 1538
-> 15 0 23 1158 topology 1170 1539
-> 16 0 23 1158 topology 1184 1539
-> 15 0 24 1158 topology 1165 1540
-> 16 0 24 1158 topology 1166 1540
-> 15 0 23 1158 topology 1182 1541
-> 16 0 23 1158 topology 1184 1541
-> 15 0 24 1158 topology 1171 1542
-> 16 0 24 1158 topology 1172 1542
-> 15 0 23 1158 topology 1166 1543
-> 16 0 23 1158 topology 1184 1543
-> 15 0 24 1158 topology 1177 1544
-> 16 0 24 1158 topology 1178 1544
-> 15 0 23 1158 topology 1178 1545
-> 16 0 23 1158 topology 1184 1545
-> 15 0 23 1158 topology 1161 1546
-> 16 0 23 1158 topology 1184 1546
-> 15 0 23 1158 topology 1173 1547
-> 16 0 23 1158 topology 1184 1547
-> 15 0 23 1158 topology 1163 1548
-> 16 0 23 1158 topology 1184 1548
-> 15 0 26 869 topology 1157 1549
-> 16 0 26 869 topology 1187 1549
-> 15 0 27 869 topology 949 1550
-> 16 0 27 869 topology 951 1550
+> 15 0 24 1158 topology 1183 1532
+> 16 0 24 1158 topology 1184 1532
+> 15 0 25 1158 topology 1159 1533
+> 16 0 25 1158 topology 1161 1533
+> 15 0 25 1158 topology 1159 1534
+> 16 0 25 1158 topology 1160 1534
+> 15 0 25 1158 topology 1162 1535
+> 16 0 25 1158 topology 1164 1535
+> 15 0 25 1158 topology 1162 1536
+> 16 0 25 1158 topology 1163 1536
+> 15 0 25 1158 topology 1165 1537
+> 16 0 25 1158 topology 1167 1537
+> 15 0 25 1158 topology 1165 1538
+> 16 0 25 1158 topology 1166 1538
+> 15 0 25 1158 topology 1168 1539
+> 16 0 25 1158 topology 1170 1539
+> 15 0 25 1158 topology 1168 1540
+> 16 0 25 1158 topology 1169 1540
+> 15 0 25 1158 topology 1171 1541
+> 16 0 25 1158 topology 1173 1541
+> 15 0 25 1158 topology 1171 1542
+> 16 0 25 1158 topology 1172 1542
+> 15 0 25 1158 topology 1174 1543
+> 16 0 25 1158 topology 1176 1543
+> 15 0 25 1158 topology 1174 1544
+> 16 0 25 1158 topology 1175 1544
+> 15 0 25 1158 topology 1177 1545
+> 16 0 25 1158 topology 1179 1545
+> 15 0 25 1158 topology 1177 1546
+> 16 0 25 1158 topology 1178 1546
+> 15 0 25 1158 topology 1180 1547
+> 16 0 25 1158 topology 1182 1547
+> 15 0 25 1158 topology 1180 1548
+> 16 0 25 1158 topology 1181 1548
+> 15 0 26 869 topology 1015 1549
+> 16 0 26 869 topology 1013 1549
+> 15 0 26 869 topology 1157 1550
+> 16 0 26 869 topology 1155 1550
 > 15 0 26 869 topology 1185 1551
-> 16 0 26 869 topology 1187 1551
-> 15 0 26 869 topology 1015 1552
-> 16 0 26 869 topology 1013 1552
-> 15 0 21 869 topology 1015 1553
-> 16 0 21 869 topology 1185 1553
-> 15 0 21 869 topology 951 1554
-> 16 0 21 869 topology 1185 1554
-> 15 0 26 869 topology 1015 1555
+> 16 0 26 869 topology 1183 1551
+> 15 0 26 869 topology 951 1552
+> 16 0 26 869 topology 1187 1552
+> 15 0 26 869 topology 1015 1553
+> 16 0 26 869 topology 1187 1553
+> 15 0 26 869 topology 1157 1554
+> 16 0 26 869 topology 1187 1554
+> 15 0 26 869 topology 1185 1555
 > 16 0 26 869 topology 1187 1555
-> 15 0 21 869 topology 1015 1556
-> 16 0 21 869 topology 1157 1556
-> 15 0 26 869 topology 951 1557
-> 16 0 26 869 topology 1187 1557
-> 15 0 21 869 topology 1157 1558
-> 16 0 21 869 topology 1185 1558
-> 15 0 26 869 topology 1185 1559
-> 16 0 26 869 topology 1183 1559
-> 15 0 21 869 topology 951 1560
-> 16 0 21 869 topology 1015 1560
-> 15 0 26 869 topology 1157 1561
-> 16 0 26 869 topology 1155 1561
-> 15 0 21 869 topology 951 1562
-> 16 0 21 869 topology 1157 1562
-> 15 0 23 1190 topology 1231 1563
+> 15 0 27 869 topology 949 1556
+> 16 0 27 869 topology 951 1556
+> 15 0 20 869 topology 951 1557
+> 16 0 20 869 topology 1015 1557
+> 15 0 20 869 topology 951 1558
+> 16 0 20 869 topology 1157 1558
+> 15 0 20 869 topology 1015 1559
+> 16 0 20 869 topology 1157 1559
+> 15 0 20 869 topology 951 1560
+> 16 0 20 869 topology 1185 1560
+> 15 0 20 869 topology 1015 1561
+> 16 0 20 869 topology 1185 1561
+> 15 0 20 869 topology 1157 1562
+> 16 0 20 869 topology 1185 1562
+> 15 0 23 1190 topology 1220 1563
 > 16 0 23 1190 topology 1360 1563
-> 15 0 24 1190 topology 1320 1564
-> 16 0 24 1190 topology 1321 1564
-> 15 0 23 1190 topology 1202 1565
+> 15 0 23 1190 topology 1219 1564
+> 16 0 23 1190 topology 1360 1564
+> 15 0 23 1190 topology 1223 1565
 > 16 0 23 1190 topology 1360 1565
-> 15 0 23 1190 topology 1291 1566
+> 15 0 23 1190 topology 1222 1566
 > 16 0 23 1190 topology 1360 1566
-> 15 0 24 1190 topology 1296 1567
-> 16 0 24 1190 topology 1297 1567
-> 15 0 24 1190 topology 1272 1568
-> 16 0 24 1190 topology 1273 1568
-> 15 0 23 1190 topology 1351 1569
+> 15 0 23 1190 topology 1226 1567
+> 16 0 23 1190 topology 1360 1567
+> 15 0 23 1190 topology 1225 1568
+> 16 0 23 1190 topology 1360 1568
+> 15 0 23 1190 topology 1229 1569
 > 16 0 23 1190 topology 1360 1569
-> 15 0 23 1190 topology 1273 1570
+> 15 0 23 1190 topology 1228 1570
 > 16 0 23 1190 topology 1360 1570
-> 15 0 24 1190 topology 1356 1571
-> 16 0 24 1190 topology 1357 1571
-> 15 0 24 1190 topology 1248 1572
-> 16 0 24 1190 topology 1250 1572
-> 15 0 23 1190 topology 1333 1573
+> 15 0 23 1190 topology 1232 1571
+> 16 0 23 1190 topology 1360 1571
+> 15 0 23 1190 topology 1231 1572
+> 16 0 23 1190 topology 1360 1572
+> 15 0 23 1190 topology 1235 1573
 > 16 0 23 1190 topology 1360 1573
-> 15 0 24 1190 topology 1332 1574
-> 16 0 24 1190 topology 1333 1574
-> 15 0 24 1190 topology 1254 1575
-> 16 0 24 1190 topology 1256 1575
-> 15 0 24 1190 topology 1311 1576
-> 16 0 24 1190 topology 1313 1576
-> 15 0 23 1190 topology 1198 1577
+> 15 0 23 1190 topology 1234 1574
+> 16 0 23 1190 topology 1360 1574
+> 15 0 23 1190 topology 1238 1575
+> 16 0 23 1190 topology 1360 1575
+> 15 0 23 1190 topology 1237 1576
+> 16 0 23 1190 topology 1360 1576
+> 15 0 23 1190 topology 1241 1577
 > 16 0 23 1190 topology 1360 1577
-> 15 0 24 1190 topology 1260 1578
-> 16 0 24 1190 topology 1262 1578
-> 15 0 23 1190 topology 1250 1579
+> 15 0 23 1190 topology 1240 1578
+> 16 0 23 1190 topology 1360 1578
+> 15 0 23 1190 topology 1244 1579
 > 16 0 23 1190 topology 1360 1579
-> 15 0 24 1190 topology 1209 1580
-> 16 0 24 1190 topology 1211 1580
-> 15 0 24 1190 topology 1317 1581
-> 16 0 24 1190 topology 1319 1581
-> 15 0 24 1190 topology 1266 1582
-> 16 0 24 1190 topology 1268 1582
-> 15 0 23 1190 topology 1286 1583
+> 15 0 23 1190 topology 1243 1580
+> 16 0 23 1190 topology 1360 1580
+> 15 0 23 1190 topology 1247 1581
+> 16 0 23 1190 topology 1360 1581
+> 15 0 23 1190 topology 1246 1582
+> 16 0 23 1190 topology 1360 1582
+> 15 0 23 1190 topology 1193 1583
 > 16 0 23 1190 topology 1360 1583
-> 15 0 23 1190 topology 1238 1584
+> 15 0 23 1190 topology 1192 1584
 > 16 0 23 1190 topology 1360 1584
-> 15 0 24 1190 topology 1323 1585
-> 16 0 24 1190 topology 1325 1585
-> 15 0 23 1190 topology 1322 1586
+> 15 0 23 1190 topology 1250 1585
+> 16 0 23 1190 topology 1360 1585
+> 15 0 23 1190 topology 1249 1586
 > 16 0 23 1190 topology 1360 1586
-> 15 0 24 1190 topology 1272 1587
-> 16 0 24 1190 topology 1274 1587
-> 15 0 23 1190 topology 1274 1588
+> 15 0 23 1190 topology 1253 1587
+> 16 0 23 1190 topology 1360 1587
+> 15 0 23 1190 topology 1252 1588
 > 16 0 23 1190 topology 1360 1588
-> 15 0 24 1190 topology 1329 1589
-> 16 0 24 1190 topology 1331 1589
-> 15 0 23 1190 topology 1358 1590
+> 15 0 23 1190 topology 1256 1589
+> 16 0 23 1190 topology 1360 1589
+> 15 0 23 1190 topology 1255 1590
 > 16 0 23 1190 topology 1360 1590
-> 15 0 24 1190 topology 1335 1591
-> 16 0 24 1190 topology 1337 1591
-> 15 0 24 1190 topology 1209 1592
-> 16 0 24 1190 topology 1210 1592
-> 15 0 23 1190 topology 1193 1593
+> 15 0 23 1190 topology 1259 1591
+> 16 0 23 1190 topology 1360 1591
+> 15 0 23 1190 topology 1258 1592
+> 16 0 23 1190 topology 1360 1592
+> 15 0 23 1190 topology 1262 1593
 > 16 0 23 1190 topology 1360 1593
-> 15 0 23 1190 topology 1258 1594
+> 15 0 23 1190 topology 1261 1594
 > 16 0 23 1190 topology 1360 1594
-> 15 0 23 1190 topology 1318 1595
+> 15 0 23 1190 topology 1265 1595
 > 16 0 23 1190 topology 1360 1595
-> 15 0 23 1190 topology 1240 1596
+> 15 0 23 1190 topology 1264 1596
 > 16 0 23 1190 topology 1360 1596
-> 15 0 23 1190 topology 1300 1597
+> 15 0 23 1190 topology 1268 1597
 > 16 0 23 1190 topology 1360 1597
-> 15 0 24 1190 topology 1194 1598
-> 16 0 24 1190 topology 1196 1598
-> 15 0 23 1190 topology 1217 1599
+> 15 0 23 1190 topology 1267 1598
+> 16 0 23 1190 topology 1360 1598
+> 15 0 23 1190 topology 1271 1599
 > 16 0 23 1190 topology 1360 1599
-> 15 0 23 1190 topology 1207 1600
+> 15 0 23 1190 topology 1270 1600
 > 16 0 23 1190 topology 1360 1600
-> 15 0 23 1190 topology 1229 1601
+> 15 0 23 1190 topology 1274 1601
 > 16 0 23 1190 topology 1360 1601
-> 15 0 23 1190 topology 1313 1602
+> 15 0 23 1190 topology 1273 1602
 > 16 0 23 1190 topology 1360 1602
-> 15 0 23 1190 topology 1265 1603
+> 15 0 23 1190 topology 1277 1603
 > 16 0 23 1190 topology 1360 1603
-> 15 0 24 1190 topology 1251 1604
-> 16 0 24 1190 topology 1252 1604
-> 15 0 23 1190 topology 1349 1605
+> 15 0 23 1190 topology 1276 1604
+> 16 0 23 1190 topology 1360 1604
+> 15 0 23 1190 topology 1196 1605
 > 16 0 23 1190 topology 1360 1605
-> 15 0 24 1190 topology 1227 1606
-> 16 0 24 1190 topology 1228 1606
-> 15 0 23 1190 topology 1301 1607
+> 15 0 23 1190 topology 1195 1606
+> 16 0 23 1190 topology 1360 1606
+> 15 0 23 1190 topology 1280 1607
 > 16 0 23 1190 topology 1360 1607
-> 15 0 24 1190 topology 1311 1608
-> 16 0 24 1190 topology 1312 1608
-> 15 0 23 1190 topology 1337 1609
+> 15 0 23 1190 topology 1279 1608
+> 16 0 23 1190 topology 1360 1608
+> 15 0 23 1190 topology 1283 1609
 > 16 0 23 1190 topology 1360 1609
-> 15 0 24 1190 topology 1287 1610
-> 16 0 24 1190 topology 1288 1610
-> 15 0 23 1190 topology 1225 1611
+> 15 0 23 1190 topology 1282 1610
+> 16 0 23 1190 topology 1360 1610
+> 15 0 23 1190 topology 1286 1611
 > 16 0 23 1190 topology 1360 1611
-> 15 0 24 1190 topology 1263 1612
-> 16 0 24 1190 topology 1264 1612
-> 15 0 24 1190 topology 1212 1613
-> 16 0 24 1190 topology 1213 1613
-> 15 0 24 1190 topology 1239 1614
-> 16 0 24 1190 topology 1240 1614
-> 15 0 23 1190 topology 1285 1615
+> 15 0 23 1190 topology 1285 1612
+> 16 0 23 1190 topology 1360 1612
+> 15 0 23 1190 topology 1289 1613
+> 16 0 23 1190 topology 1360 1613
+> 15 0 23 1190 topology 1288 1614
+> 16 0 23 1190 topology 1360 1614
+> 15 0 23 1190 topology 1292 1615
 > 16 0 23 1190 topology 1360 1615
-> 15 0 24 1190 topology 1347 1616
-> 16 0 24 1190 topology 1348 1616
-> 15 0 24 1190 topology 1323 1617
-> 16 0 24 1190 topology 1324 1617
-> 15 0 23 1190 topology 1345 1618
+> 15 0 23 1190 topology 1291 1616
+> 16 0 23 1190 topology 1360 1616
+> 15 0 23 1190 topology 1295 1617
+> 16 0 23 1190 topology 1360 1617
+> 15 0 23 1190 topology 1294 1618
 > 16 0 23 1190 topology 1360 1618
-> 15 0 23 1190 topology 1267 1619
+> 15 0 23 1190 topology 1298 1619
 > 16 0 23 1190 topology 1360 1619
-> 15 0 23 1190 topology 1208 1620
+> 15 0 23 1190 topology 1297 1620
 > 16 0 23 1190 topology 1360 1620
-> 15 0 24 1190 topology 1299 1621
-> 16 0 24 1190 topology 1300 1621
-> 15 0 24 1190 topology 1218 1622
-> 16 0 24 1190 topology 1220 1622
-> 15 0 23 1190 topology 1327 1623
+> 15 0 23 1190 topology 1301 1621
+> 16 0 23 1190 topology 1360 1621
+> 15 0 23 1190 topology 1300 1622
+> 16 0 23 1190 topology 1360 1622
+> 15 0 23 1190 topology 1304 1623
 > 16 0 23 1190 topology 1360 1623
-> 15 0 24 1190 topology 1275 1624
-> 16 0 24 1190 topology 1276 1624
-> 15 0 24 1190 topology 1224 1625
-> 16 0 24 1190 topology 1226 1625
-> 15 0 24 1190 topology 1335 1626
-> 16 0 24 1190 topology 1336 1626
-> 15 0 24 1190 topology 1281 1627
-> 16 0 24 1190 topology 1283 1627
-> 15 0 23 1190 topology 1192 1628
+> 15 0 23 1190 topology 1303 1624
+> 16 0 23 1190 topology 1360 1624
+> 15 0 23 1190 topology 1307 1625
+> 16 0 23 1190 topology 1360 1625
+> 15 0 23 1190 topology 1306 1626
+> 16 0 23 1190 topology 1360 1626
+> 15 0 23 1190 topology 1199 1627
+> 16 0 23 1190 topology 1360 1627
+> 15 0 23 1190 topology 1198 1628
 > 16 0 23 1190 topology 1360 1628
-> 15 0 24 1190 topology 1203 1629
-> 16 0 24 1190 topology 1205 1629
-> 15 0 24 1190 topology 1230 1630
-> 16 0 24 1190 topology 1232 1630
-> 15 0 24 1190 topology 1338 1631
-> 16 0 24 1190 topology 1340 1631
-> 15 0 23 1190 topology 1220 1632
+> 15 0 23 1190 topology 1310 1629
+> 16 0 23 1190 topology 1360 1629
+> 15 0 23 1190 topology 1309 1630
+> 16 0 23 1190 topology 1360 1630
+> 15 0 23 1190 topology 1313 1631
+> 16 0 23 1190 topology 1360 1631
+> 15 0 23 1190 topology 1312 1632
 > 16 0 23 1190 topology 1360 1632
-> 15 0 24 1190 topology 1287 1633
-> 16 0 24 1190 topology 1289 1633
-> 15 0 24 1190 topology 1236 1634
-> 16 0 24 1190 topology 1238 1634
-> 15 0 24 1190 topology 1344 1635
-> 16 0 24 1190 topology 1346 1635
-> 15 0 24 1190 topology 1191 1636
-> 16 0 24 1190 topology 1192 1636
-> 15 0 23 1190 topology 1256 1637
+> 15 0 23 1190 topology 1316 1633
+> 16 0 23 1190 topology 1360 1633
+> 15 0 23 1190 topology 1315 1634
+> 16 0 23 1190 topology 1360 1634
+> 15 0 23 1190 topology 1319 1635
+> 16 0 23 1190 topology 1360 1635
+> 15 0 23 1190 topology 1318 1636
+> 16 0 23 1190 topology 1360 1636
+> 15 0 23 1190 topology 1322 1637
 > 16 0 23 1190 topology 1360 1637
-> 15 0 24 1190 topology 1293 1638
-> 16 0 24 1190 topology 1295 1638
-> 15 0 23 1190 topology 1340 1639
+> 15 0 23 1190 topology 1321 1638
+> 16 0 23 1190 topology 1360 1638
+> 15 0 23 1190 topology 1325 1639
 > 16 0 23 1190 topology 1360 1639
-> 15 0 23 1190 topology 1216 1640
+> 15 0 23 1190 topology 1324 1640
 > 16 0 23 1190 topology 1360 1640
-> 15 0 24 1190 topology 1242 1641
-> 16 0 24 1190 topology 1244 1641
-> 15 0 23 1190 topology 1292 1642
+> 15 0 23 1190 topology 1328 1641
+> 16 0 23 1190 topology 1360 1641
+> 15 0 23 1190 topology 1327 1642
 > 16 0 23 1190 topology 1360 1642
-> 15 0 24 1190 topology 1350 1643
-> 16 0 24 1190 topology 1352 1643
-> 15 0 23 1190 topology 1244 1644
+> 15 0 23 1190 topology 1331 1643
+> 16 0 23 1190 topology 1360 1643
+> 15 0 23 1190 topology 1330 1644
 > 16 0 23 1190 topology 1360 1644
-> 15 0 24 1190 topology 1299 1645
-> 16 0 24 1190 topology 1301 1645
-> 15 0 23 1190 topology 1328 1646
+> 15 0 23 1190 topology 1334 1645
+> 16 0 23 1190 topology 1360 1645
+> 15 0 23 1190 topology 1333 1646
 > 16 0 23 1190 topology 1360 1646
-> 15 0 24 1190 topology 1356 1647
-> 16 0 24 1190 topology 1358 1647
-> 15 0 24 1190 topology 1305 1648
-> 16 0 24 1190 topology 1307 1648
-> 15 0 23 1190 topology 1252 1649
+> 15 0 23 1190 topology 1337 1647
+> 16 0 23 1190 topology 1360 1647
+> 15 0 23 1190 topology 1336 1648
+> 16 0 23 1190 topology 1360 1648
+> 15 0 23 1190 topology 1202 1649
 > 16 0 23 1190 topology 1360 1649
-> 15 0 23 1190 topology 1312 1650
+> 15 0 23 1190 topology 1201 1650
 > 16 0 23 1190 topology 1360 1650
-> 15 0 23 1190 topology 1199 1651
+> 15 0 23 1190 topology 1340 1651
 > 16 0 23 1190 topology 1360 1651
-> 15 0 23 1190 topology 1234 1652
+> 15 0 23 1190 topology 1339 1652
 > 16 0 23 1190 topology 1360 1652
-> 15 0 24 1190 topology 1215 1653
-> 16 0 24 1190 topology 1216 1653
-> 15 0 23 1190 topology 1294 1654
+> 15 0 23 1190 topology 1343 1653
+> 16 0 23 1190 topology 1360 1653
+> 15 0 23 1190 topology 1342 1654
 > 16 0 23 1190 topology 1360 1654
-> 15 0 23 1190 topology 1354 1655
+> 15 0 23 1190 topology 1346 1655
 > 16 0 23 1190 topology 1360 1655
-> 15 0 23 1190 topology 1276 1656
+> 15 0 23 1190 topology 1345 1656
 > 16 0 23 1190 topology 1360 1656
-> 15 0 23 1190 topology 1336 1657
+> 15 0 23 1190 topology 1349 1657
 > 16 0 23 1190 topology 1360 1657
-> 15 0 23 1190 topology 1201 1658
+> 15 0 23 1190 topology 1348 1658
 > 16 0 23 1190 topology 1360 1658
-> 15 0 24 1190 topology 1218 1659
-> 16 0 24 1190 topology 1219 1659
-> 15 0 23 1190 topology 1283 1660
+> 15 0 23 1190 topology 1352 1659
+> 16 0 23 1190 topology 1360 1659
+> 15 0 23 1190 topology 1351 1660
 > 16 0 23 1190 topology 1360 1660
-> 15 0 24 1190 topology 1212 1661
-> 16 0 24 1190 topology 1214 1661
-> 15 0 24 1190 topology 1194 1662
-> 16 0 24 1190 topology 1195 1662
-> 15 0 23 1190 topology 1235 1663
+> 15 0 23 1190 topology 1355 1661
+> 16 0 23 1190 topology 1360 1661
+> 15 0 23 1190 topology 1354 1662
+> 16 0 23 1190 topology 1360 1662
+> 15 0 23 1190 topology 1358 1663
 > 16 0 23 1190 topology 1360 1663
-> 15 0 23 1190 topology 1319 1664
+> 15 0 23 1190 topology 1357 1664
 > 16 0 23 1190 topology 1360 1664
-> 15 0 24 1190 topology 1278 1665
-> 16 0 24 1190 topology 1279 1665
-> 15 0 23 1190 topology 1271 1666
+> 15 0 23 1190 topology 1205 1665
+> 16 0 23 1190 topology 1360 1665
+> 15 0 23 1190 topology 1204 1666
 > 16 0 23 1190 topology 1360 1666
-> 15 0 24 1190 topology 1254 1667
-> 16 0 24 1190 topology 1255 1667
-> 15 0 23 1190 topology 1355 1668
+> 15 0 23 1190 topology 1208 1667
+> 16 0 23 1190 topology 1360 1667
+> 15 0 23 1190 topology 1207 1668
 > 16 0 23 1190 topology 1360 1668
-> 15 0 24 1190 topology 1230 1669
-> 16 0 24 1190 topology 1231 1669
-> 15 0 23 1190 topology 1307 1670
+> 15 0 23 1190 topology 1211 1669
+> 16 0 23 1190 topology 1360 1669
+> 15 0 23 1190 topology 1210 1670
 > 16 0 23 1190 topology 1360 1670
-> 15 0 24 1190 topology 1338 1671
-> 16 0 24 1190 topology 1339 1671
-> 15 0 23 1190 topology 1219 1672
+> 15 0 23 1190 topology 1214 1671
+> 16 0 23 1190 topology 1360 1671
+> 15 0 23 1190 topology 1213 1672
 > 16 0 23 1190 topology 1360 1672
-> 15 0 24 1190 topology 1314 1673
-> 16 0 24 1190 topology 1315 1673
-> 15 0 23 1190 topology 1279 1674
+> 15 0 23 1190 topology 1217 1673
+> 16 0 23 1190 topology 1360 1673
+> 15 0 23 1190 topology 1216 1674
 > 16 0 23 1190 topology 1360 1674
-> 15 0 24 1190 topology 1290 1675
-> 16 0 24 1190 topology 1291 1675
-> 15 0 24 1190 topology 1266 1676
-> 16 0 24 1190 topology 1267 1676
-> 15 0 23 1190 topology 1339 1677
-> 16 0 23 1190 topology 1360 1677
-> 15 0 23 1190 topology 1261 1678
-> 16 0 23 1190 topology 1360 1678
-> 15 0 24 1190 topology 1242 1679
-> 16 0 24 1190 topology 1243 1679
-> 15 0 24 1190 topology 1350 1680
-> 16 0 24 1190 topology 1351 1680
-> 15 0 23 1190 topology 1321 1681
-> 16 0 23 1190 topology 1360 1681
-> 15 0 24 1190 topology 1326 1682
-> 16 0 24 1190 topology 1327 1682
-> 15 0 23 1190 topology 1243 1683
-> 16 0 23 1190 topology 1360 1683
-> 15 0 23 1190 topology 1303 1684
-> 16 0 23 1190 topology 1360 1684
-> 15 0 24 1190 topology 1302 1685
-> 16 0 24 1190 topology 1303 1685
-> 15 0 23 1190 topology 1214 1686
-> 16 0 23 1190 topology 1360 1686
-> 15 0 24 1190 topology 1251 1687
-> 16 0 24 1190 topology 1253 1687
-> 15 0 24 1190 topology 1197 1688
-> 16 0 24 1190 topology 1199 1688
-> 15 0 24 1190 topology 1308 1689
-> 16 0 24 1190 topology 1310 1689
-> 15 0 24 1190 topology 1257 1690
-> 16 0 24 1190 topology 1259 1690
-> 15 0 25 1190 topology 1359 1691
-> 16 0 25 1190 topology 1360 1691
-> 15 0 24 1190 topology 1314 1692
-> 16 0 24 1190 topology 1316 1692
-> 15 0 24 1190 topology 1263 1693
-> 16 0 24 1190 topology 1265 1693
-> 15 0 23 1190 topology 1226 1694
-> 16 0 23 1190 topology 1360 1694
-> 15 0 23 1190 topology 1310 1695
-> 16 0 23 1190 topology 1360 1695
-> 15 0 23 1190 topology 1210 1696
-> 16 0 23 1190 topology 1360 1696
-> 15 0 24 1190 topology 1320 1697
-> 16 0 24 1190 topology 1322 1697
-> 15 0 23 1190 topology 1262 1698
-> 16 0 23 1190 topology 1360 1698
-> 15 0 24 1190 topology 1269 1699
-> 16 0 24 1190 topology 1271 1699
-> 15 0 23 1190 topology 1346 1700
-> 16 0 23 1190 topology 1360 1700
-> 15 0 24 1190 topology 1197 1701
-> 16 0 24 1190 topology 1198 1701
-> 15 0 24 1190 topology 1326 1702
-> 16 0 24 1190 topology 1328 1702
-> 15 0 23 1190 topology 1298 1703
-> 16 0 23 1190 topology 1360 1703
-> 15 0 24 1190 topology 1275 1704
-> 16 0 24 1190 topology 1277 1704
-> 15 0 23 1190 topology 1334 1705
-> 16 0 23 1190 topology 1360 1705
-> 15 0 24 1190 topology 1332 1706
-> 16 0 24 1190 topology 1334 1706
-> 15 0 23 1190 topology 1228 1707
-> 16 0 23 1190 topology 1360 1707
-> 15 0 23 1190 topology 1288 1708
-> 16 0 23 1190 topology 1360 1708
-> 15 0 23 1190 topology 1205 1709
-> 16 0 23 1190 topology 1360 1709
-> 15 0 23 1190 topology 1348 1710
-> 16 0 23 1190 topology 1360 1710
-> 15 0 23 1190 topology 1270 1711
-> 16 0 23 1190 topology 1360 1711
-> 15 0 23 1190 topology 1330 1712
-> 16 0 23 1190 topology 1360 1712
-> 15 0 23 1190 topology 1195 1713
-> 16 0 23 1190 topology 1360 1713
-> 15 0 24 1190 topology 1206 1714
-> 16 0 24 1190 topology 1208 1714
-> 15 0 23 1190 topology 1253 1715
-> 16 0 23 1190 topology 1360 1715
-> 15 0 23 1190 topology 1289 1716
-> 16 0 23 1190 topology 1360 1716
-> 15 0 24 1190 topology 1221 1717
-> 16 0 24 1190 topology 1222 1717
-> 15 0 23 1190 topology 1241 1718
-> 16 0 23 1190 topology 1360 1718
-> 15 0 23 1190 topology 1325 1719
-> 16 0 23 1190 topology 1360 1719
-> 15 0 24 1190 topology 1281 1720
-> 16 0 24 1190 topology 1282 1720
-> 15 0 24 1190 topology 1200 1721
-> 16 0 24 1190 topology 1201 1721
-> 15 0 23 1190 topology 1277 1722
-> 16 0 23 1190 topology 1360 1722
-> 15 0 24 1190 topology 1257 1723
-> 16 0 24 1190 topology 1258 1723
-> 15 0 24 1190 topology 1233 1724
-> 16 0 24 1190 topology 1234 1724
-> 15 0 24 1190 topology 1341 1725
-> 16 0 24 1190 topology 1342 1725
-> 15 0 24 1190 topology 1317 1726
-> 16 0 24 1190 topology 1318 1726
-> 15 0 23 1190 topology 1255 1727
-> 16 0 23 1190 topology 1360 1727
-> 15 0 24 1190 topology 1293 1728
-> 16 0 24 1190 topology 1294 1728
-> 15 0 23 1190 topology 1196 1729
-> 16 0 23 1190 topology 1360 1729
-> 15 0 23 1190 topology 1315 1730
-> 16 0 23 1190 topology 1360 1730
-> 15 0 24 1190 topology 1269 1731
-> 16 0 24 1190 topology 1270 1731
-> 15 0 23 1190 topology 1237 1732
-> 16 0 23 1190 topology 1360 1732
-> 15 0 23 1190 topology 1297 1733
-> 16 0 23 1190 topology 1360 1733
-> 15 0 24 1190 topology 1245 1734
-> 16 0 24 1190 topology 1246 1734
-> 15 0 24 1190 topology 1353 1735
-> 16 0 24 1190 topology 1354 1735
-> 15 0 24 1190 topology 1191 1736
-> 16 0 24 1190 topology 1193 1736
-> 15 0 24 1190 topology 1329 1737
-> 16 0 24 1190 topology 1330 1737
-> 15 0 23 1190 topology 1357 1738
-> 16 0 23 1190 topology 1360 1738
-> 15 0 24 1190 topology 1221 1739
-> 16 0 24 1190 topology 1223 1739
-> 15 0 24 1190 topology 1305 1740
-> 16 0 24 1190 topology 1306 1740
-> 15 0 24 1190 topology 1278 1741
-> 16 0 24 1190 topology 1280 1741
-> 15 0 24 1190 topology 1227 1742
-> 16 0 24 1190 topology 1229 1742
-> 15 0 24 1190 topology 1284 1743
-> 16 0 24 1190 topology 1286 1743
-> 15 0 24 1190 topology 1233 1744
-> 16 0 24 1190 topology 1235 1744
-> 15 0 24 1190 topology 1341 1745
-> 16 0 24 1190 topology 1343 1745
-> 15 0 23 1190 topology 1204 1746
-> 16 0 23 1190 topology 1360 1746
-> 15 0 24 1190 topology 1290 1747
-> 16 0 24 1190 topology 1292 1747
-> 15 0 23 1190 topology 1280 1748
-> 16 0 23 1190 topology 1360 1748
-> 15 0 24 1190 topology 1239 1749
-> 16 0 24 1190 topology 1241 1749
-> 15 0 23 1190 topology 1232 1750
-> 16 0 23 1190 topology 1360 1750
-> 15 0 24 1190 topology 1347 1751
-> 16 0 24 1190 topology 1349 1751
-> 15 0 23 1190 topology 1316 1752
-> 16 0 23 1190 topology 1360 1752
-> 15 0 24 1190 topology 1296 1753
-> 16 0 24 1190 topology 1298 1753
-> 15 0 24 1190 topology 1215 1754
-> 16 0 24 1190 topology 1217 1754
-> 15 0 23 1190 topology 1268 1755
-> 16 0 23 1190 topology 1360 1755
-> 15 0 24 1190 topology 1245 1756
-> 16 0 24 1190 topology 1247 1756
-> 15 0 23 1190 topology 1352 1757
-> 16 0 23 1190 topology 1360 1757
-> 15 0 24 1190 topology 1353 1758
-> 16 0 24 1190 topology 1355 1758
-> 15 0 23 1190 topology 1304 1759
-> 16 0 23 1190 topology 1360 1759
-> 15 0 24 1190 topology 1302 1760
-> 16 0 24 1190 topology 1304 1760
-> 15 0 24 1190 topology 1203 1761
-> 16 0 24 1190 topology 1204 1761
-> 15 0 23 1190 topology 1222 1762
-> 16 0 23 1190 topology 1360 1762
-> 15 0 23 1190 topology 1282 1763
-> 16 0 23 1190 topology 1360 1763
-> 15 0 23 1190 topology 1342 1764
-> 16 0 23 1190 topology 1360 1764
-> 15 0 23 1190 topology 1264 1765
-> 16 0 23 1190 topology 1360 1765
-> 15 0 23 1190 topology 1324 1766
-> 16 0 23 1190 topology 1360 1766
-> 15 0 23 1190 topology 1246 1767
-> 16 0 23 1190 topology 1360 1767
-> 15 0 23 1190 topology 1211 1768
-> 16 0 23 1190 topology 1360 1768
-> 15 0 23 1190 topology 1306 1769
-> 16 0 23 1190 topology 1360 1769
-> 15 0 24 1190 topology 1200 1770
-> 16 0 24 1190 topology 1202 1770
-> 15 0 23 1190 topology 1223 1771
-> 16 0 23 1190 topology 1360 1771
-> 15 0 23 1190 topology 1259 1772
-> 16 0 23 1190 topology 1360 1772
-> 15 0 23 1190 topology 1213 1773
-> 16 0 23 1190 topology 1360 1773
-> 15 0 24 1190 topology 1248 1774
-> 16 0 24 1190 topology 1249 1774
-> 15 0 23 1190 topology 1343 1775
-> 16 0 23 1190 topology 1360 1775
-> 15 0 23 1190 topology 1295 1776
-> 16 0 23 1190 topology 1360 1776
-> 15 0 24 1190 topology 1224 1777
-> 16 0 24 1190 topology 1225 1777
-> 15 0 24 1190 topology 1308 1778
-> 16 0 24 1190 topology 1309 1778
-> 15 0 23 1190 topology 1247 1779
-> 16 0 23 1190 topology 1360 1779
-> 15 0 23 1190 topology 1331 1780
-> 16 0 23 1190 topology 1360 1780
-> 15 0 24 1190 topology 1284 1781
-> 16 0 24 1190 topology 1285 1781
-> 15 0 24 1190 topology 1260 1782
-> 16 0 24 1190 topology 1261 1782
-> 15 0 24 1190 topology 1206 1783
-> 16 0 24 1190 topology 1207 1783
-> 15 0 23 1190 topology 1249 1784
-> 16 0 23 1190 topology 1360 1784
-> 15 0 24 1190 topology 1236 1785
-> 16 0 24 1190 topology 1237 1785
-> 15 0 24 1190 topology 1344 1786
-> 16 0 24 1190 topology 1345 1786
-> 15 0 23 1190 topology 1309 1787
-> 16 0 23 1190 topology 1360 1787
-> 15 0 23 1362 topology 1455 1788
+> 15 0 24 1190 topology 1359 1675
+> 16 0 24 1190 topology 1360 1675
+> 15 0 25 1190 topology 1218 1676
+> 16 0 25 1190 topology 1220 1676
+> 15 0 25 1190 topology 1218 1677
+> 16 0 25 1190 topology 1219 1677
+> 15 0 25 1190 topology 1221 1678
+> 16 0 25 1190 topology 1223 1678
+> 15 0 25 1190 topology 1221 1679
+> 16 0 25 1190 topology 1222 1679
+> 15 0 25 1190 topology 1224 1680
+> 16 0 25 1190 topology 1226 1680
+> 15 0 25 1190 topology 1224 1681
+> 16 0 25 1190 topology 1225 1681
+> 15 0 25 1190 topology 1227 1682
+> 16 0 25 1190 topology 1229 1682
+> 15 0 25 1190 topology 1227 1683
+> 16 0 25 1190 topology 1228 1683
+> 15 0 25 1190 topology 1230 1684
+> 16 0 25 1190 topology 1232 1684
+> 15 0 25 1190 topology 1230 1685
+> 16 0 25 1190 topology 1231 1685
+> 15 0 25 1190 topology 1233 1686
+> 16 0 25 1190 topology 1235 1686
+> 15 0 25 1190 topology 1233 1687
+> 16 0 25 1190 topology 1234 1687
+> 15 0 25 1190 topology 1236 1688
+> 16 0 25 1190 topology 1238 1688
+> 15 0 25 1190 topology 1236 1689
+> 16 0 25 1190 topology 1237 1689
+> 15 0 25 1190 topology 1239 1690
+> 16 0 25 1190 topology 1241 1690
+> 15 0 25 1190 topology 1239 1691
+> 16 0 25 1190 topology 1240 1691
+> 15 0 25 1190 topology 1242 1692
+> 16 0 25 1190 topology 1244 1692
+> 15 0 25 1190 topology 1242 1693
+> 16 0 25 1190 topology 1243 1693
+> 15 0 25 1190 topology 1245 1694
+> 16 0 25 1190 topology 1247 1694
+> 15 0 25 1190 topology 1245 1695
+> 16 0 25 1190 topology 1246 1695
+> 15 0 25 1190 topology 1191 1696
+> 16 0 25 1190 topology 1193 1696
+> 15 0 25 1190 topology 1191 1697
+> 16 0 25 1190 topology 1192 1697
+> 15 0 25 1190 topology 1248 1698
+> 16 0 25 1190 topology 1250 1698
+> 15 0 25 1190 topology 1248 1699
+> 16 0 25 1190 topology 1249 1699
+> 15 0 25 1190 topology 1251 1700
+> 16 0 25 1190 topology 1253 1700
+> 15 0 25 1190 topology 1251 1701
+> 16 0 25 1190 topology 1252 1701
+> 15 0 25 1190 topology 1254 1702
+> 16 0 25 1190 topology 1256 1702
+> 15 0 25 1190 topology 1254 1703
+> 16 0 25 1190 topology 1255 1703
+> 15 0 25 1190 topology 1257 1704
+> 16 0 25 1190 topology 1259 1704
+> 15 0 25 1190 topology 1257 1705
+> 16 0 25 1190 topology 1258 1705
+> 15 0 25 1190 topology 1260 1706
+> 16 0 25 1190 topology 1262 1706
+> 15 0 25 1190 topology 1260 1707
+> 16 0 25 1190 topology 1261 1707
+> 15 0 25 1190 topology 1263 1708
+> 16 0 25 1190 topology 1265 1708
+> 15 0 25 1190 topology 1263 1709
+> 16 0 25 1190 topology 1264 1709
+> 15 0 25 1190 topology 1266 1710
+> 16 0 25 1190 topology 1268 1710
+> 15 0 25 1190 topology 1266 1711
+> 16 0 25 1190 topology 1267 1711
+> 15 0 25 1190 topology 1269 1712
+> 16 0 25 1190 topology 1271 1712
+> 15 0 25 1190 topology 1269 1713
+> 16 0 25 1190 topology 1270 1713
+> 15 0 25 1190 topology 1272 1714
+> 16 0 25 1190 topology 1274 1714
+> 15 0 25 1190 topology 1272 1715
+> 16 0 25 1190 topology 1273 1715
+> 15 0 25 1190 topology 1275 1716
+> 16 0 25 1190 topology 1277 1716
+> 15 0 25 1190 topology 1275 1717
+> 16 0 25 1190 topology 1276 1717
+> 15 0 25 1190 topology 1194 1718
+> 16 0 25 1190 topology 1196 1718
+> 15 0 25 1190 topology 1194 1719
+> 16 0 25 1190 topology 1195 1719
+> 15 0 25 1190 topology 1278 1720
+> 16 0 25 1190 topology 1280 1720
+> 15 0 25 1190 topology 1278 1721
+> 16 0 25 1190 topology 1279 1721
+> 15 0 25 1190 topology 1281 1722
+> 16 0 25 1190 topology 1283 1722
+> 15 0 25 1190 topology 1281 1723
+> 16 0 25 1190 topology 1282 1723
+> 15 0 25 1190 topology 1284 1724
+> 16 0 25 1190 topology 1286 1724
+> 15 0 25 1190 topology 1284 1725
+> 16 0 25 1190 topology 1285 1725
+> 15 0 25 1190 topology 1287 1726
+> 16 0 25 1190 topology 1289 1726
+> 15 0 25 1190 topology 1287 1727
+> 16 0 25 1190 topology 1288 1727
+> 15 0 25 1190 topology 1290 1728
+> 16 0 25 1190 topology 1292 1728
+> 15 0 25 1190 topology 1290 1729
+> 16 0 25 1190 topology 1291 1729
+> 15 0 25 1190 topology 1293 1730
+> 16 0 25 1190 topology 1295 1730
+> 15 0 25 1190 topology 1293 1731
+> 16 0 25 1190 topology 1294 1731
+> 15 0 25 1190 topology 1296 1732
+> 16 0 25 1190 topology 1298 1732
+> 15 0 25 1190 topology 1296 1733
+> 16 0 25 1190 topology 1297 1733
+> 15 0 25 1190 topology 1299 1734
+> 16 0 25 1190 topology 1301 1734
+> 15 0 25 1190 topology 1299 1735
+> 16 0 25 1190 topology 1300 1735
+> 15 0 25 1190 topology 1302 1736
+> 16 0 25 1190 topology 1304 1736
+> 15 0 25 1190 topology 1302 1737
+> 16 0 25 1190 topology 1303 1737
+> 15 0 25 1190 topology 1305 1738
+> 16 0 25 1190 topology 1307 1738
+> 15 0 25 1190 topology 1305 1739
+> 16 0 25 1190 topology 1306 1739
+> 15 0 25 1190 topology 1197 1740
+> 16 0 25 1190 topology 1199 1740
+> 15 0 25 1190 topology 1197 1741
+> 16 0 25 1190 topology 1198 1741
+> 15 0 25 1190 topology 1308 1742
+> 16 0 25 1190 topology 1310 1742
+> 15 0 25 1190 topology 1308 1743
+> 16 0 25 1190 topology 1309 1743
+> 15 0 25 1190 topology 1311 1744
+> 16 0 25 1190 topology 1313 1744
+> 15 0 25 1190 topology 1311 1745
+> 16 0 25 1190 topology 1312 1745
+> 15 0 25 1190 topology 1314 1746
+> 16 0 25 1190 topology 1316 1746
+> 15 0 25 1190 topology 1314 1747
+> 16 0 25 1190 topology 1315 1747
+> 15 0 25 1190 topology 1317 1748
+> 16 0 25 1190 topology 1319 1748
+> 15 0 25 1190 topology 1317 1749
+> 16 0 25 1190 topology 1318 1749
+> 15 0 25 1190 topology 1320 1750
+> 16 0 25 1190 topology 1322 1750
+> 15 0 25 1190 topology 1320 1751
+> 16 0 25 1190 topology 1321 1751
+> 15 0 25 1190 topology 1323 1752
+> 16 0 25 1190 topology 1325 1752
+> 15 0 25 1190 topology 1323 1753
+> 16 0 25 1190 topology 1324 1753
+> 15 0 25 1190 topology 1326 1754
+> 16 0 25 1190 topology 1328 1754
+> 15 0 25 1190 topology 1326 1755
+> 16 0 25 1190 topology 1327 1755
+> 15 0 25 1190 topology 1329 1756
+> 16 0 25 1190 topology 1331 1756
+> 15 0 25 1190 topology 1329 1757
+> 16 0 25 1190 topology 1330 1757
+> 15 0 25 1190 topology 1332 1758
+> 16 0 25 1190 topology 1334 1758
+> 15 0 25 1190 topology 1332 1759
+> 16 0 25 1190 topology 1333 1759
+> 15 0 25 1190 topology 1335 1760
+> 16 0 25 1190 topology 1337 1760
+> 15 0 25 1190 topology 1335 1761
+> 16 0 25 1190 topology 1336 1761
+> 15 0 25 1190 topology 1200 1762
+> 16 0 25 1190 topology 1202 1762
+> 15 0 25 1190 topology 1200 1763
+> 16 0 25 1190 topology 1201 1763
+> 15 0 25 1190 topology 1338 1764
+> 16 0 25 1190 topology 1340 1764
+> 15 0 25 1190 topology 1338 1765
+> 16 0 25 1190 topology 1339 1765
+> 15 0 25 1190 topology 1341 1766
+> 16 0 25 1190 topology 1343 1766
+> 15 0 25 1190 topology 1341 1767
+> 16 0 25 1190 topology 1342 1767
+> 15 0 25 1190 topology 1344 1768
+> 16 0 25 1190 topology 1346 1768
+> 15 0 25 1190 topology 1344 1769
+> 16 0 25 1190 topology 1345 1769
+> 15 0 25 1190 topology 1347 1770
+> 16 0 25 1190 topology 1349 1770
+> 15 0 25 1190 topology 1347 1771
+> 16 0 25 1190 topology 1348 1771
+> 15 0 25 1190 topology 1350 1772
+> 16 0 25 1190 topology 1352 1772
+> 15 0 25 1190 topology 1350 1773
+> 16 0 25 1190 topology 1351 1773
+> 15 0 25 1190 topology 1353 1774
+> 16 0 25 1190 topology 1355 1774
+> 15 0 25 1190 topology 1353 1775
+> 16 0 25 1190 topology 1354 1775
+> 15 0 25 1190 topology 1356 1776
+> 16 0 25 1190 topology 1358 1776
+> 15 0 25 1190 topology 1356 1777
+> 16 0 25 1190 topology 1357 1777
+> 15 0 25 1190 topology 1203 1778
+> 16 0 25 1190 topology 1205 1778
+> 15 0 25 1190 topology 1203 1779
+> 16 0 25 1190 topology 1204 1779
+> 15 0 25 1190 topology 1206 1780
+> 16 0 25 1190 topology 1208 1780
+> 15 0 25 1190 topology 1206 1781
+> 16 0 25 1190 topology 1207 1781
+> 15 0 25 1190 topology 1209 1782
+> 16 0 25 1190 topology 1211 1782
+> 15 0 25 1190 topology 1209 1783
+> 16 0 25 1190 topology 1210 1783
+> 15 0 25 1190 topology 1212 1784
+> 16 0 25 1190 topology 1214 1784
+> 15 0 25 1190 topology 1212 1785
+> 16 0 25 1190 topology 1213 1785
+> 15 0 25 1190 topology 1215 1786
+> 16 0 25 1190 topology 1217 1786
+> 15 0 25 1190 topology 1215 1787
+> 16 0 25 1190 topology 1216 1787
+> 15 0 23 1362 topology 1392 1788
 > 16 0 23 1362 topology 1601 1788
-> 15 0 24 1362 topology 1465 1789
-> 16 0 24 1362 topology 1467 1789
-> 15 0 24 1362 topology 1573 1790
-> 16 0 24 1362 topology 1575 1790
-> 15 0 25 1362 topology 1600 1791
-> 16 0 25 1362 topology 1601 1791
-> 15 0 23 1362 topology 1407 1792
+> 15 0 23 1362 topology 1391 1789
+> 16 0 23 1362 topology 1601 1789
+> 15 0 23 1362 topology 1395 1790
+> 16 0 23 1362 topology 1601 1790
+> 15 0 23 1362 topology 1394 1791
+> 16 0 23 1362 topology 1601 1791
+> 15 0 23 1362 topology 1398 1792
 > 16 0 23 1362 topology 1601 1792
-> 15 0 24 1362 topology 1414 1793
-> 16 0 24 1362 topology 1416 1793
-> 15 0 23 1362 topology 1491 1794
+> 15 0 23 1362 topology 1397 1793
+> 16 0 23 1362 topology 1601 1793
+> 15 0 23 1362 topology 1401 1794
 > 16 0 23 1362 topology 1601 1794
-> 15 0 24 1362 topology 1522 1795
-> 16 0 24 1362 topology 1524 1795
-> 15 0 23 1362 topology 1575 1796
+> 15 0 23 1362 topology 1400 1795
+> 16 0 23 1362 topology 1601 1795
+> 15 0 23 1362 topology 1404 1796
 > 16 0 23 1362 topology 1601 1796
-> 15 0 23 1362 topology 1443 1797
+> 15 0 23 1362 topology 1403 1797
 > 16 0 23 1362 topology 1601 1797
-> 15 0 24 1362 topology 1471 1798
-> 16 0 24 1362 topology 1473 1798
-> 15 0 24 1362 topology 1579 1799
-> 16 0 24 1362 topology 1581 1799
-> 15 0 24 1362 topology 1372 1800
-> 16 0 24 1362 topology 1373 1800
-> 15 0 23 1362 topology 1527 1801
+> 15 0 23 1362 topology 1407 1798
+> 16 0 23 1362 topology 1601 1798
+> 15 0 23 1362 topology 1406 1799
+> 16 0 23 1362 topology 1601 1799
+> 15 0 23 1362 topology 1410 1800
+> 16 0 23 1362 topology 1601 1800
+> 15 0 23 1362 topology 1409 1801
 > 16 0 23 1362 topology 1601 1801
-> 15 0 24 1362 topology 1528 1802
-> 16 0 24 1362 topology 1530 1802
-> 15 0 23 1362 topology 1479 1803
+> 15 0 23 1362 topology 1413 1802
+> 16 0 23 1362 topology 1601 1802
+> 15 0 23 1362 topology 1412 1803
 > 16 0 23 1362 topology 1601 1803
-> 15 0 24 1362 topology 1477 1804
-> 16 0 24 1362 topology 1479 1804
-> 15 0 23 1362 topology 1563 1805
+> 15 0 23 1362 topology 1416 1804
+> 16 0 23 1362 topology 1601 1804
+> 15 0 23 1362 topology 1415 1805
 > 16 0 23 1362 topology 1601 1805
-> 15 0 24 1362 topology 1585 1806
-> 16 0 24 1362 topology 1587 1806
-> 15 0 23 1362 topology 1421 1807
+> 15 0 23 1362 topology 1419 1806
+> 16 0 23 1362 topology 1601 1806
+> 15 0 23 1362 topology 1418 1807
 > 16 0 23 1362 topology 1601 1807
-> 15 0 24 1362 topology 1534 1808
-> 16 0 24 1362 topology 1536 1808
-> 15 0 23 1362 topology 1599 1809
+> 15 0 23 1362 topology 1365 1808
+> 16 0 23 1362 topology 1601 1808
+> 15 0 23 1362 topology 1364 1809
 > 16 0 23 1362 topology 1601 1809
-> 15 0 23 1362 topology 1481 1810
+> 15 0 23 1362 topology 1422 1810
 > 16 0 23 1362 topology 1601 1810
-> 15 0 24 1362 topology 1591 1811
-> 16 0 24 1362 topology 1593 1811
-> 15 0 23 1362 topology 1403 1812
+> 15 0 23 1362 topology 1421 1811
+> 16 0 23 1362 topology 1601 1811
+> 15 0 23 1362 topology 1425 1812
 > 16 0 23 1362 topology 1601 1812
-> 15 0 23 1362 topology 1541 1813
+> 15 0 23 1362 topology 1424 1813
 > 16 0 23 1362 topology 1601 1813
-> 15 0 23 1362 topology 1463 1814
+> 15 0 23 1362 topology 1428 1814
 > 16 0 23 1362 topology 1601 1814
-> 15 0 24 1362 topology 1597 1815
-> 16 0 24 1362 topology 1599 1815
-> 15 0 23 1362 topology 1380 1816
+> 15 0 23 1362 topology 1427 1815
+> 16 0 23 1362 topology 1601 1815
+> 15 0 23 1362 topology 1431 1816
 > 16 0 23 1362 topology 1601 1816
-> 15 0 23 1362 topology 1523 1817
+> 15 0 23 1362 topology 1430 1817
 > 16 0 23 1362 topology 1601 1817
-> 15 0 23 1362 topology 1445 1818
+> 15 0 23 1362 topology 1434 1818
 > 16 0 23 1362 topology 1601 1818
-> 15 0 23 1362 topology 1583 1819
+> 15 0 23 1362 topology 1433 1819
 > 16 0 23 1362 topology 1601 1819
-> 15 0 23 1362 topology 1505 1820
+> 15 0 23 1362 topology 1437 1820
 > 16 0 23 1362 topology 1601 1820
-> 15 0 23 1362 topology 1565 1821
+> 15 0 23 1362 topology 1436 1821
 > 16 0 23 1362 topology 1601 1821
-> 15 0 23 1362 topology 1376 1822
+> 15 0 23 1362 topology 1440 1822
 > 16 0 23 1362 topology 1601 1822
-> 15 0 24 1362 topology 1381 1823
-> 16 0 24 1362 topology 1383 1823
-> 15 0 23 1362 topology 1398 1824
+> 15 0 23 1362 topology 1439 1823
+> 16 0 23 1362 topology 1601 1823
+> 15 0 23 1362 topology 1443 1824
 > 16 0 23 1362 topology 1601 1824
-> 15 0 23 1362 topology 1482 1825
+> 15 0 23 1362 topology 1442 1825
 > 16 0 23 1362 topology 1601 1825
-> 15 0 23 1362 topology 1434 1826
+> 15 0 23 1362 topology 1446 1826
 > 16 0 23 1362 topology 1601 1826
-> 15 0 23 1362 topology 1518 1827
+> 15 0 23 1362 topology 1445 1827
 > 16 0 23 1362 topology 1601 1827
-> 15 0 24 1362 topology 1423 1828
-> 16 0 24 1362 topology 1424 1828
-> 15 0 23 1362 topology 1470 1829
+> 15 0 23 1362 topology 1449 1828
+> 16 0 23 1362 topology 1601 1828
+> 15 0 23 1362 topology 1448 1829
 > 16 0 23 1362 topology 1601 1829
-> 15 0 24 1362 topology 1399 1830
-> 16 0 24 1362 topology 1400 1830
-> 15 0 23 1362 topology 1554 1831
+> 15 0 23 1362 topology 1368 1830
+> 16 0 23 1362 topology 1601 1830
+> 15 0 23 1362 topology 1367 1831
 > 16 0 23 1362 topology 1601 1831
-> 15 0 24 1362 topology 1375 1832
-> 16 0 24 1362 topology 1376 1832
-> 15 0 24 1362 topology 1483 1833
-> 16 0 24 1362 topology 1484 1833
-> 15 0 23 1362 topology 1506 1834
+> 15 0 23 1362 topology 1452 1832
+> 16 0 23 1362 topology 1601 1832
+> 15 0 23 1362 topology 1451 1833
+> 16 0 23 1362 topology 1601 1833
+> 15 0 23 1362 topology 1455 1834
 > 16 0 23 1362 topology 1601 1834
-> 15 0 23 1362 topology 1590 1835
+> 15 0 23 1362 topology 1454 1835
 > 16 0 23 1362 topology 1601 1835
-> 15 0 24 1362 topology 1459 1836
-> 16 0 24 1362 topology 1460 1836
-> 15 0 24 1362 topology 1435 1837
-> 16 0 24 1362 topology 1436 1837
-> 15 0 24 1362 topology 1543 1838
-> 16 0 24 1362 topology 1544 1838
-> 15 0 24 1362 topology 1411 1839
-> 16 0 24 1362 topology 1412 1839
-> 15 0 23 1362 topology 1430 1840
+> 15 0 23 1362 topology 1458 1836
+> 16 0 23 1362 topology 1601 1836
+> 15 0 23 1362 topology 1457 1837
+> 16 0 23 1362 topology 1601 1837
+> 15 0 23 1362 topology 1461 1838
+> 16 0 23 1362 topology 1601 1838
+> 15 0 23 1362 topology 1460 1839
+> 16 0 23 1362 topology 1601 1839
+> 15 0 23 1362 topology 1464 1840
 > 16 0 23 1362 topology 1601 1840
-> 15 0 24 1362 topology 1519 1841
-> 16 0 24 1362 topology 1520 1841
-> 15 0 23 1362 topology 1371 1842
+> 15 0 23 1362 topology 1463 1841
+> 16 0 23 1362 topology 1601 1841
+> 15 0 23 1362 topology 1467 1842
 > 16 0 23 1362 topology 1601 1842
-> 15 0 23 1362 topology 1490 1843
+> 15 0 23 1362 topology 1466 1843
 > 16 0 23 1362 topology 1601 1843
-> 15 0 24 1362 topology 1495 1844
-> 16 0 24 1362 topology 1496 1844
-> 15 0 23 1362 topology 1412 1845
+> 15 0 23 1362 topology 1470 1844
+> 16 0 23 1362 topology 1601 1844
+> 15 0 23 1362 topology 1469 1845
 > 16 0 23 1362 topology 1601 1845
-> 15 0 24 1362 topology 1471 1846
-> 16 0 24 1362 topology 1472 1846
-> 15 0 23 1362 topology 1550 1847
+> 15 0 23 1362 topology 1473 1846
+> 16 0 23 1362 topology 1601 1846
+> 15 0 23 1362 topology 1472 1847
 > 16 0 23 1362 topology 1601 1847
-> 15 0 24 1362 topology 1579 1848
-> 16 0 24 1362 topology 1580 1848
-> 15 0 23 1362 topology 1472 1849
+> 15 0 23 1362 topology 1476 1848
+> 16 0 23 1362 topology 1601 1848
+> 15 0 23 1362 topology 1475 1849
 > 16 0 23 1362 topology 1601 1849
-> 15 0 24 1362 topology 1447 1850
-> 16 0 24 1362 topology 1448 1850
-> 15 0 24 1362 topology 1555 1851
-> 16 0 24 1362 topology 1556 1851
-> 15 0 24 1362 topology 1366 1852
-> 16 0 24 1362 topology 1368 1852
-> 15 0 23 1362 topology 1532 1853
+> 15 0 23 1362 topology 1479 1850
+> 16 0 23 1362 topology 1601 1850
+> 15 0 23 1362 topology 1478 1851
+> 16 0 23 1362 topology 1601 1851
+> 15 0 23 1362 topology 1371 1852
+> 16 0 23 1362 topology 1601 1852
+> 15 0 23 1362 topology 1370 1853
 > 16 0 23 1362 topology 1601 1853
-> 15 0 24 1362 topology 1531 1854
-> 16 0 24 1362 topology 1532 1854
-> 15 0 24 1362 topology 1423 1855
-> 16 0 24 1362 topology 1425 1855
-> 15 0 23 1362 topology 1592 1856
+> 15 0 23 1362 topology 1482 1854
+> 16 0 23 1362 topology 1601 1854
+> 15 0 23 1362 topology 1481 1855
+> 16 0 23 1362 topology 1601 1855
+> 15 0 23 1362 topology 1485 1856
 > 16 0 23 1362 topology 1601 1856
-> 15 0 24 1362 topology 1507 1857
-> 16 0 24 1362 topology 1508 1857
-> 15 0 24 1362 topology 1480 1858
-> 16 0 24 1362 topology 1482 1858
-> 15 0 24 1362 topology 1591 1859
-> 16 0 24 1362 topology 1592 1859
-> 15 0 24 1362 topology 1429 1860
-> 16 0 24 1362 topology 1431 1860
-> 15 0 24 1362 topology 1567 1861
-> 16 0 24 1362 topology 1568 1861
-> 15 0 24 1362 topology 1486 1862
-> 16 0 24 1362 topology 1488 1862
-> 15 0 23 1362 topology 1425 1863
+> 15 0 23 1362 topology 1484 1857
+> 16 0 23 1362 topology 1601 1857
+> 15 0 23 1362 topology 1488 1858
+> 16 0 23 1362 topology 1601 1858
+> 15 0 23 1362 topology 1487 1859
+> 16 0 23 1362 topology 1601 1859
+> 15 0 23 1362 topology 1491 1860
+> 16 0 23 1362 topology 1601 1860
+> 15 0 23 1362 topology 1490 1861
+> 16 0 23 1362 topology 1601 1861
+> 15 0 23 1362 topology 1494 1862
+> 16 0 23 1362 topology 1601 1862
+> 15 0 23 1362 topology 1493 1863
 > 16 0 23 1362 topology 1601 1863
-> 15 0 24 1362 topology 1435 1864
-> 16 0 24 1362 topology 1437 1864
-> 15 0 24 1362 topology 1543 1865
-> 16 0 24 1362 topology 1545 1865
-> 15 0 23 1362 topology 1385 1866
+> 15 0 23 1362 topology 1497 1864
+> 16 0 23 1362 topology 1601 1864
+> 15 0 23 1362 topology 1496 1865
+> 16 0 23 1362 topology 1601 1865
+> 15 0 23 1362 topology 1500 1866
 > 16 0 23 1362 topology 1601 1866
-> 15 0 24 1362 topology 1492 1867
-> 16 0 24 1362 topology 1494 1867
-> 15 0 23 1362 topology 1461 1868
+> 15 0 23 1362 topology 1499 1867
+> 16 0 23 1362 topology 1601 1867
+> 15 0 23 1362 topology 1503 1868
 > 16 0 23 1362 topology 1601 1868
-> 15 0 24 1362 topology 1441 1869
-> 16 0 24 1362 topology 1443 1869
-> 15 0 23 1362 topology 1545 1870
+> 15 0 23 1362 topology 1502 1869
+> 16 0 23 1362 topology 1601 1869
+> 15 0 23 1362 topology 1506 1870
 > 16 0 23 1362 topology 1601 1870
-> 15 0 24 1362 topology 1549 1871
-> 16 0 24 1362 topology 1551 1871
-> 15 0 23 1362 topology 1413 1872
+> 15 0 23 1362 topology 1505 1871
+> 16 0 23 1362 topology 1601 1871
+> 15 0 23 1362 topology 1509 1872
 > 16 0 23 1362 topology 1601 1872
-> 15 0 23 1362 topology 1497 1873
+> 15 0 23 1362 topology 1508 1873
 > 16 0 23 1362 topology 1601 1873
-> 15 0 24 1362 topology 1498 1874
-> 16 0 24 1362 topology 1500 1874
-> 15 0 23 1362 topology 1581 1875
+> 15 0 23 1362 topology 1374 1874
+> 16 0 23 1362 topology 1601 1874
+> 15 0 23 1362 topology 1373 1875
 > 16 0 23 1362 topology 1601 1875
-> 15 0 24 1362 topology 1447 1876
-> 16 0 24 1362 topology 1449 1876
-> 15 0 23 1362 topology 1449 1877
+> 15 0 23 1362 topology 1512 1876
+> 16 0 23 1362 topology 1601 1876
+> 15 0 23 1362 topology 1511 1877
 > 16 0 23 1362 topology 1601 1877
-> 15 0 24 1362 topology 1555 1878
-> 16 0 24 1362 topology 1557 1878
-> 15 0 23 1362 topology 1533 1879
+> 15 0 23 1362 topology 1515 1878
+> 16 0 23 1362 topology 1601 1878
+> 15 0 23 1362 topology 1514 1879
 > 16 0 23 1362 topology 1601 1879
-> 15 0 24 1362 topology 1504 1880
-> 16 0 24 1362 topology 1506 1880
-> 15 0 24 1362 topology 1378 1881
-> 16 0 24 1362 topology 1379 1881
-> 15 0 24 1362 topology 1561 1882
-> 16 0 24 1362 topology 1563 1882
-> 15 0 23 1362 topology 1569 1883
+> 15 0 23 1362 topology 1518 1880
+> 16 0 23 1362 topology 1601 1880
+> 15 0 23 1362 topology 1517 1881
+> 16 0 23 1362 topology 1601 1881
+> 15 0 23 1362 topology 1521 1882
+> 16 0 23 1362 topology 1601 1882
+> 15 0 23 1362 topology 1520 1883
 > 16 0 23 1362 topology 1601 1883
-> 15 0 23 1362 topology 1397 1884
+> 15 0 23 1362 topology 1524 1884
 > 16 0 23 1362 topology 1601 1884
-> 15 0 23 1362 topology 1457 1885
+> 15 0 23 1362 topology 1523 1885
 > 16 0 23 1362 topology 1601 1885
-> 15 0 24 1362 topology 1567 1886
-> 16 0 24 1362 topology 1569 1886
-> 15 0 23 1362 topology 1517 1887
+> 15 0 23 1362 topology 1527 1886
+> 16 0 23 1362 topology 1601 1886
+> 15 0 23 1362 topology 1526 1887
 > 16 0 23 1362 topology 1601 1887
-> 15 0 23 1362 topology 1439 1888
+> 15 0 23 1362 topology 1530 1888
 > 16 0 23 1362 topology 1601 1888
-> 15 0 23 1362 topology 1577 1889
+> 15 0 23 1362 topology 1529 1889
 > 16 0 23 1362 topology 1601 1889
-> 15 0 23 1362 topology 1499 1890
+> 15 0 23 1362 topology 1533 1890
 > 16 0 23 1362 topology 1601 1890
-> 15 0 23 1362 topology 1386 1891
+> 15 0 23 1362 topology 1532 1891
 > 16 0 23 1362 topology 1601 1891
-> 15 0 23 1362 topology 1559 1892
+> 15 0 23 1362 topology 1536 1892
 > 16 0 23 1362 topology 1601 1892
-> 15 0 24 1362 topology 1375 1893
-> 16 0 24 1362 topology 1377 1893
-> 15 0 23 1362 topology 1370 1894
+> 15 0 23 1362 topology 1535 1893
+> 16 0 23 1362 topology 1601 1893
+> 15 0 23 1362 topology 1539 1894
 > 16 0 23 1362 topology 1601 1894
-> 15 0 23 1362 topology 1452 1895
+> 15 0 23 1362 topology 1538 1895
 > 16 0 23 1362 topology 1601 1895
-> 15 0 24 1362 topology 1390 1896
-> 16 0 24 1362 topology 1391 1896
-> 15 0 23 1362 topology 1404 1897
+> 15 0 23 1362 topology 1377 1896
+> 16 0 23 1362 topology 1601 1896
+> 15 0 23 1362 topology 1376 1897
 > 16 0 23 1362 topology 1601 1897
-> 15 0 23 1362 topology 1488 1898
+> 15 0 23 1362 topology 1542 1898
 > 16 0 23 1362 topology 1601 1898
-> 15 0 23 1362 topology 1572 1899
+> 15 0 23 1362 topology 1541 1899
 > 16 0 23 1362 topology 1601 1899
-> 15 0 23 1362 topology 1440 1900
+> 15 0 23 1362 topology 1545 1900
 > 16 0 23 1362 topology 1601 1900
-> 15 0 24 1362 topology 1450 1901
-> 16 0 24 1362 topology 1451 1901
-> 15 0 23 1362 topology 1524 1902
+> 15 0 23 1362 topology 1544 1901
+> 16 0 23 1362 topology 1601 1901
+> 15 0 23 1362 topology 1548 1902
 > 16 0 23 1362 topology 1601 1902
-> 15 0 24 1362 topology 1426 1903
-> 16 0 24 1362 topology 1427 1903
-> 15 0 23 1362 topology 1476 1904
+> 15 0 23 1362 topology 1547 1903
+> 16 0 23 1362 topology 1601 1903
+> 15 0 23 1362 topology 1551 1904
 > 16 0 23 1362 topology 1601 1904
-> 15 0 24 1362 topology 1402 1905
-> 16 0 24 1362 topology 1403 1905
-> 15 0 24 1362 topology 1510 1906
-> 16 0 24 1362 topology 1511 1906
-> 15 0 23 1362 topology 1560 1907
+> 15 0 23 1362 topology 1550 1905
+> 16 0 23 1362 topology 1601 1905
+> 15 0 23 1362 topology 1554 1906
+> 16 0 23 1362 topology 1601 1906
+> 15 0 23 1362 topology 1553 1907
 > 16 0 23 1362 topology 1601 1907
-> 15 0 24 1362 topology 1486 1908
-> 16 0 24 1362 topology 1487 1908
-> 15 0 23 1362 topology 1596 1909
+> 15 0 23 1362 topology 1557 1908
+> 16 0 23 1362 topology 1601 1908
+> 15 0 23 1362 topology 1556 1909
 > 16 0 23 1362 topology 1601 1909
-> 15 0 24 1362 topology 1381 1910
-> 16 0 24 1362 topology 1382 1910
-> 15 0 23 1362 topology 1424 1911
+> 15 0 23 1362 topology 1560 1910
+> 16 0 23 1362 topology 1601 1910
+> 15 0 23 1362 topology 1559 1911
 > 16 0 23 1362 topology 1601 1911
-> 15 0 24 1362 topology 1462 1912
-> 16 0 24 1362 topology 1463 1912
-> 15 0 24 1362 topology 1570 1913
-> 16 0 24 1362 topology 1571 1913
-> 15 0 24 1362 topology 1438 1914
-> 16 0 24 1362 topology 1439 1914
-> 15 0 23 1362 topology 1484 1915
+> 15 0 23 1362 topology 1563 1912
+> 16 0 23 1362 topology 1601 1912
+> 15 0 23 1362 topology 1562 1913
+> 16 0 23 1362 topology 1601 1913
+> 15 0 23 1362 topology 1566 1914
+> 16 0 23 1362 topology 1601 1914
+> 15 0 23 1362 topology 1565 1915
 > 16 0 23 1362 topology 1601 1915
-> 15 0 24 1362 topology 1546 1916
-> 16 0 24 1362 topology 1547 1916
-> 15 0 23 1362 topology 1406 1917
+> 15 0 23 1362 topology 1569 1916
+> 16 0 23 1362 topology 1601 1916
+> 15 0 23 1362 topology 1568 1917
 > 16 0 23 1362 topology 1601 1917
-> 15 0 24 1362 topology 1414 1918
-> 16 0 24 1362 topology 1415 1918
-> 15 0 24 1362 topology 1522 1919
-> 16 0 24 1362 topology 1523 1919
-> 15 0 23 1362 topology 1544 1920
+> 15 0 23 1362 topology 1380 1918
+> 16 0 23 1362 topology 1601 1918
+> 15 0 23 1362 topology 1379 1919
+> 16 0 23 1362 topology 1601 1919
+> 15 0 23 1362 topology 1572 1920
 > 16 0 23 1362 topology 1601 1920
-> 15 0 23 1362 topology 1377 1921
+> 15 0 23 1362 topology 1571 1921
 > 16 0 23 1362 topology 1601 1921
-> 15 0 23 1362 topology 1466 1922
+> 15 0 23 1362 topology 1575 1922
 > 16 0 23 1362 topology 1601 1922
-> 15 0 24 1362 topology 1498 1923
-> 16 0 24 1362 topology 1499 1923
-> 15 0 23 1362 topology 1526 1924
+> 15 0 23 1362 topology 1574 1923
+> 16 0 23 1362 topology 1601 1923
+> 15 0 23 1362 topology 1578 1924
 > 16 0 23 1362 topology 1601 1924
-> 15 0 23 1362 topology 1448 1925
+> 15 0 23 1362 topology 1577 1925
 > 16 0 23 1362 topology 1601 1925
-> 15 0 24 1362 topology 1474 1926
-> 16 0 24 1362 topology 1475 1926
-> 15 0 24 1362 topology 1582 1927
-> 16 0 24 1362 topology 1583 1927
-> 15 0 24 1362 topology 1393 1928
-> 16 0 24 1362 topology 1395 1928
-> 15 0 23 1362 topology 1586 1929
+> 15 0 23 1362 topology 1581 1926
+> 16 0 23 1362 topology 1601 1926
+> 15 0 23 1362 topology 1580 1927
+> 16 0 23 1362 topology 1601 1927
+> 15 0 23 1362 topology 1584 1928
+> 16 0 23 1362 topology 1601 1928
+> 15 0 23 1362 topology 1583 1929
 > 16 0 23 1362 topology 1601 1929
-> 15 0 23 1362 topology 1508 1930
+> 15 0 23 1362 topology 1587 1930
 > 16 0 23 1362 topology 1601 1930
-> 15 0 24 1362 topology 1558 1931
-> 16 0 24 1362 topology 1559 1931
-> 15 0 24 1362 topology 1450 1932
-> 16 0 24 1362 topology 1452 1932
-> 15 0 24 1362 topology 1534 1933
-> 16 0 24 1362 topology 1535 1933
-> 15 0 23 1362 topology 1568 1934
+> 15 0 23 1362 topology 1586 1931
+> 16 0 23 1362 topology 1601 1931
+> 15 0 23 1362 topology 1590 1932
+> 16 0 23 1362 topology 1601 1932
+> 15 0 23 1362 topology 1589 1933
+> 16 0 23 1362 topology 1601 1933
+> 15 0 23 1362 topology 1593 1934
 > 16 0 23 1362 topology 1601 1934
-> 15 0 24 1362 topology 1399 1935
-> 16 0 24 1362 topology 1401 1935
-> 15 0 24 1362 topology 1456 1936
-> 16 0 24 1362 topology 1458 1936
-> 15 0 24 1362 topology 1594 1937
-> 16 0 24 1362 topology 1595 1937
-> 15 0 24 1362 topology 1405 1938
-> 16 0 24 1362 topology 1407 1938
-> 15 0 24 1362 topology 1513 1939
-> 16 0 24 1362 topology 1515 1939
-> 15 0 23 1362 topology 1395 1940
+> 15 0 23 1362 topology 1592 1935
+> 16 0 23 1362 topology 1601 1935
+> 15 0 23 1362 topology 1596 1936
+> 16 0 23 1362 topology 1601 1936
+> 15 0 23 1362 topology 1595 1937
+> 16 0 23 1362 topology 1601 1937
+> 15 0 23 1362 topology 1599 1938
+> 16 0 23 1362 topology 1601 1938
+> 15 0 23 1362 topology 1598 1939
+> 16 0 23 1362 topology 1601 1939
+> 15 0 23 1362 topology 1383 1940
 > 16 0 23 1362 topology 1601 1940
-> 15 0 23 1362 topology 1379 1941
+> 15 0 23 1362 topology 1382 1941
 > 16 0 23 1362 topology 1601 1941
-> 15 0 24 1362 topology 1462 1942
-> 16 0 24 1362 topology 1464 1942
-> 15 0 24 1362 topology 1570 1943
-> 16 0 24 1362 topology 1572 1943
-> 15 0 23 1362 topology 1431 1944
+> 15 0 23 1362 topology 1386 1942
+> 16 0 23 1362 topology 1601 1942
+> 15 0 23 1362 topology 1385 1943
+> 16 0 23 1362 topology 1601 1943
+> 15 0 23 1362 topology 1389 1944
 > 16 0 23 1362 topology 1601 1944
-> 15 0 24 1362 topology 1411 1945
-> 16 0 24 1362 topology 1413 1945
-> 15 0 24 1362 topology 1384 1946
-> 16 0 24 1362 topology 1386 1946
-> 15 0 24 1362 topology 1519 1947
-> 16 0 24 1362 topology 1521 1947
-> 15 0 23 1362 topology 1515 1948
-> 16 0 23 1362 topology 1601 1948
-> 15 0 24 1362 topology 1468 1949
-> 16 0 24 1362 topology 1470 1949
-> 15 0 24 1362 topology 1576 1950
-> 16 0 24 1362 topology 1578 1950
-> 15 0 23 1362 topology 1467 1951
-> 16 0 23 1362 topology 1601 1951
-> 15 0 24 1362 topology 1417 1952
-> 16 0 24 1362 topology 1419 1952
-> 15 0 24 1362 topology 1525 1953
-> 16 0 24 1362 topology 1527 1953
-> 15 0 23 1362 topology 1551 1954
-> 16 0 23 1362 topology 1601 1954
-> 15 0 23 1362 topology 1419 1955
-> 16 0 23 1362 topology 1601 1955
-> 15 0 23 1362 topology 1503 1956
-> 16 0 23 1362 topology 1601 1956
-> 15 0 24 1362 topology 1474 1957
-> 16 0 24 1362 topology 1476 1957
-> 15 0 24 1362 topology 1582 1958
-> 16 0 24 1362 topology 1584 1958
-> 15 0 23 1362 topology 1587 1959
-> 16 0 23 1362 topology 1601 1959
-> 15 0 24 1362 topology 1531 1960
-> 16 0 24 1362 topology 1533 1960
-> 15 0 23 1362 topology 1391 1961
-> 16 0 23 1362 topology 1601 1961
-> 15 0 23 1362 topology 1539 1962
-> 16 0 23 1362 topology 1601 1962
-> 15 0 24 1362 topology 1588 1963
-> 16 0 24 1362 topology 1590 1963
-> 15 0 23 1362 topology 1451 1964
-> 16 0 23 1362 topology 1601 1964
-> 15 0 24 1362 topology 1537 1965
-> 16 0 24 1362 topology 1539 1965
-> 15 0 24 1362 topology 1384 1966
-> 16 0 24 1362 topology 1385 1966
-> 15 0 23 1362 topology 1368 1967
-> 16 0 23 1362 topology 1601 1967
-> 15 0 23 1362 topology 1511 1968
-> 16 0 23 1362 topology 1601 1968
-> 15 0 23 1362 topology 1433 1969
-> 16 0 23 1362 topology 1601 1969
-> 15 0 24 1362 topology 1594 1970
-> 16 0 24 1362 topology 1596 1970
-> 15 0 23 1362 topology 1571 1971
-> 16 0 23 1362 topology 1601 1971
-> 15 0 23 1362 topology 1493 1972
-> 16 0 23 1362 topology 1601 1972
-> 15 0 23 1362 topology 1415 1973
-> 16 0 23 1362 topology 1601 1973
-> 15 0 23 1362 topology 1553 1974
-> 16 0 23 1362 topology 1601 1974
-> 15 0 23 1362 topology 1475 1975
-> 16 0 23 1362 topology 1601 1975
-> 15 0 23 1362 topology 1535 1976
-> 16 0 23 1362 topology 1601 1976
-> 15 0 24 1362 topology 1369 1977
-> 16 0 24 1362 topology 1371 1977
-> 15 0 23 1362 topology 1595 1978
-> 16 0 23 1362 topology 1601 1978
-> 15 0 23 1362 topology 1364 1979
-> 16 0 23 1362 topology 1601 1979
-> 15 0 23 1362 topology 1422 1980
-> 16 0 23 1362 topology 1601 1980
-> 15 0 24 1362 topology 1363 1981
-> 16 0 24 1362 topology 1364 1981
-> 15 0 23 1362 topology 1458 1982
-> 16 0 23 1362 topology 1601 1982
-> 15 0 24 1362 topology 1393 1983
-> 16 0 24 1362 topology 1394 1983
-> 15 0 23 1362 topology 1388 1984
-> 16 0 23 1362 topology 1601 1984
-> 15 0 23 1362 topology 1542 1985
-> 16 0 23 1362 topology 1601 1985
-> 15 0 23 1362 topology 1410 1986
-> 16 0 23 1362 topology 1601 1986
-> 15 0 23 1362 topology 1494 1987
-> 16 0 23 1362 topology 1601 1987
-> 15 0 23 1362 topology 1578 1988
-> 16 0 23 1362 topology 1601 1988
-> 15 0 24 1362 topology 1453 1989
-> 16 0 24 1362 topology 1454 1989
-> 15 0 23 1362 topology 1446 1990
-> 16 0 23 1362 topology 1601 1990
-> 15 0 23 1362 topology 1530 1991
-> 16 0 23 1362 topology 1601 1991
-> 15 0 24 1362 topology 1429 1992
-> 16 0 24 1362 topology 1430 1992
-> 15 0 24 1362 topology 1405 1993
-> 16 0 24 1362 topology 1406 1993
-> 15 0 24 1362 topology 1513 1994
-> 16 0 24 1362 topology 1514 1994
-> 15 0 23 1362 topology 1566 1995
-> 16 0 23 1362 topology 1601 1995
-> 15 0 24 1362 topology 1489 1996
-> 16 0 24 1362 topology 1490 1996
-> 15 0 23 1362 topology 1400 1997
-> 16 0 23 1362 topology 1601 1997
-> 15 0 24 1362 topology 1465 1998
-> 16 0 24 1362 topology 1466 1998
-> 15 0 24 1362 topology 1573 1999
-> 16 0 24 1362 topology 1574 1999
-> 15 0 23 1362 topology 1460 2000
-> 16 0 23 1362 topology 1601 2000
-> 15 0 24 1362 topology 1441 2001
-> 16 0 24 1362 topology 1442 2001
-> 15 0 24 1362 topology 1387 2002
-> 16 0 24 1362 topology 1388 2002
-> 15 0 24 1362 topology 1549 2003
-> 16 0 24 1362 topology 1550 2003
-> 15 0 23 1362 topology 1520 2004
-> 16 0 23 1362 topology 1601 2004
-> 15 0 23 1362 topology 1442 2005
-> 16 0 23 1362 topology 1601 2005
-> 15 0 24 1362 topology 1417 2006
-> 16 0 24 1362 topology 1418 2006
-> 15 0 24 1362 topology 1525 2007
-> 16 0 24 1362 topology 1526 2007
-> 15 0 23 1362 topology 1383 2008
-> 16 0 23 1362 topology 1601 2008
-> 15 0 23 1362 topology 1580 2009
-> 16 0 23 1362 topology 1601 2009
-> 15 0 23 1362 topology 1502 2010
-> 16 0 23 1362 topology 1601 2010
-> 15 0 24 1362 topology 1501 2011
-> 16 0 24 1362 topology 1502 2011
-> 15 0 24 1362 topology 1420 2012
-> 16 0 24 1362 topology 1422 2012
-> 15 0 24 1362 topology 1477 2013
-> 16 0 24 1362 topology 1478 2013
-> 15 0 23 1362 topology 1562 2014
-> 16 0 23 1362 topology 1601 2014
-> 15 0 24 1362 topology 1585 2015
-> 16 0 24 1362 topology 1586 2015
-> 15 0 24 1362 topology 1561 2016
-> 16 0 24 1362 topology 1562 2016
-> 15 0 24 1362 topology 1426 2017
-> 16 0 24 1362 topology 1428 2017
-> 15 0 24 1362 topology 1537 2018
-> 16 0 24 1362 topology 1538 2018
-> 15 0 24 1362 topology 1483 2019
-> 16 0 24 1362 topology 1485 2019
-> 15 0 24 1362 topology 1432 2020
-> 16 0 24 1362 topology 1434 2020
-> 15 0 24 1362 topology 1378 2021
-> 16 0 24 1362 topology 1380 2021
-> 15 0 23 1362 topology 1373 2022
-> 16 0 23 1362 topology 1601 2022
-> 15 0 24 1362 topology 1540 2023
-> 16 0 24 1362 topology 1542 2023
-> 15 0 24 1362 topology 1597 2024
-> 16 0 24 1362 topology 1598 2024
-> 15 0 24 1362 topology 1489 2025
-> 16 0 24 1362 topology 1491 2025
-> 15 0 23 1362 topology 1401 2026
-> 16 0 23 1362 topology 1601 2026
-> 15 0 23 1362 topology 1485 2027
-> 16 0 23 1362 topology 1601 2027
-> 15 0 24 1362 topology 1438 2028
-> 16 0 24 1362 topology 1440 2028
-> 15 0 24 1362 topology 1546 2029
-> 16 0 24 1362 topology 1548 2029
-> 15 0 24 1362 topology 1366 2030
-> 16 0 24 1362 topology 1367 2030
-> 15 0 24 1362 topology 1495 2031
-> 16 0 24 1362 topology 1497 2031
-> 15 0 23 1362 topology 1437 2032
-> 16 0 23 1362 topology 1601 2032
-> 15 0 23 1362 topology 1521 2033
-> 16 0 23 1362 topology 1601 2033
-> 15 0 24 1362 topology 1444 2034
-> 16 0 24 1362 topology 1446 2034
-> 15 0 24 1362 topology 1552 2035
-> 16 0 24 1362 topology 1554 2035
-> 15 0 23 1362 topology 1473 2036
-> 16 0 23 1362 topology 1601 2036
-> 15 0 24 1362 topology 1501 2037
-> 16 0 24 1362 topology 1503 2037
-> 15 0 23 1362 topology 1557 2038
-> 16 0 23 1362 topology 1601 2038
-> 15 0 23 1362 topology 1509 2039
-> 16 0 23 1362 topology 1601 2039
-> 15 0 24 1362 topology 1558 2040
-> 16 0 24 1362 topology 1560 2040
-> 15 0 23 1362 topology 1593 2041
-> 16 0 23 1362 topology 1601 2041
-> 15 0 24 1362 topology 1507 2042
-> 16 0 24 1362 topology 1509 2042
-> 15 0 23 1362 topology 1427 2043
-> 16 0 23 1362 topology 1601 2043
-> 15 0 24 1362 topology 1564 2044
-> 16 0 24 1362 topology 1566 2044
-> 15 0 23 1362 topology 1487 2045
-> 16 0 23 1362 topology 1601 2045
-> 15 0 23 1362 topology 1409 2046
-> 16 0 23 1362 topology 1601 2046
-> 15 0 23 1362 topology 1374 2047
-> 16 0 23 1362 topology 1601 2047
-> 15 0 23 1362 topology 1547 2048
-> 16 0 23 1362 topology 1601 2048
-> 15 0 23 1362 topology 1469 2049
-> 16 0 23 1362 topology 1601 2049
-> 15 0 24 1362 topology 1363 2050
-> 16 0 24 1362 topology 1365 2050
-> 15 0 23 1362 topology 1529 2051
-> 16 0 23 1362 topology 1601 2051
-> 15 0 23 1362 topology 1589 2052
-> 16 0 23 1362 topology 1601 2052
-> 15 0 23 1362 topology 1392 2053
-> 16 0 23 1362 topology 1601 2053
-> 15 0 23 1362 topology 1428 2054
-> 16 0 23 1362 topology 1601 2054
-> 15 0 23 1362 topology 1382 2055
-> 16 0 23 1362 topology 1601 2055
-> 15 0 23 1362 topology 1512 2056
-> 16 0 23 1362 topology 1601 2056
-> 15 0 24 1362 topology 1420 2057
-> 16 0 24 1362 topology 1421 2057
-> 15 0 23 1362 topology 1464 2058
-> 16 0 23 1362 topology 1601 2058
-> 15 0 24 1362 topology 1387 2059
-> 16 0 24 1362 topology 1389 2059
-> 15 0 24 1362 topology 1396 2060
-> 16 0 24 1362 topology 1397 2060
-> 15 0 24 1362 topology 1369 2061
-> 16 0 24 1362 topology 1370 2061
-> 15 0 23 1362 topology 1548 2062
-> 16 0 23 1362 topology 1601 2062
-> 15 0 23 1362 topology 1416 2063
-> 16 0 23 1362 topology 1601 2063
-> 15 0 23 1362 topology 1500 2064
-> 16 0 23 1362 topology 1601 2064
-> 15 0 24 1362 topology 1480 2065
-> 16 0 24 1362 topology 1481 2065
-> 15 0 23 1362 topology 1584 2066
-> 16 0 23 1362 topology 1601 2066
-> 15 0 24 1362 topology 1456 2067
-> 16 0 24 1362 topology 1457 2067
-> 15 0 23 1362 topology 1536 2068
-> 16 0 23 1362 topology 1601 2068
-> 15 0 24 1362 topology 1432 2069
-> 16 0 24 1362 topology 1433 2069
-> 15 0 24 1362 topology 1540 2070
-> 16 0 24 1362 topology 1541 2070
-> 15 0 23 1362 topology 1394 2071
-> 16 0 23 1362 topology 1601 2071
-> 15 0 24 1362 topology 1408 2072
-> 16 0 24 1362 topology 1409 2072
-> 15 0 24 1362 topology 1516 2073
-> 16 0 24 1362 topology 1517 2073
-> 15 0 23 1362 topology 1454 2074
-> 16 0 23 1362 topology 1601 2074
-> 15 0 23 1362 topology 1365 2075
-> 16 0 23 1362 topology 1601 2075
-> 15 0 24 1362 topology 1492 2076
-> 16 0 24 1362 topology 1493 2076
-> 15 0 23 1362 topology 1514 2077
-> 16 0 23 1362 topology 1601 2077
-> 15 0 24 1362 topology 1468 2078
-> 16 0 24 1362 topology 1469 2078
-> 15 0 23 1362 topology 1436 2079
-> 16 0 23 1362 topology 1601 2079
-> 15 0 24 1362 topology 1576 2080
-> 16 0 24 1362 topology 1577 2080
-> 15 0 23 1362 topology 1574 2081
-> 16 0 23 1362 topology 1601 2081
-> 15 0 23 1362 topology 1496 2082
-> 16 0 23 1362 topology 1601 2082
-> 15 0 24 1362 topology 1444 2083
-> 16 0 24 1362 topology 1445 2083
-> 15 0 24 1362 topology 1552 2084
-> 16 0 24 1362 topology 1553 2084
-> 15 0 23 1362 topology 1418 2085
-> 16 0 23 1362 topology 1601 2085
-> 15 0 24 1362 topology 1390 2086
-> 16 0 24 1362 topology 1392 2086
-> 15 0 24 1362 topology 1528 2087
-> 16 0 24 1362 topology 1529 2087
-> 15 0 23 1362 topology 1556 2088
-> 16 0 23 1362 topology 1601 2088
-> 15 0 23 1362 topology 1478 2089
-> 16 0 23 1362 topology 1601 2089
-> 15 0 23 1362 topology 1389 2090
-> 16 0 23 1362 topology 1601 2090
-> 15 0 24 1362 topology 1504 2091
-> 16 0 24 1362 topology 1505 2091
-> 15 0 24 1362 topology 1396 2092
-> 16 0 24 1362 topology 1398 2092
-> 15 0 23 1362 topology 1538 2093
-> 16 0 23 1362 topology 1601 2093
-> 15 0 24 1362 topology 1588 2094
-> 16 0 24 1362 topology 1589 2094
-> 15 0 24 1362 topology 1453 2095
-> 16 0 24 1362 topology 1455 2095
-> 15 0 24 1362 topology 1372 2096
-> 16 0 24 1362 topology 1374 2096
-> 15 0 23 1362 topology 1598 2097
-> 16 0 23 1362 topology 1601 2097
-> 15 0 24 1362 topology 1564 2098
-> 16 0 24 1362 topology 1565 2098
-> 15 0 24 1362 topology 1402 2099
-> 16 0 24 1362 topology 1404 2099
-> 15 0 23 1362 topology 1367 2100
-> 16 0 23 1362 topology 1601 2100
-> 15 0 24 1362 topology 1510 2101
-> 16 0 24 1362 topology 1512 2101
-> 15 0 24 1362 topology 1459 2102
-> 16 0 24 1362 topology 1461 2102
-> 15 0 24 1362 topology 1408 2103
-> 16 0 24 1362 topology 1410 2103
-> 15 0 24 1362 topology 1516 2104
-> 16 0 24 1362 topology 1518 2104
-> 15 0 26 1189 topology 1602 2105
-> 16 0 26 1189 topology 1600 2105
-> 15 0 27 1189 topology 1359 2106
-> 16 0 27 1189 topology 1361 2106
-> 15 0 26 1189 topology 1361 2107
-> 16 0 26 1189 topology 1604 2107
-> 15 0 21 1189 topology 1361 2108
-> 16 0 21 1189 topology 1602 2108
+> 15 0 23 1362 topology 1388 1945
+> 16 0 23 1362 topology 1601 1945
+> 15 0 24 1362 topology 1600 1946
+> 16 0 24 1362 topology 1601 1946
+> 15 0 25 1362 topology 1390 1947
+> 16 0 25 1362 topology 1392 1947
+> 15 0 25 1362 topology 1390 1948
+> 16 0 25 1362 topology 1391 1948
+> 15 0 25 1362 topology 1393 1949
+> 16 0 25 1362 topology 1395 1949
+> 15 0 25 1362 topology 1393 1950
+> 16 0 25 1362 topology 1394 1950
+> 15 0 25 1362 topology 1396 1951
+> 16 0 25 1362 topology 1398 1951
+> 15 0 25 1362 topology 1396 1952
+> 16 0 25 1362 topology 1397 1952
+> 15 0 25 1362 topology 1399 1953
+> 16 0 25 1362 topology 1401 1953
+> 15 0 25 1362 topology 1399 1954
+> 16 0 25 1362 topology 1400 1954
+> 15 0 25 1362 topology 1402 1955
+> 16 0 25 1362 topology 1404 1955
+> 15 0 25 1362 topology 1402 1956
+> 16 0 25 1362 topology 1403 1956
+> 15 0 25 1362 topology 1405 1957
+> 16 0 25 1362 topology 1407 1957
+> 15 0 25 1362 topology 1405 1958
+> 16 0 25 1362 topology 1406 1958
+> 15 0 25 1362 topology 1408 1959
+> 16 0 25 1362 topology 1410 1959
+> 15 0 25 1362 topology 1408 1960
+> 16 0 25 1362 topology 1409 1960
+> 15 0 25 1362 topology 1411 1961
+> 16 0 25 1362 topology 1413 1961
+> 15 0 25 1362 topology 1411 1962
+> 16 0 25 1362 topology 1412 1962
+> 15 0 25 1362 topology 1414 1963
+> 16 0 25 1362 topology 1416 1963
+> 15 0 25 1362 topology 1414 1964
+> 16 0 25 1362 topology 1415 1964
+> 15 0 25 1362 topology 1417 1965
+> 16 0 25 1362 topology 1419 1965
+> 15 0 25 1362 topology 1417 1966
+> 16 0 25 1362 topology 1418 1966
+> 15 0 25 1362 topology 1363 1967
+> 16 0 25 1362 topology 1365 1967
+> 15 0 25 1362 topology 1363 1968
+> 16 0 25 1362 topology 1364 1968
+> 15 0 25 1362 topology 1420 1969
+> 16 0 25 1362 topology 1422 1969
+> 15 0 25 1362 topology 1420 1970
+> 16 0 25 1362 topology 1421 1970
+> 15 0 25 1362 topology 1423 1971
+> 16 0 25 1362 topology 1425 1971
+> 15 0 25 1362 topology 1423 1972
+> 16 0 25 1362 topology 1424 1972
+> 15 0 25 1362 topology 1426 1973
+> 16 0 25 1362 topology 1428 1973
+> 15 0 25 1362 topology 1426 1974
+> 16 0 25 1362 topology 1427 1974
+> 15 0 25 1362 topology 1429 1975
+> 16 0 25 1362 topology 1431 1975
+> 15 0 25 1362 topology 1429 1976
+> 16 0 25 1362 topology 1430 1976
+> 15 0 25 1362 topology 1432 1977
+> 16 0 25 1362 topology 1434 1977
+> 15 0 25 1362 topology 1432 1978
+> 16 0 25 1362 topology 1433 1978
+> 15 0 25 1362 topology 1435 1979
+> 16 0 25 1362 topology 1437 1979
+> 15 0 25 1362 topology 1435 1980
+> 16 0 25 1362 topology 1436 1980
+> 15 0 25 1362 topology 1438 1981
+> 16 0 25 1362 topology 1440 1981
+> 15 0 25 1362 topology 1438 1982
+> 16 0 25 1362 topology 1439 1982
+> 15 0 25 1362 topology 1441 1983
+> 16 0 25 1362 topology 1443 1983
+> 15 0 25 1362 topology 1441 1984
+> 16 0 25 1362 topology 1442 1984
+> 15 0 25 1362 topology 1444 1985
+> 16 0 25 1362 topology 1446 1985
+> 15 0 25 1362 topology 1444 1986
+> 16 0 25 1362 topology 1445 1986
+> 15 0 25 1362 topology 1447 1987
+> 16 0 25 1362 topology 1449 1987
+> 15 0 25 1362 topology 1447 1988
+> 16 0 25 1362 topology 1448 1988
+> 15 0 25 1362 topology 1366 1989
+> 16 0 25 1362 topology 1368 1989
+> 15 0 25 1362 topology 1366 1990
+> 16 0 25 1362 topology 1367 1990
+> 15 0 25 1362 topology 1450 1991
+> 16 0 25 1362 topology 1452 1991
+> 15 0 25 1362 topology 1450 1992
+> 16 0 25 1362 topology 1451 1992
+> 15 0 25 1362 topology 1453 1993
+> 16 0 25 1362 topology 1455 1993
+> 15 0 25 1362 topology 1453 1994
+> 16 0 25 1362 topology 1454 1994
+> 15 0 25 1362 topology 1456 1995
+> 16 0 25 1362 topology 1458 1995
+> 15 0 25 1362 topology 1456 1996
+> 16 0 25 1362 topology 1457 1996
+> 15 0 25 1362 topology 1459 1997
+> 16 0 25 1362 topology 1461 1997
+> 15 0 25 1362 topology 1459 1998
+> 16 0 25 1362 topology 1460 1998
+> 15 0 25 1362 topology 1462 1999
+> 16 0 25 1362 topology 1464 1999
+> 15 0 25 1362 topology 1462 2000
+> 16 0 25 1362 topology 1463 2000
+> 15 0 25 1362 topology 1465 2001
+> 16 0 25 1362 topology 1467 2001
+> 15 0 25 1362 topology 1465 2002
+> 16 0 25 1362 topology 1466 2002
+> 15 0 25 1362 topology 1468 2003
+> 16 0 25 1362 topology 1470 2003
+> 15 0 25 1362 topology 1468 2004
+> 16 0 25 1362 topology 1469 2004
+> 15 0 25 1362 topology 1471 2005
+> 16 0 25 1362 topology 1473 2005
+> 15 0 25 1362 topology 1471 2006
+> 16 0 25 1362 topology 1472 2006
+> 15 0 25 1362 topology 1474 2007
+> 16 0 25 1362 topology 1476 2007
+> 15 0 25 1362 topology 1474 2008
+> 16 0 25 1362 topology 1475 2008
+> 15 0 25 1362 topology 1477 2009
+> 16 0 25 1362 topology 1479 2009
+> 15 0 25 1362 topology 1477 2010
+> 16 0 25 1362 topology 1478 2010
+> 15 0 25 1362 topology 1369 2011
+> 16 0 25 1362 topology 1371 2011
+> 15 0 25 1362 topology 1369 2012
+> 16 0 25 1362 topology 1370 2012
+> 15 0 25 1362 topology 1480 2013
+> 16 0 25 1362 topology 1482 2013
+> 15 0 25 1362 topology 1480 2014
+> 16 0 25 1362 topology 1481 2014
+> 15 0 25 1362 topology 1483 2015
+> 16 0 25 1362 topology 1485 2015
+> 15 0 25 1362 topology 1483 2016
+> 16 0 25 1362 topology 1484 2016
+> 15 0 25 1362 topology 1486 2017
+> 16 0 25 1362 topology 1488 2017
+> 15 0 25 1362 topology 1486 2018
+> 16 0 25 1362 topology 1487 2018
+> 15 0 25 1362 topology 1489 2019
+> 16 0 25 1362 topology 1491 2019
+> 15 0 25 1362 topology 1489 2020
+> 16 0 25 1362 topology 1490 2020
+> 15 0 25 1362 topology 1492 2021
+> 16 0 25 1362 topology 1494 2021
+> 15 0 25 1362 topology 1492 2022
+> 16 0 25 1362 topology 1493 2022
+> 15 0 25 1362 topology 1495 2023
+> 16 0 25 1362 topology 1497 2023
+> 15 0 25 1362 topology 1495 2024
+> 16 0 25 1362 topology 1496 2024
+> 15 0 25 1362 topology 1498 2025
+> 16 0 25 1362 topology 1500 2025
+> 15 0 25 1362 topology 1498 2026
+> 16 0 25 1362 topology 1499 2026
+> 15 0 25 1362 topology 1501 2027
+> 16 0 25 1362 topology 1503 2027
+> 15 0 25 1362 topology 1501 2028
+> 16 0 25 1362 topology 1502 2028
+> 15 0 25 1362 topology 1504 2029
+> 16 0 25 1362 topology 1506 2029
+> 15 0 25 1362 topology 1504 2030
+> 16 0 25 1362 topology 1505 2030
+> 15 0 25 1362 topology 1507 2031
+> 16 0 25 1362 topology 1509 2031
+> 15 0 25 1362 topology 1507 2032
+> 16 0 25 1362 topology 1508 2032
+> 15 0 25 1362 topology 1372 2033
+> 16 0 25 1362 topology 1374 2033
+> 15 0 25 1362 topology 1372 2034
+> 16 0 25 1362 topology 1373 2034
+> 15 0 25 1362 topology 1510 2035
+> 16 0 25 1362 topology 1512 2035
+> 15 0 25 1362 topology 1510 2036
+> 16 0 25 1362 topology 1511 2036
+> 15 0 25 1362 topology 1513 2037
+> 16 0 25 1362 topology 1515 2037
+> 15 0 25 1362 topology 1513 2038
+> 16 0 25 1362 topology 1514 2038
+> 15 0 25 1362 topology 1516 2039
+> 16 0 25 1362 topology 1518 2039
+> 15 0 25 1362 topology 1516 2040
+> 16 0 25 1362 topology 1517 2040
+> 15 0 25 1362 topology 1519 2041
+> 16 0 25 1362 topology 1521 2041
+> 15 0 25 1362 topology 1519 2042
+> 16 0 25 1362 topology 1520 2042
+> 15 0 25 1362 topology 1522 2043
+> 16 0 25 1362 topology 1524 2043
+> 15 0 25 1362 topology 1522 2044
+> 16 0 25 1362 topology 1523 2044
+> 15 0 25 1362 topology 1525 2045
+> 16 0 25 1362 topology 1527 2045
+> 15 0 25 1362 topology 1525 2046
+> 16 0 25 1362 topology 1526 2046
+> 15 0 25 1362 topology 1528 2047
+> 16 0 25 1362 topology 1530 2047
+> 15 0 25 1362 topology 1528 2048
+> 16 0 25 1362 topology 1529 2048
+> 15 0 25 1362 topology 1531 2049
+> 16 0 25 1362 topology 1533 2049
+> 15 0 25 1362 topology 1531 2050
+> 16 0 25 1362 topology 1532 2050
+> 15 0 25 1362 topology 1534 2051
+> 16 0 25 1362 topology 1536 2051
+> 15 0 25 1362 topology 1534 2052
+> 16 0 25 1362 topology 1535 2052
+> 15 0 25 1362 topology 1537 2053
+> 16 0 25 1362 topology 1539 2053
+> 15 0 25 1362 topology 1537 2054
+> 16 0 25 1362 topology 1538 2054
+> 15 0 25 1362 topology 1375 2055
+> 16 0 25 1362 topology 1377 2055
+> 15 0 25 1362 topology 1375 2056
+> 16 0 25 1362 topology 1376 2056
+> 15 0 25 1362 topology 1540 2057
+> 16 0 25 1362 topology 1542 2057
+> 15 0 25 1362 topology 1540 2058
+> 16 0 25 1362 topology 1541 2058
+> 15 0 25 1362 topology 1543 2059
+> 16 0 25 1362 topology 1545 2059
+> 15 0 25 1362 topology 1543 2060
+> 16 0 25 1362 topology 1544 2060
+> 15 0 25 1362 topology 1546 2061
+> 16 0 25 1362 topology 1548 2061
+> 15 0 25 1362 topology 1546 2062
+> 16 0 25 1362 topology 1547 2062
+> 15 0 25 1362 topology 1549 2063
+> 16 0 25 1362 topology 1551 2063
+> 15 0 25 1362 topology 1549 2064
+> 16 0 25 1362 topology 1550 2064
+> 15 0 25 1362 topology 1552 2065
+> 16 0 25 1362 topology 1554 2065
+> 15 0 25 1362 topology 1552 2066
+> 16 0 25 1362 topology 1553 2066
+> 15 0 25 1362 topology 1555 2067
+> 16 0 25 1362 topology 1557 2067
+> 15 0 25 1362 topology 1555 2068
+> 16 0 25 1362 topology 1556 2068
+> 15 0 25 1362 topology 1558 2069
+> 16 0 25 1362 topology 1560 2069
+> 15 0 25 1362 topology 1558 2070
+> 16 0 25 1362 topology 1559 2070
+> 15 0 25 1362 topology 1561 2071
+> 16 0 25 1362 topology 1563 2071
+> 15 0 25 1362 topology 1561 2072
+> 16 0 25 1362 topology 1562 2072
+> 15 0 25 1362 topology 1564 2073
+> 16 0 25 1362 topology 1566 2073
+> 15 0 25 1362 topology 1564 2074
+> 16 0 25 1362 topology 1565 2074
+> 15 0 25 1362 topology 1567 2075
+> 16 0 25 1362 topology 1569 2075
+> 15 0 25 1362 topology 1567 2076
+> 16 0 25 1362 topology 1568 2076
+> 15 0 25 1362 topology 1378 2077
+> 16 0 25 1362 topology 1380 2077
+> 15 0 25 1362 topology 1378 2078
+> 16 0 25 1362 topology 1379 2078
+> 15 0 25 1362 topology 1570 2079
+> 16 0 25 1362 topology 1572 2079
+> 15 0 25 1362 topology 1570 2080
+> 16 0 25 1362 topology 1571 2080
+> 15 0 25 1362 topology 1573 2081
+> 16 0 25 1362 topology 1575 2081
+> 15 0 25 1362 topology 1573 2082
+> 16 0 25 1362 topology 1574 2082
+> 15 0 25 1362 topology 1576 2083
+> 16 0 25 1362 topology 1578 2083
+> 15 0 25 1362 topology 1576 2084
+> 16 0 25 1362 topology 1577 2084
+> 15 0 25 1362 topology 1579 2085
+> 16 0 25 1362 topology 1581 2085
+> 15 0 25 1362 topology 1579 2086
+> 16 0 25 1362 topology 1580 2086
+> 15 0 25 1362 topology 1582 2087
+> 16 0 25 1362 topology 1584 2087
+> 15 0 25 1362 topology 1582 2088
+> 16 0 25 1362 topology 1583 2088
+> 15 0 25 1362 topology 1585 2089
+> 16 0 25 1362 topology 1587 2089
+> 15 0 25 1362 topology 1585 2090
+> 16 0 25 1362 topology 1586 2090
+> 15 0 25 1362 topology 1588 2091
+> 16 0 25 1362 topology 1590 2091
+> 15 0 25 1362 topology 1588 2092
+> 16 0 25 1362 topology 1589 2092
+> 15 0 25 1362 topology 1591 2093
+> 16 0 25 1362 topology 1593 2093
+> 15 0 25 1362 topology 1591 2094
+> 16 0 25 1362 topology 1592 2094
+> 15 0 25 1362 topology 1594 2095
+> 16 0 25 1362 topology 1596 2095
+> 15 0 25 1362 topology 1594 2096
+> 16 0 25 1362 topology 1595 2096
+> 15 0 25 1362 topology 1597 2097
+> 16 0 25 1362 topology 1599 2097
+> 15 0 25 1362 topology 1597 2098
+> 16 0 25 1362 topology 1598 2098
+> 15 0 25 1362 topology 1381 2099
+> 16 0 25 1362 topology 1383 2099
+> 15 0 25 1362 topology 1381 2100
+> 16 0 25 1362 topology 1382 2100
+> 15 0 25 1362 topology 1384 2101
+> 16 0 25 1362 topology 1386 2101
+> 15 0 25 1362 topology 1384 2102
+> 16 0 25 1362 topology 1385 2102
+> 15 0 25 1362 topology 1387 2103
+> 16 0 25 1362 topology 1389 2103
+> 15 0 25 1362 topology 1387 2104
+> 16 0 25 1362 topology 1388 2104
+> 15 0 26 1189 topology 1361 2105
+> 16 0 26 1189 topology 1604 2105
+> 15 0 26 1189 topology 1602 2106
+> 16 0 26 1189 topology 1604 2106
+> 15 0 27 1189 topology 1359 2107
+> 16 0 27 1189 topology 1361 2107
+> 15 0 20 1189 topology 1361 2108
+> 16 0 20 1189 topology 1602 2108
 > 15 0 26 1189 topology 1602 2109
-> 16 0 26 1189 topology 1604 2109
-> 15 0 28 1608 topology 1641 2110
+> 16 0 26 1189 topology 1600 2109
+> 15 0 28 1608 topology 1638 2110
 > 16 0 28 1608 topology 1727 2110
-> 15 0 28 1608 topology 1701 2111
+> 15 0 28 1608 topology 1637 2111
 > 16 0 28 1608 topology 1727 2111
-> 15 0 28 1608 topology 1631 2112
+> 15 0 28 1608 topology 1641 2112
 > 16 0 28 1608 topology 1727 2112
-> 15 0 28 1608 topology 1677 2113
+> 15 0 28 1608 topology 1640 2113
 > 16 0 28 1608 topology 1727 2113
-> 15 0 28 1608 topology 1653 2114
+> 15 0 28 1608 topology 1644 2114
 > 16 0 28 1608 topology 1727 2114
-> 15 0 29 1608 topology 1633 2115
-> 16 0 29 1608 topology 1634 2115
-> 15 0 28 1608 topology 1713 2116
+> 15 0 28 1608 topology 1643 2115
+> 16 0 28 1608 topology 1727 2115
+> 15 0 28 1608 topology 1647 2116
 > 16 0 28 1608 topology 1727 2116
-> 15 0 28 1608 topology 1689 2117
+> 15 0 28 1608 topology 1646 2117
 > 16 0 28 1608 topology 1727 2117
-> 15 0 29 1608 topology 1609 2118
-> 16 0 29 1608 topology 1611 2118
-> 15 0 29 1608 topology 1636 2119
-> 16 0 29 1608 topology 1638 2119
-> 15 0 28 1608 topology 1665 2120
+> 15 0 28 1608 topology 1650 2118
+> 16 0 28 1608 topology 1727 2118
+> 15 0 28 1608 topology 1649 2119
+> 16 0 28 1608 topology 1727 2119
+> 15 0 28 1608 topology 1653 2120
 > 16 0 28 1608 topology 1727 2120
-> 15 0 29 1608 topology 1639 2121
-> 16 0 29 1608 topology 1641 2121
-> 15 0 28 1608 topology 1725 2122
+> 15 0 28 1608 topology 1652 2121
+> 16 0 28 1608 topology 1727 2121
+> 15 0 28 1608 topology 1656 2122
 > 16 0 28 1608 topology 1727 2122
-> 15 0 28 1608 topology 1637 2123
+> 15 0 28 1608 topology 1655 2123
 > 16 0 28 1608 topology 1727 2123
-> 15 0 29 1608 topology 1642 2124
-> 16 0 29 1608 topology 1644 2124
-> 15 0 29 1608 topology 1696 2125
-> 16 0 29 1608 topology 1698 2125
-> 15 0 28 1608 topology 1667 2126
+> 15 0 28 1608 topology 1659 2124
+> 16 0 28 1608 topology 1727 2124
+> 15 0 28 1608 topology 1658 2125
+> 16 0 28 1608 topology 1727 2125
+> 15 0 28 1608 topology 1662 2126
 > 16 0 28 1608 topology 1727 2126
-> 15 0 29 1608 topology 1645 2127
-> 16 0 29 1608 topology 1647 2127
-> 15 0 28 1608 topology 1697 2128
+> 15 0 28 1608 topology 1661 2127
+> 16 0 28 1608 topology 1727 2127
+> 15 0 28 1608 topology 1665 2128
 > 16 0 28 1608 topology 1727 2128
-> 15 0 29 1608 topology 1699 2129
-> 16 0 29 1608 topology 1701 2129
-> 15 0 29 1608 topology 1621 2130
-> 16 0 29 1608 topology 1623 2130
-> 15 0 28 1608 topology 1649 2131
+> 15 0 28 1608 topology 1664 2129
+> 16 0 28 1608 topology 1727 2129
+> 15 0 28 1608 topology 1611 2130
+> 16 0 28 1608 topology 1727 2130
+> 15 0 28 1608 topology 1610 2131
 > 16 0 28 1608 topology 1727 2131
-> 15 0 29 1608 topology 1648 2132
-> 16 0 29 1608 topology 1650 2132
-> 15 0 29 1608 topology 1702 2133
-> 16 0 29 1608 topology 1704 2133
-> 15 0 28 1608 topology 1679 2134
+> 15 0 28 1608 topology 1668 2132
+> 16 0 28 1608 topology 1727 2132
+> 15 0 28 1608 topology 1667 2133
+> 16 0 28 1608 topology 1727 2133
+> 15 0 28 1608 topology 1671 2134
 > 16 0 28 1608 topology 1727 2134
-> 15 0 28 1608 topology 1620 2135
+> 15 0 28 1608 topology 1670 2135
 > 16 0 28 1608 topology 1727 2135
-> 15 0 29 1608 topology 1651 2136
-> 16 0 29 1608 topology 1653 2136
-> 15 0 29 1608 topology 1705 2137
-> 16 0 29 1608 topology 1707 2137
-> 15 0 28 1608 topology 1709 2138
+> 15 0 28 1608 topology 1674 2136
+> 16 0 28 1608 topology 1727 2136
+> 15 0 28 1608 topology 1673 2137
+> 16 0 28 1608 topology 1727 2137
+> 15 0 28 1608 topology 1677 2138
 > 16 0 28 1608 topology 1727 2138
-> 15 0 29 1608 topology 1654 2139
-> 16 0 29 1608 topology 1656 2139
-> 15 0 28 1608 topology 1661 2140
+> 15 0 28 1608 topology 1676 2139
+> 16 0 28 1608 topology 1727 2139
+> 15 0 28 1608 topology 1680 2140
 > 16 0 28 1608 topology 1727 2140
-> 15 0 29 1608 topology 1708 2141
-> 16 0 29 1608 topology 1710 2141
-> 15 0 29 1608 topology 1636 2142
-> 16 0 29 1608 topology 1637 2142
-> 15 0 28 1608 topology 1691 2143
+> 15 0 28 1608 topology 1679 2141
+> 16 0 28 1608 topology 1727 2141
+> 15 0 28 1608 topology 1683 2142
+> 16 0 28 1608 topology 1727 2142
+> 15 0 28 1608 topology 1682 2143
 > 16 0 28 1608 topology 1727 2143
-> 15 0 28 1608 topology 1632 2144
+> 15 0 28 1608 topology 1686 2144
 > 16 0 28 1608 topology 1727 2144
-> 15 0 29 1608 topology 1657 2145
-> 16 0 29 1608 topology 1659 2145
-> 15 0 29 1608 topology 1711 2146
-> 16 0 29 1608 topology 1713 2146
-> 15 0 28 1608 topology 1721 2147
+> 15 0 28 1608 topology 1685 2145
+> 16 0 28 1608 topology 1727 2145
+> 15 0 28 1608 topology 1689 2146
+> 16 0 28 1608 topology 1727 2146
+> 15 0 28 1608 topology 1688 2147
 > 16 0 28 1608 topology 1727 2147
-> 15 0 29 1608 topology 1612 2148
-> 16 0 29 1608 topology 1613 2148
-> 15 0 29 1608 topology 1666 2149
-> 16 0 29 1608 topology 1667 2149
-> 15 0 30 1608 topology 1726 2150
-> 16 0 30 1608 topology 1727 2150
-> 15 0 29 1608 topology 1633 2151
-> 16 0 29 1608 topology 1635 2151
-> 15 0 29 1608 topology 1660 2152
-> 16 0 29 1608 topology 1662 2152
-> 15 0 29 1608 topology 1714 2153
-> 16 0 29 1608 topology 1716 2153
-> 15 0 29 1608 topology 1642 2154
-> 16 0 29 1608 topology 1643 2154
-> 15 0 29 1608 topology 1696 2155
-> 16 0 29 1608 topology 1697 2155
-> 15 0 29 1608 topology 1663 2156
-> 16 0 29 1608 topology 1665 2156
-> 15 0 29 1608 topology 1717 2157
-> 16 0 29 1608 topology 1719 2157
-> 15 0 29 1608 topology 1672 2158
-> 16 0 29 1608 topology 1673 2158
-> 15 0 29 1608 topology 1720 2159
-> 16 0 29 1608 topology 1722 2159
-> 15 0 29 1608 topology 1648 2160
-> 16 0 29 1608 topology 1649 2160
-> 15 0 29 1608 topology 1702 2161
-> 16 0 29 1608 topology 1703 2161
-> 15 0 28 1608 topology 1616 2162
+> 15 0 28 1608 topology 1692 2148
+> 16 0 28 1608 topology 1727 2148
+> 15 0 28 1608 topology 1691 2149
+> 16 0 28 1608 topology 1727 2149
+> 15 0 28 1608 topology 1695 2150
+> 16 0 28 1608 topology 1727 2150
+> 15 0 28 1608 topology 1694 2151
+> 16 0 28 1608 topology 1727 2151
+> 15 0 28 1608 topology 1614 2152
+> 16 0 28 1608 topology 1727 2152
+> 15 0 28 1608 topology 1613 2153
+> 16 0 28 1608 topology 1727 2153
+> 15 0 28 1608 topology 1698 2154
+> 16 0 28 1608 topology 1727 2154
+> 15 0 28 1608 topology 1697 2155
+> 16 0 28 1608 topology 1727 2155
+> 15 0 28 1608 topology 1701 2156
+> 16 0 28 1608 topology 1727 2156
+> 15 0 28 1608 topology 1700 2157
+> 16 0 28 1608 topology 1727 2157
+> 15 0 28 1608 topology 1704 2158
+> 16 0 28 1608 topology 1727 2158
+> 15 0 28 1608 topology 1703 2159
+> 16 0 28 1608 topology 1727 2159
+> 15 0 28 1608 topology 1707 2160
+> 16 0 28 1608 topology 1727 2160
+> 15 0 28 1608 topology 1706 2161
+> 16 0 28 1608 topology 1727 2161
+> 15 0 28 1608 topology 1710 2162
 > 16 0 28 1608 topology 1727 2162
-> 15 0 29 1608 topology 1723 2163
-> 16 0 29 1608 topology 1725 2163
-> 15 0 29 1608 topology 1624 2164
-> 16 0 29 1608 topology 1625 2164
-> 15 0 29 1608 topology 1678 2165
-> 16 0 29 1608 topology 1679 2165
-> 15 0 28 1608 topology 1668 2166
+> 15 0 28 1608 topology 1709 2163
+> 16 0 28 1608 topology 1727 2163
+> 15 0 28 1608 topology 1713 2164
+> 16 0 28 1608 topology 1727 2164
+> 15 0 28 1608 topology 1712 2165
+> 16 0 28 1608 topology 1727 2165
+> 15 0 28 1608 topology 1716 2166
 > 16 0 28 1608 topology 1727 2166
-> 15 0 28 1608 topology 1644 2167
+> 15 0 28 1608 topology 1715 2167
 > 16 0 28 1608 topology 1727 2167
-> 15 0 29 1608 topology 1654 2168
-> 16 0 29 1608 topology 1655 2168
-> 15 0 29 1608 topology 1708 2169
-> 16 0 29 1608 topology 1709 2169
-> 15 0 28 1608 topology 1628 2170
+> 15 0 28 1608 topology 1719 2168
+> 16 0 28 1608 topology 1727 2168
+> 15 0 28 1608 topology 1718 2169
+> 16 0 28 1608 topology 1727 2169
+> 15 0 28 1608 topology 1722 2170
 > 16 0 28 1608 topology 1727 2170
-> 15 0 29 1608 topology 1684 2171
-> 16 0 29 1608 topology 1685 2171
-> 15 0 28 1608 topology 1704 2172
+> 15 0 28 1608 topology 1721 2171
+> 16 0 28 1608 topology 1727 2171
+> 15 0 28 1608 topology 1725 2172
 > 16 0 28 1608 topology 1727 2172
-> 15 0 28 1608 topology 1680 2173
+> 15 0 28 1608 topology 1724 2173
 > 16 0 28 1608 topology 1727 2173
-> 15 0 28 1608 topology 1656 2174
+> 15 0 28 1608 topology 1617 2174
 > 16 0 28 1608 topology 1727 2174
-> 15 0 29 1608 topology 1660 2175
-> 16 0 29 1608 topology 1661 2175
-> 15 0 29 1608 topology 1714 2176
-> 16 0 29 1608 topology 1715 2176
-> 15 0 29 1608 topology 1690 2177
-> 16 0 29 1608 topology 1691 2177
-> 15 0 28 1608 topology 1716 2178
+> 15 0 28 1608 topology 1616 2175
+> 16 0 28 1608 topology 1727 2175
+> 15 0 28 1608 topology 1620 2176
+> 16 0 28 1608 topology 1727 2176
+> 15 0 28 1608 topology 1619 2177
+> 16 0 28 1608 topology 1727 2177
+> 15 0 28 1608 topology 1623 2178
 > 16 0 28 1608 topology 1727 2178
-> 15 0 28 1608 topology 1692 2179
+> 15 0 28 1608 topology 1622 2179
 > 16 0 28 1608 topology 1727 2179
-> 15 0 29 1608 topology 1720 2180
-> 16 0 29 1608 topology 1721 2180
-> 15 0 29 1608 topology 1618 2181
-> 16 0 29 1608 topology 1620 2181
-> 15 0 28 1608 topology 1611 2182
+> 15 0 28 1608 topology 1626 2180
+> 16 0 28 1608 topology 1727 2180
+> 15 0 28 1608 topology 1625 2181
+> 16 0 28 1608 topology 1727 2181
+> 15 0 28 1608 topology 1629 2182
 > 16 0 28 1608 topology 1727 2182
-> 15 0 28 1608 topology 1646 2183
+> 15 0 28 1608 topology 1628 2183
 > 16 0 28 1608 topology 1727 2183
-> 15 0 28 1608 topology 1676 2184
+> 15 0 28 1608 topology 1632 2184
 > 16 0 28 1608 topology 1727 2184
-> 15 0 28 1608 topology 1706 2185
+> 15 0 28 1608 topology 1631 2185
 > 16 0 28 1608 topology 1727 2185
-> 15 0 28 1608 topology 1623 2186
+> 15 0 28 1608 topology 1635 2186
 > 16 0 28 1608 topology 1727 2186
-> 15 0 28 1608 topology 1658 2187
+> 15 0 28 1608 topology 1634 2187
 > 16 0 28 1608 topology 1727 2187
-> 15 0 28 1608 topology 1688 2188
-> 16 0 28 1608 topology 1727 2188
-> 15 0 28 1608 topology 1718 2189
-> 16 0 28 1608 topology 1727 2189
-> 15 0 29 1608 topology 1630 2190
-> 16 0 29 1608 topology 1632 2190
-> 15 0 28 1608 topology 1635 2191
-> 16 0 28 1608 topology 1727 2191
-> 15 0 29 1608 topology 1615 2192
-> 16 0 29 1608 topology 1616 2192
-> 15 0 28 1608 topology 1613 2193
-> 16 0 28 1608 topology 1727 2193
-> 15 0 28 1608 topology 1625 2194
-> 16 0 28 1608 topology 1727 2194
-> 15 0 29 1608 topology 1627 2195
-> 16 0 29 1608 topology 1628 2195
-> 15 0 28 1608 topology 1671 2196
-> 16 0 28 1608 topology 1727 2196
-> 15 0 28 1608 topology 1647 2197
-> 16 0 28 1608 topology 1727 2197
-> 15 0 28 1608 topology 1707 2198
-> 16 0 28 1608 topology 1727 2198
-> 15 0 28 1608 topology 1683 2199
-> 16 0 28 1608 topology 1727 2199
-> 15 0 28 1608 topology 1659 2200
-> 16 0 28 1608 topology 1727 2200
-> 15 0 28 1608 topology 1719 2201
-> 16 0 28 1608 topology 1727 2201
-> 15 0 28 1608 topology 1695 2202
-> 16 0 28 1608 topology 1727 2202
-> 15 0 29 1608 topology 1666 2203
-> 16 0 29 1608 topology 1668 2203
-> 15 0 29 1608 topology 1615 2204
-> 16 0 29 1608 topology 1617 2204
-> 15 0 29 1608 topology 1669 2205
-> 16 0 29 1608 topology 1671 2205
-> 15 0 28 1608 topology 1643 2206
-> 16 0 28 1608 topology 1727 2206
-> 15 0 29 1608 topology 1672 2207
-> 16 0 29 1608 topology 1674 2207
-> 15 0 28 1608 topology 1673 2208
-> 16 0 28 1608 topology 1727 2208
-> 15 0 28 1608 topology 1614 2209
-> 16 0 28 1608 topology 1727 2209
-> 15 0 29 1608 topology 1675 2210
-> 16 0 29 1608 topology 1677 2210
-> 15 0 28 1608 topology 1703 2211
-> 16 0 28 1608 topology 1727 2211
-> 15 0 28 1608 topology 1655 2212
-> 16 0 28 1608 topology 1727 2212
-> 15 0 29 1608 topology 1678 2213
-> 16 0 29 1608 topology 1680 2213
-> 15 0 28 1608 topology 1685 2214
-> 16 0 28 1608 topology 1727 2214
-> 15 0 28 1608 topology 1626 2215
-> 16 0 28 1608 topology 1727 2215
-> 15 0 29 1608 topology 1627 2216
-> 16 0 29 1608 topology 1629 2216
-> 15 0 29 1608 topology 1681 2217
-> 16 0 29 1608 topology 1683 2217
-> 15 0 28 1608 topology 1715 2218
-> 16 0 28 1608 topology 1727 2218
-> 15 0 29 1608 topology 1684 2219
-> 16 0 29 1608 topology 1686 2219
-> 15 0 29 1608 topology 1639 2220
-> 16 0 29 1608 topology 1640 2220
-> 15 0 29 1608 topology 1687 2221
-> 16 0 29 1608 topology 1689 2221
-> 15 0 29 1608 topology 1669 2222
-> 16 0 29 1608 topology 1670 2222
-> 15 0 29 1608 topology 1690 2223
-> 16 0 29 1608 topology 1692 2223
-> 15 0 29 1608 topology 1618 2224
-> 16 0 29 1608 topology 1619 2224
-> 15 0 29 1608 topology 1645 2225
-> 16 0 29 1608 topology 1646 2225
-> 15 0 29 1608 topology 1699 2226
-> 16 0 29 1608 topology 1700 2226
-> 15 0 28 1608 topology 1610 2227
-> 16 0 28 1608 topology 1727 2227
-> 15 0 29 1608 topology 1693 2228
-> 16 0 29 1608 topology 1695 2228
-> 15 0 29 1608 topology 1675 2229
-> 16 0 29 1608 topology 1676 2229
-> 15 0 28 1608 topology 1638 2230
-> 16 0 28 1608 topology 1727 2230
-> 15 0 29 1608 topology 1651 2231
-> 16 0 29 1608 topology 1652 2231
-> 15 0 29 1608 topology 1705 2232
-> 16 0 29 1608 topology 1706 2232
-> 15 0 28 1608 topology 1622 2233
-> 16 0 28 1608 topology 1727 2233
-> 15 0 29 1608 topology 1681 2234
-> 16 0 29 1608 topology 1682 2234
-> 15 0 28 1608 topology 1698 2235
-> 16 0 28 1608 topology 1727 2235
-> 15 0 28 1608 topology 1674 2236
-> 16 0 28 1608 topology 1727 2236
-> 15 0 29 1608 topology 1630 2237
-> 16 0 29 1608 topology 1631 2237
-> 15 0 28 1608 topology 1650 2238
-> 16 0 28 1608 topology 1727 2238
-> 15 0 29 1608 topology 1657 2239
-> 16 0 29 1608 topology 1658 2239
-> 15 0 29 1608 topology 1711 2240
-> 16 0 29 1608 topology 1712 2240
-> 15 0 28 1608 topology 1634 2241
-> 16 0 28 1608 topology 1727 2241
-> 15 0 29 1608 topology 1687 2242
-> 16 0 29 1608 topology 1688 2242
-> 15 0 28 1608 topology 1710 2243
-> 16 0 28 1608 topology 1727 2243
-> 15 0 28 1608 topology 1686 2244
-> 16 0 28 1608 topology 1727 2244
-> 15 0 28 1608 topology 1662 2245
-> 16 0 28 1608 topology 1727 2245
-> 15 0 29 1608 topology 1663 2246
-> 16 0 29 1608 topology 1664 2246
-> 15 0 29 1608 topology 1717 2247
-> 16 0 29 1608 topology 1718 2247
-> 15 0 29 1608 topology 1693 2248
-> 16 0 29 1608 topology 1694 2248
-> 15 0 28 1608 topology 1722 2249
-> 16 0 28 1608 topology 1727 2249
-> 15 0 29 1608 topology 1612 2250
-> 16 0 29 1608 topology 1614 2250
-> 15 0 29 1608 topology 1723 2251
-> 16 0 29 1608 topology 1724 2251
-> 15 0 28 1608 topology 1640 2252
-> 16 0 28 1608 topology 1727 2252
-> 15 0 28 1608 topology 1670 2253
-> 16 0 28 1608 topology 1727 2253
-> 15 0 28 1608 topology 1700 2254
-> 16 0 28 1608 topology 1727 2254
-> 15 0 28 1608 topology 1617 2255
-> 16 0 28 1608 topology 1727 2255
-> 15 0 28 1608 topology 1652 2256
-> 16 0 28 1608 topology 1727 2256
-> 15 0 29 1608 topology 1624 2257
-> 16 0 29 1608 topology 1626 2257
-> 15 0 28 1608 topology 1682 2258
-> 16 0 28 1608 topology 1727 2258
-> 15 0 28 1608 topology 1712 2259
-> 16 0 28 1608 topology 1727 2259
-> 15 0 29 1608 topology 1609 2260
-> 16 0 29 1608 topology 1610 2260
-> 15 0 28 1608 topology 1629 2261
-> 16 0 28 1608 topology 1727 2261
-> 15 0 28 1608 topology 1664 2262
-> 16 0 28 1608 topology 1727 2262
-> 15 0 28 1608 topology 1694 2263
-> 16 0 28 1608 topology 1727 2263
-> 15 0 28 1608 topology 1724 2264
-> 16 0 28 1608 topology 1727 2264
-> 15 0 29 1608 topology 1621 2265
-> 16 0 29 1608 topology 1622 2265
-> 15 0 28 1608 topology 1619 2266
-> 16 0 28 1608 topology 1727 2266
-> 15 0 28 1728 topology 1764 2267
+> 15 0 29 1608 topology 1726 2188
+> 16 0 29 1608 topology 1727 2188
+> 15 0 30 1608 topology 1636 2189
+> 16 0 30 1608 topology 1638 2189
+> 15 0 30 1608 topology 1636 2190
+> 16 0 30 1608 topology 1637 2190
+> 15 0 30 1608 topology 1639 2191
+> 16 0 30 1608 topology 1641 2191
+> 15 0 30 1608 topology 1639 2192
+> 16 0 30 1608 topology 1640 2192
+> 15 0 30 1608 topology 1642 2193
+> 16 0 30 1608 topology 1644 2193
+> 15 0 30 1608 topology 1642 2194
+> 16 0 30 1608 topology 1643 2194
+> 15 0 30 1608 topology 1645 2195
+> 16 0 30 1608 topology 1647 2195
+> 15 0 30 1608 topology 1645 2196
+> 16 0 30 1608 topology 1646 2196
+> 15 0 30 1608 topology 1648 2197
+> 16 0 30 1608 topology 1650 2197
+> 15 0 30 1608 topology 1648 2198
+> 16 0 30 1608 topology 1649 2198
+> 15 0 30 1608 topology 1651 2199
+> 16 0 30 1608 topology 1653 2199
+> 15 0 30 1608 topology 1651 2200
+> 16 0 30 1608 topology 1652 2200
+> 15 0 30 1608 topology 1654 2201
+> 16 0 30 1608 topology 1656 2201
+> 15 0 30 1608 topology 1654 2202
+> 16 0 30 1608 topology 1655 2202
+> 15 0 30 1608 topology 1657 2203
+> 16 0 30 1608 topology 1659 2203
+> 15 0 30 1608 topology 1657 2204
+> 16 0 30 1608 topology 1658 2204
+> 15 0 30 1608 topology 1660 2205
+> 16 0 30 1608 topology 1662 2205
+> 15 0 30 1608 topology 1660 2206
+> 16 0 30 1608 topology 1661 2206
+> 15 0 30 1608 topology 1663 2207
+> 16 0 30 1608 topology 1665 2207
+> 15 0 30 1608 topology 1663 2208
+> 16 0 30 1608 topology 1664 2208
+> 15 0 30 1608 topology 1609 2209
+> 16 0 30 1608 topology 1611 2209
+> 15 0 30 1608 topology 1609 2210
+> 16 0 30 1608 topology 1610 2210
+> 15 0 30 1608 topology 1666 2211
+> 16 0 30 1608 topology 1668 2211
+> 15 0 30 1608 topology 1666 2212
+> 16 0 30 1608 topology 1667 2212
+> 15 0 30 1608 topology 1669 2213
+> 16 0 30 1608 topology 1671 2213
+> 15 0 30 1608 topology 1669 2214
+> 16 0 30 1608 topology 1670 2214
+> 15 0 30 1608 topology 1672 2215
+> 16 0 30 1608 topology 1674 2215
+> 15 0 30 1608 topology 1672 2216
+> 16 0 30 1608 topology 1673 2216
+> 15 0 30 1608 topology 1675 2217
+> 16 0 30 1608 topology 1677 2217
+> 15 0 30 1608 topology 1675 2218
+> 16 0 30 1608 topology 1676 2218
+> 15 0 30 1608 topology 1678 2219
+> 16 0 30 1608 topology 1680 2219
+> 15 0 30 1608 topology 1678 2220
+> 16 0 30 1608 topology 1679 2220
+> 15 0 30 1608 topology 1681 2221
+> 16 0 30 1608 topology 1683 2221
+> 15 0 30 1608 topology 1681 2222
+> 16 0 30 1608 topology 1682 2222
+> 15 0 30 1608 topology 1684 2223
+> 16 0 30 1608 topology 1686 2223
+> 15 0 30 1608 topology 1684 2224
+> 16 0 30 1608 topology 1685 2224
+> 15 0 30 1608 topology 1687 2225
+> 16 0 30 1608 topology 1689 2225
+> 15 0 30 1608 topology 1687 2226
+> 16 0 30 1608 topology 1688 2226
+> 15 0 30 1608 topology 1690 2227
+> 16 0 30 1608 topology 1692 2227
+> 15 0 30 1608 topology 1690 2228
+> 16 0 30 1608 topology 1691 2228
+> 15 0 30 1608 topology 1693 2229
+> 16 0 30 1608 topology 1695 2229
+> 15 0 30 1608 topology 1693 2230
+> 16 0 30 1608 topology 1694 2230
+> 15 0 30 1608 topology 1612 2231
+> 16 0 30 1608 topology 1614 2231
+> 15 0 30 1608 topology 1612 2232
+> 16 0 30 1608 topology 1613 2232
+> 15 0 30 1608 topology 1696 2233
+> 16 0 30 1608 topology 1698 2233
+> 15 0 30 1608 topology 1696 2234
+> 16 0 30 1608 topology 1697 2234
+> 15 0 30 1608 topology 1699 2235
+> 16 0 30 1608 topology 1701 2235
+> 15 0 30 1608 topology 1699 2236
+> 16 0 30 1608 topology 1700 2236
+> 15 0 30 1608 topology 1702 2237
+> 16 0 30 1608 topology 1704 2237
+> 15 0 30 1608 topology 1702 2238
+> 16 0 30 1608 topology 1703 2238
+> 15 0 30 1608 topology 1705 2239
+> 16 0 30 1608 topology 1707 2239
+> 15 0 30 1608 topology 1705 2240
+> 16 0 30 1608 topology 1706 2240
+> 15 0 30 1608 topology 1708 2241
+> 16 0 30 1608 topology 1710 2241
+> 15 0 30 1608 topology 1708 2242
+> 16 0 30 1608 topology 1709 2242
+> 15 0 30 1608 topology 1711 2243
+> 16 0 30 1608 topology 1713 2243
+> 15 0 30 1608 topology 1711 2244
+> 16 0 30 1608 topology 1712 2244
+> 15 0 30 1608 topology 1714 2245
+> 16 0 30 1608 topology 1716 2245
+> 15 0 30 1608 topology 1714 2246
+> 16 0 30 1608 topology 1715 2246
+> 15 0 30 1608 topology 1717 2247
+> 16 0 30 1608 topology 1719 2247
+> 15 0 30 1608 topology 1717 2248
+> 16 0 30 1608 topology 1718 2248
+> 15 0 30 1608 topology 1720 2249
+> 16 0 30 1608 topology 1722 2249
+> 15 0 30 1608 topology 1720 2250
+> 16 0 30 1608 topology 1721 2250
+> 15 0 30 1608 topology 1723 2251
+> 16 0 30 1608 topology 1725 2251
+> 15 0 30 1608 topology 1723 2252
+> 16 0 30 1608 topology 1724 2252
+> 15 0 30 1608 topology 1615 2253
+> 16 0 30 1608 topology 1617 2253
+> 15 0 30 1608 topology 1615 2254
+> 16 0 30 1608 topology 1616 2254
+> 15 0 30 1608 topology 1618 2255
+> 16 0 30 1608 topology 1620 2255
+> 15 0 30 1608 topology 1618 2256
+> 16 0 30 1608 topology 1619 2256
+> 15 0 30 1608 topology 1621 2257
+> 16 0 30 1608 topology 1623 2257
+> 15 0 30 1608 topology 1621 2258
+> 16 0 30 1608 topology 1622 2258
+> 15 0 30 1608 topology 1624 2259
+> 16 0 30 1608 topology 1626 2259
+> 15 0 30 1608 topology 1624 2260
+> 16 0 30 1608 topology 1625 2260
+> 15 0 30 1608 topology 1627 2261
+> 16 0 30 1608 topology 1629 2261
+> 15 0 30 1608 topology 1627 2262
+> 16 0 30 1608 topology 1628 2262
+> 15 0 30 1608 topology 1630 2263
+> 16 0 30 1608 topology 1632 2263
+> 15 0 30 1608 topology 1630 2264
+> 16 0 30 1608 topology 1631 2264
+> 15 0 30 1608 topology 1633 2265
+> 16 0 30 1608 topology 1635 2265
+> 15 0 30 1608 topology 1633 2266
+> 16 0 30 1608 topology 1634 2266
+> 15 0 28 1728 topology 1731 2267
 > 16 0 28 1728 topology 1835 2267
-> 15 0 28 1728 topology 1740 2268
+> 15 0 28 1728 topology 1730 2268
 > 16 0 28 1728 topology 1835 2268
-> 15 0 28 1728 topology 1824 2269
+> 15 0 28 1728 topology 1734 2269
 > 16 0 28 1728 topology 1835 2269
-> 15 0 28 1728 topology 1800 2270
+> 15 0 28 1728 topology 1733 2270
 > 16 0 28 1728 topology 1835 2270
-> 15 0 28 1728 topology 1776 2271
+> 15 0 28 1728 topology 1737 2271
 > 16 0 28 1728 topology 1835 2271
-> 15 0 28 1728 topology 1752 2272
+> 15 0 28 1728 topology 1736 2272
 > 16 0 28 1728 topology 1835 2272
-> 15 0 28 1728 topology 1812 2273
+> 15 0 28 1728 topology 1740 2273
 > 16 0 28 1728 topology 1835 2273
-> 15 0 28 1728 topology 1788 2274
+> 15 0 28 1728 topology 1739 2274
 > 16 0 28 1728 topology 1835 2274
-> 15 0 29 1728 topology 1729 2275
-> 16 0 29 1728 topology 1731 2275
-> 15 0 28 1728 topology 1730 2276
+> 15 0 28 1728 topology 1743 2275
+> 16 0 28 1728 topology 1835 2275
+> 15 0 28 1728 topology 1742 2276
 > 16 0 28 1728 topology 1835 2276
-> 15 0 29 1728 topology 1732 2277
-> 16 0 29 1728 topology 1734 2277
-> 15 0 28 1728 topology 1760 2278
+> 15 0 28 1728 topology 1746 2277
+> 16 0 28 1728 topology 1835 2277
+> 15 0 28 1728 topology 1745 2278
 > 16 0 28 1728 topology 1835 2278
-> 15 0 29 1728 topology 1735 2279
-> 16 0 29 1728 topology 1737 2279
-> 15 0 28 1728 topology 1790 2280
+> 15 0 28 1728 topology 1749 2279
+> 16 0 28 1728 topology 1835 2279
+> 15 0 28 1728 topology 1748 2280
 > 16 0 28 1728 topology 1835 2280
-> 15 0 29 1728 topology 1789 2281
-> 16 0 29 1728 topology 1791 2281
-> 15 0 28 1728 topology 1820 2282
+> 15 0 28 1728 topology 1752 2281
+> 16 0 28 1728 topology 1835 2281
+> 15 0 28 1728 topology 1751 2282
 > 16 0 28 1728 topology 1835 2282
-> 15 0 29 1728 topology 1738 2283
-> 16 0 29 1728 topology 1740 2283
-> 15 0 28 1728 topology 1742 2284
+> 15 0 28 1728 topology 1755 2283
+> 16 0 28 1728 topology 1835 2283
+> 15 0 28 1728 topology 1754 2284
 > 16 0 28 1728 topology 1835 2284
-> 15 0 29 1728 topology 1792 2285
-> 16 0 29 1728 topology 1794 2285
-> 15 0 28 1728 topology 1772 2286
+> 15 0 28 1728 topology 1758 2285
+> 16 0 28 1728 topology 1835 2285
+> 15 0 28 1728 topology 1757 2286
 > 16 0 28 1728 topology 1835 2286
-> 15 0 29 1728 topology 1741 2287
-> 16 0 29 1728 topology 1743 2287
-> 15 0 29 1728 topology 1795 2288
-> 16 0 29 1728 topology 1797 2288
-> 15 0 28 1728 topology 1802 2289
+> 15 0 28 1728 topology 1761 2287
+> 16 0 28 1728 topology 1835 2287
+> 15 0 28 1728 topology 1760 2288
+> 16 0 28 1728 topology 1835 2288
+> 15 0 28 1728 topology 1764 2289
 > 16 0 28 1728 topology 1835 2289
-> 15 0 28 1728 topology 1832 2290
+> 15 0 28 1728 topology 1763 2290
 > 16 0 28 1728 topology 1835 2290
-> 15 0 29 1728 topology 1744 2291
-> 16 0 29 1728 topology 1746 2291
-> 15 0 28 1728 topology 1754 2292
+> 15 0 28 1728 topology 1767 2291
+> 16 0 28 1728 topology 1835 2291
+> 15 0 28 1728 topology 1766 2292
 > 16 0 28 1728 topology 1835 2292
-> 15 0 29 1728 topology 1798 2293
-> 16 0 29 1728 topology 1800 2293
-> 15 0 28 1728 topology 1784 2294
+> 15 0 28 1728 topology 1770 2293
+> 16 0 28 1728 topology 1835 2293
+> 15 0 28 1728 topology 1769 2294
 > 16 0 28 1728 topology 1835 2294
-> 15 0 29 1728 topology 1747 2295
-> 16 0 29 1728 topology 1749 2295
-> 15 0 29 1728 topology 1801 2296
-> 16 0 29 1728 topology 1803 2296
-> 15 0 28 1728 topology 1814 2297
+> 15 0 28 1728 topology 1773 2295
+> 16 0 28 1728 topology 1835 2295
+> 15 0 28 1728 topology 1772 2296
+> 16 0 28 1728 topology 1835 2296
+> 15 0 28 1728 topology 1776 2297
 > 16 0 28 1728 topology 1835 2297
-> 15 0 29 1728 topology 1729 2298
-> 16 0 29 1728 topology 1730 2298
-> 15 0 29 1728 topology 1750 2299
-> 16 0 29 1728 topology 1752 2299
-> 15 0 29 1728 topology 1804 2300
-> 16 0 29 1728 topology 1806 2300
-> 15 0 29 1728 topology 1759 2301
-> 16 0 29 1728 topology 1760 2301
-> 15 0 29 1728 topology 1753 2302
-> 16 0 29 1728 topology 1755 2302
-> 15 0 29 1728 topology 1807 2303
-> 16 0 29 1728 topology 1809 2303
-> 15 0 29 1728 topology 1735 2304
-> 16 0 29 1728 topology 1736 2304
-> 15 0 29 1728 topology 1789 2305
-> 16 0 29 1728 topology 1790 2305
-> 15 0 29 1728 topology 1756 2306
-> 16 0 29 1728 topology 1758 2306
-> 15 0 29 1728 topology 1810 2307
-> 16 0 29 1728 topology 1812 2307
-> 15 0 29 1728 topology 1765 2308
-> 16 0 29 1728 topology 1766 2308
-> 15 0 29 1728 topology 1819 2309
-> 16 0 29 1728 topology 1820 2309
-> 15 0 29 1728 topology 1813 2310
-> 16 0 29 1728 topology 1815 2310
-> 15 0 28 1728 topology 1731 2311
+> 15 0 28 1728 topology 1775 2298
+> 16 0 28 1728 topology 1835 2298
+> 15 0 28 1728 topology 1779 2299
+> 16 0 28 1728 topology 1835 2299
+> 15 0 28 1728 topology 1778 2300
+> 16 0 28 1728 topology 1835 2300
+> 15 0 28 1728 topology 1782 2301
+> 16 0 28 1728 topology 1835 2301
+> 15 0 28 1728 topology 1781 2302
+> 16 0 28 1728 topology 1835 2302
+> 15 0 28 1728 topology 1785 2303
+> 16 0 28 1728 topology 1835 2303
+> 15 0 28 1728 topology 1784 2304
+> 16 0 28 1728 topology 1835 2304
+> 15 0 28 1728 topology 1788 2305
+> 16 0 28 1728 topology 1835 2305
+> 15 0 28 1728 topology 1787 2306
+> 16 0 28 1728 topology 1835 2306
+> 15 0 28 1728 topology 1791 2307
+> 16 0 28 1728 topology 1835 2307
+> 15 0 28 1728 topology 1790 2308
+> 16 0 28 1728 topology 1835 2308
+> 15 0 28 1728 topology 1794 2309
+> 16 0 28 1728 topology 1835 2309
+> 15 0 28 1728 topology 1793 2310
+> 16 0 28 1728 topology 1835 2310
+> 15 0 28 1728 topology 1797 2311
 > 16 0 28 1728 topology 1835 2311
-> 15 0 29 1728 topology 1741 2312
-> 16 0 29 1728 topology 1742 2312
-> 15 0 29 1728 topology 1795 2313
-> 16 0 29 1728 topology 1796 2313
-> 15 0 29 1728 topology 1816 2314
-> 16 0 29 1728 topology 1818 2314
-> 15 0 29 1728 topology 1771 2315
-> 16 0 29 1728 topology 1772 2315
-> 15 0 28 1728 topology 1791 2316
+> 15 0 28 1728 topology 1796 2312
+> 16 0 28 1728 topology 1835 2312
+> 15 0 28 1728 topology 1800 2313
+> 16 0 28 1728 topology 1835 2313
+> 15 0 28 1728 topology 1799 2314
+> 16 0 28 1728 topology 1835 2314
+> 15 0 28 1728 topology 1803 2315
+> 16 0 28 1728 topology 1835 2315
+> 15 0 28 1728 topology 1802 2316
 > 16 0 28 1728 topology 1835 2316
-> 15 0 29 1728 topology 1825 2317
-> 16 0 29 1728 topology 1826 2317
-> 15 0 28 1728 topology 1767 2318
+> 15 0 28 1728 topology 1806 2317
+> 16 0 28 1728 topology 1835 2317
+> 15 0 28 1728 topology 1805 2318
 > 16 0 28 1728 topology 1835 2318
-> 15 0 28 1728 topology 1743 2319
+> 15 0 28 1728 topology 1809 2319
 > 16 0 28 1728 topology 1835 2319
-> 15 0 29 1728 topology 1747 2320
-> 16 0 29 1728 topology 1748 2320
-> 15 0 29 1728 topology 1801 2321
-> 16 0 29 1728 topology 1802 2321
-> 15 0 28 1728 topology 1827 2322
+> 15 0 28 1728 topology 1808 2320
+> 16 0 28 1728 topology 1835 2320
+> 15 0 28 1728 topology 1812 2321
+> 16 0 28 1728 topology 1835 2321
+> 15 0 28 1728 topology 1811 2322
 > 16 0 28 1728 topology 1835 2322
-> 15 0 29 1728 topology 1777 2323
-> 16 0 29 1728 topology 1778 2323
-> 15 0 28 1728 topology 1803 2324
+> 15 0 28 1728 topology 1815 2323
+> 16 0 28 1728 topology 1835 2323
+> 15 0 28 1728 topology 1814 2324
 > 16 0 28 1728 topology 1835 2324
-> 15 0 29 1728 topology 1831 2325
-> 16 0 29 1728 topology 1832 2325
-> 15 0 28 1728 topology 1779 2326
+> 15 0 28 1728 topology 1818 2325
+> 16 0 28 1728 topology 1835 2325
+> 15 0 28 1728 topology 1817 2326
 > 16 0 28 1728 topology 1835 2326
-> 15 0 29 1728 topology 1753 2327
-> 16 0 29 1728 topology 1754 2327
-> 15 0 28 1728 topology 1755 2328
+> 15 0 28 1728 topology 1821 2327
+> 16 0 28 1728 topology 1835 2327
+> 15 0 28 1728 topology 1820 2328
 > 16 0 28 1728 topology 1835 2328
-> 15 0 29 1728 topology 1807 2329
-> 16 0 29 1728 topology 1808 2329
-> 15 0 29 1728 topology 1783 2330
-> 16 0 29 1728 topology 1784 2330
-> 15 0 28 1728 topology 1815 2331
+> 15 0 28 1728 topology 1824 2329
+> 16 0 28 1728 topology 1835 2329
+> 15 0 28 1728 topology 1823 2330
+> 16 0 28 1728 topology 1835 2330
+> 15 0 28 1728 topology 1827 2331
 > 16 0 28 1728 topology 1835 2331
-> 15 0 29 1728 topology 1813 2332
-> 16 0 29 1728 topology 1814 2332
-> 15 0 28 1728 topology 1739 2333
+> 15 0 28 1728 topology 1826 2332
+> 16 0 28 1728 topology 1835 2332
+> 15 0 28 1728 topology 1830 2333
 > 16 0 28 1728 topology 1835 2333
-> 15 0 28 1728 topology 1769 2334
+> 15 0 28 1728 topology 1829 2334
 > 16 0 28 1728 topology 1835 2334
-> 15 0 28 1728 topology 1799 2335
+> 15 0 28 1728 topology 1833 2335
 > 16 0 28 1728 topology 1835 2335
-> 15 0 28 1728 topology 1829 2336
+> 15 0 28 1728 topology 1832 2336
 > 16 0 28 1728 topology 1835 2336
-> 15 0 28 1728 topology 1751 2337
-> 16 0 28 1728 topology 1835 2337
-> 15 0 28 1728 topology 1781 2338
-> 16 0 28 1728 topology 1835 2338
-> 15 0 30 1728 topology 1834 2339
-> 16 0 30 1728 topology 1835 2339
-> 15 0 28 1728 topology 1811 2340
-> 16 0 28 1728 topology 1835 2340
-> 15 0 28 1728 topology 1734 2341
-> 16 0 28 1728 topology 1835 2341
-> 15 0 28 1728 topology 1794 2342
-> 16 0 28 1728 topology 1835 2342
-> 15 0 28 1728 topology 1770 2343
-> 16 0 28 1728 topology 1835 2343
-> 15 0 28 1728 topology 1746 2344
-> 16 0 28 1728 topology 1835 2344
-> 15 0 28 1728 topology 1830 2345
-> 16 0 28 1728 topology 1835 2345
-> 15 0 28 1728 topology 1806 2346
-> 16 0 28 1728 topology 1835 2346
-> 15 0 28 1728 topology 1782 2347
-> 16 0 28 1728 topology 1835 2347
-> 15 0 28 1728 topology 1758 2348
-> 16 0 28 1728 topology 1835 2348
-> 15 0 28 1728 topology 1818 2349
-> 16 0 28 1728 topology 1835 2349
-> 15 0 29 1728 topology 1759 2350
-> 16 0 29 1728 topology 1761 2350
-> 15 0 28 1728 topology 1736 2351
-> 16 0 28 1728 topology 1835 2351
-> 15 0 29 1728 topology 1762 2352
-> 16 0 29 1728 topology 1764 2352
-> 15 0 28 1728 topology 1766 2353
-> 16 0 28 1728 topology 1835 2353
-> 15 0 29 1728 topology 1765 2354
-> 16 0 29 1728 topology 1767 2354
-> 15 0 28 1728 topology 1796 2355
-> 16 0 28 1728 topology 1835 2355
-> 15 0 29 1728 topology 1819 2356
-> 16 0 29 1728 topology 1821 2356
-> 15 0 28 1728 topology 1826 2357
-> 16 0 28 1728 topology 1835 2357
-> 15 0 28 1728 topology 1748 2358
-> 16 0 28 1728 topology 1835 2358
-> 15 0 29 1728 topology 1768 2359
-> 16 0 29 1728 topology 1770 2359
-> 15 0 29 1728 topology 1822 2360
-> 16 0 29 1728 topology 1824 2360
-> 15 0 28 1728 topology 1778 2361
-> 16 0 28 1728 topology 1835 2361
-> 15 0 29 1728 topology 1771 2362
-> 16 0 29 1728 topology 1773 2362
-> 15 0 28 1728 topology 1808 2363
-> 16 0 28 1728 topology 1835 2363
-> 15 0 29 1728 topology 1825 2364
-> 16 0 29 1728 topology 1827 2364
-> 15 0 29 1728 topology 1774 2365
-> 16 0 29 1728 topology 1776 2365
-> 15 0 29 1728 topology 1828 2366
-> 16 0 29 1728 topology 1830 2366
-> 15 0 29 1728 topology 1777 2367
-> 16 0 29 1728 topology 1779 2367
-> 15 0 29 1728 topology 1831 2368
-> 16 0 29 1728 topology 1833 2368
-> 15 0 29 1728 topology 1732 2369
-> 16 0 29 1728 topology 1733 2369
-> 15 0 29 1728 topology 1780 2370
-> 16 0 29 1728 topology 1782 2370
-> 15 0 29 1728 topology 1762 2371
-> 16 0 29 1728 topology 1763 2371
-> 15 0 29 1728 topology 1783 2372
-> 16 0 29 1728 topology 1785 2372
-> 15 0 29 1728 topology 1738 2373
-> 16 0 29 1728 topology 1739 2373
-> 15 0 29 1728 topology 1792 2374
-> 16 0 29 1728 topology 1793 2374
-> 15 0 29 1728 topology 1786 2375
-> 16 0 29 1728 topology 1788 2375
-> 15 0 29 1728 topology 1768 2376
-> 16 0 29 1728 topology 1769 2376
-> 15 0 29 1728 topology 1822 2377
-> 16 0 29 1728 topology 1823 2377
-> 15 0 28 1728 topology 1761 2378
-> 16 0 28 1728 topology 1835 2378
-> 15 0 28 1728 topology 1737 2379
-> 16 0 28 1728 topology 1835 2379
-> 15 0 29 1728 topology 1744 2380
-> 16 0 29 1728 topology 1745 2380
-> 15 0 29 1728 topology 1798 2381
-> 16 0 29 1728 topology 1799 2381
-> 15 0 28 1728 topology 1821 2382
-> 16 0 28 1728 topology 1835 2382
-> 15 0 29 1728 topology 1774 2383
-> 16 0 29 1728 topology 1775 2383
-> 15 0 28 1728 topology 1797 2384
-> 16 0 28 1728 topology 1835 2384
-> 15 0 29 1728 topology 1828 2385
-> 16 0 29 1728 topology 1829 2385
-> 15 0 28 1728 topology 1773 2386
-> 16 0 28 1728 topology 1835 2386
-> 15 0 28 1728 topology 1749 2387
-> 16 0 28 1728 topology 1835 2387
-> 15 0 29 1728 topology 1750 2388
-> 16 0 29 1728 topology 1751 2388
-> 15 0 29 1728 topology 1804 2389
-> 16 0 29 1728 topology 1805 2389
-> 15 0 28 1728 topology 1833 2390
-> 16 0 28 1728 topology 1835 2390
-> 15 0 29 1728 topology 1780 2391
-> 16 0 29 1728 topology 1781 2391
-> 15 0 28 1728 topology 1809 2392
-> 16 0 28 1728 topology 1835 2392
-> 15 0 28 1728 topology 1785 2393
-> 16 0 28 1728 topology 1835 2393
-> 15 0 29 1728 topology 1756 2394
-> 16 0 29 1728 topology 1757 2394
-> 15 0 29 1728 topology 1810 2395
-> 16 0 29 1728 topology 1811 2395
-> 15 0 29 1728 topology 1786 2396
-> 16 0 29 1728 topology 1787 2396
-> 15 0 28 1728 topology 1733 2397
-> 16 0 28 1728 topology 1835 2397
-> 15 0 29 1728 topology 1816 2398
-> 16 0 29 1728 topology 1817 2398
-> 15 0 28 1728 topology 1763 2399
-> 16 0 28 1728 topology 1835 2399
-> 15 0 28 1728 topology 1793 2400
-> 16 0 28 1728 topology 1835 2400
-> 15 0 28 1728 topology 1823 2401
-> 16 0 28 1728 topology 1835 2401
-> 15 0 28 1728 topology 1745 2402
-> 16 0 28 1728 topology 1835 2402
-> 15 0 28 1728 topology 1775 2403
-> 16 0 28 1728 topology 1835 2403
-> 15 0 28 1728 topology 1805 2404
-> 16 0 28 1728 topology 1835 2404
-> 15 0 28 1728 topology 1757 2405
-> 16 0 28 1728 topology 1835 2405
-> 15 0 28 1728 topology 1787 2406
-> 16 0 28 1728 topology 1835 2406
-> 15 0 28 1728 topology 1817 2407
-> 16 0 28 1728 topology 1835 2407
-> 15 0 28 1836 topology 1880 2408
+> 15 0 29 1728 topology 1834 2337
+> 16 0 29 1728 topology 1835 2337
+> 15 0 30 1728 topology 1729 2338
+> 16 0 30 1728 topology 1731 2338
+> 15 0 30 1728 topology 1729 2339
+> 16 0 30 1728 topology 1730 2339
+> 15 0 30 1728 topology 1732 2340
+> 16 0 30 1728 topology 1734 2340
+> 15 0 30 1728 topology 1732 2341
+> 16 0 30 1728 topology 1733 2341
+> 15 0 30 1728 topology 1735 2342
+> 16 0 30 1728 topology 1737 2342
+> 15 0 30 1728 topology 1735 2343
+> 16 0 30 1728 topology 1736 2343
+> 15 0 30 1728 topology 1738 2344
+> 16 0 30 1728 topology 1740 2344
+> 15 0 30 1728 topology 1738 2345
+> 16 0 30 1728 topology 1739 2345
+> 15 0 30 1728 topology 1741 2346
+> 16 0 30 1728 topology 1743 2346
+> 15 0 30 1728 topology 1741 2347
+> 16 0 30 1728 topology 1742 2347
+> 15 0 30 1728 topology 1744 2348
+> 16 0 30 1728 topology 1746 2348
+> 15 0 30 1728 topology 1744 2349
+> 16 0 30 1728 topology 1745 2349
+> 15 0 30 1728 topology 1747 2350
+> 16 0 30 1728 topology 1749 2350
+> 15 0 30 1728 topology 1747 2351
+> 16 0 30 1728 topology 1748 2351
+> 15 0 30 1728 topology 1750 2352
+> 16 0 30 1728 topology 1752 2352
+> 15 0 30 1728 topology 1750 2353
+> 16 0 30 1728 topology 1751 2353
+> 15 0 30 1728 topology 1753 2354
+> 16 0 30 1728 topology 1755 2354
+> 15 0 30 1728 topology 1753 2355
+> 16 0 30 1728 topology 1754 2355
+> 15 0 30 1728 topology 1756 2356
+> 16 0 30 1728 topology 1758 2356
+> 15 0 30 1728 topology 1756 2357
+> 16 0 30 1728 topology 1757 2357
+> 15 0 30 1728 topology 1759 2358
+> 16 0 30 1728 topology 1761 2358
+> 15 0 30 1728 topology 1759 2359
+> 16 0 30 1728 topology 1760 2359
+> 15 0 30 1728 topology 1762 2360
+> 16 0 30 1728 topology 1764 2360
+> 15 0 30 1728 topology 1762 2361
+> 16 0 30 1728 topology 1763 2361
+> 15 0 30 1728 topology 1765 2362
+> 16 0 30 1728 topology 1767 2362
+> 15 0 30 1728 topology 1765 2363
+> 16 0 30 1728 topology 1766 2363
+> 15 0 30 1728 topology 1768 2364
+> 16 0 30 1728 topology 1770 2364
+> 15 0 30 1728 topology 1768 2365
+> 16 0 30 1728 topology 1769 2365
+> 15 0 30 1728 topology 1771 2366
+> 16 0 30 1728 topology 1773 2366
+> 15 0 30 1728 topology 1771 2367
+> 16 0 30 1728 topology 1772 2367
+> 15 0 30 1728 topology 1774 2368
+> 16 0 30 1728 topology 1776 2368
+> 15 0 30 1728 topology 1774 2369
+> 16 0 30 1728 topology 1775 2369
+> 15 0 30 1728 topology 1777 2370
+> 16 0 30 1728 topology 1779 2370
+> 15 0 30 1728 topology 1777 2371
+> 16 0 30 1728 topology 1778 2371
+> 15 0 30 1728 topology 1780 2372
+> 16 0 30 1728 topology 1782 2372
+> 15 0 30 1728 topology 1780 2373
+> 16 0 30 1728 topology 1781 2373
+> 15 0 30 1728 topology 1783 2374
+> 16 0 30 1728 topology 1785 2374
+> 15 0 30 1728 topology 1783 2375
+> 16 0 30 1728 topology 1784 2375
+> 15 0 30 1728 topology 1786 2376
+> 16 0 30 1728 topology 1788 2376
+> 15 0 30 1728 topology 1786 2377
+> 16 0 30 1728 topology 1787 2377
+> 15 0 30 1728 topology 1789 2378
+> 16 0 30 1728 topology 1791 2378
+> 15 0 30 1728 topology 1789 2379
+> 16 0 30 1728 topology 1790 2379
+> 15 0 30 1728 topology 1792 2380
+> 16 0 30 1728 topology 1794 2380
+> 15 0 30 1728 topology 1792 2381
+> 16 0 30 1728 topology 1793 2381
+> 15 0 30 1728 topology 1795 2382
+> 16 0 30 1728 topology 1797 2382
+> 15 0 30 1728 topology 1795 2383
+> 16 0 30 1728 topology 1796 2383
+> 15 0 30 1728 topology 1798 2384
+> 16 0 30 1728 topology 1800 2384
+> 15 0 30 1728 topology 1798 2385
+> 16 0 30 1728 topology 1799 2385
+> 15 0 30 1728 topology 1801 2386
+> 16 0 30 1728 topology 1803 2386
+> 15 0 30 1728 topology 1801 2387
+> 16 0 30 1728 topology 1802 2387
+> 15 0 30 1728 topology 1804 2388
+> 16 0 30 1728 topology 1806 2388
+> 15 0 30 1728 topology 1804 2389
+> 16 0 30 1728 topology 1805 2389
+> 15 0 30 1728 topology 1807 2390
+> 16 0 30 1728 topology 1809 2390
+> 15 0 30 1728 topology 1807 2391
+> 16 0 30 1728 topology 1808 2391
+> 15 0 30 1728 topology 1810 2392
+> 16 0 30 1728 topology 1812 2392
+> 15 0 30 1728 topology 1810 2393
+> 16 0 30 1728 topology 1811 2393
+> 15 0 30 1728 topology 1813 2394
+> 16 0 30 1728 topology 1815 2394
+> 15 0 30 1728 topology 1813 2395
+> 16 0 30 1728 topology 1814 2395
+> 15 0 30 1728 topology 1816 2396
+> 16 0 30 1728 topology 1818 2396
+> 15 0 30 1728 topology 1816 2397
+> 16 0 30 1728 topology 1817 2397
+> 15 0 30 1728 topology 1819 2398
+> 16 0 30 1728 topology 1821 2398
+> 15 0 30 1728 topology 1819 2399
+> 16 0 30 1728 topology 1820 2399
+> 15 0 30 1728 topology 1822 2400
+> 16 0 30 1728 topology 1824 2400
+> 15 0 30 1728 topology 1822 2401
+> 16 0 30 1728 topology 1823 2401
+> 15 0 30 1728 topology 1825 2402
+> 16 0 30 1728 topology 1827 2402
+> 15 0 30 1728 topology 1825 2403
+> 16 0 30 1728 topology 1826 2403
+> 15 0 30 1728 topology 1828 2404
+> 16 0 30 1728 topology 1830 2404
+> 15 0 30 1728 topology 1828 2405
+> 16 0 30 1728 topology 1829 2405
+> 15 0 30 1728 topology 1831 2406
+> 16 0 30 1728 topology 1833 2406
+> 15 0 30 1728 topology 1831 2407
+> 16 0 30 1728 topology 1832 2407
+> 15 0 28 1836 topology 1914 2408
 > 16 0 28 1836 topology 1928 2408
-> 15 0 28 1836 topology 1910 2409
+> 15 0 28 1836 topology 1913 2409
 > 16 0 28 1836 topology 1928 2409
-> 15 0 28 1836 topology 1919 2410
+> 15 0 28 1836 topology 1917 2410
 > 16 0 28 1836 topology 1928 2410
-> 15 0 29 1836 topology 1912 2411
-> 16 0 29 1836 topology 1914 2411
-> 15 0 28 1836 topology 1887 2412
+> 15 0 28 1836 topology 1916 2411
+> 16 0 28 1836 topology 1928 2411
+> 15 0 28 1836 topology 1920 2412
 > 16 0 28 1836 topology 1928 2412
-> 15 0 28 1836 topology 1863 2413
+> 15 0 28 1836 topology 1919 2413
 > 16 0 28 1836 topology 1928 2413
-> 15 0 28 1836 topology 1839 2414
+> 15 0 28 1836 topology 1923 2414
 > 16 0 28 1836 topology 1928 2414
-> 15 0 28 1836 topology 1899 2415
+> 15 0 28 1836 topology 1922 2415
 > 16 0 28 1836 topology 1928 2415
-> 15 0 28 1836 topology 1875 2416
+> 15 0 28 1836 topology 1926 2416
 > 16 0 28 1836 topology 1928 2416
-> 15 0 28 1836 topology 1851 2417
+> 15 0 28 1836 topology 1925 2417
 > 16 0 28 1836 topology 1928 2417
-> 15 0 29 1836 topology 1924 2418
-> 16 0 29 1836 topology 1926 2418
-> 15 0 28 1836 topology 1914 2419
+> 15 0 28 1836 topology 1839 2418
+> 16 0 28 1836 topology 1928 2418
+> 15 0 28 1836 topology 1838 2419
 > 16 0 28 1836 topology 1928 2419
-> 15 0 28 1836 topology 1911 2420
+> 15 0 28 1836 topology 1842 2420
 > 16 0 28 1836 topology 1928 2420
-> 15 0 28 1836 topology 1853 2421
+> 15 0 28 1836 topology 1841 2421
 > 16 0 28 1836 topology 1928 2421
-> 15 0 28 1836 topology 1926 2422
+> 15 0 28 1836 topology 1845 2422
 > 16 0 28 1836 topology 1928 2422
-> 15 0 28 1836 topology 1883 2423
+> 15 0 28 1836 topology 1844 2423
 > 16 0 28 1836 topology 1928 2423
-> 15 0 29 1836 topology 1915 2424
-> 16 0 29 1836 topology 1916 2424
-> 15 0 29 1836 topology 1882 2425
-> 16 0 29 1836 topology 1884 2425
-> 15 0 28 1836 topology 1865 2426
+> 15 0 28 1836 topology 1848 2424
+> 16 0 28 1836 topology 1928 2424
+> 15 0 28 1836 topology 1847 2425
+> 16 0 28 1836 topology 1928 2425
+> 15 0 28 1836 topology 1851 2426
 > 16 0 28 1836 topology 1928 2426
-> 15 0 29 1836 topology 1885 2427
-> 16 0 29 1836 topology 1887 2427
-> 15 0 28 1836 topology 1895 2428
+> 15 0 28 1836 topology 1850 2427
+> 16 0 28 1836 topology 1928 2427
+> 15 0 28 1836 topology 1854 2428
 > 16 0 28 1836 topology 1928 2428
-> 15 0 28 1836 topology 1847 2429
+> 15 0 28 1836 topology 1853 2429
 > 16 0 28 1836 topology 1928 2429
-> 15 0 29 1836 topology 1888 2430
-> 16 0 29 1836 topology 1890 2430
-> 15 0 28 1836 topology 1877 2431
+> 15 0 28 1836 topology 1857 2430
+> 16 0 28 1836 topology 1928 2430
+> 15 0 28 1836 topology 1856 2431
 > 16 0 28 1836 topology 1928 2431
-> 15 0 29 1836 topology 1837 2432
-> 16 0 29 1836 topology 1839 2432
-> 15 0 29 1836 topology 1891 2433
-> 16 0 29 1836 topology 1893 2433
-> 15 0 28 1836 topology 1907 2434
+> 15 0 28 1836 topology 1860 2432
+> 16 0 28 1836 topology 1928 2432
+> 15 0 28 1836 topology 1859 2433
+> 16 0 28 1836 topology 1928 2433
+> 15 0 28 1836 topology 1863 2434
 > 16 0 28 1836 topology 1928 2434
-> 15 0 28 1836 topology 1916 2435
+> 15 0 28 1836 topology 1862 2435
 > 16 0 28 1836 topology 1928 2435
-> 15 0 29 1836 topology 1840 2436
-> 16 0 29 1836 topology 1842 2436
-> 15 0 29 1836 topology 1894 2437
-> 16 0 29 1836 topology 1896 2437
-> 15 0 29 1836 topology 1843 2438
-> 16 0 29 1836 topology 1845 2438
-> 15 0 29 1836 topology 1897 2439
-> 16 0 29 1836 topology 1899 2439
-> 15 0 29 1836 topology 1852 2440
-> 16 0 29 1836 topology 1853 2440
-> 15 0 29 1836 topology 1846 2441
-> 16 0 29 1836 topology 1848 2441
-> 15 0 29 1836 topology 1900 2442
-> 16 0 29 1836 topology 1902 2442
-> 15 0 29 1836 topology 1882 2443
-> 16 0 29 1836 topology 1883 2443
-> 15 0 29 1836 topology 1849 2444
-> 16 0 29 1836 topology 1851 2444
-> 15 0 29 1836 topology 1903 2445
-> 16 0 29 1836 topology 1905 2445
-> 15 0 29 1836 topology 1858 2446
-> 16 0 29 1836 topology 1859 2446
-> 15 0 28 1836 topology 1854 2447
+> 15 0 28 1836 topology 1866 2436
+> 16 0 28 1836 topology 1928 2436
+> 15 0 28 1836 topology 1865 2437
+> 16 0 28 1836 topology 1928 2437
+> 15 0 28 1836 topology 1869 2438
+> 16 0 28 1836 topology 1928 2438
+> 15 0 28 1836 topology 1868 2439
+> 16 0 28 1836 topology 1928 2439
+> 15 0 28 1836 topology 1872 2440
+> 16 0 28 1836 topology 1928 2440
+> 15 0 28 1836 topology 1871 2441
+> 16 0 28 1836 topology 1928 2441
+> 15 0 28 1836 topology 1875 2442
+> 16 0 28 1836 topology 1928 2442
+> 15 0 28 1836 topology 1874 2443
+> 16 0 28 1836 topology 1928 2443
+> 15 0 28 1836 topology 1878 2444
+> 16 0 28 1836 topology 1928 2444
+> 15 0 28 1836 topology 1877 2445
+> 16 0 28 1836 topology 1928 2445
+> 15 0 28 1836 topology 1881 2446
+> 16 0 28 1836 topology 1928 2446
+> 15 0 28 1836 topology 1880 2447
 > 16 0 28 1836 topology 1928 2447
-> 15 0 29 1836 topology 1906 2448
-> 16 0 29 1836 topology 1908 2448
-> 15 0 29 1836 topology 1888 2449
-> 16 0 29 1836 topology 1889 2449
-> 15 0 29 1836 topology 1909 2450
-> 16 0 29 1836 topology 1911 2450
-> 15 0 29 1836 topology 1915 2451
-> 16 0 29 1836 topology 1917 2451
-> 15 0 29 1836 topology 1864 2452
-> 16 0 29 1836 topology 1865 2452
-> 15 0 28 1836 topology 1890 2453
+> 15 0 28 1836 topology 1884 2448
+> 16 0 28 1836 topology 1928 2448
+> 15 0 28 1836 topology 1883 2449
+> 16 0 28 1836 topology 1928 2449
+> 15 0 28 1836 topology 1887 2450
+> 16 0 28 1836 topology 1928 2450
+> 15 0 28 1836 topology 1886 2451
+> 16 0 28 1836 topology 1928 2451
+> 15 0 28 1836 topology 1890 2452
+> 16 0 28 1836 topology 1928 2452
+> 15 0 28 1836 topology 1889 2453
 > 16 0 28 1836 topology 1928 2453
-> 15 0 28 1836 topology 1866 2454
+> 15 0 28 1836 topology 1893 2454
 > 16 0 28 1836 topology 1928 2454
-> 15 0 29 1836 topology 1840 2455
-> 16 0 29 1836 topology 1841 2455
-> 15 0 28 1836 topology 1842 2456
+> 15 0 28 1836 topology 1892 2455
+> 16 0 28 1836 topology 1928 2455
+> 15 0 28 1836 topology 1896 2456
 > 16 0 28 1836 topology 1928 2456
-> 15 0 29 1836 topology 1894 2457
-> 16 0 29 1836 topology 1895 2457
-> 15 0 29 1836 topology 1870 2458
-> 16 0 29 1836 topology 1871 2458
-> 15 0 28 1836 topology 1902 2459
+> 15 0 28 1836 topology 1895 2457
+> 16 0 28 1836 topology 1928 2457
+> 15 0 28 1836 topology 1899 2458
+> 16 0 28 1836 topology 1928 2458
+> 15 0 28 1836 topology 1898 2459
 > 16 0 28 1836 topology 1928 2459
-> 15 0 28 1836 topology 1878 2460
+> 15 0 28 1836 topology 1902 2460
 > 16 0 28 1836 topology 1928 2460
-> 15 0 29 1836 topology 1846 2461
-> 16 0 29 1836 topology 1847 2461
-> 15 0 29 1836 topology 1900 2462
-> 16 0 29 1836 topology 1901 2462
-> 15 0 28 1836 topology 1917 2463
+> 15 0 28 1836 topology 1901 2461
+> 16 0 28 1836 topology 1928 2461
+> 15 0 28 1836 topology 1905 2462
+> 16 0 28 1836 topology 1928 2462
+> 15 0 28 1836 topology 1904 2463
 > 16 0 28 1836 topology 1928 2463
-> 15 0 29 1836 topology 1876 2464
-> 16 0 29 1836 topology 1877 2464
-> 15 0 29 1836 topology 1906 2465
-> 16 0 29 1836 topology 1907 2465
-> 15 0 29 1836 topology 1912 2466
-> 16 0 29 1836 topology 1913 2466
-> 15 0 28 1836 topology 1862 2467
+> 15 0 28 1836 topology 1908 2464
+> 16 0 28 1836 topology 1928 2464
+> 15 0 28 1836 topology 1907 2465
+> 16 0 28 1836 topology 1928 2465
+> 15 0 28 1836 topology 1911 2466
+> 16 0 28 1836 topology 1928 2466
+> 15 0 28 1836 topology 1910 2467
 > 16 0 28 1836 topology 1928 2467
-> 15 0 28 1836 topology 1892 2468
-> 16 0 28 1836 topology 1928 2468
-> 15 0 28 1836 topology 1844 2469
-> 16 0 28 1836 topology 1928 2469
-> 15 0 28 1836 topology 1874 2470
-> 16 0 28 1836 topology 1928 2470
-> 15 0 28 1836 topology 1904 2471
-> 16 0 28 1836 topology 1928 2471
-> 15 0 29 1836 topology 1924 2472
-> 16 0 29 1836 topology 1925 2472
-> 15 0 28 1836 topology 1913 2473
-> 16 0 28 1836 topology 1928 2473
-> 15 0 28 1836 topology 1925 2474
-> 16 0 28 1836 topology 1928 2474
-> 15 0 28 1836 topology 1857 2475
-> 16 0 28 1836 topology 1928 2475
-> 15 0 28 1836 topology 1893 2476
-> 16 0 28 1836 topology 1928 2476
-> 15 0 29 1836 topology 1918 2477
-> 16 0 29 1836 topology 1920 2477
-> 15 0 28 1836 topology 1869 2478
-> 16 0 28 1836 topology 1928 2478
-> 15 0 28 1836 topology 1845 2479
-> 16 0 28 1836 topology 1928 2479
-> 15 0 28 1836 topology 1905 2480
-> 16 0 28 1836 topology 1928 2480
-> 15 0 28 1836 topology 1881 2481
-> 16 0 28 1836 topology 1928 2481
-> 15 0 28 1836 topology 1920 2482
-> 16 0 28 1836 topology 1928 2482
-> 15 0 29 1836 topology 1852 2483
-> 16 0 29 1836 topology 1854 2483
-> 15 0 28 1836 topology 1859 2484
-> 16 0 28 1836 topology 1928 2484
-> 15 0 29 1836 topology 1855 2485
-> 16 0 29 1836 topology 1857 2485
-> 15 0 28 1836 topology 1889 2486
-> 16 0 28 1836 topology 1928 2486
-> 15 0 30 1836 topology 1927 2487
-> 16 0 30 1836 topology 1928 2487
-> 15 0 28 1836 topology 1841 2488
-> 16 0 28 1836 topology 1928 2488
-> 15 0 29 1836 topology 1858 2489
-> 16 0 29 1836 topology 1860 2489
-> 15 0 28 1836 topology 1871 2490
-> 16 0 28 1836 topology 1928 2490
-> 15 0 29 1836 topology 1921 2491
-> 16 0 29 1836 topology 1922 2491
-> 15 0 29 1836 topology 1861 2492
-> 16 0 29 1836 topology 1863 2492
-> 15 0 28 1836 topology 1901 2493
-> 16 0 28 1836 topology 1928 2493
-> 15 0 29 1836 topology 1864 2494
-> 16 0 29 1836 topology 1866 2494
-> 15 0 29 1836 topology 1867 2495
-> 16 0 29 1836 topology 1869 2495
-> 15 0 28 1836 topology 1922 2496
-> 16 0 28 1836 topology 1928 2496
-> 15 0 29 1836 topology 1870 2497
-> 16 0 29 1836 topology 1872 2497
-> 15 0 29 1836 topology 1873 2498
-> 16 0 29 1836 topology 1875 2498
-> 15 0 29 1836 topology 1855 2499
-> 16 0 29 1836 topology 1856 2499
-> 15 0 29 1836 topology 1876 2500
-> 16 0 29 1836 topology 1878 2500
-> 15 0 29 1836 topology 1885 2501
-> 16 0 29 1836 topology 1886 2501
-> 15 0 29 1836 topology 1879 2502
-> 16 0 29 1836 topology 1881 2502
-> 15 0 29 1836 topology 1861 2503
-> 16 0 29 1836 topology 1862 2503
-> 15 0 28 1836 topology 1884 2504
-> 16 0 28 1836 topology 1928 2504
-> 15 0 28 1836 topology 1860 2505
-> 16 0 28 1836 topology 1928 2505
-> 15 0 29 1836 topology 1837 2506
-> 16 0 29 1836 topology 1838 2506
-> 15 0 29 1836 topology 1891 2507
-> 16 0 29 1836 topology 1892 2507
-> 15 0 29 1836 topology 1867 2508
-> 16 0 29 1836 topology 1868 2508
-> 15 0 28 1836 topology 1896 2509
-> 16 0 28 1836 topology 1928 2509
-> 15 0 28 1836 topology 1872 2510
-> 16 0 28 1836 topology 1928 2510
-> 15 0 29 1836 topology 1921 2511
-> 16 0 29 1836 topology 1923 2511
-> 15 0 29 1836 topology 1843 2512
-> 16 0 29 1836 topology 1844 2512
-> 15 0 28 1836 topology 1848 2513
-> 16 0 28 1836 topology 1928 2513
-> 15 0 29 1836 topology 1897 2514
-> 16 0 29 1836 topology 1898 2514
-> 15 0 29 1836 topology 1873 2515
-> 16 0 29 1836 topology 1874 2515
-> 15 0 28 1836 topology 1908 2516
-> 16 0 28 1836 topology 1928 2516
-> 15 0 29 1836 topology 1849 2517
-> 16 0 29 1836 topology 1850 2517
-> 15 0 29 1836 topology 1903 2518
-> 16 0 29 1836 topology 1904 2518
-> 15 0 28 1836 topology 1923 2519
-> 16 0 28 1836 topology 1928 2519
-> 15 0 29 1836 topology 1879 2520
-> 16 0 29 1836 topology 1880 2520
-> 15 0 28 1836 topology 1856 2521
-> 16 0 28 1836 topology 1928 2521
-> 15 0 28 1836 topology 1886 2522
-> 16 0 28 1836 topology 1928 2522
-> 15 0 29 1836 topology 1909 2523
-> 16 0 29 1836 topology 1910 2523
-> 15 0 28 1836 topology 1838 2524
-> 16 0 28 1836 topology 1928 2524
-> 15 0 29 1836 topology 1918 2525
-> 16 0 29 1836 topology 1919 2525
-> 15 0 28 1836 topology 1868 2526
-> 16 0 28 1836 topology 1928 2526
-> 15 0 28 1836 topology 1898 2527
-> 16 0 28 1836 topology 1928 2527
-> 15 0 28 1836 topology 1850 2528
-> 16 0 28 1836 topology 1928 2528
-> 15 0 29 1929 topology 1981 2529
-> 16 0 29 1929 topology 1982 2529
-> 15 0 28 1929 topology 2004 2530
+> 15 0 29 1836 topology 1927 2468
+> 16 0 29 1836 topology 1928 2468
+> 15 0 30 1836 topology 1912 2469
+> 16 0 30 1836 topology 1914 2469
+> 15 0 30 1836 topology 1912 2470
+> 16 0 30 1836 topology 1913 2470
+> 15 0 30 1836 topology 1915 2471
+> 16 0 30 1836 topology 1917 2471
+> 15 0 30 1836 topology 1915 2472
+> 16 0 30 1836 topology 1916 2472
+> 15 0 30 1836 topology 1918 2473
+> 16 0 30 1836 topology 1920 2473
+> 15 0 30 1836 topology 1918 2474
+> 16 0 30 1836 topology 1919 2474
+> 15 0 30 1836 topology 1921 2475
+> 16 0 30 1836 topology 1923 2475
+> 15 0 30 1836 topology 1921 2476
+> 16 0 30 1836 topology 1922 2476
+> 15 0 30 1836 topology 1924 2477
+> 16 0 30 1836 topology 1926 2477
+> 15 0 30 1836 topology 1924 2478
+> 16 0 30 1836 topology 1925 2478
+> 15 0 30 1836 topology 1837 2479
+> 16 0 30 1836 topology 1839 2479
+> 15 0 30 1836 topology 1837 2480
+> 16 0 30 1836 topology 1838 2480
+> 15 0 30 1836 topology 1840 2481
+> 16 0 30 1836 topology 1842 2481
+> 15 0 30 1836 topology 1840 2482
+> 16 0 30 1836 topology 1841 2482
+> 15 0 30 1836 topology 1843 2483
+> 16 0 30 1836 topology 1845 2483
+> 15 0 30 1836 topology 1843 2484
+> 16 0 30 1836 topology 1844 2484
+> 15 0 30 1836 topology 1846 2485
+> 16 0 30 1836 topology 1848 2485
+> 15 0 30 1836 topology 1846 2486
+> 16 0 30 1836 topology 1847 2486
+> 15 0 30 1836 topology 1849 2487
+> 16 0 30 1836 topology 1851 2487
+> 15 0 30 1836 topology 1849 2488
+> 16 0 30 1836 topology 1850 2488
+> 15 0 30 1836 topology 1852 2489
+> 16 0 30 1836 topology 1854 2489
+> 15 0 30 1836 topology 1852 2490
+> 16 0 30 1836 topology 1853 2490
+> 15 0 30 1836 topology 1855 2491
+> 16 0 30 1836 topology 1857 2491
+> 15 0 30 1836 topology 1855 2492
+> 16 0 30 1836 topology 1856 2492
+> 15 0 30 1836 topology 1858 2493
+> 16 0 30 1836 topology 1860 2493
+> 15 0 30 1836 topology 1858 2494
+> 16 0 30 1836 topology 1859 2494
+> 15 0 30 1836 topology 1861 2495
+> 16 0 30 1836 topology 1863 2495
+> 15 0 30 1836 topology 1861 2496
+> 16 0 30 1836 topology 1862 2496
+> 15 0 30 1836 topology 1864 2497
+> 16 0 30 1836 topology 1866 2497
+> 15 0 30 1836 topology 1864 2498
+> 16 0 30 1836 topology 1865 2498
+> 15 0 30 1836 topology 1867 2499
+> 16 0 30 1836 topology 1869 2499
+> 15 0 30 1836 topology 1867 2500
+> 16 0 30 1836 topology 1868 2500
+> 15 0 30 1836 topology 1870 2501
+> 16 0 30 1836 topology 1872 2501
+> 15 0 30 1836 topology 1870 2502
+> 16 0 30 1836 topology 1871 2502
+> 15 0 30 1836 topology 1873 2503
+> 16 0 30 1836 topology 1875 2503
+> 15 0 30 1836 topology 1873 2504
+> 16 0 30 1836 topology 1874 2504
+> 15 0 30 1836 topology 1876 2505
+> 16 0 30 1836 topology 1878 2505
+> 15 0 30 1836 topology 1876 2506
+> 16 0 30 1836 topology 1877 2506
+> 15 0 30 1836 topology 1879 2507
+> 16 0 30 1836 topology 1881 2507
+> 15 0 30 1836 topology 1879 2508
+> 16 0 30 1836 topology 1880 2508
+> 15 0 30 1836 topology 1882 2509
+> 16 0 30 1836 topology 1884 2509
+> 15 0 30 1836 topology 1882 2510
+> 16 0 30 1836 topology 1883 2510
+> 15 0 30 1836 topology 1885 2511
+> 16 0 30 1836 topology 1887 2511
+> 15 0 30 1836 topology 1885 2512
+> 16 0 30 1836 topology 1886 2512
+> 15 0 30 1836 topology 1888 2513
+> 16 0 30 1836 topology 1890 2513
+> 15 0 30 1836 topology 1888 2514
+> 16 0 30 1836 topology 1889 2514
+> 15 0 30 1836 topology 1891 2515
+> 16 0 30 1836 topology 1893 2515
+> 15 0 30 1836 topology 1891 2516
+> 16 0 30 1836 topology 1892 2516
+> 15 0 30 1836 topology 1894 2517
+> 16 0 30 1836 topology 1896 2517
+> 15 0 30 1836 topology 1894 2518
+> 16 0 30 1836 topology 1895 2518
+> 15 0 30 1836 topology 1897 2519
+> 16 0 30 1836 topology 1899 2519
+> 15 0 30 1836 topology 1897 2520
+> 16 0 30 1836 topology 1898 2520
+> 15 0 30 1836 topology 1900 2521
+> 16 0 30 1836 topology 1902 2521
+> 15 0 30 1836 topology 1900 2522
+> 16 0 30 1836 topology 1901 2522
+> 15 0 30 1836 topology 1903 2523
+> 16 0 30 1836 topology 1905 2523
+> 15 0 30 1836 topology 1903 2524
+> 16 0 30 1836 topology 1904 2524
+> 15 0 30 1836 topology 1906 2525
+> 16 0 30 1836 topology 1908 2525
+> 15 0 30 1836 topology 1906 2526
+> 16 0 30 1836 topology 1907 2526
+> 15 0 30 1836 topology 1909 2527
+> 16 0 30 1836 topology 1911 2527
+> 15 0 30 1836 topology 1909 2528
+> 16 0 30 1836 topology 1910 2528
+> 15 0 28 1929 topology 1932 2529
+> 16 0 28 1929 topology 2051 2529
+> 15 0 28 1929 topology 1931 2530
 > 16 0 28 1929 topology 2051 2530
-> 15 0 29 1929 topology 2035 2531
-> 16 0 29 1929 topology 2036 2531
-> 15 0 29 1929 topology 2002 2532
-> 16 0 29 1929 topology 2004 2532
-> 15 0 28 1929 topology 1946 2533
+> 15 0 28 1929 topology 1935 2531
+> 16 0 28 1929 topology 2051 2531
+> 15 0 28 1929 topology 1934 2532
+> 16 0 28 1929 topology 2051 2532
+> 15 0 28 1929 topology 1938 2533
 > 16 0 28 1929 topology 2051 2533
-> 15 0 29 1929 topology 1960 2534
-> 16 0 29 1929 topology 1961 2534
-> 15 0 28 1929 topology 1976 2535
+> 15 0 28 1929 topology 1937 2534
+> 16 0 28 1929 topology 2051 2534
+> 15 0 28 1929 topology 1941 2535
 > 16 0 28 1929 topology 2051 2535
-> 15 0 29 1929 topology 2014 2536
-> 16 0 29 1929 topology 2015 2536
-> 15 0 28 1929 topology 2006 2537
+> 15 0 28 1929 topology 1940 2536
+> 16 0 28 1929 topology 2051 2536
+> 15 0 28 1929 topology 1944 2537
 > 16 0 28 1929 topology 2051 2537
-> 15 0 28 1929 topology 2036 2538
+> 15 0 28 1929 topology 1943 2538
 > 16 0 28 1929 topology 2051 2538
-> 15 0 28 1929 topology 1958 2539
+> 15 0 28 1929 topology 1947 2539
 > 16 0 28 1929 topology 2051 2539
-> 15 0 29 1929 topology 1939 2540
-> 16 0 29 1929 topology 1940 2540
-> 15 0 28 1929 topology 1988 2541
+> 15 0 28 1929 topology 1946 2540
+> 16 0 28 1929 topology 2051 2540
+> 15 0 28 1929 topology 1950 2541
 > 16 0 28 1929 topology 2051 2541
-> 15 0 29 1929 topology 1993 2542
-> 16 0 29 1929 topology 1994 2542
-> 15 0 29 1929 topology 2047 2543
-> 16 0 29 1929 topology 2048 2543
-> 15 0 28 1929 topology 2018 2544
+> 15 0 28 1929 topology 1949 2542
+> 16 0 28 1929 topology 2051 2542
+> 15 0 28 1929 topology 1953 2543
+> 16 0 28 1929 topology 2051 2543
+> 15 0 28 1929 topology 1952 2544
 > 16 0 28 1929 topology 2051 2544
-> 15 0 28 1929 topology 1940 2545
+> 15 0 28 1929 topology 1956 2545
 > 16 0 28 1929 topology 2051 2545
-> 15 0 28 1929 topology 2048 2546
+> 15 0 28 1929 topology 1955 2546
 > 16 0 28 1929 topology 2051 2546
-> 15 0 28 1929 topology 1970 2547
+> 15 0 28 1929 topology 1959 2547
 > 16 0 28 1929 topology 2051 2547
-> 15 0 29 1929 topology 1972 2548
-> 16 0 29 1929 topology 1973 2548
-> 15 0 28 1929 topology 2000 2549
+> 15 0 28 1929 topology 1958 2548
+> 16 0 28 1929 topology 2051 2548
+> 15 0 28 1929 topology 1962 2549
 > 16 0 28 1929 topology 2051 2549
-> 15 0 29 1929 topology 2026 2550
-> 16 0 29 1929 topology 2027 2550
-> 15 0 28 1929 topology 2030 2551
+> 15 0 28 1929 topology 1961 2550
+> 16 0 28 1929 topology 2051 2550
+> 15 0 28 1929 topology 1965 2551
 > 16 0 28 1929 topology 2051 2551
-> 15 0 29 1929 topology 1948 2552
-> 16 0 29 1929 topology 1950 2552
-> 15 0 29 1929 topology 1981 2553
-> 16 0 29 1929 topology 1983 2553
-> 15 0 29 1929 topology 2035 2554
-> 16 0 29 1929 topology 2037 2554
-> 15 0 28 1929 topology 1947 2555
+> 15 0 28 1929 topology 1964 2552
+> 16 0 28 1929 topology 2051 2552
+> 15 0 28 1929 topology 1968 2553
+> 16 0 28 1929 topology 2051 2553
+> 15 0 28 1929 topology 1967 2554
+> 16 0 28 1929 topology 2051 2554
+> 15 0 28 1929 topology 1971 2555
 > 16 0 28 1929 topology 2051 2555
-> 15 0 29 1929 topology 1960 2556
-> 16 0 29 1929 topology 1962 2556
-> 15 0 29 1929 topology 2014 2557
-> 16 0 29 1929 topology 2016 2557
-> 15 0 28 1929 topology 2007 2558
+> 15 0 28 1929 topology 1970 2556
+> 16 0 28 1929 topology 2051 2556
+> 15 0 28 1929 topology 1974 2557
+> 16 0 28 1929 topology 2051 2557
+> 15 0 28 1929 topology 1973 2558
 > 16 0 28 1929 topology 2051 2558
-> 15 0 28 1929 topology 1983 2559
+> 15 0 28 1929 topology 1977 2559
 > 16 0 28 1929 topology 2051 2559
-> 15 0 29 1929 topology 1945 2560
-> 16 0 29 1929 topology 1946 2560
-> 15 0 28 1929 topology 1959 2561
+> 15 0 28 1929 topology 1976 2560
+> 16 0 28 1929 topology 2051 2560
+> 15 0 28 1929 topology 1980 2561
 > 16 0 28 1929 topology 2051 2561
-> 15 0 28 1929 topology 1935 2562
+> 15 0 28 1929 topology 1979 2562
 > 16 0 28 1929 topology 2051 2562
-> 15 0 29 1929 topology 1939 2563
-> 16 0 29 1929 topology 1941 2563
-> 15 0 29 1929 topology 1993 2564
-> 16 0 29 1929 topology 1995 2564
-> 15 0 28 1929 topology 2043 2565
+> 15 0 28 1929 topology 1983 2563
+> 16 0 28 1929 topology 2051 2563
+> 15 0 28 1929 topology 1982 2564
+> 16 0 28 1929 topology 2051 2564
+> 15 0 28 1929 topology 1986 2565
 > 16 0 28 1929 topology 2051 2565
-> 15 0 29 1929 topology 2047 2566
-> 16 0 29 1929 topology 2049 2566
-> 15 0 28 1929 topology 2019 2567
+> 15 0 28 1929 topology 1985 2566
+> 16 0 28 1929 topology 2051 2566
+> 15 0 28 1929 topology 1989 2567
 > 16 0 28 1929 topology 2051 2567
-> 15 0 28 1929 topology 1995 2568
+> 15 0 28 1929 topology 1988 2568
 > 16 0 28 1929 topology 2051 2568
-> 15 0 28 1929 topology 1971 2569
+> 15 0 28 1929 topology 1992 2569
 > 16 0 28 1929 topology 2051 2569
-> 15 0 29 1929 topology 1978 2570
-> 16 0 29 1929 topology 1979 2570
-> 15 0 29 1929 topology 1972 2571
-> 16 0 29 1929 topology 1974 2571
-> 15 0 29 1929 topology 2026 2572
-> 16 0 29 1929 topology 2028 2572
-> 15 0 28 1929 topology 2031 2573
+> 15 0 28 1929 topology 1991 2570
+> 16 0 28 1929 topology 2051 2570
+> 15 0 28 1929 topology 1995 2571
+> 16 0 28 1929 topology 2051 2571
+> 15 0 28 1929 topology 1994 2572
+> 16 0 28 1929 topology 2051 2572
+> 15 0 28 1929 topology 1998 2573
 > 16 0 28 1929 topology 2051 2573
-> 15 0 29 1929 topology 1957 2574
-> 16 0 29 1929 topology 1958 2574
-> 15 0 29 1929 topology 2011 2575
-> 16 0 29 1929 topology 2012 2575
-> 15 0 29 1929 topology 1936 2576
-> 16 0 29 1929 topology 1937 2576
-> 15 0 28 1929 topology 1955 2577
+> 15 0 28 1929 topology 1997 2574
+> 16 0 28 1929 topology 2051 2574
+> 15 0 28 1929 topology 2001 2575
+> 16 0 28 1929 topology 2051 2575
+> 15 0 28 1929 topology 2000 2576
+> 16 0 28 1929 topology 2051 2576
+> 15 0 28 1929 topology 2004 2577
 > 16 0 28 1929 topology 2051 2577
-> 15 0 29 1929 topology 1990 2578
-> 16 0 29 1929 topology 1991 2578
-> 15 0 29 1929 topology 2044 2579
-> 16 0 29 1929 topology 2045 2579
-> 15 0 28 1929 topology 1985 2580
+> 15 0 28 1929 topology 2003 2578
+> 16 0 28 1929 topology 2051 2578
+> 15 0 28 1929 topology 2007 2579
+> 16 0 28 1929 topology 2051 2579
+> 15 0 28 1929 topology 2006 2580
 > 16 0 28 1929 topology 2051 2580
-> 15 0 28 1929 topology 2015 2581
+> 15 0 28 1929 topology 2010 2581
 > 16 0 28 1929 topology 2051 2581
-> 15 0 28 1929 topology 1937 2582
+> 15 0 28 1929 topology 2009 2582
 > 16 0 28 1929 topology 2051 2582
-> 15 0 28 1929 topology 2045 2583
+> 15 0 28 1929 topology 2013 2583
 > 16 0 28 1929 topology 2051 2583
-> 15 0 28 1929 topology 1967 2584
+> 15 0 28 1929 topology 2012 2584
 > 16 0 28 1929 topology 2051 2584
-> 15 0 29 1929 topology 1969 2585
-> 16 0 29 1929 topology 1970 2585
-> 15 0 29 1929 topology 2023 2586
-> 16 0 29 1929 topology 2024 2586
-> 15 0 28 1929 topology 1997 2587
+> 15 0 28 1929 topology 2016 2585
+> 16 0 28 1929 topology 2051 2585
+> 15 0 28 1929 topology 2015 2586
+> 16 0 28 1929 topology 2051 2586
+> 15 0 28 1929 topology 2019 2587
 > 16 0 28 1929 topology 2051 2587
-> 15 0 28 1929 topology 2027 2588
+> 15 0 28 1929 topology 2018 2588
 > 16 0 28 1929 topology 2051 2588
-> 15 0 29 1929 topology 2002 2589
-> 16 0 29 1929 topology 2003 2589
-> 15 0 29 1929 topology 1951 2590
-> 16 0 29 1929 topology 1953 2590
-> 15 0 29 1929 topology 2005 2591
-> 16 0 29 1929 topology 2007 2591
-> 15 0 29 1929 topology 1930 2592
-> 16 0 29 1929 topology 1932 2592
-> 15 0 29 1929 topology 1984 2593
-> 16 0 29 1929 topology 1986 2593
-> 15 0 29 1929 topology 2038 2594
-> 16 0 29 1929 topology 2040 2594
-> 15 0 28 1929 topology 1950 2595
+> 15 0 28 1929 topology 2022 2589
+> 16 0 28 1929 topology 2051 2589
+> 15 0 28 1929 topology 2021 2590
+> 16 0 28 1929 topology 2051 2590
+> 15 0 28 1929 topology 2025 2591
+> 16 0 28 1929 topology 2051 2591
+> 15 0 28 1929 topology 2024 2592
+> 16 0 28 1929 topology 2051 2592
+> 15 0 28 1929 topology 2028 2593
+> 16 0 28 1929 topology 2051 2593
+> 15 0 28 1929 topology 2027 2594
+> 16 0 28 1929 topology 2051 2594
+> 15 0 28 1929 topology 2031 2595
 > 16 0 28 1929 topology 2051 2595
-> 15 0 29 1929 topology 1963 2596
-> 16 0 29 1929 topology 1965 2596
-> 15 0 28 1929 topology 2010 2597
+> 15 0 28 1929 topology 2030 2596
+> 16 0 28 1929 topology 2051 2596
+> 15 0 28 1929 topology 2034 2597
 > 16 0 28 1929 topology 2051 2597
-> 15 0 29 1929 topology 2017 2598
-> 16 0 29 1929 topology 2019 2598
-> 15 0 28 1929 topology 1986 2599
+> 15 0 28 1929 topology 2033 2598
+> 16 0 28 1929 topology 2051 2598
+> 15 0 28 1929 topology 2037 2599
 > 16 0 28 1929 topology 2051 2599
-> 15 0 28 1929 topology 1962 2600
+> 15 0 28 1929 topology 2036 2600
 > 16 0 28 1929 topology 2051 2600
-> 15 0 28 1929 topology 1938 2601
+> 15 0 28 1929 topology 2040 2601
 > 16 0 28 1929 topology 2051 2601
-> 15 0 29 1929 topology 1975 2602
-> 16 0 29 1929 topology 1976 2602
-> 15 0 28 1929 topology 2046 2603
+> 15 0 28 1929 topology 2039 2602
+> 16 0 28 1929 topology 2051 2602
+> 15 0 28 1929 topology 2043 2603
 > 16 0 28 1929 topology 2051 2603
-> 15 0 29 1929 topology 1942 2604
-> 16 0 29 1929 topology 1944 2604
-> 15 0 29 1929 topology 1996 2605
-> 16 0 29 1929 topology 1998 2605
-> 15 0 28 1929 topology 2022 2606
+> 15 0 28 1929 topology 2042 2604
+> 16 0 28 1929 topology 2051 2604
+> 15 0 28 1929 topology 2046 2605
+> 16 0 28 1929 topology 2051 2605
+> 15 0 28 1929 topology 2045 2606
 > 16 0 28 1929 topology 2051 2606
-> 15 0 28 1929 topology 1998 2607
+> 15 0 28 1929 topology 2049 2607
 > 16 0 28 1929 topology 2051 2607
-> 15 0 28 1929 topology 1974 2608
+> 15 0 28 1929 topology 2048 2608
 > 16 0 28 1929 topology 2051 2608
-> 15 0 29 1929 topology 1954 2609
-> 16 0 29 1929 topology 1955 2609
-> 15 0 29 1929 topology 2008 2610
-> 16 0 29 1929 topology 2009 2610
-> 15 0 29 1929 topology 2029 2611
-> 16 0 29 1929 topology 2031 2611
-> 15 0 28 1929 topology 2034 2612
-> 16 0 28 1929 topology 2051 2612
-> 15 0 29 1929 topology 1933 2613
-> 16 0 29 1929 topology 1934 2613
-> 15 0 29 1929 topology 1987 2614
-> 16 0 29 1929 topology 1988 2614
-> 15 0 29 1929 topology 2041 2615
-> 16 0 29 1929 topology 2042 2615
-> 15 0 28 1929 topology 1952 2616
-> 16 0 28 1929 topology 2051 2616
-> 15 0 28 1929 topology 1982 2617
-> 16 0 28 1929 topology 2051 2617
-> 15 0 28 1929 topology 2012 2618
-> 16 0 28 1929 topology 2051 2618
-> 15 0 28 1929 topology 1934 2619
-> 16 0 28 1929 topology 2051 2619
-> 15 0 29 1929 topology 1966 2620
-> 16 0 29 1929 topology 1967 2620
-> 15 0 29 1929 topology 2020 2621
-> 16 0 29 1929 topology 2021 2621
-> 15 0 28 1929 topology 2042 2622
-> 16 0 28 1929 topology 2051 2622
-> 15 0 28 1929 topology 1964 2623
-> 16 0 28 1929 topology 2051 2623
-> 15 0 28 1929 topology 1994 2624
-> 16 0 28 1929 topology 2051 2624
-> 15 0 28 1929 topology 2024 2625
-> 16 0 28 1929 topology 2051 2625
-> 15 0 29 1929 topology 1999 2626
-> 16 0 29 1929 topology 2000 2626
-> 15 0 29 1929 topology 1975 2627
-> 16 0 29 1929 topology 1977 2627
-> 15 0 29 1929 topology 2032 2628
-> 16 0 29 1929 topology 2033 2628
-> 15 0 29 1929 topology 1954 2629
-> 16 0 29 1929 topology 1956 2629
-> 15 0 29 1929 topology 2008 2630
-> 16 0 29 1929 topology 2010 2630
-> 15 0 29 1929 topology 1933 2631
-> 16 0 29 1929 topology 1935 2631
-> 15 0 28 1929 topology 1977 2632
-> 16 0 28 1929 topology 2051 2632
-> 15 0 29 1929 topology 1987 2633
-> 16 0 29 1929 topology 1989 2633
-> 15 0 29 1929 topology 2041 2634
-> 16 0 29 1929 topology 2043 2634
-> 15 0 28 1929 topology 1953 2635
-> 16 0 28 1929 topology 2051 2635
-> 15 0 28 1929 topology 2037 2636
-> 16 0 28 1929 topology 2051 2636
-> 15 0 28 1929 topology 2013 2637
-> 16 0 28 1929 topology 2051 2637
-> 15 0 29 1929 topology 1966 2638
-> 16 0 29 1929 topology 1968 2638
-> 15 0 28 1929 topology 1989 2639
-> 16 0 28 1929 topology 2051 2639
-> 15 0 29 1929 topology 2020 2640
-> 16 0 29 1929 topology 2022 2640
-> 15 0 28 1929 topology 1965 2641
-> 16 0 28 1929 topology 2051 2641
-> 15 0 28 1929 topology 1941 2642
-> 16 0 28 1929 topology 2051 2642
-> 15 0 28 1929 topology 2049 2643
-> 16 0 28 1929 topology 2051 2643
-> 15 0 29 1929 topology 1951 2644
-> 16 0 29 1929 topology 1952 2644
-> 15 0 29 1929 topology 2005 2645
-> 16 0 29 1929 topology 2006 2645
-> 15 0 28 1929 topology 2025 2646
-> 16 0 28 1929 topology 2051 2646
-> 15 0 29 1929 topology 1999 2647
-> 16 0 29 1929 topology 2001 2647
-> 15 0 28 1929 topology 2001 2648
-> 16 0 28 1929 topology 2051 2648
-> 15 0 29 1929 topology 1930 2649
-> 16 0 29 1929 topology 1931 2649
-> 15 0 29 1929 topology 1984 2650
-> 16 0 29 1929 topology 1985 2650
-> 15 0 29 1929 topology 2038 2651
-> 16 0 29 1929 topology 2039 2651
-> 15 0 29 1929 topology 2032 2652
-> 16 0 29 1929 topology 2034 2652
-> 15 0 28 1929 topology 1949 2653
-> 16 0 28 1929 topology 2051 2653
-> 15 0 28 1929 topology 1979 2654
-> 16 0 28 1929 topology 2051 2654
-> 15 0 29 1929 topology 1963 2655
-> 16 0 29 1929 topology 1964 2655
-> 15 0 28 1929 topology 2009 2656
-> 16 0 28 1929 topology 2051 2656
-> 15 0 29 1929 topology 2017 2657
-> 16 0 29 1929 topology 2018 2657
-> 15 0 28 1929 topology 1931 2658
-> 16 0 28 1929 topology 2051 2658
-> 15 0 28 1929 topology 2039 2659
-> 16 0 28 1929 topology 2051 2659
-> 15 0 28 1929 topology 1961 2660
-> 16 0 28 1929 topology 2051 2660
-> 15 0 28 1929 topology 1991 2661
-> 16 0 28 1929 topology 2051 2661
-> 15 0 29 1929 topology 1942 2662
-> 16 0 29 1929 topology 1943 2662
-> 15 0 29 1929 topology 1996 2663
-> 16 0 29 1929 topology 1997 2663
-> 15 0 28 1929 topology 2021 2664
-> 16 0 28 1929 topology 2051 2664
-> 15 0 28 1929 topology 1943 2665
-> 16 0 28 1929 topology 2051 2665
-> 15 0 28 1929 topology 1973 2666
-> 16 0 28 1929 topology 2051 2666
-> 15 0 29 1929 topology 1945 2667
-> 16 0 29 1929 topology 1947 2667
-> 15 0 28 1929 topology 2003 2668
-> 16 0 28 1929 topology 2051 2668
-> 15 0 29 1929 topology 2029 2669
-> 16 0 29 1929 topology 2030 2669
-> 15 0 28 1929 topology 2033 2670
-> 16 0 28 1929 topology 2051 2670
-> 15 0 29 1929 topology 1978 2671
-> 16 0 29 1929 topology 1980 2671
-> 15 0 29 1929 topology 1957 2672
-> 16 0 29 1929 topology 1959 2672
-> 15 0 29 1929 topology 2011 2673
-> 16 0 29 1929 topology 2013 2673
-> 15 0 28 1929 topology 1980 2674
-> 16 0 28 1929 topology 2051 2674
-> 15 0 29 1929 topology 1936 2675
-> 16 0 29 1929 topology 1938 2675
-> 15 0 28 1929 topology 1956 2676
-> 16 0 28 1929 topology 2051 2676
-> 15 0 29 1929 topology 1990 2677
-> 16 0 29 1929 topology 1992 2677
-> 15 0 29 1929 topology 2044 2678
-> 16 0 29 1929 topology 2046 2678
-> 15 0 28 1929 topology 1932 2679
-> 16 0 28 1929 topology 2051 2679
-> 15 0 28 1929 topology 2040 2680
-> 16 0 28 1929 topology 2051 2680
-> 15 0 28 1929 topology 2016 2681
-> 16 0 28 1929 topology 2051 2681
-> 15 0 29 1929 topology 1948 2682
-> 16 0 29 1929 topology 1949 2682
-> 15 0 28 1929 topology 1992 2683
-> 16 0 28 1929 topology 2051 2683
-> 15 0 28 1929 topology 1968 2684
-> 16 0 28 1929 topology 2051 2684
-> 15 0 29 1929 topology 1969 2685
-> 16 0 29 1929 topology 1971 2685
-> 15 0 29 1929 topology 2023 2686
-> 16 0 29 1929 topology 2025 2686
-> 15 0 30 1929 topology 2050 2687
-> 16 0 30 1929 topology 2051 2687
-> 15 0 28 1929 topology 1944 2688
-> 16 0 28 1929 topology 2051 2688
-> 15 0 28 1929 topology 2028 2689
-> 16 0 28 1929 topology 2051 2689
+> 15 0 29 1929 topology 2050 2609
+> 16 0 29 1929 topology 2051 2609
+> 15 0 30 1929 topology 1930 2610
+> 16 0 30 1929 topology 1932 2610
+> 15 0 30 1929 topology 1930 2611
+> 16 0 30 1929 topology 1931 2611
+> 15 0 30 1929 topology 1933 2612
+> 16 0 30 1929 topology 1935 2612
+> 15 0 30 1929 topology 1933 2613
+> 16 0 30 1929 topology 1934 2613
+> 15 0 30 1929 topology 1936 2614
+> 16 0 30 1929 topology 1938 2614
+> 15 0 30 1929 topology 1936 2615
+> 16 0 30 1929 topology 1937 2615
+> 15 0 30 1929 topology 1939 2616
+> 16 0 30 1929 topology 1941 2616
+> 15 0 30 1929 topology 1939 2617
+> 16 0 30 1929 topology 1940 2617
+> 15 0 30 1929 topology 1942 2618
+> 16 0 30 1929 topology 1944 2618
+> 15 0 30 1929 topology 1942 2619
+> 16 0 30 1929 topology 1943 2619
+> 15 0 30 1929 topology 1945 2620
+> 16 0 30 1929 topology 1947 2620
+> 15 0 30 1929 topology 1945 2621
+> 16 0 30 1929 topology 1946 2621
+> 15 0 30 1929 topology 1948 2622
+> 16 0 30 1929 topology 1950 2622
+> 15 0 30 1929 topology 1948 2623
+> 16 0 30 1929 topology 1949 2623
+> 15 0 30 1929 topology 1951 2624
+> 16 0 30 1929 topology 1953 2624
+> 15 0 30 1929 topology 1951 2625
+> 16 0 30 1929 topology 1952 2625
+> 15 0 30 1929 topology 1954 2626
+> 16 0 30 1929 topology 1956 2626
+> 15 0 30 1929 topology 1954 2627
+> 16 0 30 1929 topology 1955 2627
+> 15 0 30 1929 topology 1957 2628
+> 16 0 30 1929 topology 1959 2628
+> 15 0 30 1929 topology 1957 2629
+> 16 0 30 1929 topology 1958 2629
+> 15 0 30 1929 topology 1960 2630
+> 16 0 30 1929 topology 1962 2630
+> 15 0 30 1929 topology 1960 2631
+> 16 0 30 1929 topology 1961 2631
+> 15 0 30 1929 topology 1963 2632
+> 16 0 30 1929 topology 1965 2632
+> 15 0 30 1929 topology 1963 2633
+> 16 0 30 1929 topology 1964 2633
+> 15 0 30 1929 topology 1966 2634
+> 16 0 30 1929 topology 1968 2634
+> 15 0 30 1929 topology 1966 2635
+> 16 0 30 1929 topology 1967 2635
+> 15 0 30 1929 topology 1969 2636
+> 16 0 30 1929 topology 1971 2636
+> 15 0 30 1929 topology 1969 2637
+> 16 0 30 1929 topology 1970 2637
+> 15 0 30 1929 topology 1972 2638
+> 16 0 30 1929 topology 1974 2638
+> 15 0 30 1929 topology 1972 2639
+> 16 0 30 1929 topology 1973 2639
+> 15 0 30 1929 topology 1975 2640
+> 16 0 30 1929 topology 1977 2640
+> 15 0 30 1929 topology 1975 2641
+> 16 0 30 1929 topology 1976 2641
+> 15 0 30 1929 topology 1978 2642
+> 16 0 30 1929 topology 1980 2642
+> 15 0 30 1929 topology 1978 2643
+> 16 0 30 1929 topology 1979 2643
+> 15 0 30 1929 topology 1981 2644
+> 16 0 30 1929 topology 1983 2644
+> 15 0 30 1929 topology 1981 2645
+> 16 0 30 1929 topology 1982 2645
+> 15 0 30 1929 topology 1984 2646
+> 16 0 30 1929 topology 1986 2646
+> 15 0 30 1929 topology 1984 2647
+> 16 0 30 1929 topology 1985 2647
+> 15 0 30 1929 topology 1987 2648
+> 16 0 30 1929 topology 1989 2648
+> 15 0 30 1929 topology 1987 2649
+> 16 0 30 1929 topology 1988 2649
+> 15 0 30 1929 topology 1990 2650
+> 16 0 30 1929 topology 1992 2650
+> 15 0 30 1929 topology 1990 2651
+> 16 0 30 1929 topology 1991 2651
+> 15 0 30 1929 topology 1993 2652
+> 16 0 30 1929 topology 1995 2652
+> 15 0 30 1929 topology 1993 2653
+> 16 0 30 1929 topology 1994 2653
+> 15 0 30 1929 topology 1996 2654
+> 16 0 30 1929 topology 1998 2654
+> 15 0 30 1929 topology 1996 2655
+> 16 0 30 1929 topology 1997 2655
+> 15 0 30 1929 topology 1999 2656
+> 16 0 30 1929 topology 2001 2656
+> 15 0 30 1929 topology 1999 2657
+> 16 0 30 1929 topology 2000 2657
+> 15 0 30 1929 topology 2002 2658
+> 16 0 30 1929 topology 2004 2658
+> 15 0 30 1929 topology 2002 2659
+> 16 0 30 1929 topology 2003 2659
+> 15 0 30 1929 topology 2005 2660
+> 16 0 30 1929 topology 2007 2660
+> 15 0 30 1929 topology 2005 2661
+> 16 0 30 1929 topology 2006 2661
+> 15 0 30 1929 topology 2008 2662
+> 16 0 30 1929 topology 2010 2662
+> 15 0 30 1929 topology 2008 2663
+> 16 0 30 1929 topology 2009 2663
+> 15 0 30 1929 topology 2011 2664
+> 16 0 30 1929 topology 2013 2664
+> 15 0 30 1929 topology 2011 2665
+> 16 0 30 1929 topology 2012 2665
+> 15 0 30 1929 topology 2014 2666
+> 16 0 30 1929 topology 2016 2666
+> 15 0 30 1929 topology 2014 2667
+> 16 0 30 1929 topology 2015 2667
+> 15 0 30 1929 topology 2017 2668
+> 16 0 30 1929 topology 2019 2668
+> 15 0 30 1929 topology 2017 2669
+> 16 0 30 1929 topology 2018 2669
+> 15 0 30 1929 topology 2020 2670
+> 16 0 30 1929 topology 2022 2670
+> 15 0 30 1929 topology 2020 2671
+> 16 0 30 1929 topology 2021 2671
+> 15 0 30 1929 topology 2023 2672
+> 16 0 30 1929 topology 2025 2672
+> 15 0 30 1929 topology 2023 2673
+> 16 0 30 1929 topology 2024 2673
+> 15 0 30 1929 topology 2026 2674
+> 16 0 30 1929 topology 2028 2674
+> 15 0 30 1929 topology 2026 2675
+> 16 0 30 1929 topology 2027 2675
+> 15 0 30 1929 topology 2029 2676
+> 16 0 30 1929 topology 2031 2676
+> 15 0 30 1929 topology 2029 2677
+> 16 0 30 1929 topology 2030 2677
+> 15 0 30 1929 topology 2032 2678
+> 16 0 30 1929 topology 2034 2678
+> 15 0 30 1929 topology 2032 2679
+> 16 0 30 1929 topology 2033 2679
+> 15 0 30 1929 topology 2035 2680
+> 16 0 30 1929 topology 2037 2680
+> 15 0 30 1929 topology 2035 2681
+> 16 0 30 1929 topology 2036 2681
+> 15 0 30 1929 topology 2038 2682
+> 16 0 30 1929 topology 2040 2682
+> 15 0 30 1929 topology 2038 2683
+> 16 0 30 1929 topology 2039 2683
+> 15 0 30 1929 topology 2041 2684
+> 16 0 30 1929 topology 2043 2684
+> 15 0 30 1929 topology 2041 2685
+> 16 0 30 1929 topology 2042 2685
+> 15 0 30 1929 topology 2044 2686
+> 16 0 30 1929 topology 2046 2686
+> 15 0 30 1929 topology 2044 2687
+> 16 0 30 1929 topology 2045 2687
+> 15 0 30 1929 topology 2047 2688
+> 16 0 30 1929 topology 2049 2688
+> 15 0 30 1929 topology 2047 2689
+> 16 0 30 1929 topology 2048 2689
 > 15 0 31 1607 topology 2054 2690
 > 16 0 31 1607 topology 2053 2690
 > 15 0 31 1607 topology 2054 2691
@@ -18484,12040 +18484,12040 @@ $ tail -n +3 trace_platform.trace
 > 16 0 31 1607 topology 2050 2693
 > 15 0 32 1607 topology 1726 2694
 > 16 0 32 1607 topology 2054 2694
-> 15 0 28 2057 topology 2068 2695
+> 15 0 28 2057 topology 2087 2695
 > 16 0 28 2057 topology 2155 2695
-> 15 0 29 2057 topology 2073 2696
-> 16 0 29 2057 topology 2074 2696
-> 15 0 29 2057 topology 2076 2697
-> 16 0 29 2057 topology 2077 2697
-> 15 0 28 2057 topology 2120 2698
+> 15 0 28 2057 topology 2086 2696
+> 16 0 28 2057 topology 2155 2696
+> 15 0 28 2057 topology 2090 2697
+> 16 0 28 2057 topology 2155 2697
+> 15 0 28 2057 topology 2089 2698
 > 16 0 28 2057 topology 2155 2698
-> 15 0 29 2057 topology 2130 2699
-> 16 0 29 2057 topology 2131 2699
-> 15 0 28 2057 topology 2096 2700
+> 15 0 28 2057 topology 2093 2699
+> 16 0 28 2057 topology 2155 2699
+> 15 0 28 2057 topology 2092 2700
 > 16 0 28 2057 topology 2155 2700
-> 15 0 29 2057 topology 2079 2701
-> 16 0 29 2057 topology 2080 2701
-> 15 0 28 2057 topology 2080 2702
+> 15 0 28 2057 topology 2096 2701
+> 16 0 28 2057 topology 2155 2701
+> 15 0 28 2057 topology 2095 2702
 > 16 0 28 2057 topology 2155 2702
-> 15 0 29 2057 topology 2082 2703
-> 16 0 29 2057 topology 2083 2703
-> 15 0 29 2057 topology 2109 2704
-> 16 0 29 2057 topology 2110 2704
-> 15 0 28 2057 topology 2132 2705
+> 15 0 28 2057 topology 2099 2703
+> 16 0 28 2057 topology 2155 2703
+> 15 0 28 2057 topology 2098 2704
+> 16 0 28 2057 topology 2155 2704
+> 15 0 28 2057 topology 2102 2705
 > 16 0 28 2057 topology 2155 2705
-> 15 0 28 2057 topology 2108 2706
+> 15 0 28 2057 topology 2101 2706
 > 16 0 28 2057 topology 2155 2706
-> 15 0 29 2057 topology 2142 2707
-> 16 0 29 2057 topology 2143 2707
-> 15 0 28 2057 topology 2144 2708
+> 15 0 28 2057 topology 2105 2707
+> 16 0 28 2057 topology 2155 2707
+> 15 0 28 2057 topology 2104 2708
 > 16 0 28 2057 topology 2155 2708
-> 15 0 29 2057 topology 2091 2709
-> 16 0 29 2057 topology 2093 2709
-> 15 0 29 2057 topology 2145 2710
-> 16 0 29 2057 topology 2146 2710
-> 15 0 28 2057 topology 2092 2711
+> 15 0 28 2057 topology 2108 2709
+> 16 0 28 2057 topology 2155 2709
+> 15 0 28 2057 topology 2107 2710
+> 16 0 28 2057 topology 2155 2710
+> 15 0 28 2057 topology 2111 2711
 > 16 0 28 2057 topology 2155 2711
-> 15 0 28 2057 topology 2122 2712
+> 15 0 28 2057 topology 2110 2712
 > 16 0 28 2057 topology 2155 2712
-> 15 0 29 2057 topology 2124 2713
-> 16 0 29 2057 topology 2126 2713
-> 15 0 28 2057 topology 2069 2714
+> 15 0 28 2057 topology 2114 2713
+> 16 0 28 2057 topology 2155 2713
+> 15 0 28 2057 topology 2113 2714
 > 16 0 28 2057 topology 2155 2714
-> 15 0 28 2057 topology 2104 2715
+> 15 0 28 2057 topology 2060 2715
 > 16 0 28 2057 topology 2155 2715
-> 15 0 28 2057 topology 2134 2716
+> 15 0 28 2057 topology 2059 2716
 > 16 0 28 2057 topology 2155 2716
-> 15 0 29 2057 topology 2103 2717
-> 16 0 29 2057 topology 2105 2717
-> 15 0 28 2057 topology 2081 2718
+> 15 0 28 2057 topology 2117 2717
+> 16 0 28 2057 topology 2155 2717
+> 15 0 28 2057 topology 2116 2718
 > 16 0 28 2057 topology 2155 2718
-> 15 0 29 2057 topology 2088 2719
-> 16 0 29 2057 topology 2089 2719
-> 15 0 29 2057 topology 2136 2720
-> 16 0 29 2057 topology 2138 2720
-> 15 0 29 2057 topology 2121 2721
-> 16 0 29 2057 topology 2122 2721
-> 15 0 28 2057 topology 2065 2722
+> 15 0 28 2057 topology 2120 2719
+> 16 0 28 2057 topology 2155 2719
+> 15 0 28 2057 topology 2119 2720
+> 16 0 28 2057 topology 2155 2720
+> 15 0 28 2057 topology 2123 2721
+> 16 0 28 2057 topology 2155 2721
+> 15 0 28 2057 topology 2122 2722
 > 16 0 28 2057 topology 2155 2722
-> 15 0 28 2057 topology 2087 2723
+> 15 0 28 2057 topology 2126 2723
 > 16 0 28 2057 topology 2155 2723
-> 15 0 29 2057 topology 2100 2724
-> 16 0 29 2057 topology 2101 2724
-> 15 0 28 2057 topology 2077 2725
+> 15 0 28 2057 topology 2125 2724
+> 16 0 28 2057 topology 2155 2724
+> 15 0 28 2057 topology 2129 2725
 > 16 0 28 2057 topology 2155 2725
-> 15 0 28 2057 topology 2123 2726
+> 15 0 28 2057 topology 2128 2726
 > 16 0 28 2057 topology 2155 2726
-> 15 0 28 2057 topology 2099 2727
+> 15 0 28 2057 topology 2132 2727
 > 16 0 28 2057 topology 2155 2727
-> 15 0 29 2057 topology 2133 2728
-> 16 0 29 2057 topology 2134 2728
+> 15 0 28 2057 topology 2131 2728
+> 16 0 28 2057 topology 2155 2728
 > 15 0 28 2057 topology 2135 2729
 > 16 0 28 2057 topology 2155 2729
-> 15 0 28 2057 topology 2111 2730
+> 15 0 28 2057 topology 2134 2730
 > 16 0 28 2057 topology 2155 2730
-> 15 0 29 2057 topology 2112 2731
-> 16 0 29 2057 topology 2113 2731
-> 15 0 29 2057 topology 2061 2732
-> 16 0 29 2057 topology 2063 2732
-> 15 0 29 2057 topology 2088 2733
-> 16 0 29 2057 topology 2090 2733
-> 15 0 28 2057 topology 2147 2734
+> 15 0 28 2057 topology 2138 2731
+> 16 0 28 2057 topology 2155 2731
+> 15 0 28 2057 topology 2137 2732
+> 16 0 28 2057 topology 2155 2732
+> 15 0 28 2057 topology 2141 2733
+> 16 0 28 2057 topology 2155 2733
+> 15 0 28 2057 topology 2140 2734
 > 16 0 28 2057 topology 2155 2734
-> 15 0 28 2057 topology 2089 2735
+> 15 0 28 2057 topology 2144 2735
 > 16 0 28 2057 topology 2155 2735
-> 15 0 29 2057 topology 2067 2736
-> 16 0 29 2057 topology 2069 2736
-> 15 0 28 2057 topology 2119 2737
+> 15 0 28 2057 topology 2143 2736
+> 16 0 28 2057 topology 2155 2736
+> 15 0 28 2057 topology 2063 2737
 > 16 0 28 2057 topology 2155 2737
-> 15 0 29 2057 topology 2121 2738
-> 16 0 29 2057 topology 2123 2738
-> 15 0 28 2057 topology 2060 2739
+> 15 0 28 2057 topology 2062 2738
+> 16 0 28 2057 topology 2155 2738
+> 15 0 28 2057 topology 2066 2739
 > 16 0 28 2057 topology 2155 2739
-> 15 0 29 2057 topology 2148 2740
-> 16 0 29 2057 topology 2149 2740
-> 15 0 28 2057 topology 2101 2741
+> 15 0 28 2057 topology 2065 2740
+> 16 0 28 2057 topology 2155 2740
+> 15 0 28 2057 topology 2069 2741
 > 16 0 28 2057 topology 2155 2741
-> 15 0 29 2057 topology 2073 2742
-> 16 0 29 2057 topology 2075 2742
-> 15 0 29 2057 topology 2100 2743
-> 16 0 29 2057 topology 2102 2743
-> 15 0 28 2057 topology 2131 2744
+> 15 0 28 2057 topology 2068 2742
+> 16 0 28 2057 topology 2155 2742
+> 15 0 28 2057 topology 2147 2743
+> 16 0 28 2057 topology 2155 2743
+> 15 0 28 2057 topology 2146 2744
 > 16 0 28 2057 topology 2155 2744
-> 15 0 28 2057 topology 2072 2745
+> 15 0 28 2057 topology 2150 2745
 > 16 0 28 2057 topology 2155 2745
-> 15 0 28 2057 topology 2113 2746
+> 15 0 28 2057 topology 2149 2746
 > 16 0 28 2057 topology 2155 2746
-> 15 0 29 2057 topology 2079 2747
-> 16 0 29 2057 topology 2081 2747
-> 15 0 29 2057 topology 2133 2748
-> 16 0 29 2057 topology 2135 2748
-> 15 0 28 2057 topology 2143 2749
+> 15 0 28 2057 topology 2072 2747
+> 16 0 28 2057 topology 2155 2747
+> 15 0 28 2057 topology 2071 2748
+> 16 0 28 2057 topology 2155 2748
+> 15 0 28 2057 topology 2153 2749
 > 16 0 28 2057 topology 2155 2749
-> 15 0 28 2057 topology 2084 2750
+> 15 0 28 2057 topology 2152 2750
 > 16 0 28 2057 topology 2155 2750
-> 15 0 29 2057 topology 2091 2751
-> 16 0 29 2057 topology 2092 2751
-> 15 0 28 2057 topology 2149 2752
+> 15 0 28 2057 topology 2075 2751
+> 16 0 28 2057 topology 2155 2751
+> 15 0 28 2057 topology 2074 2752
 > 16 0 28 2057 topology 2155 2752
-> 15 0 29 2057 topology 2112 2753
-> 16 0 29 2057 topology 2114 2753
-> 15 0 28 2057 topology 2062 2754
+> 15 0 28 2057 topology 2078 2753
+> 16 0 28 2057 topology 2155 2753
+> 15 0 28 2057 topology 2077 2754
 > 16 0 28 2057 topology 2155 2754
-> 15 0 29 2057 topology 2124 2755
-> 16 0 29 2057 topology 2125 2755
-> 15 0 28 2057 topology 2090 2756
+> 15 0 28 2057 topology 2081 2755
+> 16 0 28 2057 topology 2155 2755
+> 15 0 28 2057 topology 2080 2756
 > 16 0 28 2057 topology 2155 2756
-> 15 0 28 2057 topology 2074 2757
+> 15 0 28 2057 topology 2084 2757
 > 16 0 28 2057 topology 2155 2757
-> 15 0 29 2057 topology 2103 2758
-> 16 0 29 2057 topology 2104 2758
-> 15 0 29 2057 topology 2148 2759
-> 16 0 29 2057 topology 2150 2759
-> 15 0 28 2057 topology 2126 2760
-> 16 0 28 2057 topology 2155 2760
-> 15 0 28 2057 topology 2102 2761
-> 16 0 28 2057 topology 2155 2761
-> 15 0 29 2057 topology 2136 2762
-> 16 0 29 2057 topology 2137 2762
-> 15 0 28 2057 topology 2138 2763
-> 16 0 28 2057 topology 2155 2763
-> 15 0 29 2057 topology 2085 2764
-> 16 0 29 2057 topology 2087 2764
-> 15 0 28 2057 topology 2114 2765
-> 16 0 28 2057 topology 2155 2765
-> 15 0 28 2057 topology 2086 2766
-> 16 0 28 2057 topology 2155 2766
-> 15 0 29 2057 topology 2118 2767
-> 16 0 29 2057 topology 2120 2767
-> 15 0 28 2057 topology 2150 2768
-> 16 0 28 2057 topology 2155 2768
-> 15 0 28 2057 topology 2116 2769
-> 16 0 28 2057 topology 2155 2769
-> 15 0 28 2057 topology 2063 2770
-> 16 0 28 2057 topology 2155 2770
-> 15 0 28 2057 topology 2098 2771
-> 16 0 28 2057 topology 2155 2771
-> 15 0 29 2057 topology 2097 2772
-> 16 0 29 2057 topology 2099 2772
-> 15 0 28 2057 topology 2128 2773
-> 16 0 28 2057 topology 2155 2773
-> 15 0 28 2057 topology 2152 2774
-> 16 0 28 2057 topology 2155 2774
-> 15 0 28 2057 topology 2075 2775
-> 16 0 28 2057 topology 2155 2775
-> 15 0 28 2057 topology 2110 2776
-> 16 0 28 2057 topology 2155 2776
-> 15 0 29 2057 topology 2130 2777
-> 16 0 29 2057 topology 2132 2777
-> 15 0 28 2057 topology 2140 2778
-> 16 0 28 2057 topology 2155 2778
-> 15 0 29 2057 topology 2115 2779
-> 16 0 29 2057 topology 2116 2779
-> 15 0 29 2057 topology 2109 2780
-> 16 0 29 2057 topology 2111 2780
-> 15 0 28 2057 topology 2146 2781
-> 16 0 28 2057 topology 2155 2781
-> 15 0 29 2057 topology 2094 2782
-> 16 0 29 2057 topology 2095 2782
-> 15 0 28 2057 topology 2059 2783
-> 16 0 28 2057 topology 2155 2783
-> 15 0 29 2057 topology 2142 2784
-> 16 0 29 2057 topology 2144 2784
-> 15 0 29 2057 topology 2127 2785
-> 16 0 29 2057 topology 2128 2785
-> 15 0 29 2057 topology 2151 2786
-> 16 0 29 2057 topology 2152 2786
-> 15 0 28 2057 topology 2071 2787
-> 16 0 28 2057 topology 2155 2787
-> 15 0 28 2057 topology 2117 2788
-> 16 0 28 2057 topology 2155 2788
-> 15 0 29 2057 topology 2145 2789
-> 16 0 29 2057 topology 2147 2789
-> 15 0 28 2057 topology 2093 2790
-> 16 0 28 2057 topology 2155 2790
-> 15 0 29 2057 topology 2106 2791
-> 16 0 29 2057 topology 2107 2791
-> 15 0 28 2057 topology 2083 2792
-> 16 0 28 2057 topology 2155 2792
-> 15 0 28 2057 topology 2129 2793
-> 16 0 28 2057 topology 2155 2793
-> 15 0 28 2057 topology 2153 2794
-> 16 0 28 2057 topology 2155 2794
-> 15 0 28 2057 topology 2105 2795
-> 16 0 28 2057 topology 2155 2795
-> 15 0 29 2057 topology 2139 2796
-> 16 0 29 2057 topology 2140 2796
-> 15 0 29 2057 topology 2058 2797
-> 16 0 29 2057 topology 2060 2797
-> 15 0 28 2057 topology 2141 2798
-> 16 0 28 2057 topology 2155 2798
-> 15 0 29 2057 topology 2115 2799
-> 16 0 29 2057 topology 2117 2799
-> 15 0 29 2057 topology 2064 2800
-> 16 0 29 2057 topology 2066 2800
-> 15 0 29 2057 topology 2094 2801
-> 16 0 29 2057 topology 2096 2801
-> 15 0 28 2057 topology 2095 2802
-> 16 0 28 2057 topology 2155 2802
-> 15 0 29 2057 topology 2070 2803
-> 16 0 29 2057 topology 2072 2803
-> 15 0 28 2057 topology 2125 2804
-> 16 0 28 2057 topology 2155 2804
-> 15 0 28 2057 topology 2066 2805
-> 16 0 28 2057 topology 2155 2805
-> 15 0 29 2057 topology 2127 2806
-> 16 0 29 2057 topology 2129 2806
-> 15 0 29 2057 topology 2151 2807
-> 16 0 29 2057 topology 2153 2807
-> 15 0 28 2057 topology 2107 2808
-> 16 0 28 2057 topology 2155 2808
-> 15 0 29 2057 topology 2076 2809
-> 16 0 29 2057 topology 2078 2809
-> 15 0 28 2057 topology 2137 2810
-> 16 0 28 2057 topology 2155 2810
-> 15 0 29 2057 topology 2058 2811
-> 16 0 29 2057 topology 2059 2811
-> 15 0 28 2057 topology 2078 2812
-> 16 0 28 2057 topology 2155 2812
-> 15 0 29 2057 topology 2085 2813
-> 16 0 29 2057 topology 2086 2813
-> 15 0 29 2057 topology 2106 2814
-> 16 0 29 2057 topology 2108 2814
-> 15 0 29 2057 topology 2061 2815
-> 16 0 29 2057 topology 2062 2815
-> 15 0 29 2057 topology 2082 2816
-> 16 0 29 2057 topology 2084 2816
-> 15 0 30 2057 topology 2154 2817
-> 16 0 30 2057 topology 2155 2817
-> 15 0 29 2057 topology 2064 2818
-> 16 0 29 2057 topology 2065 2818
-> 15 0 29 2057 topology 2118 2819
-> 16 0 29 2057 topology 2119 2819
-> 15 0 29 2057 topology 2139 2820
-> 16 0 29 2057 topology 2141 2820
-> 15 0 29 2057 topology 2067 2821
-> 16 0 29 2057 topology 2068 2821
-> 15 0 29 2057 topology 2070 2822
-> 16 0 29 2057 topology 2071 2822
-> 15 0 29 2057 topology 2097 2823
-> 16 0 29 2057 topology 2098 2823
-> 15 0 29 2156 topology 2166 2824
-> 16 0 29 2156 topology 2167 2824
-> 15 0 29 2156 topology 2220 2825
-> 16 0 29 2156 topology 2221 2825
-> 15 0 28 2156 topology 2159 2826
+> 15 0 28 2057 topology 2083 2758
+> 16 0 28 2057 topology 2155 2758
+> 15 0 29 2057 topology 2154 2759
+> 16 0 29 2057 topology 2155 2759
+> 15 0 30 2057 topology 2085 2760
+> 16 0 30 2057 topology 2087 2760
+> 15 0 30 2057 topology 2085 2761
+> 16 0 30 2057 topology 2086 2761
+> 15 0 30 2057 topology 2088 2762
+> 16 0 30 2057 topology 2090 2762
+> 15 0 30 2057 topology 2088 2763
+> 16 0 30 2057 topology 2089 2763
+> 15 0 30 2057 topology 2091 2764
+> 16 0 30 2057 topology 2093 2764
+> 15 0 30 2057 topology 2091 2765
+> 16 0 30 2057 topology 2092 2765
+> 15 0 30 2057 topology 2094 2766
+> 16 0 30 2057 topology 2096 2766
+> 15 0 30 2057 topology 2094 2767
+> 16 0 30 2057 topology 2095 2767
+> 15 0 30 2057 topology 2097 2768
+> 16 0 30 2057 topology 2099 2768
+> 15 0 30 2057 topology 2097 2769
+> 16 0 30 2057 topology 2098 2769
+> 15 0 30 2057 topology 2100 2770
+> 16 0 30 2057 topology 2102 2770
+> 15 0 30 2057 topology 2100 2771
+> 16 0 30 2057 topology 2101 2771
+> 15 0 30 2057 topology 2103 2772
+> 16 0 30 2057 topology 2105 2772
+> 15 0 30 2057 topology 2103 2773
+> 16 0 30 2057 topology 2104 2773
+> 15 0 30 2057 topology 2106 2774
+> 16 0 30 2057 topology 2108 2774
+> 15 0 30 2057 topology 2106 2775
+> 16 0 30 2057 topology 2107 2775
+> 15 0 30 2057 topology 2109 2776
+> 16 0 30 2057 topology 2111 2776
+> 15 0 30 2057 topology 2109 2777
+> 16 0 30 2057 topology 2110 2777
+> 15 0 30 2057 topology 2112 2778
+> 16 0 30 2057 topology 2114 2778
+> 15 0 30 2057 topology 2112 2779
+> 16 0 30 2057 topology 2113 2779
+> 15 0 30 2057 topology 2058 2780
+> 16 0 30 2057 topology 2060 2780
+> 15 0 30 2057 topology 2058 2781
+> 16 0 30 2057 topology 2059 2781
+> 15 0 30 2057 topology 2115 2782
+> 16 0 30 2057 topology 2117 2782
+> 15 0 30 2057 topology 2115 2783
+> 16 0 30 2057 topology 2116 2783
+> 15 0 30 2057 topology 2118 2784
+> 16 0 30 2057 topology 2120 2784
+> 15 0 30 2057 topology 2118 2785
+> 16 0 30 2057 topology 2119 2785
+> 15 0 30 2057 topology 2121 2786
+> 16 0 30 2057 topology 2123 2786
+> 15 0 30 2057 topology 2121 2787
+> 16 0 30 2057 topology 2122 2787
+> 15 0 30 2057 topology 2124 2788
+> 16 0 30 2057 topology 2126 2788
+> 15 0 30 2057 topology 2124 2789
+> 16 0 30 2057 topology 2125 2789
+> 15 0 30 2057 topology 2127 2790
+> 16 0 30 2057 topology 2129 2790
+> 15 0 30 2057 topology 2127 2791
+> 16 0 30 2057 topology 2128 2791
+> 15 0 30 2057 topology 2130 2792
+> 16 0 30 2057 topology 2132 2792
+> 15 0 30 2057 topology 2130 2793
+> 16 0 30 2057 topology 2131 2793
+> 15 0 30 2057 topology 2133 2794
+> 16 0 30 2057 topology 2135 2794
+> 15 0 30 2057 topology 2133 2795
+> 16 0 30 2057 topology 2134 2795
+> 15 0 30 2057 topology 2136 2796
+> 16 0 30 2057 topology 2138 2796
+> 15 0 30 2057 topology 2136 2797
+> 16 0 30 2057 topology 2137 2797
+> 15 0 30 2057 topology 2139 2798
+> 16 0 30 2057 topology 2141 2798
+> 15 0 30 2057 topology 2139 2799
+> 16 0 30 2057 topology 2140 2799
+> 15 0 30 2057 topology 2142 2800
+> 16 0 30 2057 topology 2144 2800
+> 15 0 30 2057 topology 2142 2801
+> 16 0 30 2057 topology 2143 2801
+> 15 0 30 2057 topology 2061 2802
+> 16 0 30 2057 topology 2063 2802
+> 15 0 30 2057 topology 2061 2803
+> 16 0 30 2057 topology 2062 2803
+> 15 0 30 2057 topology 2064 2804
+> 16 0 30 2057 topology 2066 2804
+> 15 0 30 2057 topology 2064 2805
+> 16 0 30 2057 topology 2065 2805
+> 15 0 30 2057 topology 2067 2806
+> 16 0 30 2057 topology 2069 2806
+> 15 0 30 2057 topology 2067 2807
+> 16 0 30 2057 topology 2068 2807
+> 15 0 30 2057 topology 2145 2808
+> 16 0 30 2057 topology 2147 2808
+> 15 0 30 2057 topology 2145 2809
+> 16 0 30 2057 topology 2146 2809
+> 15 0 30 2057 topology 2148 2810
+> 16 0 30 2057 topology 2150 2810
+> 15 0 30 2057 topology 2148 2811
+> 16 0 30 2057 topology 2149 2811
+> 15 0 30 2057 topology 2070 2812
+> 16 0 30 2057 topology 2072 2812
+> 15 0 30 2057 topology 2070 2813
+> 16 0 30 2057 topology 2071 2813
+> 15 0 30 2057 topology 2151 2814
+> 16 0 30 2057 topology 2153 2814
+> 15 0 30 2057 topology 2151 2815
+> 16 0 30 2057 topology 2152 2815
+> 15 0 30 2057 topology 2073 2816
+> 16 0 30 2057 topology 2075 2816
+> 15 0 30 2057 topology 2073 2817
+> 16 0 30 2057 topology 2074 2817
+> 15 0 30 2057 topology 2076 2818
+> 16 0 30 2057 topology 2078 2818
+> 15 0 30 2057 topology 2076 2819
+> 16 0 30 2057 topology 2077 2819
+> 15 0 30 2057 topology 2079 2820
+> 16 0 30 2057 topology 2081 2820
+> 15 0 30 2057 topology 2079 2821
+> 16 0 30 2057 topology 2080 2821
+> 15 0 30 2057 topology 2082 2822
+> 16 0 30 2057 topology 2084 2822
+> 15 0 30 2057 topology 2082 2823
+> 16 0 30 2057 topology 2083 2823
+> 15 0 28 2156 topology 2159 2824
+> 16 0 28 2156 topology 2242 2824
+> 15 0 28 2156 topology 2158 2825
+> 16 0 28 2156 topology 2242 2825
+> 15 0 28 2156 topology 2162 2826
 > 16 0 28 2156 topology 2242 2826
-> 15 0 29 2156 topology 2199 2827
-> 16 0 29 2156 topology 2200 2827
-> 15 0 28 2156 topology 2219 2828
+> 15 0 28 2156 topology 2161 2827
+> 16 0 28 2156 topology 2242 2827
+> 15 0 28 2156 topology 2165 2828
 > 16 0 28 2156 topology 2242 2828
-> 15 0 28 2156 topology 2195 2829
+> 15 0 28 2156 topology 2164 2829
 > 16 0 28 2156 topology 2242 2829
-> 15 0 28 2156 topology 2171 2830
+> 15 0 28 2156 topology 2168 2830
 > 16 0 28 2156 topology 2242 2830
-> 15 0 29 2156 topology 2178 2831
-> 16 0 29 2156 topology 2179 2831
-> 15 0 29 2156 topology 2232 2832
-> 16 0 29 2156 topology 2233 2832
-> 15 0 28 2156 topology 2231 2833
+> 15 0 28 2156 topology 2167 2831
+> 16 0 28 2156 topology 2242 2831
+> 15 0 28 2156 topology 2171 2832
+> 16 0 28 2156 topology 2242 2832
+> 15 0 28 2156 topology 2170 2833
 > 16 0 28 2156 topology 2242 2833
-> 15 0 28 2156 topology 2207 2834
+> 15 0 28 2156 topology 2174 2834
 > 16 0 28 2156 topology 2242 2834
-> 15 0 28 2156 topology 2183 2835
+> 15 0 28 2156 topology 2173 2835
 > 16 0 28 2156 topology 2242 2835
-> 15 0 29 2156 topology 2211 2836
-> 16 0 29 2156 topology 2212 2836
-> 15 0 29 2156 topology 2160 2837
-> 16 0 29 2156 topology 2162 2837
-> 15 0 28 2156 topology 2161 2838
+> 15 0 28 2156 topology 2177 2836
+> 16 0 28 2156 topology 2242 2836
+> 15 0 28 2156 topology 2176 2837
+> 16 0 28 2156 topology 2242 2837
+> 15 0 28 2156 topology 2180 2838
 > 16 0 28 2156 topology 2242 2838
-> 15 0 28 2156 topology 2191 2839
+> 15 0 28 2156 topology 2179 2839
 > 16 0 28 2156 topology 2242 2839
-> 15 0 29 2156 topology 2193 2840
-> 16 0 29 2156 topology 2195 2840
-> 15 0 28 2156 topology 2221 2841
+> 15 0 28 2156 topology 2183 2840
+> 16 0 28 2156 topology 2242 2840
+> 15 0 28 2156 topology 2182 2841
 > 16 0 28 2156 topology 2242 2841
-> 15 0 28 2156 topology 2173 2842
+> 15 0 28 2156 topology 2186 2842
 > 16 0 28 2156 topology 2242 2842
-> 15 0 28 2156 topology 2203 2843
+> 15 0 28 2156 topology 2185 2843
 > 16 0 28 2156 topology 2242 2843
-> 15 0 29 2156 topology 2172 2844
-> 16 0 29 2156 topology 2174 2844
-> 15 0 29 2156 topology 2226 2845
-> 16 0 29 2156 topology 2228 2845
-> 15 0 28 2156 topology 2233 2846
+> 15 0 28 2156 topology 2189 2844
+> 16 0 28 2156 topology 2242 2844
+> 15 0 28 2156 topology 2188 2845
+> 16 0 28 2156 topology 2242 2845
+> 15 0 28 2156 topology 2192 2846
 > 16 0 28 2156 topology 2242 2846
-> 15 0 28 2156 topology 2185 2847
+> 15 0 28 2156 topology 2191 2847
 > 16 0 28 2156 topology 2242 2847
-> 15 0 29 2156 topology 2157 2848
-> 16 0 29 2156 topology 2158 2848
-> 15 0 28 2156 topology 2215 2849
+> 15 0 28 2156 topology 2195 2848
+> 16 0 28 2156 topology 2242 2848
+> 15 0 28 2156 topology 2194 2849
 > 16 0 28 2156 topology 2242 2849
-> 15 0 29 2156 topology 2205 2850
-> 16 0 29 2156 topology 2207 2850
-> 15 0 29 2156 topology 2190 2851
-> 16 0 29 2156 topology 2191 2851
-> 15 0 29 2156 topology 2184 2852
-> 16 0 29 2156 topology 2186 2852
-> 15 0 29 2156 topology 2238 2853
-> 16 0 29 2156 topology 2240 2853
-> 15 0 29 2156 topology 2169 2854
-> 16 0 29 2156 topology 2170 2854
-> 15 0 29 2156 topology 2223 2855
-> 16 0 29 2156 topology 2224 2855
-> 15 0 28 2156 topology 2162 2856
+> 15 0 28 2156 topology 2198 2850
+> 16 0 28 2156 topology 2242 2850
+> 15 0 28 2156 topology 2197 2851
+> 16 0 28 2156 topology 2242 2851
+> 15 0 28 2156 topology 2201 2852
+> 16 0 28 2156 topology 2242 2852
+> 15 0 28 2156 topology 2200 2853
+> 16 0 28 2156 topology 2242 2853
+> 15 0 28 2156 topology 2204 2854
+> 16 0 28 2156 topology 2242 2854
+> 15 0 28 2156 topology 2203 2855
+> 16 0 28 2156 topology 2242 2855
+> 15 0 28 2156 topology 2207 2856
 > 16 0 28 2156 topology 2242 2856
-> 15 0 29 2156 topology 2202 2857
-> 16 0 29 2156 topology 2203 2857
-> 15 0 28 2156 topology 2222 2858
+> 15 0 28 2156 topology 2206 2857
+> 16 0 28 2156 topology 2242 2857
+> 15 0 28 2156 topology 2210 2858
 > 16 0 28 2156 topology 2242 2858
-> 15 0 28 2156 topology 2198 2859
+> 15 0 28 2156 topology 2209 2859
 > 16 0 28 2156 topology 2242 2859
-> 15 0 28 2156 topology 2174 2860
+> 15 0 28 2156 topology 2213 2860
 > 16 0 28 2156 topology 2242 2860
-> 15 0 29 2156 topology 2181 2861
-> 16 0 29 2156 topology 2182 2861
-> 15 0 28 2156 topology 2234 2862
+> 15 0 28 2156 topology 2212 2861
+> 16 0 28 2156 topology 2242 2861
+> 15 0 28 2156 topology 2216 2862
 > 16 0 28 2156 topology 2242 2862
-> 15 0 29 2156 topology 2235 2863
-> 16 0 29 2156 topology 2236 2863
-> 15 0 28 2156 topology 2210 2864
+> 15 0 28 2156 topology 2215 2863
+> 16 0 28 2156 topology 2242 2863
+> 15 0 28 2156 topology 2219 2864
 > 16 0 28 2156 topology 2242 2864
-> 15 0 28 2156 topology 2186 2865
+> 15 0 28 2156 topology 2218 2865
 > 16 0 28 2156 topology 2242 2865
-> 15 0 29 2156 topology 2157 2866
-> 16 0 29 2156 topology 2159 2866
-> 15 0 29 2156 topology 2214 2867
-> 16 0 29 2156 topology 2215 2867
-> 15 0 28 2156 topology 2158 2868
+> 15 0 28 2156 topology 2222 2866
+> 16 0 28 2156 topology 2242 2866
+> 15 0 28 2156 topology 2221 2867
+> 16 0 28 2156 topology 2242 2867
+> 15 0 28 2156 topology 2225 2868
 > 16 0 28 2156 topology 2242 2868
-> 15 0 28 2156 topology 2188 2869
+> 15 0 28 2156 topology 2224 2869
 > 16 0 28 2156 topology 2242 2869
-> 15 0 29 2156 topology 2190 2870
-> 16 0 29 2156 topology 2192 2870
-> 15 0 28 2156 topology 2218 2871
+> 15 0 28 2156 topology 2228 2870
+> 16 0 28 2156 topology 2242 2870
+> 15 0 28 2156 topology 2227 2871
 > 16 0 28 2156 topology 2242 2871
-> 15 0 28 2156 topology 2170 2872
+> 15 0 28 2156 topology 2231 2872
 > 16 0 28 2156 topology 2242 2872
-> 15 0 29 2156 topology 2169 2873
-> 16 0 29 2156 topology 2171 2873
-> 15 0 28 2156 topology 2200 2874
+> 15 0 28 2156 topology 2230 2873
+> 16 0 28 2156 topology 2242 2873
+> 15 0 28 2156 topology 2234 2874
 > 16 0 28 2156 topology 2242 2874
-> 15 0 29 2156 topology 2223 2875
-> 16 0 29 2156 topology 2225 2875
-> 15 0 28 2156 topology 2230 2876
+> 15 0 28 2156 topology 2233 2875
+> 16 0 28 2156 topology 2242 2875
+> 15 0 28 2156 topology 2237 2876
 > 16 0 28 2156 topology 2242 2876
-> 15 0 28 2156 topology 2182 2877
+> 15 0 28 2156 topology 2236 2877
 > 16 0 28 2156 topology 2242 2877
-> 15 0 29 2156 topology 2202 2878
-> 16 0 29 2156 topology 2204 2878
-> 15 0 28 2156 topology 2212 2879
+> 15 0 28 2156 topology 2240 2878
+> 16 0 28 2156 topology 2242 2878
+> 15 0 28 2156 topology 2239 2879
 > 16 0 28 2156 topology 2242 2879
-> 15 0 29 2156 topology 2160 2880
-> 16 0 29 2156 topology 2161 2880
-> 15 0 29 2156 topology 2181 2881
-> 16 0 29 2156 topology 2183 2881
-> 15 0 29 2156 topology 2235 2882
-> 16 0 29 2156 topology 2237 2882
-> 15 0 29 2156 topology 2193 2883
-> 16 0 29 2156 topology 2194 2883
-> 15 0 29 2156 topology 2214 2884
-> 16 0 29 2156 topology 2216 2884
-> 15 0 29 2156 topology 2172 2885
-> 16 0 29 2156 topology 2173 2885
-> 15 0 28 2156 topology 2189 2886
-> 16 0 28 2156 topology 2242 2886
-> 15 0 29 2156 topology 2226 2887
-> 16 0 29 2156 topology 2227 2887
-> 15 0 28 2156 topology 2165 2888
-> 16 0 28 2156 topology 2242 2888
-> 15 0 28 2156 topology 2225 2889
-> 16 0 28 2156 topology 2242 2889
-> 15 0 28 2156 topology 2201 2890
-> 16 0 28 2156 topology 2242 2890
-> 15 0 29 2156 topology 2205 2891
-> 16 0 29 2156 topology 2206 2891
-> 15 0 28 2156 topology 2177 2892
-> 16 0 28 2156 topology 2242 2892
-> 15 0 28 2156 topology 2237 2893
-> 16 0 28 2156 topology 2242 2893
-> 15 0 29 2156 topology 2184 2894
-> 16 0 29 2156 topology 2185 2894
-> 15 0 28 2156 topology 2213 2895
-> 16 0 28 2156 topology 2242 2895
-> 15 0 29 2156 topology 2238 2896
-> 16 0 29 2156 topology 2239 2896
-> 15 0 29 2156 topology 2187 2897
-> 16 0 29 2156 topology 2189 2897
-> 15 0 28 2156 topology 2167 2898
-> 16 0 28 2156 topology 2242 2898
-> 15 0 29 2156 topology 2166 2899
-> 16 0 29 2156 topology 2168 2899
-> 15 0 29 2156 topology 2220 2900
-> 16 0 29 2156 topology 2222 2900
-> 15 0 28 2156 topology 2197 2901
-> 16 0 28 2156 topology 2242 2901
-> 15 0 28 2156 topology 2227 2902
-> 16 0 28 2156 topology 2242 2902
-> 15 0 28 2156 topology 2179 2903
-> 16 0 28 2156 topology 2242 2903
-> 15 0 29 2156 topology 2199 2904
-> 16 0 29 2156 topology 2201 2904
-> 15 0 28 2156 topology 2209 2905
-> 16 0 28 2156 topology 2242 2905
-> 15 0 28 2156 topology 2239 2906
-> 16 0 28 2156 topology 2242 2906
-> 15 0 30 2156 topology 2241 2907
-> 16 0 30 2156 topology 2242 2907
-> 15 0 29 2156 topology 2178 2908
-> 16 0 29 2156 topology 2180 2908
-> 15 0 29 2156 topology 2232 2909
-> 16 0 29 2156 topology 2234 2909
-> 15 0 29 2156 topology 2163 2910
-> 16 0 29 2156 topology 2164 2910
-> 15 0 29 2156 topology 2217 2911
-> 16 0 29 2156 topology 2218 2911
-> 15 0 29 2156 topology 2211 2912
-> 16 0 29 2156 topology 2213 2912
-> 15 0 29 2156 topology 2196 2913
-> 16 0 29 2156 topology 2197 2913
-> 15 0 28 2156 topology 2192 2914
-> 16 0 28 2156 topology 2242 2914
-> 15 0 28 2156 topology 2168 2915
-> 16 0 28 2156 topology 2242 2915
-> 15 0 29 2156 topology 2175 2916
-> 16 0 29 2156 topology 2176 2916
-> 15 0 29 2156 topology 2229 2917
-> 16 0 29 2156 topology 2230 2917
-> 15 0 28 2156 topology 2228 2918
-> 16 0 28 2156 topology 2242 2918
-> 15 0 28 2156 topology 2204 2919
-> 16 0 28 2156 topology 2242 2919
-> 15 0 28 2156 topology 2180 2920
-> 16 0 28 2156 topology 2242 2920
-> 15 0 29 2156 topology 2208 2921
-> 16 0 29 2156 topology 2209 2921
-> 15 0 28 2156 topology 2240 2922
-> 16 0 28 2156 topology 2242 2922
-> 15 0 28 2156 topology 2216 2923
-> 16 0 28 2156 topology 2242 2923
-> 15 0 29 2156 topology 2163 2924
-> 16 0 29 2156 topology 2165 2924
-> 15 0 29 2156 topology 2217 2925
-> 16 0 29 2156 topology 2219 2925
-> 15 0 28 2156 topology 2164 2926
-> 16 0 28 2156 topology 2242 2926
-> 15 0 28 2156 topology 2194 2927
-> 16 0 28 2156 topology 2242 2927
-> 15 0 28 2156 topology 2224 2928
-> 16 0 28 2156 topology 2242 2928
-> 15 0 29 2156 topology 2196 2929
-> 16 0 29 2156 topology 2198 2929
-> 15 0 28 2156 topology 2176 2930
-> 16 0 28 2156 topology 2242 2930
-> 15 0 28 2156 topology 2206 2931
-> 16 0 28 2156 topology 2242 2931
-> 15 0 28 2156 topology 2236 2932
-> 16 0 28 2156 topology 2242 2932
-> 15 0 29 2156 topology 2175 2933
-> 16 0 29 2156 topology 2177 2933
-> 15 0 29 2156 topology 2229 2934
-> 16 0 29 2156 topology 2231 2934
-> 15 0 29 2156 topology 2187 2935
-> 16 0 29 2156 topology 2188 2935
-> 15 0 29 2156 topology 2208 2936
-> 16 0 29 2156 topology 2210 2936
-> 15 0 28 2243 topology 2269 2937
+> 15 0 29 2156 topology 2241 2880
+> 16 0 29 2156 topology 2242 2880
+> 15 0 30 2156 topology 2157 2881
+> 16 0 30 2156 topology 2159 2881
+> 15 0 30 2156 topology 2157 2882
+> 16 0 30 2156 topology 2158 2882
+> 15 0 30 2156 topology 2160 2883
+> 16 0 30 2156 topology 2162 2883
+> 15 0 30 2156 topology 2160 2884
+> 16 0 30 2156 topology 2161 2884
+> 15 0 30 2156 topology 2163 2885
+> 16 0 30 2156 topology 2165 2885
+> 15 0 30 2156 topology 2163 2886
+> 16 0 30 2156 topology 2164 2886
+> 15 0 30 2156 topology 2166 2887
+> 16 0 30 2156 topology 2168 2887
+> 15 0 30 2156 topology 2166 2888
+> 16 0 30 2156 topology 2167 2888
+> 15 0 30 2156 topology 2169 2889
+> 16 0 30 2156 topology 2171 2889
+> 15 0 30 2156 topology 2169 2890
+> 16 0 30 2156 topology 2170 2890
+> 15 0 30 2156 topology 2172 2891
+> 16 0 30 2156 topology 2174 2891
+> 15 0 30 2156 topology 2172 2892
+> 16 0 30 2156 topology 2173 2892
+> 15 0 30 2156 topology 2175 2893
+> 16 0 30 2156 topology 2177 2893
+> 15 0 30 2156 topology 2175 2894
+> 16 0 30 2156 topology 2176 2894
+> 15 0 30 2156 topology 2178 2895
+> 16 0 30 2156 topology 2180 2895
+> 15 0 30 2156 topology 2178 2896
+> 16 0 30 2156 topology 2179 2896
+> 15 0 30 2156 topology 2181 2897
+> 16 0 30 2156 topology 2183 2897
+> 15 0 30 2156 topology 2181 2898
+> 16 0 30 2156 topology 2182 2898
+> 15 0 30 2156 topology 2184 2899
+> 16 0 30 2156 topology 2186 2899
+> 15 0 30 2156 topology 2184 2900
+> 16 0 30 2156 topology 2185 2900
+> 15 0 30 2156 topology 2187 2901
+> 16 0 30 2156 topology 2189 2901
+> 15 0 30 2156 topology 2187 2902
+> 16 0 30 2156 topology 2188 2902
+> 15 0 30 2156 topology 2190 2903
+> 16 0 30 2156 topology 2192 2903
+> 15 0 30 2156 topology 2190 2904
+> 16 0 30 2156 topology 2191 2904
+> 15 0 30 2156 topology 2193 2905
+> 16 0 30 2156 topology 2195 2905
+> 15 0 30 2156 topology 2193 2906
+> 16 0 30 2156 topology 2194 2906
+> 15 0 30 2156 topology 2196 2907
+> 16 0 30 2156 topology 2198 2907
+> 15 0 30 2156 topology 2196 2908
+> 16 0 30 2156 topology 2197 2908
+> 15 0 30 2156 topology 2199 2909
+> 16 0 30 2156 topology 2201 2909
+> 15 0 30 2156 topology 2199 2910
+> 16 0 30 2156 topology 2200 2910
+> 15 0 30 2156 topology 2202 2911
+> 16 0 30 2156 topology 2204 2911
+> 15 0 30 2156 topology 2202 2912
+> 16 0 30 2156 topology 2203 2912
+> 15 0 30 2156 topology 2205 2913
+> 16 0 30 2156 topology 2207 2913
+> 15 0 30 2156 topology 2205 2914
+> 16 0 30 2156 topology 2206 2914
+> 15 0 30 2156 topology 2208 2915
+> 16 0 30 2156 topology 2210 2915
+> 15 0 30 2156 topology 2208 2916
+> 16 0 30 2156 topology 2209 2916
+> 15 0 30 2156 topology 2211 2917
+> 16 0 30 2156 topology 2213 2917
+> 15 0 30 2156 topology 2211 2918
+> 16 0 30 2156 topology 2212 2918
+> 15 0 30 2156 topology 2214 2919
+> 16 0 30 2156 topology 2216 2919
+> 15 0 30 2156 topology 2214 2920
+> 16 0 30 2156 topology 2215 2920
+> 15 0 30 2156 topology 2217 2921
+> 16 0 30 2156 topology 2219 2921
+> 15 0 30 2156 topology 2217 2922
+> 16 0 30 2156 topology 2218 2922
+> 15 0 30 2156 topology 2220 2923
+> 16 0 30 2156 topology 2222 2923
+> 15 0 30 2156 topology 2220 2924
+> 16 0 30 2156 topology 2221 2924
+> 15 0 30 2156 topology 2223 2925
+> 16 0 30 2156 topology 2225 2925
+> 15 0 30 2156 topology 2223 2926
+> 16 0 30 2156 topology 2224 2926
+> 15 0 30 2156 topology 2226 2927
+> 16 0 30 2156 topology 2228 2927
+> 15 0 30 2156 topology 2226 2928
+> 16 0 30 2156 topology 2227 2928
+> 15 0 30 2156 topology 2229 2929
+> 16 0 30 2156 topology 2231 2929
+> 15 0 30 2156 topology 2229 2930
+> 16 0 30 2156 topology 2230 2930
+> 15 0 30 2156 topology 2232 2931
+> 16 0 30 2156 topology 2234 2931
+> 15 0 30 2156 topology 2232 2932
+> 16 0 30 2156 topology 2233 2932
+> 15 0 30 2156 topology 2235 2933
+> 16 0 30 2156 topology 2237 2933
+> 15 0 30 2156 topology 2235 2934
+> 16 0 30 2156 topology 2236 2934
+> 15 0 30 2156 topology 2238 2935
+> 16 0 30 2156 topology 2240 2935
+> 15 0 30 2156 topology 2238 2936
+> 16 0 30 2156 topology 2239 2936
+> 15 0 28 2243 topology 2246 2937
 > 16 0 28 2243 topology 2341 2937
-> 15 0 28 2243 topology 2299 2938
+> 15 0 28 2243 topology 2245 2938
 > 16 0 28 2243 topology 2341 2938
-> 15 0 29 2243 topology 2259 2939
-> 16 0 29 2243 topology 2261 2939
-> 15 0 29 2243 topology 2313 2940
-> 16 0 29 2243 topology 2315 2940
-> 15 0 28 2243 topology 2329 2941
+> 15 0 28 2243 topology 2249 2939
+> 16 0 28 2243 topology 2341 2939
+> 15 0 28 2243 topology 2248 2940
+> 16 0 28 2243 topology 2341 2940
+> 15 0 28 2243 topology 2252 2941
 > 16 0 28 2243 topology 2341 2941
-> 15 0 29 2243 topology 2271 2942
-> 16 0 29 2243 topology 2272 2942
-> 15 0 29 2243 topology 2292 2943
-> 16 0 29 2243 topology 2294 2943
-> 15 0 29 2243 topology 2250 2944
-> 16 0 29 2243 topology 2251 2944
-> 15 0 29 2243 topology 2304 2945
-> 16 0 29 2243 topology 2305 2945
-> 15 0 29 2243 topology 2325 2946
-> 16 0 29 2243 topology 2327 2946
-> 15 0 28 2243 topology 2276 2947
+> 15 0 28 2243 topology 2251 2942
+> 16 0 28 2243 topology 2341 2942
+> 15 0 28 2243 topology 2255 2943
+> 16 0 28 2243 topology 2341 2943
+> 15 0 28 2243 topology 2254 2944
+> 16 0 28 2243 topology 2341 2944
+> 15 0 28 2243 topology 2258 2945
+> 16 0 28 2243 topology 2341 2945
+> 15 0 28 2243 topology 2257 2946
+> 16 0 28 2243 topology 2341 2946
+> 15 0 28 2243 topology 2261 2947
 > 16 0 28 2243 topology 2341 2947
-> 15 0 28 2243 topology 2252 2948
+> 15 0 28 2243 topology 2260 2948
 > 16 0 28 2243 topology 2341 2948
-> 15 0 29 2243 topology 2283 2949
-> 16 0 29 2243 topology 2284 2949
-> 15 0 29 2243 topology 2337 2950
-> 16 0 29 2243 topology 2338 2950
-> 15 0 28 2243 topology 2336 2951
+> 15 0 28 2243 topology 2264 2949
+> 16 0 28 2243 topology 2341 2949
+> 15 0 28 2243 topology 2263 2950
+> 16 0 28 2243 topology 2341 2950
+> 15 0 28 2243 topology 2267 2951
 > 16 0 28 2243 topology 2341 2951
-> 15 0 28 2243 topology 2312 2952
+> 15 0 28 2243 topology 2266 2952
 > 16 0 28 2243 topology 2341 2952
-> 15 0 28 2243 topology 2288 2953
+> 15 0 28 2243 topology 2270 2953
 > 16 0 28 2243 topology 2341 2953
-> 15 0 29 2243 topology 2262 2954
-> 16 0 29 2243 topology 2263 2954
-> 15 0 28 2243 topology 2264 2955
+> 15 0 28 2243 topology 2269 2954
+> 16 0 28 2243 topology 2341 2954
+> 15 0 28 2243 topology 2273 2955
 > 16 0 28 2243 topology 2341 2955
-> 15 0 29 2243 topology 2316 2956
-> 16 0 29 2243 topology 2317 2956
-> 15 0 28 2243 topology 2324 2957
+> 15 0 28 2243 topology 2272 2956
+> 16 0 28 2243 topology 2341 2956
+> 15 0 28 2243 topology 2276 2957
 > 16 0 28 2243 topology 2341 2957
-> 15 0 28 2243 topology 2300 2958
+> 15 0 28 2243 topology 2275 2958
 > 16 0 28 2243 topology 2341 2958
-> 15 0 29 2243 topology 2295 2959
-> 16 0 29 2243 topology 2296 2959
-> 15 0 29 2243 topology 2244 2960
-> 16 0 29 2243 topology 2246 2960
-> 15 0 28 2243 topology 2272 2961
+> 15 0 28 2243 topology 2279 2959
+> 16 0 28 2243 topology 2341 2959
+> 15 0 28 2243 topology 2278 2960
+> 16 0 28 2243 topology 2341 2960
+> 15 0 28 2243 topology 2282 2961
 > 16 0 28 2243 topology 2341 2961
-> 15 0 28 2243 topology 2302 2962
+> 15 0 28 2243 topology 2281 2962
 > 16 0 28 2243 topology 2341 2962
-> 15 0 29 2243 topology 2328 2963
-> 16 0 29 2243 topology 2329 2963
-> 15 0 28 2243 topology 2332 2964
+> 15 0 28 2243 topology 2285 2963
+> 16 0 28 2243 topology 2341 2963
+> 15 0 28 2243 topology 2284 2964
 > 16 0 28 2243 topology 2341 2964
-> 15 0 28 2243 topology 2254 2965
+> 15 0 28 2243 topology 2288 2965
 > 16 0 28 2243 topology 2341 2965
-> 15 0 29 2243 topology 2277 2966
-> 16 0 29 2243 topology 2279 2966
-> 15 0 28 2243 topology 2284 2967
+> 15 0 28 2243 topology 2287 2966
+> 16 0 28 2243 topology 2341 2966
+> 15 0 28 2243 topology 2291 2967
 > 16 0 28 2243 topology 2341 2967
-> 15 0 29 2243 topology 2331 2968
-> 16 0 29 2243 topology 2333 2968
-> 15 0 28 2243 topology 2314 2969
+> 15 0 28 2243 topology 2290 2968
+> 16 0 28 2243 topology 2341 2968
+> 15 0 28 2243 topology 2294 2969
 > 16 0 28 2243 topology 2341 2969
-> 15 0 28 2243 topology 2266 2970
+> 15 0 28 2243 topology 2293 2970
 > 16 0 28 2243 topology 2341 2970
-> 15 0 29 2243 topology 2256 2971
-> 16 0 29 2243 topology 2258 2971
+> 15 0 28 2243 topology 2297 2971
+> 16 0 28 2243 topology 2341 2971
 > 15 0 28 2243 topology 2296 2972
 > 16 0 28 2243 topology 2341 2972
-> 15 0 29 2243 topology 2310 2973
-> 16 0 29 2243 topology 2312 2973
-> 15 0 28 2243 topology 2326 2974
+> 15 0 28 2243 topology 2300 2973
+> 16 0 28 2243 topology 2341 2973
+> 15 0 28 2243 topology 2299 2974
 > 16 0 28 2243 topology 2341 2974
-> 15 0 29 2243 topology 2289 2975
-> 16 0 29 2243 topology 2291 2975
-> 15 0 29 2243 topology 2274 2976
-> 16 0 29 2243 topology 2275 2976
-> 15 0 29 2243 topology 2268 2977
-> 16 0 29 2243 topology 2270 2977
-> 15 0 29 2243 topology 2322 2978
-> 16 0 29 2243 topology 2324 2978
-> 15 0 29 2243 topology 2253 2979
-> 16 0 29 2243 topology 2254 2979
-> 15 0 29 2243 topology 2307 2980
-> 16 0 29 2243 topology 2308 2980
-> 15 0 28 2243 topology 2303 2981
+> 15 0 28 2243 topology 2303 2975
+> 16 0 28 2243 topology 2341 2975
+> 15 0 28 2243 topology 2302 2976
+> 16 0 28 2243 topology 2341 2976
+> 15 0 28 2243 topology 2306 2977
+> 16 0 28 2243 topology 2341 2977
+> 15 0 28 2243 topology 2305 2978
+> 16 0 28 2243 topology 2341 2978
+> 15 0 28 2243 topology 2309 2979
+> 16 0 28 2243 topology 2341 2979
+> 15 0 28 2243 topology 2308 2980
+> 16 0 28 2243 topology 2341 2980
+> 15 0 28 2243 topology 2312 2981
 > 16 0 28 2243 topology 2341 2981
-> 15 0 28 2243 topology 2279 2982
+> 15 0 28 2243 topology 2311 2982
 > 16 0 28 2243 topology 2341 2982
-> 15 0 28 2243 topology 2255 2983
+> 15 0 28 2243 topology 2315 2983
 > 16 0 28 2243 topology 2341 2983
-> 15 0 29 2243 topology 2286 2984
-> 16 0 29 2243 topology 2287 2984
-> 15 0 28 2243 topology 2339 2985
+> 15 0 28 2243 topology 2314 2984
+> 16 0 28 2243 topology 2341 2984
+> 15 0 28 2243 topology 2318 2985
 > 16 0 28 2243 topology 2341 2985
-> 15 0 28 2243 topology 2315 2986
+> 15 0 28 2243 topology 2317 2986
 > 16 0 28 2243 topology 2341 2986
-> 15 0 28 2243 topology 2291 2987
+> 15 0 28 2243 topology 2321 2987
 > 16 0 28 2243 topology 2341 2987
-> 15 0 28 2243 topology 2267 2988
+> 15 0 28 2243 topology 2320 2988
 > 16 0 28 2243 topology 2341 2988
-> 15 0 29 2243 topology 2265 2989
-> 16 0 29 2243 topology 2266 2989
-> 15 0 29 2243 topology 2319 2990
-> 16 0 29 2243 topology 2320 2990
+> 15 0 28 2243 topology 2324 2989
+> 16 0 28 2243 topology 2341 2989
+> 15 0 28 2243 topology 2323 2990
+> 16 0 28 2243 topology 2341 2990
 > 15 0 28 2243 topology 2327 2991
 > 16 0 28 2243 topology 2341 2991
-> 15 0 29 2243 topology 2298 2992
-> 16 0 29 2243 topology 2299 2992
-> 15 0 28 2243 topology 2251 2993
+> 15 0 28 2243 topology 2326 2992
+> 16 0 28 2243 topology 2341 2992
+> 15 0 28 2243 topology 2330 2993
 > 16 0 28 2243 topology 2341 2993
-> 15 0 29 2243 topology 2274 2994
-> 16 0 29 2243 topology 2276 2994
-> 15 0 28 2243 topology 2281 2995
+> 15 0 28 2243 topology 2329 2994
+> 16 0 28 2243 topology 2341 2994
+> 15 0 28 2243 topology 2333 2995
 > 16 0 28 2243 topology 2341 2995
-> 15 0 28 2243 topology 2311 2996
+> 15 0 28 2243 topology 2332 2996
 > 16 0 28 2243 topology 2341 2996
-> 15 0 29 2243 topology 2253 2997
-> 16 0 29 2243 topology 2255 2997
-> 15 0 28 2243 topology 2263 2998
+> 15 0 28 2243 topology 2336 2997
+> 16 0 28 2243 topology 2341 2997
+> 15 0 28 2243 topology 2335 2998
 > 16 0 28 2243 topology 2341 2998
-> 15 0 29 2243 topology 2307 2999
-> 16 0 29 2243 topology 2309 2999
-> 15 0 30 2243 topology 2340 3000
-> 16 0 30 2243 topology 2341 3000
-> 15 0 28 2243 topology 2293 3001
-> 16 0 28 2243 topology 2341 3001
-> 15 0 28 2243 topology 2323 3002
-> 16 0 28 2243 topology 2341 3002
-> 15 0 29 2243 topology 2286 3003
-> 16 0 29 2243 topology 2288 3003
-> 15 0 29 2243 topology 2244 3004
-> 16 0 29 2243 topology 2245 3004
-> 15 0 29 2243 topology 2265 3005
-> 16 0 29 2243 topology 2267 3005
-> 15 0 29 2243 topology 2319 3006
-> 16 0 29 2243 topology 2321 3006
-> 15 0 29 2243 topology 2277 3007
-> 16 0 29 2243 topology 2278 3007
-> 15 0 29 2243 topology 2331 3008
-> 16 0 29 2243 topology 2332 3008
-> 15 0 29 2243 topology 2298 3009
-> 16 0 29 2243 topology 2300 3009
-> 15 0 28 2243 topology 2246 3010
-> 16 0 28 2243 topology 2341 3010
-> 15 0 29 2243 topology 2256 3011
-> 16 0 29 2243 topology 2257 3011
-> 15 0 28 2243 topology 2306 3012
-> 16 0 28 2243 topology 2341 3012
-> 15 0 29 2243 topology 2310 3013
-> 16 0 29 2243 topology 2311 3013
-> 15 0 28 2243 topology 2282 3014
-> 16 0 28 2243 topology 2341 3014
-> 15 0 28 2243 topology 2258 3015
-> 16 0 28 2243 topology 2341 3015
-> 15 0 29 2243 topology 2289 3016
-> 16 0 29 2243 topology 2290 3016
-> 15 0 28 2243 topology 2318 3017
-> 16 0 28 2243 topology 2341 3017
-> 15 0 28 2243 topology 2294 3018
-> 16 0 28 2243 topology 2341 3018
-> 15 0 28 2243 topology 2270 3019
-> 16 0 28 2243 topology 2341 3019
-> 15 0 29 2243 topology 2268 3020
-> 16 0 29 2243 topology 2269 3020
-> 15 0 29 2243 topology 2322 3021
-> 16 0 29 2243 topology 2323 3021
-> 15 0 28 2243 topology 2330 3022
-> 16 0 28 2243 topology 2341 3022
-> 15 0 29 2243 topology 2271 3023
-> 16 0 29 2243 topology 2273 3023
-> 15 0 28 2243 topology 2248 3024
-> 16 0 28 2243 topology 2341 3024
-> 15 0 28 2243 topology 2278 3025
-> 16 0 28 2243 topology 2341 3025
-> 15 0 28 2243 topology 2308 3026
-> 16 0 28 2243 topology 2341 3026
-> 15 0 29 2243 topology 2250 3027
-> 16 0 29 2243 topology 2252 3027
-> 15 0 29 2243 topology 2304 3028
-> 16 0 29 2243 topology 2306 3028
-> 15 0 28 2243 topology 2338 3029
-> 16 0 28 2243 topology 2341 3029
-> 15 0 28 2243 topology 2260 3030
-> 16 0 28 2243 topology 2341 3030
-> 15 0 28 2243 topology 2290 3031
-> 16 0 28 2243 topology 2341 3031
-> 15 0 28 2243 topology 2320 3032
-> 16 0 28 2243 topology 2341 3032
-> 15 0 29 2243 topology 2283 3033
-> 16 0 29 2243 topology 2285 3033
-> 15 0 29 2243 topology 2337 3034
-> 16 0 29 2243 topology 2339 3034
-> 15 0 29 2243 topology 2262 3035
-> 16 0 29 2243 topology 2264 3035
-> 15 0 29 2243 topology 2316 3036
-> 16 0 29 2243 topology 2318 3036
-> 15 0 29 2243 topology 2247 3037
-> 16 0 29 2243 topology 2248 3037
-> 15 0 29 2243 topology 2301 3038
-> 16 0 29 2243 topology 2302 3038
-> 15 0 29 2243 topology 2295 3039
-> 16 0 29 2243 topology 2297 3039
-> 15 0 28 2243 topology 2273 3040
-> 16 0 28 2243 topology 2341 3040
-> 15 0 29 2243 topology 2280 3041
-> 16 0 29 2243 topology 2281 3041
-> 15 0 29 2243 topology 2334 3042
-> 16 0 29 2243 topology 2335 3042
-> 15 0 28 2243 topology 2249 3043
-> 16 0 28 2243 topology 2341 3043
-> 15 0 29 2243 topology 2328 3044
-> 16 0 29 2243 topology 2330 3044
-> 15 0 28 2243 topology 2333 3045
-> 16 0 28 2243 topology 2341 3045
-> 15 0 28 2243 topology 2309 3046
-> 16 0 28 2243 topology 2341 3046
-> 15 0 29 2243 topology 2259 3047
-> 16 0 29 2243 topology 2260 3047
-> 15 0 28 2243 topology 2285 3048
-> 16 0 28 2243 topology 2341 3048
-> 15 0 29 2243 topology 2313 3049
-> 16 0 29 2243 topology 2314 3049
-> 15 0 28 2243 topology 2261 3050
-> 16 0 28 2243 topology 2341 3050
-> 15 0 28 2243 topology 2321 3051
-> 16 0 28 2243 topology 2341 3051
-> 15 0 29 2243 topology 2292 3052
-> 16 0 29 2243 topology 2293 3052
-> 15 0 28 2243 topology 2297 3053
-> 16 0 28 2243 topology 2341 3053
-> 15 0 29 2243 topology 2325 3054
-> 16 0 29 2243 topology 2326 3054
-> 15 0 28 2243 topology 2245 3055
-> 16 0 28 2243 topology 2341 3055
-> 15 0 28 2243 topology 2275 3056
-> 16 0 28 2243 topology 2341 3056
-> 15 0 29 2243 topology 2247 3057
-> 16 0 29 2243 topology 2249 3057
-> 15 0 29 2243 topology 2301 3058
-> 16 0 29 2243 topology 2303 3058
-> 15 0 28 2243 topology 2305 3059
-> 16 0 28 2243 topology 2341 3059
-> 15 0 28 2243 topology 2335 3060
-> 16 0 28 2243 topology 2341 3060
-> 15 0 28 2243 topology 2257 3061
-> 16 0 28 2243 topology 2341 3061
-> 15 0 28 2243 topology 2287 3062
-> 16 0 28 2243 topology 2341 3062
-> 15 0 29 2243 topology 2280 3063
-> 16 0 29 2243 topology 2282 3063
-> 15 0 28 2243 topology 2317 3064
-> 16 0 28 2243 topology 2341 3064
-> 15 0 29 2243 topology 2334 3065
-> 16 0 29 2243 topology 2336 3065
+> 15 0 28 2243 topology 2339 2999
+> 16 0 28 2243 topology 2341 2999
+> 15 0 28 2243 topology 2338 3000
+> 16 0 28 2243 topology 2341 3000
+> 15 0 29 2243 topology 2340 3001
+> 16 0 29 2243 topology 2341 3001
+> 15 0 30 2243 topology 2244 3002
+> 16 0 30 2243 topology 2246 3002
+> 15 0 30 2243 topology 2244 3003
+> 16 0 30 2243 topology 2245 3003
+> 15 0 30 2243 topology 2247 3004
+> 16 0 30 2243 topology 2249 3004
+> 15 0 30 2243 topology 2247 3005
+> 16 0 30 2243 topology 2248 3005
+> 15 0 30 2243 topology 2250 3006
+> 16 0 30 2243 topology 2252 3006
+> 15 0 30 2243 topology 2250 3007
+> 16 0 30 2243 topology 2251 3007
+> 15 0 30 2243 topology 2253 3008
+> 16 0 30 2243 topology 2255 3008
+> 15 0 30 2243 topology 2253 3009
+> 16 0 30 2243 topology 2254 3009
+> 15 0 30 2243 topology 2256 3010
+> 16 0 30 2243 topology 2258 3010
+> 15 0 30 2243 topology 2256 3011
+> 16 0 30 2243 topology 2257 3011
+> 15 0 30 2243 topology 2259 3012
+> 16 0 30 2243 topology 2261 3012
+> 15 0 30 2243 topology 2259 3013
+> 16 0 30 2243 topology 2260 3013
+> 15 0 30 2243 topology 2262 3014
+> 16 0 30 2243 topology 2264 3014
+> 15 0 30 2243 topology 2262 3015
+> 16 0 30 2243 topology 2263 3015
+> 15 0 30 2243 topology 2265 3016
+> 16 0 30 2243 topology 2267 3016
+> 15 0 30 2243 topology 2265 3017
+> 16 0 30 2243 topology 2266 3017
+> 15 0 30 2243 topology 2268 3018
+> 16 0 30 2243 topology 2270 3018
+> 15 0 30 2243 topology 2268 3019
+> 16 0 30 2243 topology 2269 3019
+> 15 0 30 2243 topology 2271 3020
+> 16 0 30 2243 topology 2273 3020
+> 15 0 30 2243 topology 2271 3021
+> 16 0 30 2243 topology 2272 3021
+> 15 0 30 2243 topology 2274 3022
+> 16 0 30 2243 topology 2276 3022
+> 15 0 30 2243 topology 2274 3023
+> 16 0 30 2243 topology 2275 3023
+> 15 0 30 2243 topology 2277 3024
+> 16 0 30 2243 topology 2279 3024
+> 15 0 30 2243 topology 2277 3025
+> 16 0 30 2243 topology 2278 3025
+> 15 0 30 2243 topology 2280 3026
+> 16 0 30 2243 topology 2282 3026
+> 15 0 30 2243 topology 2280 3027
+> 16 0 30 2243 topology 2281 3027
+> 15 0 30 2243 topology 2283 3028
+> 16 0 30 2243 topology 2285 3028
+> 15 0 30 2243 topology 2283 3029
+> 16 0 30 2243 topology 2284 3029
+> 15 0 30 2243 topology 2286 3030
+> 16 0 30 2243 topology 2288 3030
+> 15 0 30 2243 topology 2286 3031
+> 16 0 30 2243 topology 2287 3031
+> 15 0 30 2243 topology 2289 3032
+> 16 0 30 2243 topology 2291 3032
+> 15 0 30 2243 topology 2289 3033
+> 16 0 30 2243 topology 2290 3033
+> 15 0 30 2243 topology 2292 3034
+> 16 0 30 2243 topology 2294 3034
+> 15 0 30 2243 topology 2292 3035
+> 16 0 30 2243 topology 2293 3035
+> 15 0 30 2243 topology 2295 3036
+> 16 0 30 2243 topology 2297 3036
+> 15 0 30 2243 topology 2295 3037
+> 16 0 30 2243 topology 2296 3037
+> 15 0 30 2243 topology 2298 3038
+> 16 0 30 2243 topology 2300 3038
+> 15 0 30 2243 topology 2298 3039
+> 16 0 30 2243 topology 2299 3039
+> 15 0 30 2243 topology 2301 3040
+> 16 0 30 2243 topology 2303 3040
+> 15 0 30 2243 topology 2301 3041
+> 16 0 30 2243 topology 2302 3041
+> 15 0 30 2243 topology 2304 3042
+> 16 0 30 2243 topology 2306 3042
+> 15 0 30 2243 topology 2304 3043
+> 16 0 30 2243 topology 2305 3043
+> 15 0 30 2243 topology 2307 3044
+> 16 0 30 2243 topology 2309 3044
+> 15 0 30 2243 topology 2307 3045
+> 16 0 30 2243 topology 2308 3045
+> 15 0 30 2243 topology 2310 3046
+> 16 0 30 2243 topology 2312 3046
+> 15 0 30 2243 topology 2310 3047
+> 16 0 30 2243 topology 2311 3047
+> 15 0 30 2243 topology 2313 3048
+> 16 0 30 2243 topology 2315 3048
+> 15 0 30 2243 topology 2313 3049
+> 16 0 30 2243 topology 2314 3049
+> 15 0 30 2243 topology 2316 3050
+> 16 0 30 2243 topology 2318 3050
+> 15 0 30 2243 topology 2316 3051
+> 16 0 30 2243 topology 2317 3051
+> 15 0 30 2243 topology 2319 3052
+> 16 0 30 2243 topology 2321 3052
+> 15 0 30 2243 topology 2319 3053
+> 16 0 30 2243 topology 2320 3053
+> 15 0 30 2243 topology 2322 3054
+> 16 0 30 2243 topology 2324 3054
+> 15 0 30 2243 topology 2322 3055
+> 16 0 30 2243 topology 2323 3055
+> 15 0 30 2243 topology 2325 3056
+> 16 0 30 2243 topology 2327 3056
+> 15 0 30 2243 topology 2325 3057
+> 16 0 30 2243 topology 2326 3057
+> 15 0 30 2243 topology 2328 3058
+> 16 0 30 2243 topology 2330 3058
+> 15 0 30 2243 topology 2328 3059
+> 16 0 30 2243 topology 2329 3059
+> 15 0 30 2243 topology 2331 3060
+> 16 0 30 2243 topology 2333 3060
+> 15 0 30 2243 topology 2331 3061
+> 16 0 30 2243 topology 2332 3061
+> 15 0 30 2243 topology 2334 3062
+> 16 0 30 2243 topology 2336 3062
+> 15 0 30 2243 topology 2334 3063
+> 16 0 30 2243 topology 2335 3063
+> 15 0 30 2243 topology 2337 3064
+> 16 0 30 2243 topology 2339 3064
+> 15 0 30 2243 topology 2337 3065
+> 16 0 30 2243 topology 2338 3065
 > 15 0 31 2056 topology 2344 3066
-> 16 0 31 2056 topology 2241 3066
+> 16 0 31 2056 topology 2343 3066
 > 15 0 31 2056 topology 2344 3067
-> 16 0 31 2056 topology 2343 3067
-> 15 0 32 2056 topology 2154 3068
-> 16 0 32 2056 topology 2344 3068
-> 15 0 31 2056 topology 2344 3069
-> 16 0 31 2056 topology 2340 3069
-> 15 0 26 1606 topology 2055 3070
-> 16 0 26 1606 topology 2347 3070
-> 15 0 26 1606 topology 2345 3071
+> 16 0 31 2056 topology 2241 3067
+> 15 0 31 2056 topology 2344 3068
+> 16 0 31 2056 topology 2340 3068
+> 15 0 32 2056 topology 2154 3069
+> 16 0 32 2056 topology 2344 3069
+> 15 0 33 1606 topology 2345 3070
+> 16 0 33 1606 topology 2343 3070
+> 15 0 26 1606 topology 2055 3071
 > 16 0 26 1606 topology 2347 3071
-> 15 0 21 1606 topology 2055 3072
-> 16 0 21 1606 topology 2345 3072
-> 15 0 33 1606 topology 2053 3073
-> 16 0 33 1606 topology 2055 3073
-> 15 0 34 1606 topology 2345 3074
-> 16 0 34 1606 topology 2343 3074
-> 15 0 29 2351 topology 2367 3075
-> 16 0 29 2351 topology 2368 3075
-> 15 0 29 2351 topology 2370 3076
-> 16 0 29 2351 topology 2371 3076
-> 15 0 29 2351 topology 2397 3077
-> 16 0 29 2351 topology 2398 3077
-> 15 0 29 2351 topology 2451 3078
-> 16 0 29 2351 topology 2452 3078
-> 15 0 29 2351 topology 2373 3079
-> 16 0 29 2351 topology 2374 3079
-> 15 0 28 2351 topology 2362 3080
+> 15 0 26 1606 topology 2345 3072
+> 16 0 26 1606 topology 2347 3072
+> 15 0 34 1606 topology 2053 3073
+> 16 0 34 1606 topology 2055 3073
+> 15 0 20 1606 topology 2055 3074
+> 16 0 20 1606 topology 2345 3074
+> 15 0 28 2351 topology 2381 3075
+> 16 0 28 2351 topology 2461 3075
+> 15 0 28 2351 topology 2380 3076
+> 16 0 28 2351 topology 2461 3076
+> 15 0 28 2351 topology 2384 3077
+> 16 0 28 2351 topology 2461 3077
+> 15 0 28 2351 topology 2383 3078
+> 16 0 28 2351 topology 2461 3078
+> 15 0 28 2351 topology 2387 3079
+> 16 0 28 2351 topology 2461 3079
+> 15 0 28 2351 topology 2386 3080
 > 16 0 28 2351 topology 2461 3080
-> 15 0 29 2351 topology 2376 3081
-> 16 0 29 2351 topology 2377 3081
-> 15 0 29 2351 topology 2430 3082
-> 16 0 29 2351 topology 2431 3082
-> 15 0 28 2351 topology 2384 3083
+> 15 0 28 2351 topology 2390 3081
+> 16 0 28 2351 topology 2461 3081
+> 15 0 28 2351 topology 2389 3082
+> 16 0 28 2351 topology 2461 3082
+> 15 0 28 2351 topology 2393 3083
 > 16 0 28 2351 topology 2461 3083
-> 15 0 28 2351 topology 2444 3084
+> 15 0 28 2351 topology 2392 3084
 > 16 0 28 2351 topology 2461 3084
-> 15 0 28 2351 topology 2374 3085
+> 15 0 28 2351 topology 2396 3085
 > 16 0 28 2351 topology 2461 3085
-> 15 0 28 2351 topology 2420 3086
+> 15 0 28 2351 topology 2395 3086
 > 16 0 28 2351 topology 2461 3086
-> 15 0 28 2351 topology 2396 3087
+> 15 0 28 2351 topology 2399 3087
 > 16 0 28 2351 topology 2461 3087
-> 15 0 29 2351 topology 2385 3088
-> 16 0 29 2351 topology 2387 3088
-> 15 0 29 2351 topology 2439 3089
-> 16 0 29 2351 topology 2441 3089
-> 15 0 28 2351 topology 2456 3090
+> 15 0 28 2351 topology 2398 3088
+> 16 0 28 2351 topology 2461 3088
+> 15 0 28 2351 topology 2402 3089
+> 16 0 28 2351 topology 2461 3089
+> 15 0 28 2351 topology 2401 3090
 > 16 0 28 2351 topology 2461 3090
-> 15 0 28 2351 topology 2432 3091
+> 15 0 28 2351 topology 2405 3091
 > 16 0 28 2351 topology 2461 3091
-> 15 0 28 2351 topology 2408 3092
+> 15 0 28 2351 topology 2404 3092
 > 16 0 28 2351 topology 2461 3092
-> 15 0 29 2351 topology 2418 3093
-> 16 0 29 2351 topology 2420 3093
-> 15 0 28 2351 topology 2380 3094
+> 15 0 28 2351 topology 2408 3093
+> 16 0 28 2351 topology 2461 3093
+> 15 0 28 2351 topology 2407 3094
 > 16 0 28 2351 topology 2461 3094
-> 15 0 28 2351 topology 2410 3095
+> 15 0 28 2351 topology 2354 3095
 > 16 0 28 2351 topology 2461 3095
-> 15 0 29 2351 topology 2397 3096
-> 16 0 29 2351 topology 2399 3096
-> 15 0 28 2351 topology 2440 3097
+> 15 0 28 2351 topology 2353 3096
+> 16 0 28 2351 topology 2461 3096
+> 15 0 28 2351 topology 2411 3097
 > 16 0 28 2351 topology 2461 3097
-> 15 0 29 2351 topology 2451 3098
-> 16 0 29 2351 topology 2453 3098
-> 15 0 28 2351 topology 2392 3099
+> 15 0 28 2351 topology 2410 3098
+> 16 0 28 2351 topology 2461 3098
+> 15 0 28 2351 topology 2414 3099
 > 16 0 28 2351 topology 2461 3099
-> 15 0 29 2351 topology 2409 3100
-> 16 0 29 2351 topology 2410 3100
-> 15 0 28 2351 topology 2422 3101
+> 15 0 28 2351 topology 2413 3100
+> 16 0 28 2351 topology 2461 3100
+> 15 0 28 2351 topology 2417 3101
 > 16 0 28 2351 topology 2461 3101
-> 15 0 28 2351 topology 2363 3102
+> 15 0 28 2351 topology 2416 3102
 > 16 0 28 2351 topology 2461 3102
-> 15 0 29 2351 topology 2430 3103
-> 16 0 29 2351 topology 2432 3103
-> 15 0 28 2351 topology 2452 3104
+> 15 0 28 2351 topology 2420 3103
+> 16 0 28 2351 topology 2461 3103
+> 15 0 28 2351 topology 2419 3104
 > 16 0 28 2351 topology 2461 3104
-> 15 0 28 2351 topology 2404 3105
+> 15 0 28 2351 topology 2423 3105
 > 16 0 28 2351 topology 2461 3105
-> 15 0 29 2351 topology 2388 3106
-> 16 0 29 2351 topology 2389 3106
-> 15 0 28 2351 topology 2434 3107
+> 15 0 28 2351 topology 2422 3106
+> 16 0 28 2351 topology 2461 3106
+> 15 0 28 2351 topology 2426 3107
 > 16 0 28 2351 topology 2461 3107
-> 15 0 29 2351 topology 2442 3108
-> 16 0 29 2351 topology 2443 3108
-> 15 0 28 2351 topology 2375 3109
+> 15 0 28 2351 topology 2425 3108
+> 16 0 28 2351 topology 2461 3108
+> 15 0 28 2351 topology 2429 3109
 > 16 0 28 2351 topology 2461 3109
-> 15 0 29 2351 topology 2421 3110
-> 16 0 29 2351 topology 2422 3110
-> 15 0 29 2351 topology 2400 3111
-> 16 0 29 2351 topology 2401 3111
-> 15 0 29 2351 topology 2454 3112
-> 16 0 29 2351 topology 2455 3112
-> 15 0 28 2351 topology 2359 3113
+> 15 0 28 2351 topology 2428 3110
+> 16 0 28 2351 topology 2461 3110
+> 15 0 28 2351 topology 2432 3111
+> 16 0 28 2351 topology 2461 3111
+> 15 0 28 2351 topology 2431 3112
+> 16 0 28 2351 topology 2461 3112
+> 15 0 28 2351 topology 2435 3113
 > 16 0 28 2351 topology 2461 3113
-> 15 0 28 2351 topology 2411 3114
+> 15 0 28 2351 topology 2434 3114
 > 16 0 28 2351 topology 2461 3114
-> 15 0 28 2351 topology 2387 3115
+> 15 0 28 2351 topology 2438 3115
 > 16 0 28 2351 topology 2461 3115
-> 15 0 29 2351 topology 2433 3116
-> 16 0 29 2351 topology 2434 3116
-> 15 0 29 2351 topology 2352 3117
-> 16 0 29 2351 topology 2354 3117
-> 15 0 28 2351 topology 2371 3118
+> 15 0 28 2351 topology 2437 3116
+> 16 0 28 2351 topology 2461 3116
+> 15 0 28 2351 topology 2357 3117
+> 16 0 28 2351 topology 2461 3117
+> 15 0 28 2351 topology 2356 3118
 > 16 0 28 2351 topology 2461 3118
-> 15 0 28 2351 topology 2447 3119
+> 15 0 28 2351 topology 2441 3119
 > 16 0 28 2351 topology 2461 3119
-> 15 0 29 2351 topology 2382 3120
-> 16 0 29 2351 topology 2384 3120
-> 15 0 28 2351 topology 2423 3121
+> 15 0 28 2351 topology 2440 3120
+> 16 0 28 2351 topology 2461 3120
+> 15 0 28 2351 topology 2444 3121
 > 16 0 28 2351 topology 2461 3121
-> 15 0 28 2351 topology 2399 3122
+> 15 0 28 2351 topology 2443 3122
 > 16 0 28 2351 topology 2461 3122
-> 15 0 30 2351 topology 2460 3123
-> 16 0 30 2351 topology 2461 3123
-> 15 0 29 2351 topology 2358 3124
-> 16 0 29 2351 topology 2360 3124
-> 15 0 28 2351 topology 2459 3125
+> 15 0 28 2351 topology 2447 3123
+> 16 0 28 2351 topology 2461 3123
+> 15 0 28 2351 topology 2446 3124
+> 16 0 28 2351 topology 2461 3124
+> 15 0 28 2351 topology 2450 3125
 > 16 0 28 2351 topology 2461 3125
-> 15 0 29 2351 topology 2415 3126
-> 16 0 29 2351 topology 2417 3126
-> 15 0 28 2351 topology 2435 3127
+> 15 0 28 2351 topology 2449 3126
+> 16 0 28 2351 topology 2461 3126
+> 15 0 28 2351 topology 2453 3127
 > 16 0 28 2351 topology 2461 3127
-> 15 0 29 2351 topology 2364 3128
-> 16 0 29 2351 topology 2366 3128
-> 15 0 29 2351 topology 2394 3129
-> 16 0 29 2351 topology 2396 3129
-> 15 0 29 2351 topology 2448 3130
-> 16 0 29 2351 topology 2450 3130
-> 15 0 29 2351 topology 2370 3131
-> 16 0 29 2351 topology 2372 3131
-> 15 0 28 2351 topology 2354 3132
+> 15 0 28 2351 topology 2452 3128
+> 16 0 28 2351 topology 2461 3128
+> 15 0 28 2351 topology 2456 3129
+> 16 0 28 2351 topology 2461 3129
+> 15 0 28 2351 topology 2455 3130
+> 16 0 28 2351 topology 2461 3130
+> 15 0 28 2351 topology 2459 3131
+> 16 0 28 2351 topology 2461 3131
+> 15 0 28 2351 topology 2458 3132
 > 16 0 28 2351 topology 2461 3132
-> 15 0 29 2351 topology 2379 3133
-> 16 0 29 2351 topology 2380 3133
-> 15 0 28 2351 topology 2389 3134
+> 15 0 28 2351 topology 2360 3133
+> 16 0 28 2351 topology 2461 3133
+> 15 0 28 2351 topology 2359 3134
 > 16 0 28 2351 topology 2461 3134
-> 15 0 28 2351 topology 2419 3135
+> 15 0 28 2351 topology 2363 3135
 > 16 0 28 2351 topology 2461 3135
-> 15 0 29 2351 topology 2427 3136
-> 16 0 29 2351 topology 2429 3136
-> 15 0 28 2351 topology 2449 3137
+> 15 0 28 2351 topology 2362 3136
+> 16 0 28 2351 topology 2461 3136
+> 15 0 28 2351 topology 2366 3137
 > 16 0 28 2351 topology 2461 3137
-> 15 0 29 2351 topology 2376 3138
-> 16 0 29 2351 topology 2378 3138
-> 15 0 28 2351 topology 2366 3139
+> 15 0 28 2351 topology 2365 3138
+> 16 0 28 2351 topology 2461 3138
+> 15 0 28 2351 topology 2369 3139
 > 16 0 28 2351 topology 2461 3139
-> 15 0 28 2351 topology 2401 3140
+> 15 0 28 2351 topology 2368 3140
 > 16 0 28 2351 topology 2461 3140
-> 15 0 29 2351 topology 2412 3141
-> 16 0 29 2351 topology 2413 3141
-> 15 0 29 2351 topology 2406 3142
-> 16 0 29 2351 topology 2408 3142
-> 15 0 28 2351 topology 2431 3143
+> 15 0 28 2351 topology 2372 3141
+> 16 0 28 2351 topology 2461 3141
+> 15 0 28 2351 topology 2371 3142
+> 16 0 28 2351 topology 2461 3142
+> 15 0 28 2351 topology 2375 3143
 > 16 0 28 2351 topology 2461 3143
-> 15 0 28 2351 topology 2378 3144
+> 15 0 28 2351 topology 2374 3144
 > 16 0 28 2351 topology 2461 3144
-> 15 0 29 2351 topology 2391 3145
-> 16 0 29 2351 topology 2392 3145
-> 15 0 29 2351 topology 2445 3146
-> 16 0 29 2351 topology 2446 3146
-> 15 0 29 2351 topology 2424 3147
-> 16 0 29 2351 topology 2425 3147
-> 15 0 28 2351 topology 2356 3148
-> 16 0 28 2351 topology 2461 3148
-> 15 0 29 2351 topology 2403 3149
-> 16 0 29 2351 topology 2404 3149
-> 15 0 29 2351 topology 2457 3150
-> 16 0 29 2351 topology 2458 3150
-> 15 0 28 2351 topology 2368 3151
-> 16 0 28 2351 topology 2461 3151
-> 15 0 28 2351 topology 2414 3152
-> 16 0 28 2351 topology 2461 3152
-> 15 0 29 2351 topology 2379 3153
-> 16 0 29 2351 topology 2381 3153
-> 15 0 28 2351 topology 2390 3154
-> 16 0 28 2351 topology 2461 3154
-> 15 0 29 2351 topology 2436 3155
-> 16 0 29 2351 topology 2437 3155
-> 15 0 28 2351 topology 2450 3156
-> 16 0 28 2351 topology 2461 3156
-> 15 0 28 2351 topology 2426 3157
-> 16 0 28 2351 topology 2461 3157
-> 15 0 28 2351 topology 2402 3158
-> 16 0 28 2351 topology 2461 3158
-> 15 0 29 2351 topology 2412 3159
-> 16 0 29 2351 topology 2414 3159
-> 15 0 28 2351 topology 2438 3160
-> 16 0 28 2351 topology 2461 3160
-> 15 0 29 2351 topology 2391 3161
-> 16 0 29 2351 topology 2393 3161
-> 15 0 29 2351 topology 2445 3162
-> 16 0 29 2351 topology 2447 3162
-> 15 0 28 2351 topology 2386 3163
-> 16 0 28 2351 topology 2461 3163
-> 15 0 29 2351 topology 2424 3164
-> 16 0 29 2351 topology 2426 3164
-> 15 0 28 2351 topology 2416 3165
-> 16 0 28 2351 topology 2461 3165
-> 15 0 28 2351 topology 2357 3166
-> 16 0 28 2351 topology 2461 3166
-> 15 0 28 2351 topology 2446 3167
-> 16 0 28 2351 topology 2461 3167
-> 15 0 29 2351 topology 2382 3168
-> 16 0 29 2351 topology 2383 3168
-> 15 0 28 2351 topology 2398 3169
-> 16 0 28 2351 topology 2461 3169
-> 15 0 29 2351 topology 2403 3170
-> 16 0 29 2351 topology 2405 3170
-> 15 0 29 2351 topology 2457 3171
-> 16 0 29 2351 topology 2459 3171
-> 15 0 28 2351 topology 2428 3172
-> 16 0 28 2351 topology 2461 3172
-> 15 0 28 2351 topology 2369 3173
-> 16 0 28 2351 topology 2461 3173
-> 15 0 28 2351 topology 2458 3174
-> 16 0 28 2351 topology 2461 3174
-> 15 0 29 2351 topology 2415 3175
-> 16 0 29 2351 topology 2416 3175
-> 15 0 29 2351 topology 2436 3176
-> 16 0 29 2351 topology 2438 3176
-> 15 0 29 2351 topology 2394 3177
-> 16 0 29 2351 topology 2395 3177
-> 15 0 29 2351 topology 2448 3178
-> 16 0 29 2351 topology 2449 3178
-> 15 0 28 2351 topology 2353 3179
-> 16 0 28 2351 topology 2461 3179
-> 15 0 29 2351 topology 2427 3180
-> 16 0 29 2351 topology 2428 3180
-> 15 0 28 2351 topology 2381 3181
-> 16 0 28 2351 topology 2461 3181
-> 15 0 28 2351 topology 2365 3182
-> 16 0 28 2351 topology 2461 3182
-> 15 0 29 2351 topology 2406 3183
-> 16 0 29 2351 topology 2407 3183
-> 15 0 28 2351 topology 2441 3184
-> 16 0 28 2351 topology 2461 3184
-> 15 0 28 2351 topology 2417 3185
-> 16 0 28 2351 topology 2461 3185
-> 15 0 28 2351 topology 2393 3186
-> 16 0 28 2351 topology 2461 3186
-> 15 0 29 2351 topology 2355 3187
-> 16 0 29 2351 topology 2357 3187
-> 15 0 28 2351 topology 2377 3188
-> 16 0 28 2351 topology 2461 3188
-> 15 0 29 2351 topology 2409 3189
-> 16 0 29 2351 topology 2411 3189
-> 15 0 28 2351 topology 2453 3190
-> 16 0 28 2351 topology 2461 3190
-> 15 0 28 2351 topology 2429 3191
-> 16 0 28 2351 topology 2461 3191
-> 15 0 28 2351 topology 2405 3192
-> 16 0 28 2351 topology 2461 3192
-> 15 0 29 2351 topology 2361 3193
-> 16 0 29 2351 topology 2363 3193
-> 15 0 29 2351 topology 2388 3194
-> 16 0 29 2351 topology 2390 3194
-> 15 0 29 2351 topology 2442 3195
-> 16 0 29 2351 topology 2444 3195
-> 15 0 29 2351 topology 2367 3196
-> 16 0 29 2351 topology 2369 3196
-> 15 0 29 2351 topology 2421 3197
-> 16 0 29 2351 topology 2423 3197
-> 15 0 28 2351 topology 2383 3198
-> 16 0 28 2351 topology 2461 3198
-> 15 0 28 2351 topology 2413 3199
-> 16 0 28 2351 topology 2461 3199
-> 15 0 29 2351 topology 2352 3200
-> 16 0 29 2351 topology 2353 3200
-> 15 0 28 2351 topology 2443 3201
-> 16 0 28 2351 topology 2461 3201
-> 15 0 29 2351 topology 2373 3202
-> 16 0 29 2351 topology 2375 3202
-> 15 0 29 2351 topology 2400 3203
-> 16 0 29 2351 topology 2402 3203
-> 15 0 29 2351 topology 2454 3204
-> 16 0 29 2351 topology 2456 3204
-> 15 0 29 2351 topology 2355 3205
-> 16 0 29 2351 topology 2356 3205
-> 15 0 28 2351 topology 2360 3206
-> 16 0 28 2351 topology 2461 3206
-> 15 0 28 2351 topology 2395 3207
-> 16 0 28 2351 topology 2461 3207
-> 15 0 28 2351 topology 2425 3208
-> 16 0 28 2351 topology 2461 3208
-> 15 0 29 2351 topology 2358 3209
-> 16 0 29 2351 topology 2359 3209
-> 15 0 29 2351 topology 2385 3210
-> 16 0 29 2351 topology 2386 3210
-> 15 0 29 2351 topology 2439 3211
-> 16 0 29 2351 topology 2440 3211
-> 15 0 28 2351 topology 2455 3212
-> 16 0 28 2351 topology 2461 3212
-> 15 0 29 2351 topology 2433 3213
-> 16 0 29 2351 topology 2435 3213
-> 15 0 29 2351 topology 2361 3214
-> 16 0 29 2351 topology 2362 3214
-> 15 0 28 2351 topology 2372 3215
-> 16 0 28 2351 topology 2461 3215
-> 15 0 28 2351 topology 2407 3216
-> 16 0 28 2351 topology 2461 3216
-> 15 0 28 2351 topology 2437 3217
-> 16 0 28 2351 topology 2461 3217
-> 15 0 29 2351 topology 2364 3218
-> 16 0 29 2351 topology 2365 3218
-> 15 0 29 2351 topology 2418 3219
-> 16 0 29 2351 topology 2419 3219
-> 15 0 28 2462 topology 2521 3220
+> 15 0 28 2351 topology 2378 3145
+> 16 0 28 2351 topology 2461 3145
+> 15 0 28 2351 topology 2377 3146
+> 16 0 28 2351 topology 2461 3146
+> 15 0 29 2351 topology 2460 3147
+> 16 0 29 2351 topology 2461 3147
+> 15 0 30 2351 topology 2379 3148
+> 16 0 30 2351 topology 2381 3148
+> 15 0 30 2351 topology 2379 3149
+> 16 0 30 2351 topology 2380 3149
+> 15 0 30 2351 topology 2382 3150
+> 16 0 30 2351 topology 2384 3150
+> 15 0 30 2351 topology 2382 3151
+> 16 0 30 2351 topology 2383 3151
+> 15 0 30 2351 topology 2385 3152
+> 16 0 30 2351 topology 2387 3152
+> 15 0 30 2351 topology 2385 3153
+> 16 0 30 2351 topology 2386 3153
+> 15 0 30 2351 topology 2388 3154
+> 16 0 30 2351 topology 2390 3154
+> 15 0 30 2351 topology 2388 3155
+> 16 0 30 2351 topology 2389 3155
+> 15 0 30 2351 topology 2391 3156
+> 16 0 30 2351 topology 2393 3156
+> 15 0 30 2351 topology 2391 3157
+> 16 0 30 2351 topology 2392 3157
+> 15 0 30 2351 topology 2394 3158
+> 16 0 30 2351 topology 2396 3158
+> 15 0 30 2351 topology 2394 3159
+> 16 0 30 2351 topology 2395 3159
+> 15 0 30 2351 topology 2397 3160
+> 16 0 30 2351 topology 2399 3160
+> 15 0 30 2351 topology 2397 3161
+> 16 0 30 2351 topology 2398 3161
+> 15 0 30 2351 topology 2400 3162
+> 16 0 30 2351 topology 2402 3162
+> 15 0 30 2351 topology 2400 3163
+> 16 0 30 2351 topology 2401 3163
+> 15 0 30 2351 topology 2403 3164
+> 16 0 30 2351 topology 2405 3164
+> 15 0 30 2351 topology 2403 3165
+> 16 0 30 2351 topology 2404 3165
+> 15 0 30 2351 topology 2406 3166
+> 16 0 30 2351 topology 2408 3166
+> 15 0 30 2351 topology 2406 3167
+> 16 0 30 2351 topology 2407 3167
+> 15 0 30 2351 topology 2352 3168
+> 16 0 30 2351 topology 2354 3168
+> 15 0 30 2351 topology 2352 3169
+> 16 0 30 2351 topology 2353 3169
+> 15 0 30 2351 topology 2409 3170
+> 16 0 30 2351 topology 2411 3170
+> 15 0 30 2351 topology 2409 3171
+> 16 0 30 2351 topology 2410 3171
+> 15 0 30 2351 topology 2412 3172
+> 16 0 30 2351 topology 2414 3172
+> 15 0 30 2351 topology 2412 3173
+> 16 0 30 2351 topology 2413 3173
+> 15 0 30 2351 topology 2415 3174
+> 16 0 30 2351 topology 2417 3174
+> 15 0 30 2351 topology 2415 3175
+> 16 0 30 2351 topology 2416 3175
+> 15 0 30 2351 topology 2418 3176
+> 16 0 30 2351 topology 2420 3176
+> 15 0 30 2351 topology 2418 3177
+> 16 0 30 2351 topology 2419 3177
+> 15 0 30 2351 topology 2421 3178
+> 16 0 30 2351 topology 2423 3178
+> 15 0 30 2351 topology 2421 3179
+> 16 0 30 2351 topology 2422 3179
+> 15 0 30 2351 topology 2424 3180
+> 16 0 30 2351 topology 2426 3180
+> 15 0 30 2351 topology 2424 3181
+> 16 0 30 2351 topology 2425 3181
+> 15 0 30 2351 topology 2427 3182
+> 16 0 30 2351 topology 2429 3182
+> 15 0 30 2351 topology 2427 3183
+> 16 0 30 2351 topology 2428 3183
+> 15 0 30 2351 topology 2430 3184
+> 16 0 30 2351 topology 2432 3184
+> 15 0 30 2351 topology 2430 3185
+> 16 0 30 2351 topology 2431 3185
+> 15 0 30 2351 topology 2433 3186
+> 16 0 30 2351 topology 2435 3186
+> 15 0 30 2351 topology 2433 3187
+> 16 0 30 2351 topology 2434 3187
+> 15 0 30 2351 topology 2436 3188
+> 16 0 30 2351 topology 2438 3188
+> 15 0 30 2351 topology 2436 3189
+> 16 0 30 2351 topology 2437 3189
+> 15 0 30 2351 topology 2355 3190
+> 16 0 30 2351 topology 2357 3190
+> 15 0 30 2351 topology 2355 3191
+> 16 0 30 2351 topology 2356 3191
+> 15 0 30 2351 topology 2439 3192
+> 16 0 30 2351 topology 2441 3192
+> 15 0 30 2351 topology 2439 3193
+> 16 0 30 2351 topology 2440 3193
+> 15 0 30 2351 topology 2442 3194
+> 16 0 30 2351 topology 2444 3194
+> 15 0 30 2351 topology 2442 3195
+> 16 0 30 2351 topology 2443 3195
+> 15 0 30 2351 topology 2445 3196
+> 16 0 30 2351 topology 2447 3196
+> 15 0 30 2351 topology 2445 3197
+> 16 0 30 2351 topology 2446 3197
+> 15 0 30 2351 topology 2448 3198
+> 16 0 30 2351 topology 2450 3198
+> 15 0 30 2351 topology 2448 3199
+> 16 0 30 2351 topology 2449 3199
+> 15 0 30 2351 topology 2451 3200
+> 16 0 30 2351 topology 2453 3200
+> 15 0 30 2351 topology 2451 3201
+> 16 0 30 2351 topology 2452 3201
+> 15 0 30 2351 topology 2454 3202
+> 16 0 30 2351 topology 2456 3202
+> 15 0 30 2351 topology 2454 3203
+> 16 0 30 2351 topology 2455 3203
+> 15 0 30 2351 topology 2457 3204
+> 16 0 30 2351 topology 2459 3204
+> 15 0 30 2351 topology 2457 3205
+> 16 0 30 2351 topology 2458 3205
+> 15 0 30 2351 topology 2358 3206
+> 16 0 30 2351 topology 2360 3206
+> 15 0 30 2351 topology 2358 3207
+> 16 0 30 2351 topology 2359 3207
+> 15 0 30 2351 topology 2361 3208
+> 16 0 30 2351 topology 2363 3208
+> 15 0 30 2351 topology 2361 3209
+> 16 0 30 2351 topology 2362 3209
+> 15 0 30 2351 topology 2364 3210
+> 16 0 30 2351 topology 2366 3210
+> 15 0 30 2351 topology 2364 3211
+> 16 0 30 2351 topology 2365 3211
+> 15 0 30 2351 topology 2367 3212
+> 16 0 30 2351 topology 2369 3212
+> 15 0 30 2351 topology 2367 3213
+> 16 0 30 2351 topology 2368 3213
+> 15 0 30 2351 topology 2370 3214
+> 16 0 30 2351 topology 2372 3214
+> 15 0 30 2351 topology 2370 3215
+> 16 0 30 2351 topology 2371 3215
+> 15 0 30 2351 topology 2373 3216
+> 16 0 30 2351 topology 2375 3216
+> 15 0 30 2351 topology 2373 3217
+> 16 0 30 2351 topology 2374 3217
+> 15 0 30 2351 topology 2376 3218
+> 16 0 30 2351 topology 2378 3218
+> 15 0 30 2351 topology 2376 3219
+> 16 0 30 2351 topology 2377 3219
+> 15 0 28 2462 topology 2465 3220
 > 16 0 28 2462 topology 2572 3220
-> 15 0 28 2462 topology 2551 3221
+> 15 0 28 2462 topology 2464 3221
 > 16 0 28 2462 topology 2572 3221
-> 15 0 29 2462 topology 2505 3222
-> 16 0 29 2462 topology 2506 3222
-> 15 0 29 2462 topology 2499 3223
-> 16 0 29 2462 topology 2501 3223
-> 15 0 29 2462 topology 2553 3224
-> 16 0 29 2462 topology 2555 3224
-> 15 0 29 2462 topology 2484 3225
-> 16 0 29 2462 topology 2485 3225
-> 15 0 29 2462 topology 2538 3226
-> 16 0 29 2462 topology 2539 3226
-> 15 0 29 2462 topology 2463 3227
-> 16 0 29 2462 topology 2464 3227
-> 15 0 29 2462 topology 2517 3228
-> 16 0 29 2462 topology 2518 3228
-> 15 0 28 2462 topology 2504 3229
+> 15 0 28 2462 topology 2468 3222
+> 16 0 28 2462 topology 2572 3222
+> 15 0 28 2462 topology 2467 3223
+> 16 0 28 2462 topology 2572 3223
+> 15 0 28 2462 topology 2471 3224
+> 16 0 28 2462 topology 2572 3224
+> 15 0 28 2462 topology 2470 3225
+> 16 0 28 2462 topology 2572 3225
+> 15 0 28 2462 topology 2474 3226
+> 16 0 28 2462 topology 2572 3226
+> 15 0 28 2462 topology 2473 3227
+> 16 0 28 2462 topology 2572 3227
+> 15 0 28 2462 topology 2477 3228
+> 16 0 28 2462 topology 2572 3228
+> 15 0 28 2462 topology 2476 3229
 > 16 0 28 2462 topology 2572 3229
 > 15 0 28 2462 topology 2480 3230
 > 16 0 28 2462 topology 2572 3230
-> 15 0 29 2462 topology 2496 3231
-> 16 0 29 2462 topology 2497 3231
-> 15 0 29 2462 topology 2550 3232
-> 16 0 29 2462 topology 2551 3232
-> 15 0 28 2462 topology 2564 3233
+> 15 0 28 2462 topology 2479 3231
+> 16 0 28 2462 topology 2572 3231
+> 15 0 28 2462 topology 2483 3232
+> 16 0 28 2462 topology 2572 3232
+> 15 0 28 2462 topology 2482 3233
 > 16 0 28 2462 topology 2572 3233
-> 15 0 28 2462 topology 2540 3234
+> 15 0 28 2462 topology 2486 3234
 > 16 0 28 2462 topology 2572 3234
-> 15 0 29 2462 topology 2472 3235
-> 16 0 29 2462 topology 2474 3235
-> 15 0 28 2462 topology 2516 3236
+> 15 0 28 2462 topology 2485 3235
+> 16 0 28 2462 topology 2572 3235
+> 15 0 28 2462 topology 2489 3236
 > 16 0 28 2462 topology 2572 3236
-> 15 0 28 2462 topology 2492 3237
+> 15 0 28 2462 topology 2488 3237
 > 16 0 28 2462 topology 2572 3237
-> 15 0 29 2462 topology 2529 3238
-> 16 0 29 2462 topology 2530 3238
-> 15 0 28 2462 topology 2468 3239
+> 15 0 28 2462 topology 2492 3238
+> 16 0 28 2462 topology 2572 3238
+> 15 0 28 2462 topology 2491 3239
 > 16 0 28 2462 topology 2572 3239
-> 15 0 28 2462 topology 2552 3240
+> 15 0 28 2462 topology 2495 3240
 > 16 0 28 2462 topology 2572 3240
-> 15 0 29 2462 topology 2505 3241
-> 16 0 29 2462 topology 2507 3241
-> 15 0 28 2462 topology 2528 3242
+> 15 0 28 2462 topology 2494 3241
+> 16 0 28 2462 topology 2572 3241
+> 15 0 28 2462 topology 2498 3242
 > 16 0 28 2462 topology 2572 3242
-> 15 0 29 2462 topology 2484 3243
-> 16 0 29 2462 topology 2486 3243
-> 15 0 29 2462 topology 2538 3244
-> 16 0 29 2462 topology 2540 3244
-> 15 0 28 2462 topology 2476 3245
+> 15 0 28 2462 topology 2497 3243
+> 16 0 28 2462 topology 2572 3243
+> 15 0 28 2462 topology 2501 3244
+> 16 0 28 2462 topology 2572 3244
+> 15 0 28 2462 topology 2500 3245
 > 16 0 28 2462 topology 2572 3245
-> 15 0 28 2462 topology 2506 3246
+> 15 0 28 2462 topology 2504 3246
 > 16 0 28 2462 topology 2572 3246
-> 15 0 28 2462 topology 2536 3247
+> 15 0 28 2462 topology 2503 3247
 > 16 0 28 2462 topology 2572 3247
-> 15 0 29 2462 topology 2463 3248
-> 16 0 29 2462 topology 2465 3248
-> 15 0 29 2462 topology 2517 3249
-> 16 0 29 2462 topology 2519 3249
-> 15 0 28 2462 topology 2566 3250
+> 15 0 28 2462 topology 2507 3248
+> 16 0 28 2462 topology 2572 3248
+> 15 0 28 2462 topology 2506 3249
+> 16 0 28 2462 topology 2572 3249
+> 15 0 28 2462 topology 2510 3250
 > 16 0 28 2462 topology 2572 3250
-> 15 0 28 2462 topology 2488 3251
+> 15 0 28 2462 topology 2509 3251
 > 16 0 28 2462 topology 2572 3251
-> 15 0 28 2462 topology 2518 3252
+> 15 0 28 2462 topology 2513 3252
 > 16 0 28 2462 topology 2572 3252
-> 15 0 29 2462 topology 2475 3253
-> 16 0 29 2462 topology 2476 3253
-> 15 0 28 2462 topology 2548 3254
+> 15 0 28 2462 topology 2512 3253
+> 16 0 28 2462 topology 2572 3253
+> 15 0 28 2462 topology 2516 3254
 > 16 0 28 2462 topology 2572 3254
-> 15 0 28 2462 topology 2470 3255
+> 15 0 28 2462 topology 2515 3255
 > 16 0 28 2462 topology 2572 3255
-> 15 0 29 2462 topology 2496 3256
-> 16 0 29 2462 topology 2498 3256
-> 15 0 29 2462 topology 2550 3257
-> 16 0 29 2462 topology 2552 3257
-> 15 0 28 2462 topology 2500 3258
+> 15 0 28 2462 topology 2519 3256
+> 16 0 28 2462 topology 2572 3256
+> 15 0 28 2462 topology 2518 3257
+> 16 0 28 2462 topology 2572 3257
+> 15 0 28 2462 topology 2522 3258
 > 16 0 28 2462 topology 2572 3258
-> 15 0 28 2462 topology 2530 3259
+> 15 0 28 2462 topology 2521 3259
 > 16 0 28 2462 topology 2572 3259
-> 15 0 29 2462 topology 2508 3260
-> 16 0 29 2462 topology 2509 3260
-> 15 0 28 2462 topology 2560 3261
+> 15 0 28 2462 topology 2525 3260
+> 16 0 28 2462 topology 2572 3260
+> 15 0 28 2462 topology 2524 3261
 > 16 0 28 2462 topology 2572 3261
-> 15 0 29 2462 topology 2562 3262
-> 16 0 29 2462 topology 2563 3262
-> 15 0 29 2462 topology 2529 3263
-> 16 0 29 2462 topology 2531 3263
-> 15 0 29 2462 topology 2487 3264
-> 16 0 29 2462 topology 2488 3264
-> 15 0 29 2462 topology 2541 3265
-> 16 0 29 2462 topology 2542 3265
-> 15 0 29 2462 topology 2466 3266
-> 16 0 29 2462 topology 2467 3266
-> 15 0 29 2462 topology 2520 3267
-> 16 0 29 2462 topology 2521 3267
-> 15 0 28 2462 topology 2507 3268
+> 15 0 28 2462 topology 2528 3262
+> 16 0 28 2462 topology 2572 3262
+> 15 0 28 2462 topology 2527 3263
+> 16 0 28 2462 topology 2572 3263
+> 15 0 28 2462 topology 2531 3264
+> 16 0 28 2462 topology 2572 3264
+> 15 0 28 2462 topology 2530 3265
+> 16 0 28 2462 topology 2572 3265
+> 15 0 28 2462 topology 2534 3266
+> 16 0 28 2462 topology 2572 3266
+> 15 0 28 2462 topology 2533 3267
+> 16 0 28 2462 topology 2572 3267
+> 15 0 28 2462 topology 2537 3268
 > 16 0 28 2462 topology 2572 3268
-> 15 0 28 2462 topology 2483 3269
+> 15 0 28 2462 topology 2536 3269
 > 16 0 28 2462 topology 2572 3269
-> 15 0 29 2462 topology 2499 3270
-> 16 0 29 2462 topology 2500 3270
-> 15 0 29 2462 topology 2553 3271
-> 16 0 29 2462 topology 2554 3271
-> 15 0 28 2462 topology 2567 3272
+> 15 0 28 2462 topology 2540 3270
+> 16 0 28 2462 topology 2572 3270
+> 15 0 28 2462 topology 2539 3271
+> 16 0 28 2462 topology 2572 3271
+> 15 0 28 2462 topology 2543 3272
 > 16 0 28 2462 topology 2572 3272
-> 15 0 28 2462 topology 2543 3273
+> 15 0 28 2462 topology 2542 3273
 > 16 0 28 2462 topology 2572 3273
-> 15 0 28 2462 topology 2519 3274
+> 15 0 28 2462 topology 2546 3274
 > 16 0 28 2462 topology 2572 3274
-> 15 0 28 2462 topology 2495 3275
+> 15 0 28 2462 topology 2545 3275
 > 16 0 28 2462 topology 2572 3275
-> 15 0 29 2462 topology 2502 3276
-> 16 0 29 2462 topology 2504 3276
-> 15 0 28 2462 topology 2471 3277
+> 15 0 28 2462 topology 2549 3276
+> 16 0 28 2462 topology 2572 3276
+> 15 0 28 2462 topology 2548 3277
 > 16 0 28 2462 topology 2572 3277
-> 15 0 28 2462 topology 2555 3278
+> 15 0 28 2462 topology 2552 3278
 > 16 0 28 2462 topology 2572 3278
-> 15 0 28 2462 topology 2531 3279
+> 15 0 28 2462 topology 2551 3279
 > 16 0 28 2462 topology 2572 3279
-> 15 0 29 2462 topology 2481 3280
-> 16 0 29 2462 topology 2483 3280
-> 15 0 29 2462 topology 2535 3281
-> 16 0 29 2462 topology 2537 3281
-> 15 0 28 2462 topology 2473 3282
+> 15 0 28 2462 topology 2555 3280
+> 16 0 28 2462 topology 2572 3280
+> 15 0 28 2462 topology 2554 3281
+> 16 0 28 2462 topology 2572 3281
+> 15 0 28 2462 topology 2558 3282
 > 16 0 28 2462 topology 2572 3282
-> 15 0 28 2462 topology 2503 3283
+> 15 0 28 2462 topology 2557 3283
 > 16 0 28 2462 topology 2572 3283
-> 15 0 29 2462 topology 2514 3284
-> 16 0 29 2462 topology 2516 3284
-> 15 0 28 2462 topology 2533 3285
+> 15 0 28 2462 topology 2561 3284
+> 16 0 28 2462 topology 2572 3284
+> 15 0 28 2462 topology 2560 3285
 > 16 0 28 2462 topology 2572 3285
-> 15 0 29 2462 topology 2568 3286
-> 16 0 29 2462 topology 2570 3286
+> 15 0 28 2462 topology 2564 3286
+> 16 0 28 2462 topology 2572 3286
 > 15 0 28 2462 topology 2563 3287
 > 16 0 28 2462 topology 2572 3287
-> 15 0 28 2462 topology 2485 3288
+> 15 0 28 2462 topology 2567 3288
 > 16 0 28 2462 topology 2572 3288
-> 15 0 28 2462 topology 2515 3289
+> 15 0 28 2462 topology 2566 3289
 > 16 0 28 2462 topology 2572 3289
-> 15 0 29 2462 topology 2493 3290
-> 16 0 29 2462 topology 2495 3290
-> 15 0 28 2462 topology 2545 3291
+> 15 0 28 2462 topology 2570 3290
+> 16 0 28 2462 topology 2572 3290
+> 15 0 28 2462 topology 2569 3291
 > 16 0 28 2462 topology 2572 3291
-> 15 0 29 2462 topology 2547 3292
-> 16 0 29 2462 topology 2549 3292
-> 15 0 28 2462 topology 2467 3293
-> 16 0 28 2462 topology 2572 3293
-> 15 0 28 2462 topology 2497 3294
-> 16 0 28 2462 topology 2572 3294
-> 15 0 29 2462 topology 2478 3295
-> 16 0 29 2462 topology 2479 3295
-> 15 0 28 2462 topology 2527 3296
-> 16 0 28 2462 topology 2572 3296
-> 15 0 29 2462 topology 2532 3297
-> 16 0 29 2462 topology 2533 3297
-> 15 0 29 2462 topology 2526 3298
-> 16 0 29 2462 topology 2528 3298
-> 15 0 28 2462 topology 2557 3299
-> 16 0 28 2462 topology 2572 3299
-> 15 0 29 2462 topology 2511 3300
-> 16 0 29 2462 topology 2512 3300
-> 15 0 29 2462 topology 2565 3301
-> 16 0 29 2462 topology 2566 3301
-> 15 0 29 2462 topology 2559 3302
-> 16 0 29 2462 topology 2561 3302
-> 15 0 29 2462 topology 2490 3303
-> 16 0 29 2462 topology 2491 3303
-> 15 0 29 2462 topology 2544 3304
-> 16 0 29 2462 topology 2545 3304
-> 15 0 28 2462 topology 2474 3305
-> 16 0 28 2462 topology 2572 3305
-> 15 0 29 2462 topology 2469 3306
-> 16 0 29 2462 topology 2470 3306
-> 15 0 29 2462 topology 2523 3307
-> 16 0 29 2462 topology 2524 3307
-> 15 0 28 2462 topology 2534 3308
-> 16 0 28 2462 topology 2572 3308
-> 15 0 28 2462 topology 2510 3309
-> 16 0 28 2462 topology 2572 3309
-> 15 0 30 2462 topology 2571 3310
-> 16 0 30 2462 topology 2572 3310
-> 15 0 28 2462 topology 2486 3311
-> 16 0 28 2462 topology 2572 3311
-> 15 0 28 2462 topology 2570 3312
-> 16 0 28 2462 topology 2572 3312
-> 15 0 28 2462 topology 2546 3313
-> 16 0 28 2462 topology 2572 3313
-> 15 0 29 2462 topology 2556 3314
-> 16 0 29 2462 topology 2557 3314
-> 15 0 28 2462 topology 2522 3315
-> 16 0 28 2462 topology 2572 3315
-> 15 0 28 2462 topology 2498 3316
-> 16 0 28 2462 topology 2572 3316
-> 15 0 29 2462 topology 2478 3317
-> 16 0 29 2462 topology 2480 3317
-> 15 0 29 2462 topology 2532 3318
-> 16 0 29 2462 topology 2534 3318
-> 15 0 28 2462 topology 2558 3319
-> 16 0 28 2462 topology 2572 3319
-> 15 0 29 2462 topology 2511 3320
-> 16 0 29 2462 topology 2513 3320
-> 15 0 29 2462 topology 2565 3321
-> 16 0 29 2462 topology 2567 3321
-> 15 0 28 2462 topology 2482 3322
-> 16 0 28 2462 topology 2572 3322
-> 15 0 29 2462 topology 2490 3323
-> 16 0 29 2462 topology 2492 3323
-> 15 0 28 2462 topology 2512 3324
-> 16 0 28 2462 topology 2572 3324
-> 15 0 29 2462 topology 2544 3325
-> 16 0 29 2462 topology 2546 3325
-> 15 0 28 2462 topology 2542 3326
-> 16 0 28 2462 topology 2572 3326
-> 15 0 28 2462 topology 2464 3327
-> 16 0 28 2462 topology 2572 3327
-> 15 0 28 2462 topology 2494 3328
-> 16 0 28 2462 topology 2572 3328
-> 15 0 29 2462 topology 2502 3329
-> 16 0 29 2462 topology 2503 3329
-> 15 0 29 2462 topology 2469 3330
-> 16 0 29 2462 topology 2471 3330
-> 15 0 28 2462 topology 2524 3331
-> 16 0 28 2462 topology 2572 3331
-> 15 0 29 2462 topology 2523 3332
-> 16 0 29 2462 topology 2525 3332
-> 15 0 28 2462 topology 2554 3333
-> 16 0 28 2462 topology 2572 3333
-> 15 0 29 2462 topology 2481 3334
-> 16 0 29 2462 topology 2482 3334
-> 15 0 29 2462 topology 2535 3335
-> 16 0 29 2462 topology 2536 3335
-> 15 0 29 2462 topology 2556 3336
-> 16 0 29 2462 topology 2558 3336
-> 15 0 29 2462 topology 2514 3337
-> 16 0 29 2462 topology 2515 3337
-> 15 0 29 2462 topology 2568 3338
-> 16 0 29 2462 topology 2569 3338
-> 15 0 29 2462 topology 2493 3339
-> 16 0 29 2462 topology 2494 3339
-> 15 0 29 2462 topology 2547 3340
-> 16 0 29 2462 topology 2548 3340
-> 15 0 28 2462 topology 2477 3341
-> 16 0 28 2462 topology 2572 3341
-> 15 0 28 2462 topology 2537 3342
-> 16 0 28 2462 topology 2572 3342
-> 15 0 28 2462 topology 2513 3343
-> 16 0 28 2462 topology 2572 3343
-> 15 0 29 2462 topology 2526 3344
-> 16 0 29 2462 topology 2527 3344
-> 15 0 28 2462 topology 2489 3345
-> 16 0 28 2462 topology 2572 3345
-> 15 0 28 2462 topology 2465 3346
-> 16 0 28 2462 topology 2572 3346
-> 15 0 29 2462 topology 2475 3347
-> 16 0 29 2462 topology 2477 3347
-> 15 0 28 2462 topology 2549 3348
-> 16 0 28 2462 topology 2572 3348
-> 15 0 28 2462 topology 2525 3349
-> 16 0 28 2462 topology 2572 3349
-> 15 0 29 2462 topology 2559 3350
-> 16 0 29 2462 topology 2560 3350
-> 15 0 28 2462 topology 2501 3351
-> 16 0 28 2462 topology 2572 3351
-> 15 0 29 2462 topology 2508 3352
-> 16 0 29 2462 topology 2510 3352
-> 15 0 28 2462 topology 2561 3353
-> 16 0 28 2462 topology 2572 3353
-> 15 0 29 2462 topology 2562 3354
-> 16 0 29 2462 topology 2564 3354
-> 15 0 28 2462 topology 2479 3355
-> 16 0 28 2462 topology 2572 3355
-> 15 0 29 2462 topology 2487 3356
-> 16 0 29 2462 topology 2489 3356
-> 15 0 29 2462 topology 2541 3357
-> 16 0 29 2462 topology 2543 3357
-> 15 0 28 2462 topology 2509 3358
-> 16 0 28 2462 topology 2572 3358
-> 15 0 28 2462 topology 2539 3359
-> 16 0 28 2462 topology 2572 3359
-> 15 0 29 2462 topology 2472 3360
-> 16 0 29 2462 topology 2473 3360
-> 15 0 28 2462 topology 2569 3361
-> 16 0 28 2462 topology 2572 3361
-> 15 0 29 2462 topology 2466 3362
-> 16 0 29 2462 topology 2468 3362
-> 15 0 28 2462 topology 2491 3363
-> 16 0 28 2462 topology 2572 3363
-> 15 0 29 2462 topology 2520 3364
-> 16 0 29 2462 topology 2522 3364
-> 15 0 28 2573 topology 2672 3365
+> 15 0 29 2462 topology 2571 3292
+> 16 0 29 2462 topology 2572 3292
+> 15 0 30 2462 topology 2463 3293
+> 16 0 30 2462 topology 2465 3293
+> 15 0 30 2462 topology 2463 3294
+> 16 0 30 2462 topology 2464 3294
+> 15 0 30 2462 topology 2466 3295
+> 16 0 30 2462 topology 2468 3295
+> 15 0 30 2462 topology 2466 3296
+> 16 0 30 2462 topology 2467 3296
+> 15 0 30 2462 topology 2469 3297
+> 16 0 30 2462 topology 2471 3297
+> 15 0 30 2462 topology 2469 3298
+> 16 0 30 2462 topology 2470 3298
+> 15 0 30 2462 topology 2472 3299
+> 16 0 30 2462 topology 2474 3299
+> 15 0 30 2462 topology 2472 3300
+> 16 0 30 2462 topology 2473 3300
+> 15 0 30 2462 topology 2475 3301
+> 16 0 30 2462 topology 2477 3301
+> 15 0 30 2462 topology 2475 3302
+> 16 0 30 2462 topology 2476 3302
+> 15 0 30 2462 topology 2478 3303
+> 16 0 30 2462 topology 2480 3303
+> 15 0 30 2462 topology 2478 3304
+> 16 0 30 2462 topology 2479 3304
+> 15 0 30 2462 topology 2481 3305
+> 16 0 30 2462 topology 2483 3305
+> 15 0 30 2462 topology 2481 3306
+> 16 0 30 2462 topology 2482 3306
+> 15 0 30 2462 topology 2484 3307
+> 16 0 30 2462 topology 2486 3307
+> 15 0 30 2462 topology 2484 3308
+> 16 0 30 2462 topology 2485 3308
+> 15 0 30 2462 topology 2487 3309
+> 16 0 30 2462 topology 2489 3309
+> 15 0 30 2462 topology 2487 3310
+> 16 0 30 2462 topology 2488 3310
+> 15 0 30 2462 topology 2490 3311
+> 16 0 30 2462 topology 2492 3311
+> 15 0 30 2462 topology 2490 3312
+> 16 0 30 2462 topology 2491 3312
+> 15 0 30 2462 topology 2493 3313
+> 16 0 30 2462 topology 2495 3313
+> 15 0 30 2462 topology 2493 3314
+> 16 0 30 2462 topology 2494 3314
+> 15 0 30 2462 topology 2496 3315
+> 16 0 30 2462 topology 2498 3315
+> 15 0 30 2462 topology 2496 3316
+> 16 0 30 2462 topology 2497 3316
+> 15 0 30 2462 topology 2499 3317
+> 16 0 30 2462 topology 2501 3317
+> 15 0 30 2462 topology 2499 3318
+> 16 0 30 2462 topology 2500 3318
+> 15 0 30 2462 topology 2502 3319
+> 16 0 30 2462 topology 2504 3319
+> 15 0 30 2462 topology 2502 3320
+> 16 0 30 2462 topology 2503 3320
+> 15 0 30 2462 topology 2505 3321
+> 16 0 30 2462 topology 2507 3321
+> 15 0 30 2462 topology 2505 3322
+> 16 0 30 2462 topology 2506 3322
+> 15 0 30 2462 topology 2508 3323
+> 16 0 30 2462 topology 2510 3323
+> 15 0 30 2462 topology 2508 3324
+> 16 0 30 2462 topology 2509 3324
+> 15 0 30 2462 topology 2511 3325
+> 16 0 30 2462 topology 2513 3325
+> 15 0 30 2462 topology 2511 3326
+> 16 0 30 2462 topology 2512 3326
+> 15 0 30 2462 topology 2514 3327
+> 16 0 30 2462 topology 2516 3327
+> 15 0 30 2462 topology 2514 3328
+> 16 0 30 2462 topology 2515 3328
+> 15 0 30 2462 topology 2517 3329
+> 16 0 30 2462 topology 2519 3329
+> 15 0 30 2462 topology 2517 3330
+> 16 0 30 2462 topology 2518 3330
+> 15 0 30 2462 topology 2520 3331
+> 16 0 30 2462 topology 2522 3331
+> 15 0 30 2462 topology 2520 3332
+> 16 0 30 2462 topology 2521 3332
+> 15 0 30 2462 topology 2523 3333
+> 16 0 30 2462 topology 2525 3333
+> 15 0 30 2462 topology 2523 3334
+> 16 0 30 2462 topology 2524 3334
+> 15 0 30 2462 topology 2526 3335
+> 16 0 30 2462 topology 2528 3335
+> 15 0 30 2462 topology 2526 3336
+> 16 0 30 2462 topology 2527 3336
+> 15 0 30 2462 topology 2529 3337
+> 16 0 30 2462 topology 2531 3337
+> 15 0 30 2462 topology 2529 3338
+> 16 0 30 2462 topology 2530 3338
+> 15 0 30 2462 topology 2532 3339
+> 16 0 30 2462 topology 2534 3339
+> 15 0 30 2462 topology 2532 3340
+> 16 0 30 2462 topology 2533 3340
+> 15 0 30 2462 topology 2535 3341
+> 16 0 30 2462 topology 2537 3341
+> 15 0 30 2462 topology 2535 3342
+> 16 0 30 2462 topology 2536 3342
+> 15 0 30 2462 topology 2538 3343
+> 16 0 30 2462 topology 2540 3343
+> 15 0 30 2462 topology 2538 3344
+> 16 0 30 2462 topology 2539 3344
+> 15 0 30 2462 topology 2541 3345
+> 16 0 30 2462 topology 2543 3345
+> 15 0 30 2462 topology 2541 3346
+> 16 0 30 2462 topology 2542 3346
+> 15 0 30 2462 topology 2544 3347
+> 16 0 30 2462 topology 2546 3347
+> 15 0 30 2462 topology 2544 3348
+> 16 0 30 2462 topology 2545 3348
+> 15 0 30 2462 topology 2547 3349
+> 16 0 30 2462 topology 2549 3349
+> 15 0 30 2462 topology 2547 3350
+> 16 0 30 2462 topology 2548 3350
+> 15 0 30 2462 topology 2550 3351
+> 16 0 30 2462 topology 2552 3351
+> 15 0 30 2462 topology 2550 3352
+> 16 0 30 2462 topology 2551 3352
+> 15 0 30 2462 topology 2553 3353
+> 16 0 30 2462 topology 2555 3353
+> 15 0 30 2462 topology 2553 3354
+> 16 0 30 2462 topology 2554 3354
+> 15 0 30 2462 topology 2556 3355
+> 16 0 30 2462 topology 2558 3355
+> 15 0 30 2462 topology 2556 3356
+> 16 0 30 2462 topology 2557 3356
+> 15 0 30 2462 topology 2559 3357
+> 16 0 30 2462 topology 2561 3357
+> 15 0 30 2462 topology 2559 3358
+> 16 0 30 2462 topology 2560 3358
+> 15 0 30 2462 topology 2562 3359
+> 16 0 30 2462 topology 2564 3359
+> 15 0 30 2462 topology 2562 3360
+> 16 0 30 2462 topology 2563 3360
+> 15 0 30 2462 topology 2565 3361
+> 16 0 30 2462 topology 2567 3361
+> 15 0 30 2462 topology 2565 3362
+> 16 0 30 2462 topology 2566 3362
+> 15 0 30 2462 topology 2568 3363
+> 16 0 30 2462 topology 2570 3363
+> 15 0 30 2462 topology 2568 3364
+> 16 0 30 2462 topology 2569 3364
+> 15 0 28 2573 topology 2657 3365
 > 16 0 28 2573 topology 2683 3365
-> 15 0 28 2573 topology 2575 3366
+> 15 0 28 2573 topology 2656 3366
 > 16 0 28 2573 topology 2683 3366
-> 15 0 28 2573 topology 2605 3367
+> 15 0 28 2573 topology 2660 3367
 > 16 0 28 2573 topology 2683 3367
-> 15 0 29 2573 topology 2607 3368
-> 16 0 29 2573 topology 2609 3368
-> 15 0 28 2573 topology 2635 3369
+> 15 0 28 2573 topology 2659 3368
+> 16 0 28 2573 topology 2683 3368
+> 15 0 28 2573 topology 2663 3369
 > 16 0 28 2573 topology 2683 3369
-> 15 0 29 2573 topology 2670 3370
-> 16 0 29 2573 topology 2671 3370
-> 15 0 28 2573 topology 2587 3371
+> 15 0 28 2573 topology 2662 3370
+> 16 0 28 2573 topology 2683 3370
+> 15 0 28 2573 topology 2666 3371
 > 16 0 28 2573 topology 2683 3371
-> 15 0 29 2573 topology 2586 3372
-> 16 0 29 2573 topology 2588 3372
-> 15 0 28 2573 topology 2617 3373
+> 15 0 28 2573 topology 2665 3372
+> 16 0 28 2573 topology 2683 3372
+> 15 0 28 2573 topology 2669 3373
 > 16 0 28 2573 topology 2683 3373
-> 15 0 29 2573 topology 2640 3374
-> 16 0 29 2573 topology 2642 3374
-> 15 0 28 2573 topology 2647 3375
+> 15 0 28 2573 topology 2668 3374
+> 16 0 28 2573 topology 2683 3374
+> 15 0 28 2573 topology 2672 3375
 > 16 0 28 2573 topology 2683 3375
-> 15 0 29 2573 topology 2676 3376
-> 16 0 29 2573 topology 2677 3376
-> 15 0 28 2573 topology 2656 3377
+> 15 0 28 2573 topology 2671 3376
+> 16 0 28 2573 topology 2683 3376
+> 15 0 28 2573 topology 2675 3377
 > 16 0 28 2573 topology 2683 3377
-> 15 0 29 2573 topology 2625 3378
-> 16 0 29 2573 topology 2626 3378
-> 15 0 29 2573 topology 2619 3379
-> 16 0 29 2573 topology 2621 3379
-> 15 0 28 2573 topology 2668 3380
+> 15 0 28 2573 topology 2674 3378
+> 16 0 28 2573 topology 2683 3378
+> 15 0 28 2573 topology 2678 3379
+> 16 0 28 2573 topology 2683 3379
+> 15 0 28 2573 topology 2677 3380
 > 16 0 28 2573 topology 2683 3380
-> 15 0 29 2573 topology 2604 3381
-> 16 0 29 2573 topology 2605 3381
-> 15 0 29 2573 topology 2652 3382
-> 16 0 29 2573 topology 2654 3382
-> 15 0 28 2573 topology 2680 3383
+> 15 0 28 2573 topology 2681 3381
+> 16 0 28 2573 topology 2683 3381
+> 15 0 28 2573 topology 2680 3382
+> 16 0 28 2573 topology 2683 3382
+> 15 0 28 2573 topology 2576 3383
 > 16 0 28 2573 topology 2683 3383
-> 15 0 29 2573 topology 2583 3384
-> 16 0 29 2573 topology 2584 3384
-> 15 0 29 2573 topology 2637 3385
-> 16 0 29 2573 topology 2638 3385
-> 15 0 28 2573 topology 2600 3386
+> 15 0 28 2573 topology 2575 3384
+> 16 0 28 2573 topology 2683 3384
+> 15 0 28 2573 topology 2579 3385
+> 16 0 28 2573 topology 2683 3385
+> 15 0 28 2573 topology 2578 3386
 > 16 0 28 2573 topology 2683 3386
-> 15 0 28 2573 topology 2576 3387
+> 15 0 28 2573 topology 2582 3387
 > 16 0 28 2573 topology 2683 3387
-> 15 0 29 2573 topology 2616 3388
-> 16 0 29 2573 topology 2617 3388
-> 15 0 28 2573 topology 2636 3389
+> 15 0 28 2573 topology 2581 3388
+> 16 0 28 2573 topology 2683 3388
+> 15 0 28 2573 topology 2585 3389
 > 16 0 28 2573 topology 2683 3389
-> 15 0 28 2573 topology 2612 3390
+> 15 0 28 2573 topology 2584 3390
 > 16 0 28 2573 topology 2683 3390
 > 15 0 28 2573 topology 2588 3391
 > 16 0 28 2573 topology 2683 3391
-> 15 0 29 2573 topology 2649 3392
-> 16 0 29 2573 topology 2650 3392
-> 15 0 28 2573 topology 2648 3393
+> 15 0 28 2573 topology 2587 3392
+> 16 0 28 2573 topology 2683 3392
+> 15 0 28 2573 topology 2591 3393
 > 16 0 28 2573 topology 2683 3393
-> 15 0 28 2573 topology 2624 3394
+> 15 0 28 2573 topology 2590 3394
 > 16 0 28 2573 topology 2683 3394
-> 15 0 29 2573 topology 2625 3395
-> 16 0 29 2573 topology 2627 3395
-> 15 0 28 2573 topology 2663 3396
+> 15 0 28 2573 topology 2594 3395
+> 16 0 28 2573 topology 2683 3395
+> 15 0 28 2573 topology 2593 3396
 > 16 0 28 2573 topology 2683 3396
-> 15 0 29 2573 topology 2604 3397
-> 16 0 29 2573 topology 2606 3397
-> 15 0 28 2573 topology 2602 3398
+> 15 0 28 2573 topology 2597 3397
+> 16 0 28 2573 topology 2683 3397
+> 15 0 28 2573 topology 2596 3398
 > 16 0 28 2573 topology 2683 3398
-> 15 0 28 2573 topology 2675 3399
+> 15 0 28 2573 topology 2600 3399
 > 16 0 28 2573 topology 2683 3399
-> 15 0 28 2573 topology 2632 3400
+> 15 0 28 2573 topology 2599 3400
 > 16 0 28 2573 topology 2683 3400
-> 15 0 28 2573 topology 2584 3401
+> 15 0 28 2573 topology 2603 3401
 > 16 0 28 2573 topology 2683 3401
-> 15 0 29 2573 topology 2583 3402
-> 16 0 29 2573 topology 2585 3402
-> 15 0 29 2573 topology 2637 3403
-> 16 0 29 2573 topology 2639 3403
-> 15 0 28 2573 topology 2614 3404
+> 15 0 28 2573 topology 2602 3402
+> 16 0 28 2573 topology 2683 3402
+> 15 0 28 2573 topology 2606 3403
+> 16 0 28 2573 topology 2683 3403
+> 15 0 28 2573 topology 2605 3404
 > 16 0 28 2573 topology 2683 3404
-> 15 0 28 2573 topology 2644 3405
+> 15 0 28 2573 topology 2609 3405
 > 16 0 28 2573 topology 2683 3405
-> 15 0 29 2573 topology 2595 3406
-> 16 0 29 2573 topology 2596 3406
-> 15 0 29 2573 topology 2616 3407
-> 16 0 29 2573 topology 2618 3407
-> 15 0 29 2573 topology 2574 3408
-> 16 0 29 2573 topology 2575 3408
-> 15 0 29 2573 topology 2628 3409
-> 16 0 29 2573 topology 2629 3409
-> 15 0 28 2573 topology 2665 3410
+> 15 0 28 2573 topology 2608 3406
+> 16 0 28 2573 topology 2683 3406
+> 15 0 28 2573 topology 2612 3407
+> 16 0 28 2573 topology 2683 3407
+> 15 0 28 2573 topology 2611 3408
+> 16 0 28 2573 topology 2683 3408
+> 15 0 28 2573 topology 2615 3409
+> 16 0 28 2573 topology 2683 3409
+> 15 0 28 2573 topology 2614 3410
 > 16 0 28 2573 topology 2683 3410
-> 15 0 29 2573 topology 2649 3411
-> 16 0 29 2573 topology 2651 3411
-> 15 0 29 2573 topology 2655 3412
-> 16 0 29 2573 topology 2657 3412
-> 15 0 29 2573 topology 2658 3413
-> 16 0 29 2573 topology 2660 3413
-> 15 0 29 2573 topology 2607 3414
-> 16 0 29 2573 topology 2608 3414
-> 15 0 28 2573 topology 2677 3415
+> 15 0 28 2573 topology 2618 3411
+> 16 0 28 2573 topology 2683 3411
+> 15 0 28 2573 topology 2617 3412
+> 16 0 28 2573 topology 2683 3412
+> 15 0 28 2573 topology 2621 3413
+> 16 0 28 2573 topology 2683 3413
+> 15 0 28 2573 topology 2620 3414
+> 16 0 28 2573 topology 2683 3414
+> 15 0 28 2573 topology 2624 3415
 > 16 0 28 2573 topology 2683 3415
-> 15 0 29 2573 topology 2661 3416
-> 16 0 29 2573 topology 2663 3416
-> 15 0 29 2573 topology 2664 3417
-> 16 0 29 2573 topology 2666 3417
-> 15 0 29 2573 topology 2586 3418
-> 16 0 29 2573 topology 2587 3418
-> 15 0 28 2573 topology 2627 3419
+> 15 0 28 2573 topology 2623 3416
+> 16 0 28 2573 topology 2683 3416
+> 15 0 28 2573 topology 2627 3417
+> 16 0 28 2573 topology 2683 3417
+> 15 0 28 2573 topology 2626 3418
+> 16 0 28 2573 topology 2683 3418
+> 15 0 28 2573 topology 2630 3419
 > 16 0 28 2573 topology 2683 3419
-> 15 0 29 2573 topology 2640 3420
-> 16 0 29 2573 topology 2641 3420
-> 15 0 28 2573 topology 2603 3421
+> 15 0 28 2573 topology 2629 3420
+> 16 0 28 2573 topology 2683 3420
+> 15 0 28 2573 topology 2633 3421
 > 16 0 28 2573 topology 2683 3421
-> 15 0 29 2573 topology 2667 3422
-> 16 0 29 2573 topology 2669 3422
-> 15 0 28 2573 topology 2579 3423
+> 15 0 28 2573 topology 2632 3422
+> 16 0 28 2573 topology 2683 3422
+> 15 0 28 2573 topology 2636 3423
 > 16 0 28 2573 topology 2683 3423
-> 15 0 29 2573 topology 2670 3424
-> 16 0 29 2573 topology 2672 3424
-> 15 0 29 2573 topology 2619 3425
-> 16 0 29 2573 topology 2620 3425
-> 15 0 28 2573 topology 2639 3426
+> 15 0 28 2573 topology 2635 3424
+> 16 0 28 2573 topology 2683 3424
+> 15 0 28 2573 topology 2639 3425
+> 16 0 28 2573 topology 2683 3425
+> 15 0 28 2573 topology 2638 3426
 > 16 0 28 2573 topology 2683 3426
-> 15 0 28 2573 topology 2615 3427
+> 15 0 28 2573 topology 2642 3427
 > 16 0 28 2573 topology 2683 3427
-> 15 0 29 2573 topology 2673 3428
-> 16 0 29 2573 topology 2675 3428
-> 15 0 28 2573 topology 2591 3429
+> 15 0 28 2573 topology 2641 3428
+> 16 0 28 2573 topology 2683 3428
+> 15 0 28 2573 topology 2645 3429
 > 16 0 28 2573 topology 2683 3429
-> 15 0 29 2573 topology 2655 3430
-> 16 0 29 2573 topology 2656 3430
-> 15 0 29 2573 topology 2676 3431
-> 16 0 29 2573 topology 2678 3431
-> 15 0 28 2573 topology 2651 3432
+> 15 0 28 2573 topology 2644 3430
+> 16 0 28 2573 topology 2683 3430
+> 15 0 28 2573 topology 2648 3431
+> 16 0 28 2573 topology 2683 3431
+> 15 0 28 2573 topology 2647 3432
 > 16 0 28 2573 topology 2683 3432
-> 15 0 29 2573 topology 2652 3433
-> 16 0 29 2573 topology 2653 3433
-> 15 0 29 2573 topology 2679 3434
-> 16 0 29 2573 topology 2681 3434
-> 15 0 29 2573 topology 2661 3435
-> 16 0 29 2573 topology 2662 3435
-> 15 0 29 2573 topology 2601 3436
-> 16 0 29 2573 topology 2603 3436
-> 15 0 28 2573 topology 2666 3437
-> 16 0 28 2573 topology 2683 3437
-> 15 0 28 2573 topology 2599 3438
-> 16 0 28 2573 topology 2683 3438
-> 15 0 28 2573 topology 2629 3439
-> 16 0 28 2573 topology 2683 3439
-> 15 0 29 2573 topology 2667 3440
-> 16 0 29 2573 topology 2668 3440
-> 15 0 29 2573 topology 2580 3441
-> 16 0 29 2573 topology 2582 3441
-> 15 0 29 2573 topology 2634 3442
-> 16 0 29 2573 topology 2636 3442
-> 15 0 28 2573 topology 2678 3443
-> 16 0 28 2573 topology 2683 3443
-> 15 0 28 2573 topology 2581 3444
-> 16 0 28 2573 topology 2683 3444
-> 15 0 28 2573 topology 2611 3445
-> 16 0 28 2573 topology 2683 3445
-> 15 0 28 2573 topology 2641 3446
-> 16 0 28 2573 topology 2683 3446
-> 15 0 29 2573 topology 2673 3447
-> 16 0 29 2573 topology 2674 3447
-> 15 0 29 2573 topology 2613 3448
-> 16 0 29 2573 topology 2615 3448
-> 15 0 28 2573 topology 2593 3449
-> 16 0 28 2573 topology 2683 3449
-> 15 0 28 2573 topology 2623 3450
-> 16 0 28 2573 topology 2683 3450
-> 15 0 29 2573 topology 2598 3451
-> 16 0 29 2573 topology 2599 3451
-> 15 0 28 2573 topology 2653 3452
-> 16 0 28 2573 topology 2683 3452
-> 15 0 29 2573 topology 2679 3453
-> 16 0 29 2573 topology 2680 3453
-> 15 0 29 2573 topology 2592 3454
-> 16 0 29 2573 topology 2594 3454
-> 15 0 29 2573 topology 2646 3455
-> 16 0 29 2573 topology 2648 3455
-> 15 0 28 2573 topology 2662 3456
-> 16 0 28 2573 topology 2683 3456
-> 15 0 29 2573 topology 2577 3457
-> 16 0 29 2573 topology 2578 3457
-> 15 0 29 2573 topology 2631 3458
-> 16 0 29 2573 topology 2632 3458
-> 15 0 28 2573 topology 2674 3459
-> 16 0 28 2573 topology 2683 3459
-> 15 0 29 2573 topology 2610 3460
-> 16 0 29 2573 topology 2611 3460
-> 15 0 28 2573 topology 2630 3461
-> 16 0 28 2573 topology 2683 3461
-> 15 0 29 2573 topology 2589 3462
-> 16 0 29 2573 topology 2590 3462
-> 15 0 28 2573 topology 2606 3463
-> 16 0 28 2573 topology 2683 3463
-> 15 0 29 2573 topology 2643 3464
-> 16 0 29 2573 topology 2644 3464
-> 15 0 28 2573 topology 2582 3465
-> 16 0 28 2573 topology 2683 3465
-> 15 0 28 2573 topology 2642 3466
-> 16 0 28 2573 topology 2683 3466
-> 15 0 28 2573 topology 2618 3467
-> 16 0 28 2573 topology 2683 3467
-> 15 0 29 2573 topology 2622 3468
-> 16 0 29 2573 topology 2623 3468
-> 15 0 28 2573 topology 2594 3469
-> 16 0 28 2573 topology 2683 3469
-> 15 0 28 2573 topology 2657 3470
-> 16 0 28 2573 topology 2683 3470
-> 15 0 29 2573 topology 2598 3471
-> 16 0 29 2573 topology 2600 3471
-> 15 0 28 2573 topology 2654 3472
-> 16 0 28 2573 topology 2683 3472
-> 15 0 28 2573 topology 2596 3473
-> 16 0 28 2573 topology 2683 3473
-> 15 0 28 2573 topology 2669 3474
-> 16 0 28 2573 topology 2683 3474
-> 15 0 29 2573 topology 2577 3475
-> 16 0 29 2573 topology 2579 3475
-> 15 0 28 2573 topology 2626 3476
-> 16 0 28 2573 topology 2683 3476
-> 15 0 29 2573 topology 2631 3477
-> 16 0 29 2573 topology 2633 3477
-> 15 0 28 2573 topology 2578 3478
-> 16 0 28 2573 topology 2683 3478
-> 15 0 28 2573 topology 2608 3479
-> 16 0 28 2573 topology 2683 3479
-> 15 0 28 2573 topology 2681 3480
-> 16 0 28 2573 topology 2683 3480
-> 15 0 29 2573 topology 2610 3481
-> 16 0 29 2573 topology 2612 3481
-> 15 0 28 2573 topology 2638 3482
-> 16 0 28 2573 topology 2683 3482
-> 15 0 28 2573 topology 2590 3483
-> 16 0 28 2573 topology 2683 3483
-> 15 0 28 2573 topology 2620 3484
-> 16 0 28 2573 topology 2683 3484
-> 15 0 29 2573 topology 2589 3485
-> 16 0 29 2573 topology 2591 3485
-> 15 0 29 2573 topology 2643 3486
-> 16 0 29 2573 topology 2645 3486
-> 15 0 28 2573 topology 2650 3487
-> 16 0 28 2573 topology 2683 3487
-> 15 0 28 2573 topology 2659 3488
-> 16 0 28 2573 topology 2683 3488
-> 15 0 29 2573 topology 2601 3489
-> 16 0 29 2573 topology 2602 3489
-> 15 0 29 2573 topology 2622 3490
-> 16 0 29 2573 topology 2624 3490
-> 15 0 28 2573 topology 2671 3491
-> 16 0 28 2573 topology 2683 3491
-> 15 0 29 2573 topology 2580 3492
-> 16 0 29 2573 topology 2581 3492
-> 15 0 29 2573 topology 2634 3493
-> 16 0 29 2573 topology 2635 3493
-> 15 0 30 2573 topology 2682 3494
-> 16 0 30 2573 topology 2683 3494
-> 15 0 28 2573 topology 2597 3495
-> 16 0 28 2573 topology 2683 3495
-> 15 0 29 2573 topology 2613 3496
-> 16 0 29 2573 topology 2614 3496
-> 15 0 28 2573 topology 2633 3497
-> 16 0 28 2573 topology 2683 3497
-> 15 0 28 2573 topology 2609 3498
-> 16 0 28 2573 topology 2683 3498
-> 15 0 28 2573 topology 2585 3499
-> 16 0 28 2573 topology 2683 3499
-> 15 0 29 2573 topology 2592 3500
-> 16 0 29 2573 topology 2593 3500
-> 15 0 29 2573 topology 2646 3501
-> 16 0 29 2573 topology 2647 3501
-> 15 0 28 2573 topology 2645 3502
-> 16 0 28 2573 topology 2683 3502
-> 15 0 29 2573 topology 2595 3503
-> 16 0 29 2573 topology 2597 3503
-> 15 0 28 2573 topology 2621 3504
-> 16 0 28 2573 topology 2683 3504
-> 15 0 29 2573 topology 2658 3505
-> 16 0 29 2573 topology 2659 3505
-> 15 0 28 2573 topology 2660 3506
-> 16 0 28 2573 topology 2683 3506
-> 15 0 29 2573 topology 2574 3507
-> 16 0 29 2573 topology 2576 3507
-> 15 0 29 2573 topology 2628 3508
-> 16 0 29 2573 topology 2630 3508
-> 15 0 29 2573 topology 2664 3509
-> 16 0 29 2573 topology 2665 3509
-> 15 0 28 2684 topology 2750 3510
+> 15 0 28 2573 topology 2651 3433
+> 16 0 28 2573 topology 2683 3433
+> 15 0 28 2573 topology 2650 3434
+> 16 0 28 2573 topology 2683 3434
+> 15 0 28 2573 topology 2654 3435
+> 16 0 28 2573 topology 2683 3435
+> 15 0 28 2573 topology 2653 3436
+> 16 0 28 2573 topology 2683 3436
+> 15 0 29 2573 topology 2682 3437
+> 16 0 29 2573 topology 2683 3437
+> 15 0 30 2573 topology 2655 3438
+> 16 0 30 2573 topology 2657 3438
+> 15 0 30 2573 topology 2655 3439
+> 16 0 30 2573 topology 2656 3439
+> 15 0 30 2573 topology 2658 3440
+> 16 0 30 2573 topology 2660 3440
+> 15 0 30 2573 topology 2658 3441
+> 16 0 30 2573 topology 2659 3441
+> 15 0 30 2573 topology 2661 3442
+> 16 0 30 2573 topology 2663 3442
+> 15 0 30 2573 topology 2661 3443
+> 16 0 30 2573 topology 2662 3443
+> 15 0 30 2573 topology 2664 3444
+> 16 0 30 2573 topology 2666 3444
+> 15 0 30 2573 topology 2664 3445
+> 16 0 30 2573 topology 2665 3445
+> 15 0 30 2573 topology 2667 3446
+> 16 0 30 2573 topology 2669 3446
+> 15 0 30 2573 topology 2667 3447
+> 16 0 30 2573 topology 2668 3447
+> 15 0 30 2573 topology 2670 3448
+> 16 0 30 2573 topology 2672 3448
+> 15 0 30 2573 topology 2670 3449
+> 16 0 30 2573 topology 2671 3449
+> 15 0 30 2573 topology 2673 3450
+> 16 0 30 2573 topology 2675 3450
+> 15 0 30 2573 topology 2673 3451
+> 16 0 30 2573 topology 2674 3451
+> 15 0 30 2573 topology 2676 3452
+> 16 0 30 2573 topology 2678 3452
+> 15 0 30 2573 topology 2676 3453
+> 16 0 30 2573 topology 2677 3453
+> 15 0 30 2573 topology 2679 3454
+> 16 0 30 2573 topology 2681 3454
+> 15 0 30 2573 topology 2679 3455
+> 16 0 30 2573 topology 2680 3455
+> 15 0 30 2573 topology 2574 3456
+> 16 0 30 2573 topology 2576 3456
+> 15 0 30 2573 topology 2574 3457
+> 16 0 30 2573 topology 2575 3457
+> 15 0 30 2573 topology 2577 3458
+> 16 0 30 2573 topology 2579 3458
+> 15 0 30 2573 topology 2577 3459
+> 16 0 30 2573 topology 2578 3459
+> 15 0 30 2573 topology 2580 3460
+> 16 0 30 2573 topology 2582 3460
+> 15 0 30 2573 topology 2580 3461
+> 16 0 30 2573 topology 2581 3461
+> 15 0 30 2573 topology 2583 3462
+> 16 0 30 2573 topology 2585 3462
+> 15 0 30 2573 topology 2583 3463
+> 16 0 30 2573 topology 2584 3463
+> 15 0 30 2573 topology 2586 3464
+> 16 0 30 2573 topology 2588 3464
+> 15 0 30 2573 topology 2586 3465
+> 16 0 30 2573 topology 2587 3465
+> 15 0 30 2573 topology 2589 3466
+> 16 0 30 2573 topology 2591 3466
+> 15 0 30 2573 topology 2589 3467
+> 16 0 30 2573 topology 2590 3467
+> 15 0 30 2573 topology 2592 3468
+> 16 0 30 2573 topology 2594 3468
+> 15 0 30 2573 topology 2592 3469
+> 16 0 30 2573 topology 2593 3469
+> 15 0 30 2573 topology 2595 3470
+> 16 0 30 2573 topology 2597 3470
+> 15 0 30 2573 topology 2595 3471
+> 16 0 30 2573 topology 2596 3471
+> 15 0 30 2573 topology 2598 3472
+> 16 0 30 2573 topology 2600 3472
+> 15 0 30 2573 topology 2598 3473
+> 16 0 30 2573 topology 2599 3473
+> 15 0 30 2573 topology 2601 3474
+> 16 0 30 2573 topology 2603 3474
+> 15 0 30 2573 topology 2601 3475
+> 16 0 30 2573 topology 2602 3475
+> 15 0 30 2573 topology 2604 3476
+> 16 0 30 2573 topology 2606 3476
+> 15 0 30 2573 topology 2604 3477
+> 16 0 30 2573 topology 2605 3477
+> 15 0 30 2573 topology 2607 3478
+> 16 0 30 2573 topology 2609 3478
+> 15 0 30 2573 topology 2607 3479
+> 16 0 30 2573 topology 2608 3479
+> 15 0 30 2573 topology 2610 3480
+> 16 0 30 2573 topology 2612 3480
+> 15 0 30 2573 topology 2610 3481
+> 16 0 30 2573 topology 2611 3481
+> 15 0 30 2573 topology 2613 3482
+> 16 0 30 2573 topology 2615 3482
+> 15 0 30 2573 topology 2613 3483
+> 16 0 30 2573 topology 2614 3483
+> 15 0 30 2573 topology 2616 3484
+> 16 0 30 2573 topology 2618 3484
+> 15 0 30 2573 topology 2616 3485
+> 16 0 30 2573 topology 2617 3485
+> 15 0 30 2573 topology 2619 3486
+> 16 0 30 2573 topology 2621 3486
+> 15 0 30 2573 topology 2619 3487
+> 16 0 30 2573 topology 2620 3487
+> 15 0 30 2573 topology 2622 3488
+> 16 0 30 2573 topology 2624 3488
+> 15 0 30 2573 topology 2622 3489
+> 16 0 30 2573 topology 2623 3489
+> 15 0 30 2573 topology 2625 3490
+> 16 0 30 2573 topology 2627 3490
+> 15 0 30 2573 topology 2625 3491
+> 16 0 30 2573 topology 2626 3491
+> 15 0 30 2573 topology 2628 3492
+> 16 0 30 2573 topology 2630 3492
+> 15 0 30 2573 topology 2628 3493
+> 16 0 30 2573 topology 2629 3493
+> 15 0 30 2573 topology 2631 3494
+> 16 0 30 2573 topology 2633 3494
+> 15 0 30 2573 topology 2631 3495
+> 16 0 30 2573 topology 2632 3495
+> 15 0 30 2573 topology 2634 3496
+> 16 0 30 2573 topology 2636 3496
+> 15 0 30 2573 topology 2634 3497
+> 16 0 30 2573 topology 2635 3497
+> 15 0 30 2573 topology 2637 3498
+> 16 0 30 2573 topology 2639 3498
+> 15 0 30 2573 topology 2637 3499
+> 16 0 30 2573 topology 2638 3499
+> 15 0 30 2573 topology 2640 3500
+> 16 0 30 2573 topology 2642 3500
+> 15 0 30 2573 topology 2640 3501
+> 16 0 30 2573 topology 2641 3501
+> 15 0 30 2573 topology 2643 3502
+> 16 0 30 2573 topology 2645 3502
+> 15 0 30 2573 topology 2643 3503
+> 16 0 30 2573 topology 2644 3503
+> 15 0 30 2573 topology 2646 3504
+> 16 0 30 2573 topology 2648 3504
+> 15 0 30 2573 topology 2646 3505
+> 16 0 30 2573 topology 2647 3505
+> 15 0 30 2573 topology 2649 3506
+> 16 0 30 2573 topology 2651 3506
+> 15 0 30 2573 topology 2649 3507
+> 16 0 30 2573 topology 2650 3507
+> 15 0 30 2573 topology 2652 3508
+> 16 0 30 2573 topology 2654 3508
+> 15 0 30 2573 topology 2652 3509
+> 16 0 30 2573 topology 2653 3509
+> 15 0 28 2684 topology 2687 3510
 > 16 0 28 2684 topology 2794 3510
-> 15 0 28 2684 topology 2726 3511
+> 15 0 28 2684 topology 2686 3511
 > 16 0 28 2684 topology 2794 3511
-> 15 0 28 2684 topology 2702 3512
+> 15 0 28 2684 topology 2690 3512
 > 16 0 28 2684 topology 2794 3512
-> 15 0 28 2684 topology 2786 3513
+> 15 0 28 2684 topology 2689 3513
 > 16 0 28 2684 topology 2794 3513
-> 15 0 28 2684 topology 2762 3514
+> 15 0 28 2684 topology 2693 3514
 > 16 0 28 2684 topology 2794 3514
-> 15 0 28 2684 topology 2738 3515
+> 15 0 28 2684 topology 2692 3515
 > 16 0 28 2684 topology 2794 3515
-> 15 0 28 2684 topology 2714 3516
+> 15 0 28 2684 topology 2696 3516
 > 16 0 28 2684 topology 2794 3516
-> 15 0 28 2684 topology 2774 3517
+> 15 0 28 2684 topology 2695 3517
 > 16 0 28 2684 topology 2794 3517
-> 15 0 28 2684 topology 2698 3518
+> 15 0 28 2684 topology 2699 3518
 > 16 0 28 2684 topology 2794 3518
-> 15 0 29 2684 topology 2688 3519
-> 16 0 29 2684 topology 2690 3519
-> 15 0 28 2684 topology 2728 3520
+> 15 0 28 2684 topology 2698 3519
+> 16 0 28 2684 topology 2794 3519
+> 15 0 28 2684 topology 2702 3520
 > 16 0 28 2684 topology 2794 3520
-> 15 0 28 2684 topology 2758 3521
+> 15 0 28 2684 topology 2701 3521
 > 16 0 28 2684 topology 2794 3521
-> 15 0 29 2684 topology 2691 3522
-> 16 0 29 2684 topology 2693 3522
-> 15 0 28 2684 topology 2788 3523
+> 15 0 28 2684 topology 2705 3522
+> 16 0 28 2684 topology 2794 3522
+> 15 0 28 2684 topology 2704 3523
 > 16 0 28 2684 topology 2794 3523
-> 15 0 28 2684 topology 2710 3524
+> 15 0 28 2684 topology 2708 3524
 > 16 0 28 2684 topology 2794 3524
-> 15 0 29 2684 topology 2694 3525
-> 16 0 29 2684 topology 2696 3525
-> 15 0 28 2684 topology 2740 3526
+> 15 0 28 2684 topology 2707 3525
+> 16 0 28 2684 topology 2794 3525
+> 15 0 28 2684 topology 2711 3526
 > 16 0 28 2684 topology 2794 3526
-> 15 0 29 2684 topology 2748 3527
-> 16 0 29 2684 topology 2750 3527
-> 15 0 30 2684 topology 2793 3528
-> 16 0 30 2684 topology 2794 3528
-> 15 0 28 2684 topology 2770 3529
+> 15 0 28 2684 topology 2710 3527
+> 16 0 28 2684 topology 2794 3527
+> 15 0 28 2684 topology 2714 3528
+> 16 0 28 2684 topology 2794 3528
+> 15 0 28 2684 topology 2713 3529
 > 16 0 28 2684 topology 2794 3529
-> 15 0 29 2684 topology 2697 3530
-> 16 0 29 2684 topology 2699 3530
-> 15 0 29 2684 topology 2751 3531
-> 16 0 29 2684 topology 2753 3531
-> 15 0 29 2684 topology 2700 3532
-> 16 0 29 2684 topology 2702 3532
-> 15 0 29 2684 topology 2754 3533
-> 16 0 29 2684 topology 2756 3533
-> 15 0 29 2684 topology 2703 3534
-> 16 0 29 2684 topology 2705 3534
-> 15 0 29 2684 topology 2757 3535
-> 16 0 29 2684 topology 2759 3535
-> 15 0 29 2684 topology 2706 3536
-> 16 0 29 2684 topology 2708 3536
-> 15 0 29 2684 topology 2760 3537
-> 16 0 29 2684 topology 2762 3537
-> 15 0 29 2684 topology 2688 3538
-> 16 0 29 2684 topology 2689 3538
-> 15 0 29 2684 topology 2709 3539
-> 16 0 29 2684 topology 2711 3539
-> 15 0 29 2684 topology 2763 3540
-> 16 0 29 2684 topology 2765 3540
-> 15 0 29 2684 topology 2718 3541
-> 16 0 29 2684 topology 2719 3541
-> 15 0 28 2684 topology 2693 3542
+> 15 0 28 2684 topology 2717 3530
+> 16 0 28 2684 topology 2794 3530
+> 15 0 28 2684 topology 2716 3531
+> 16 0 28 2684 topology 2794 3531
+> 15 0 28 2684 topology 2720 3532
+> 16 0 28 2684 topology 2794 3532
+> 15 0 28 2684 topology 2719 3533
+> 16 0 28 2684 topology 2794 3533
+> 15 0 28 2684 topology 2723 3534
+> 16 0 28 2684 topology 2794 3534
+> 15 0 28 2684 topology 2722 3535
+> 16 0 28 2684 topology 2794 3535
+> 15 0 28 2684 topology 2726 3536
+> 16 0 28 2684 topology 2794 3536
+> 15 0 28 2684 topology 2725 3537
+> 16 0 28 2684 topology 2794 3537
+> 15 0 28 2684 topology 2729 3538
+> 16 0 28 2684 topology 2794 3538
+> 15 0 28 2684 topology 2728 3539
+> 16 0 28 2684 topology 2794 3539
+> 15 0 28 2684 topology 2732 3540
+> 16 0 28 2684 topology 2794 3540
+> 15 0 28 2684 topology 2731 3541
+> 16 0 28 2684 topology 2794 3541
+> 15 0 28 2684 topology 2735 3542
 > 16 0 28 2684 topology 2794 3542
-> 15 0 29 2684 topology 2712 3543
-> 16 0 29 2684 topology 2714 3543
-> 15 0 29 2684 topology 2766 3544
-> 16 0 29 2684 topology 2768 3544
-> 15 0 29 2684 topology 2694 3545
-> 16 0 29 2684 topology 2695 3545
-> 15 0 29 2684 topology 2748 3546
-> 16 0 29 2684 topology 2749 3546
-> 15 0 29 2684 topology 2715 3547
-> 16 0 29 2684 topology 2717 3547
-> 15 0 28 2684 topology 2753 3548
+> 15 0 28 2684 topology 2734 3543
+> 16 0 28 2684 topology 2794 3543
+> 15 0 28 2684 topology 2738 3544
+> 16 0 28 2684 topology 2794 3544
+> 15 0 28 2684 topology 2737 3545
+> 16 0 28 2684 topology 2794 3545
+> 15 0 28 2684 topology 2741 3546
+> 16 0 28 2684 topology 2794 3546
+> 15 0 28 2684 topology 2740 3547
+> 16 0 28 2684 topology 2794 3547
+> 15 0 28 2684 topology 2744 3548
 > 16 0 28 2684 topology 2794 3548
-> 15 0 29 2684 topology 2769 3549
-> 16 0 29 2684 topology 2771 3549
-> 15 0 29 2684 topology 2724 3550
-> 16 0 29 2684 topology 2725 3550
-> 15 0 28 2684 topology 2729 3551
+> 15 0 28 2684 topology 2743 3549
+> 16 0 28 2684 topology 2794 3549
+> 15 0 28 2684 topology 2747 3550
+> 16 0 28 2684 topology 2794 3550
+> 15 0 28 2684 topology 2746 3551
 > 16 0 28 2684 topology 2794 3551
-> 15 0 29 2684 topology 2778 3552
-> 16 0 29 2684 topology 2779 3552
-> 15 0 28 2684 topology 2705 3553
+> 15 0 28 2684 topology 2750 3552
+> 16 0 28 2684 topology 2794 3552
+> 15 0 28 2684 topology 2749 3553
 > 16 0 28 2684 topology 2794 3553
-> 15 0 29 2684 topology 2772 3554
-> 16 0 29 2684 topology 2774 3554
-> 15 0 29 2684 topology 2700 3555
-> 16 0 29 2684 topology 2701 3555
-> 15 0 29 2684 topology 2754 3556
-> 16 0 29 2684 topology 2755 3556
-> 15 0 28 2684 topology 2789 3557
+> 15 0 28 2684 topology 2753 3554
+> 16 0 28 2684 topology 2794 3554
+> 15 0 28 2684 topology 2752 3555
+> 16 0 28 2684 topology 2794 3555
+> 15 0 28 2684 topology 2756 3556
+> 16 0 28 2684 topology 2794 3556
+> 15 0 28 2684 topology 2755 3557
 > 16 0 28 2684 topology 2794 3557
-> 15 0 28 2684 topology 2765 3558
+> 15 0 28 2684 topology 2759 3558
 > 16 0 28 2684 topology 2794 3558
-> 15 0 29 2684 topology 2775 3559
-> 16 0 29 2684 topology 2777 3559
-> 15 0 29 2684 topology 2730 3560
-> 16 0 29 2684 topology 2731 3560
-> 15 0 28 2684 topology 2741 3561
+> 15 0 28 2684 topology 2758 3559
+> 16 0 28 2684 topology 2794 3559
+> 15 0 28 2684 topology 2762 3560
+> 16 0 28 2684 topology 2794 3560
+> 15 0 28 2684 topology 2761 3561
 > 16 0 28 2684 topology 2794 3561
-> 15 0 29 2684 topology 2784 3562
-> 16 0 29 2684 topology 2785 3562
-> 15 0 28 2684 topology 2717 3563
+> 15 0 28 2684 topology 2765 3562
+> 16 0 28 2684 topology 2794 3562
+> 15 0 28 2684 topology 2764 3563
 > 16 0 28 2684 topology 2794 3563
-> 15 0 29 2684 topology 2706 3564
-> 16 0 29 2684 topology 2707 3564
-> 15 0 29 2684 topology 2760 3565
-> 16 0 29 2684 topology 2761 3565
-> 15 0 28 2684 topology 2777 3566
+> 15 0 28 2684 topology 2768 3564
+> 16 0 28 2684 topology 2794 3564
+> 15 0 28 2684 topology 2767 3565
+> 16 0 28 2684 topology 2794 3565
+> 15 0 28 2684 topology 2771 3566
 > 16 0 28 2684 topology 2794 3566
-> 15 0 29 2684 topology 2736 3567
-> 16 0 29 2684 topology 2737 3567
-> 15 0 29 2684 topology 2790 3568
-> 16 0 29 2684 topology 2791 3568
-> 15 0 29 2684 topology 2712 3569
-> 16 0 29 2684 topology 2713 3569
-> 15 0 29 2684 topology 2766 3570
-> 16 0 29 2684 topology 2767 3570
-> 15 0 28 2684 topology 2695 3571
+> 15 0 28 2684 topology 2770 3567
+> 16 0 28 2684 topology 2794 3567
+> 15 0 28 2684 topology 2774 3568
+> 16 0 28 2684 topology 2794 3568
+> 15 0 28 2684 topology 2773 3569
+> 16 0 28 2684 topology 2794 3569
+> 15 0 28 2684 topology 2777 3570
+> 16 0 28 2684 topology 2794 3570
+> 15 0 28 2684 topology 2776 3571
 > 16 0 28 2684 topology 2794 3571
-> 15 0 28 2684 topology 2725 3572
+> 15 0 28 2684 topology 2780 3572
 > 16 0 28 2684 topology 2794 3572
-> 15 0 29 2684 topology 2742 3573
-> 16 0 29 2684 topology 2743 3573
-> 15 0 28 2684 topology 2755 3574
+> 15 0 28 2684 topology 2779 3573
+> 16 0 28 2684 topology 2794 3573
+> 15 0 28 2684 topology 2783 3574
 > 16 0 28 2684 topology 2794 3574
-> 15 0 29 2684 topology 2772 3575
-> 16 0 29 2684 topology 2773 3575
-> 15 0 28 2684 topology 2785 3576
+> 15 0 28 2684 topology 2782 3575
+> 16 0 28 2684 topology 2794 3575
+> 15 0 28 2684 topology 2786 3576
 > 16 0 28 2684 topology 2794 3576
-> 15 0 28 2684 topology 2707 3577
+> 15 0 28 2684 topology 2785 3577
 > 16 0 28 2684 topology 2794 3577
-> 15 0 28 2684 topology 2737 3578
+> 15 0 28 2684 topology 2789 3578
 > 16 0 28 2684 topology 2794 3578
-> 15 0 28 2684 topology 2767 3579
+> 15 0 28 2684 topology 2788 3579
 > 16 0 28 2684 topology 2794 3579
-> 15 0 28 2684 topology 2720 3580
+> 15 0 28 2684 topology 2792 3580
 > 16 0 28 2684 topology 2794 3580
-> 15 0 28 2684 topology 2696 3581
+> 15 0 28 2684 topology 2791 3581
 > 16 0 28 2684 topology 2794 3581
-> 15 0 28 2684 topology 2780 3582
-> 16 0 28 2684 topology 2794 3582
-> 15 0 28 2684 topology 2756 3583
-> 16 0 28 2684 topology 2794 3583
-> 15 0 28 2684 topology 2732 3584
-> 16 0 28 2684 topology 2794 3584
-> 15 0 28 2684 topology 2708 3585
-> 16 0 28 2684 topology 2794 3585
-> 15 0 28 2684 topology 2792 3586
-> 16 0 28 2684 topology 2794 3586
-> 15 0 28 2684 topology 2768 3587
-> 16 0 28 2684 topology 2794 3587
-> 15 0 28 2684 topology 2744 3588
-> 16 0 28 2684 topology 2794 3588
-> 15 0 28 2684 topology 2692 3589
-> 16 0 28 2684 topology 2794 3589
-> 15 0 28 2684 topology 2722 3590
-> 16 0 28 2684 topology 2794 3590
-> 15 0 28 2684 topology 2752 3591
-> 16 0 28 2684 topology 2794 3591
-> 15 0 28 2684 topology 2782 3592
-> 16 0 28 2684 topology 2794 3592
-> 15 0 28 2684 topology 2704 3593
-> 16 0 28 2684 topology 2794 3593
-> 15 0 29 2684 topology 2718 3594
-> 16 0 29 2684 topology 2720 3594
-> 15 0 28 2684 topology 2734 3595
-> 16 0 28 2684 topology 2794 3595
-> 15 0 28 2684 topology 2764 3596
-> 16 0 28 2684 topology 2794 3596
-> 15 0 28 2684 topology 2686 3597
-> 16 0 28 2684 topology 2794 3597
-> 15 0 29 2684 topology 2721 3598
-> 16 0 29 2684 topology 2723 3598
-> 15 0 28 2684 topology 2716 3599
-> 16 0 28 2684 topology 2794 3599
-> 15 0 29 2684 topology 2724 3600
-> 16 0 29 2684 topology 2726 3600
-> 15 0 28 2684 topology 2746 3601
-> 16 0 28 2684 topology 2794 3601
-> 15 0 29 2684 topology 2778 3602
-> 16 0 29 2684 topology 2780 3602
-> 15 0 28 2684 topology 2776 3603
-> 16 0 28 2684 topology 2794 3603
-> 15 0 29 2684 topology 2727 3604
-> 16 0 29 2684 topology 2729 3604
-> 15 0 29 2684 topology 2781 3605
-> 16 0 29 2684 topology 2783 3605
-> 15 0 29 2684 topology 2730 3606
-> 16 0 29 2684 topology 2732 3606
-> 15 0 29 2684 topology 2784 3607
-> 16 0 29 2684 topology 2786 3607
-> 15 0 29 2684 topology 2733 3608
-> 16 0 29 2684 topology 2735 3608
-> 15 0 29 2684 topology 2787 3609
-> 16 0 29 2684 topology 2789 3609
-> 15 0 29 2684 topology 2736 3610
-> 16 0 29 2684 topology 2738 3610
-> 15 0 29 2684 topology 2790 3611
-> 16 0 29 2684 topology 2792 3611
-> 15 0 29 2684 topology 2691 3612
-> 16 0 29 2684 topology 2692 3612
-> 15 0 29 2684 topology 2685 3613
-> 16 0 29 2684 topology 2687 3613
-> 15 0 29 2684 topology 2739 3614
-> 16 0 29 2684 topology 2741 3614
-> 15 0 29 2684 topology 2721 3615
-> 16 0 29 2684 topology 2722 3615
-> 15 0 28 2684 topology 2723 3616
-> 16 0 28 2684 topology 2794 3616
-> 15 0 28 2684 topology 2699 3617
-> 16 0 28 2684 topology 2794 3617
-> 15 0 29 2684 topology 2742 3618
-> 16 0 29 2684 topology 2744 3618
-> 15 0 29 2684 topology 2697 3619
-> 16 0 29 2684 topology 2698 3619
-> 15 0 29 2684 topology 2751 3620
-> 16 0 29 2684 topology 2752 3620
-> 15 0 28 2684 topology 2783 3621
-> 16 0 28 2684 topology 2794 3621
-> 15 0 29 2684 topology 2745 3622
-> 16 0 29 2684 topology 2747 3622
-> 15 0 28 2684 topology 2759 3623
-> 16 0 28 2684 topology 2794 3623
-> 15 0 29 2684 topology 2727 3624
-> 16 0 29 2684 topology 2728 3624
-> 15 0 28 2684 topology 2735 3625
-> 16 0 28 2684 topology 2794 3625
-> 15 0 29 2684 topology 2781 3626
-> 16 0 29 2684 topology 2782 3626
-> 15 0 28 2684 topology 2711 3627
-> 16 0 28 2684 topology 2794 3627
-> 15 0 28 2684 topology 2687 3628
-> 16 0 28 2684 topology 2794 3628
-> 15 0 29 2684 topology 2703 3629
-> 16 0 29 2684 topology 2704 3629
-> 15 0 29 2684 topology 2757 3630
-> 16 0 29 2684 topology 2758 3630
-> 15 0 28 2684 topology 2771 3631
-> 16 0 28 2684 topology 2794 3631
-> 15 0 29 2684 topology 2733 3632
-> 16 0 29 2684 topology 2734 3632
-> 15 0 28 2684 topology 2747 3633
-> 16 0 28 2684 topology 2794 3633
-> 15 0 29 2684 topology 2787 3634
-> 16 0 29 2684 topology 2788 3634
-> 15 0 29 2684 topology 2709 3635
-> 16 0 29 2684 topology 2710 3635
-> 15 0 29 2684 topology 2763 3636
-> 16 0 29 2684 topology 2764 3636
-> 15 0 28 2684 topology 2689 3637
-> 16 0 28 2684 topology 2794 3637
-> 15 0 29 2684 topology 2685 3638
-> 16 0 29 2684 topology 2686 3638
-> 15 0 28 2684 topology 2719 3639
-> 16 0 28 2684 topology 2794 3639
-> 15 0 29 2684 topology 2739 3640
-> 16 0 29 2684 topology 2740 3640
-> 15 0 28 2684 topology 2749 3641
-> 16 0 28 2684 topology 2794 3641
-> 15 0 29 2684 topology 2715 3642
-> 16 0 29 2684 topology 2716 3642
-> 15 0 29 2684 topology 2769 3643
-> 16 0 29 2684 topology 2770 3643
-> 15 0 28 2684 topology 2779 3644
-> 16 0 28 2684 topology 2794 3644
-> 15 0 28 2684 topology 2701 3645
-> 16 0 28 2684 topology 2794 3645
-> 15 0 28 2684 topology 2731 3646
-> 16 0 28 2684 topology 2794 3646
-> 15 0 29 2684 topology 2745 3647
-> 16 0 29 2684 topology 2746 3647
-> 15 0 28 2684 topology 2761 3648
-> 16 0 28 2684 topology 2794 3648
-> 15 0 29 2684 topology 2775 3649
-> 16 0 29 2684 topology 2776 3649
-> 15 0 28 2684 topology 2791 3650
-> 16 0 28 2684 topology 2794 3650
-> 15 0 28 2684 topology 2713 3651
-> 16 0 28 2684 topology 2794 3651
-> 15 0 28 2684 topology 2743 3652
-> 16 0 28 2684 topology 2794 3652
-> 15 0 28 2684 topology 2773 3653
-> 16 0 28 2684 topology 2794 3653
-> 15 0 28 2684 topology 2690 3654
-> 16 0 28 2684 topology 2794 3654
-> 15 0 29 2795 topology 2796 3655
-> 16 0 29 2795 topology 2798 3655
-> 15 0 29 2795 topology 2850 3656
-> 16 0 29 2795 topology 2852 3656
-> 15 0 29 2795 topology 2799 3657
-> 16 0 29 2795 topology 2801 3657
-> 15 0 29 2795 topology 2853 3658
-> 16 0 29 2795 topology 2855 3658
-> 15 0 29 2795 topology 2802 3659
-> 16 0 29 2795 topology 2804 3659
-> 15 0 29 2795 topology 2856 3660
-> 16 0 29 2795 topology 2858 3660
-> 15 0 29 2795 topology 2811 3661
-> 16 0 29 2795 topology 2812 3661
-> 15 0 28 2795 topology 2816 3662
+> 15 0 29 2684 topology 2793 3582
+> 16 0 29 2684 topology 2794 3582
+> 15 0 30 2684 topology 2685 3583
+> 16 0 30 2684 topology 2687 3583
+> 15 0 30 2684 topology 2685 3584
+> 16 0 30 2684 topology 2686 3584
+> 15 0 30 2684 topology 2688 3585
+> 16 0 30 2684 topology 2690 3585
+> 15 0 30 2684 topology 2688 3586
+> 16 0 30 2684 topology 2689 3586
+> 15 0 30 2684 topology 2691 3587
+> 16 0 30 2684 topology 2693 3587
+> 15 0 30 2684 topology 2691 3588
+> 16 0 30 2684 topology 2692 3588
+> 15 0 30 2684 topology 2694 3589
+> 16 0 30 2684 topology 2696 3589
+> 15 0 30 2684 topology 2694 3590
+> 16 0 30 2684 topology 2695 3590
+> 15 0 30 2684 topology 2697 3591
+> 16 0 30 2684 topology 2699 3591
+> 15 0 30 2684 topology 2697 3592
+> 16 0 30 2684 topology 2698 3592
+> 15 0 30 2684 topology 2700 3593
+> 16 0 30 2684 topology 2702 3593
+> 15 0 30 2684 topology 2700 3594
+> 16 0 30 2684 topology 2701 3594
+> 15 0 30 2684 topology 2703 3595
+> 16 0 30 2684 topology 2705 3595
+> 15 0 30 2684 topology 2703 3596
+> 16 0 30 2684 topology 2704 3596
+> 15 0 30 2684 topology 2706 3597
+> 16 0 30 2684 topology 2708 3597
+> 15 0 30 2684 topology 2706 3598
+> 16 0 30 2684 topology 2707 3598
+> 15 0 30 2684 topology 2709 3599
+> 16 0 30 2684 topology 2711 3599
+> 15 0 30 2684 topology 2709 3600
+> 16 0 30 2684 topology 2710 3600
+> 15 0 30 2684 topology 2712 3601
+> 16 0 30 2684 topology 2714 3601
+> 15 0 30 2684 topology 2712 3602
+> 16 0 30 2684 topology 2713 3602
+> 15 0 30 2684 topology 2715 3603
+> 16 0 30 2684 topology 2717 3603
+> 15 0 30 2684 topology 2715 3604
+> 16 0 30 2684 topology 2716 3604
+> 15 0 30 2684 topology 2718 3605
+> 16 0 30 2684 topology 2720 3605
+> 15 0 30 2684 topology 2718 3606
+> 16 0 30 2684 topology 2719 3606
+> 15 0 30 2684 topology 2721 3607
+> 16 0 30 2684 topology 2723 3607
+> 15 0 30 2684 topology 2721 3608
+> 16 0 30 2684 topology 2722 3608
+> 15 0 30 2684 topology 2724 3609
+> 16 0 30 2684 topology 2726 3609
+> 15 0 30 2684 topology 2724 3610
+> 16 0 30 2684 topology 2725 3610
+> 15 0 30 2684 topology 2727 3611
+> 16 0 30 2684 topology 2729 3611
+> 15 0 30 2684 topology 2727 3612
+> 16 0 30 2684 topology 2728 3612
+> 15 0 30 2684 topology 2730 3613
+> 16 0 30 2684 topology 2732 3613
+> 15 0 30 2684 topology 2730 3614
+> 16 0 30 2684 topology 2731 3614
+> 15 0 30 2684 topology 2733 3615
+> 16 0 30 2684 topology 2735 3615
+> 15 0 30 2684 topology 2733 3616
+> 16 0 30 2684 topology 2734 3616
+> 15 0 30 2684 topology 2736 3617
+> 16 0 30 2684 topology 2738 3617
+> 15 0 30 2684 topology 2736 3618
+> 16 0 30 2684 topology 2737 3618
+> 15 0 30 2684 topology 2739 3619
+> 16 0 30 2684 topology 2741 3619
+> 15 0 30 2684 topology 2739 3620
+> 16 0 30 2684 topology 2740 3620
+> 15 0 30 2684 topology 2742 3621
+> 16 0 30 2684 topology 2744 3621
+> 15 0 30 2684 topology 2742 3622
+> 16 0 30 2684 topology 2743 3622
+> 15 0 30 2684 topology 2745 3623
+> 16 0 30 2684 topology 2747 3623
+> 15 0 30 2684 topology 2745 3624
+> 16 0 30 2684 topology 2746 3624
+> 15 0 30 2684 topology 2748 3625
+> 16 0 30 2684 topology 2750 3625
+> 15 0 30 2684 topology 2748 3626
+> 16 0 30 2684 topology 2749 3626
+> 15 0 30 2684 topology 2751 3627
+> 16 0 30 2684 topology 2753 3627
+> 15 0 30 2684 topology 2751 3628
+> 16 0 30 2684 topology 2752 3628
+> 15 0 30 2684 topology 2754 3629
+> 16 0 30 2684 topology 2756 3629
+> 15 0 30 2684 topology 2754 3630
+> 16 0 30 2684 topology 2755 3630
+> 15 0 30 2684 topology 2757 3631
+> 16 0 30 2684 topology 2759 3631
+> 15 0 30 2684 topology 2757 3632
+> 16 0 30 2684 topology 2758 3632
+> 15 0 30 2684 topology 2760 3633
+> 16 0 30 2684 topology 2762 3633
+> 15 0 30 2684 topology 2760 3634
+> 16 0 30 2684 topology 2761 3634
+> 15 0 30 2684 topology 2763 3635
+> 16 0 30 2684 topology 2765 3635
+> 15 0 30 2684 topology 2763 3636
+> 16 0 30 2684 topology 2764 3636
+> 15 0 30 2684 topology 2766 3637
+> 16 0 30 2684 topology 2768 3637
+> 15 0 30 2684 topology 2766 3638
+> 16 0 30 2684 topology 2767 3638
+> 15 0 30 2684 topology 2769 3639
+> 16 0 30 2684 topology 2771 3639
+> 15 0 30 2684 topology 2769 3640
+> 16 0 30 2684 topology 2770 3640
+> 15 0 30 2684 topology 2772 3641
+> 16 0 30 2684 topology 2774 3641
+> 15 0 30 2684 topology 2772 3642
+> 16 0 30 2684 topology 2773 3642
+> 15 0 30 2684 topology 2775 3643
+> 16 0 30 2684 topology 2777 3643
+> 15 0 30 2684 topology 2775 3644
+> 16 0 30 2684 topology 2776 3644
+> 15 0 30 2684 topology 2778 3645
+> 16 0 30 2684 topology 2780 3645
+> 15 0 30 2684 topology 2778 3646
+> 16 0 30 2684 topology 2779 3646
+> 15 0 30 2684 topology 2781 3647
+> 16 0 30 2684 topology 2783 3647
+> 15 0 30 2684 topology 2781 3648
+> 16 0 30 2684 topology 2782 3648
+> 15 0 30 2684 topology 2784 3649
+> 16 0 30 2684 topology 2786 3649
+> 15 0 30 2684 topology 2784 3650
+> 16 0 30 2684 topology 2785 3650
+> 15 0 30 2684 topology 2787 3651
+> 16 0 30 2684 topology 2789 3651
+> 15 0 30 2684 topology 2787 3652
+> 16 0 30 2684 topology 2788 3652
+> 15 0 30 2684 topology 2790 3653
+> 16 0 30 2684 topology 2792 3653
+> 15 0 30 2684 topology 2790 3654
+> 16 0 30 2684 topology 2791 3654
+> 15 0 28 2795 topology 2798 3655
+> 16 0 28 2795 topology 2905 3655
+> 15 0 28 2795 topology 2797 3656
+> 16 0 28 2795 topology 2905 3656
+> 15 0 28 2795 topology 2801 3657
+> 16 0 28 2795 topology 2905 3657
+> 15 0 28 2795 topology 2800 3658
+> 16 0 28 2795 topology 2905 3658
+> 15 0 28 2795 topology 2804 3659
+> 16 0 28 2795 topology 2905 3659
+> 15 0 28 2795 topology 2803 3660
+> 16 0 28 2795 topology 2905 3660
+> 15 0 28 2795 topology 2807 3661
+> 16 0 28 2795 topology 2905 3661
+> 15 0 28 2795 topology 2806 3662
 > 16 0 28 2795 topology 2905 3662
-> 15 0 29 2795 topology 2805 3663
-> 16 0 29 2795 topology 2807 3663
-> 15 0 29 2795 topology 2859 3664
-> 16 0 29 2795 topology 2861 3664
-> 15 0 29 2795 topology 2841 3665
-> 16 0 29 2795 topology 2842 3665
-> 15 0 28 2795 topology 2876 3666
+> 15 0 28 2795 topology 2810 3663
+> 16 0 28 2795 topology 2905 3663
+> 15 0 28 2795 topology 2809 3664
+> 16 0 28 2795 topology 2905 3664
+> 15 0 28 2795 topology 2813 3665
+> 16 0 28 2795 topology 2905 3665
+> 15 0 28 2795 topology 2812 3666
 > 16 0 28 2795 topology 2905 3666
-> 15 0 29 2795 topology 2808 3667
-> 16 0 29 2795 topology 2810 3667
-> 15 0 28 2795 topology 2852 3668
+> 15 0 28 2795 topology 2816 3667
+> 16 0 28 2795 topology 2905 3667
+> 15 0 28 2795 topology 2815 3668
 > 16 0 28 2795 topology 2905 3668
-> 15 0 29 2795 topology 2862 3669
-> 16 0 29 2795 topology 2864 3669
-> 15 0 29 2795 topology 2817 3670
-> 16 0 29 2795 topology 2818 3670
-> 15 0 28 2795 topology 2828 3671
+> 15 0 28 2795 topology 2819 3669
+> 16 0 28 2795 topology 2905 3669
+> 15 0 28 2795 topology 2818 3670
+> 16 0 28 2795 topology 2905 3670
+> 15 0 28 2795 topology 2822 3671
 > 16 0 28 2795 topology 2905 3671
-> 15 0 29 2795 topology 2871 3672
-> 16 0 29 2795 topology 2872 3672
-> 15 0 28 2795 topology 2804 3673
+> 15 0 28 2795 topology 2821 3672
+> 16 0 28 2795 topology 2905 3672
+> 15 0 28 2795 topology 2825 3673
 > 16 0 28 2795 topology 2905 3673
-> 15 0 29 2795 topology 2865 3674
-> 16 0 29 2795 topology 2867 3674
-> 15 0 29 2795 topology 2847 3675
-> 16 0 29 2795 topology 2848 3675
-> 15 0 28 2795 topology 2888 3676
+> 15 0 28 2795 topology 2824 3674
+> 16 0 28 2795 topology 2905 3674
+> 15 0 28 2795 topology 2828 3675
+> 16 0 28 2795 topology 2905 3675
+> 15 0 28 2795 topology 2827 3676
 > 16 0 28 2795 topology 2905 3676
-> 15 0 29 2795 topology 2901 3677
-> 16 0 29 2795 topology 2902 3677
-> 15 0 28 2795 topology 2864 3678
+> 15 0 28 2795 topology 2831 3677
+> 16 0 28 2795 topology 2905 3677
+> 15 0 28 2795 topology 2830 3678
 > 16 0 28 2795 topology 2905 3678
-> 15 0 29 2795 topology 2868 3679
-> 16 0 29 2795 topology 2870 3679
-> 15 0 29 2795 topology 2823 3680
-> 16 0 29 2795 topology 2824 3680
-> 15 0 28 2795 topology 2840 3681
+> 15 0 28 2795 topology 2834 3679
+> 16 0 28 2795 topology 2905 3679
+> 15 0 28 2795 topology 2833 3680
+> 16 0 28 2795 topology 2905 3680
+> 15 0 28 2795 topology 2837 3681
 > 16 0 28 2795 topology 2905 3681
-> 15 0 29 2795 topology 2877 3682
-> 16 0 29 2795 topology 2878 3682
-> 15 0 29 2795 topology 2799 3683
-> 16 0 29 2795 topology 2800 3683
-> 15 0 29 2795 topology 2853 3684
-> 16 0 29 2795 topology 2854 3684
-> 15 0 28 2795 topology 2900 3685
+> 15 0 28 2795 topology 2836 3682
+> 16 0 28 2795 topology 2905 3682
+> 15 0 28 2795 topology 2840 3683
+> 16 0 28 2795 topology 2905 3683
+> 15 0 28 2795 topology 2839 3684
+> 16 0 28 2795 topology 2905 3684
+> 15 0 28 2795 topology 2843 3685
 > 16 0 28 2795 topology 2905 3685
-> 15 0 29 2795 topology 2829 3686
-> 16 0 29 2795 topology 2830 3686
-> 15 0 29 2795 topology 2883 3687
-> 16 0 29 2795 topology 2884 3687
-> 15 0 29 2795 topology 2805 3688
-> 16 0 29 2795 topology 2806 3688
-> 15 0 28 2795 topology 2818 3689
+> 15 0 28 2795 topology 2842 3686
+> 16 0 28 2795 topology 2905 3686
+> 15 0 28 2795 topology 2846 3687
+> 16 0 28 2795 topology 2905 3687
+> 15 0 28 2795 topology 2845 3688
+> 16 0 28 2795 topology 2905 3688
+> 15 0 28 2795 topology 2849 3689
 > 16 0 28 2795 topology 2905 3689
-> 15 0 29 2795 topology 2859 3690
-> 16 0 29 2795 topology 2860 3690
-> 15 0 28 2795 topology 2848 3691
+> 15 0 28 2795 topology 2848 3690
+> 16 0 28 2795 topology 2905 3690
+> 15 0 28 2795 topology 2852 3691
 > 16 0 28 2795 topology 2905 3691
-> 15 0 29 2795 topology 2835 3692
-> 16 0 29 2795 topology 2836 3692
-> 15 0 28 2795 topology 2878 3693
+> 15 0 28 2795 topology 2851 3692
+> 16 0 28 2795 topology 2905 3692
+> 15 0 28 2795 topology 2855 3693
 > 16 0 28 2795 topology 2905 3693
-> 15 0 29 2795 topology 2889 3694
-> 16 0 29 2795 topology 2890 3694
-> 15 0 28 2795 topology 2800 3695
+> 15 0 28 2795 topology 2854 3694
+> 16 0 28 2795 topology 2905 3694
+> 15 0 28 2795 topology 2858 3695
 > 16 0 28 2795 topology 2905 3695
-> 15 0 28 2795 topology 2830 3696
+> 15 0 28 2795 topology 2857 3696
 > 16 0 28 2795 topology 2905 3696
-> 15 0 29 2795 topology 2865 3697
-> 16 0 29 2795 topology 2866 3697
+> 15 0 28 2795 topology 2861 3697
+> 16 0 28 2795 topology 2905 3697
 > 15 0 28 2795 topology 2860 3698
 > 16 0 28 2795 topology 2905 3698
-> 15 0 28 2795 topology 2890 3699
+> 15 0 28 2795 topology 2864 3699
 > 16 0 28 2795 topology 2905 3699
-> 15 0 29 2795 topology 2895 3700
-> 16 0 29 2795 topology 2896 3700
-> 15 0 28 2795 topology 2843 3701
+> 15 0 28 2795 topology 2863 3700
+> 16 0 28 2795 topology 2905 3700
+> 15 0 28 2795 topology 2867 3701
 > 16 0 28 2795 topology 2905 3701
-> 15 0 28 2795 topology 2819 3702
+> 15 0 28 2795 topology 2866 3702
 > 16 0 28 2795 topology 2905 3702
-> 15 0 28 2795 topology 2903 3703
+> 15 0 28 2795 topology 2870 3703
 > 16 0 28 2795 topology 2905 3703
-> 15 0 28 2795 topology 2879 3704
+> 15 0 28 2795 topology 2869 3704
 > 16 0 28 2795 topology 2905 3704
-> 15 0 28 2795 topology 2855 3705
+> 15 0 28 2795 topology 2873 3705
 > 16 0 28 2795 topology 2905 3705
-> 15 0 28 2795 topology 2831 3706
+> 15 0 28 2795 topology 2872 3706
 > 16 0 28 2795 topology 2905 3706
-> 15 0 28 2795 topology 2807 3707
+> 15 0 28 2795 topology 2876 3707
 > 16 0 28 2795 topology 2905 3707
-> 15 0 28 2795 topology 2891 3708
+> 15 0 28 2795 topology 2875 3708
 > 16 0 28 2795 topology 2905 3708
-> 15 0 28 2795 topology 2867 3709
+> 15 0 28 2795 topology 2879 3709
 > 16 0 28 2795 topology 2905 3709
-> 15 0 28 2795 topology 2815 3710
+> 15 0 28 2795 topology 2878 3710
 > 16 0 28 2795 topology 2905 3710
-> 15 0 28 2795 topology 2845 3711
+> 15 0 28 2795 topology 2882 3711
 > 16 0 28 2795 topology 2905 3711
-> 15 0 28 2795 topology 2875 3712
+> 15 0 28 2795 topology 2881 3712
 > 16 0 28 2795 topology 2905 3712
-> 15 0 28 2795 topology 2797 3713
+> 15 0 28 2795 topology 2885 3713
 > 16 0 28 2795 topology 2905 3713
-> 15 0 30 2795 topology 2904 3714
-> 16 0 30 2795 topology 2905 3714
-> 15 0 28 2795 topology 2827 3715
+> 15 0 28 2795 topology 2884 3714
+> 16 0 28 2795 topology 2905 3714
+> 15 0 28 2795 topology 2888 3715
 > 16 0 28 2795 topology 2905 3715
-> 15 0 28 2795 topology 2857 3716
+> 15 0 28 2795 topology 2887 3716
 > 16 0 28 2795 topology 2905 3716
-> 15 0 29 2795 topology 2811 3717
-> 16 0 29 2795 topology 2813 3717
-> 15 0 28 2795 topology 2887 3718
+> 15 0 28 2795 topology 2891 3717
+> 16 0 28 2795 topology 2905 3717
+> 15 0 28 2795 topology 2890 3718
 > 16 0 28 2795 topology 2905 3718
-> 15 0 28 2795 topology 2809 3719
+> 15 0 28 2795 topology 2894 3719
 > 16 0 28 2795 topology 2905 3719
-> 15 0 29 2795 topology 2814 3720
-> 16 0 29 2795 topology 2816 3720
-> 15 0 28 2795 topology 2839 3721
+> 15 0 28 2795 topology 2893 3720
+> 16 0 28 2795 topology 2905 3720
+> 15 0 28 2795 topology 2897 3721
 > 16 0 28 2795 topology 2905 3721
-> 15 0 28 2795 topology 2869 3722
+> 15 0 28 2795 topology 2896 3722
 > 16 0 28 2795 topology 2905 3722
-> 15 0 29 2795 topology 2817 3723
-> 16 0 29 2795 topology 2819 3723
-> 15 0 29 2795 topology 2871 3724
-> 16 0 29 2795 topology 2873 3724
-> 15 0 28 2795 topology 2899 3725
+> 15 0 28 2795 topology 2900 3723
+> 16 0 28 2795 topology 2905 3723
+> 15 0 28 2795 topology 2899 3724
+> 16 0 28 2795 topology 2905 3724
+> 15 0 28 2795 topology 2903 3725
 > 16 0 28 2795 topology 2905 3725
-> 15 0 29 2795 topology 2820 3726
-> 16 0 29 2795 topology 2822 3726
-> 15 0 29 2795 topology 2874 3727
-> 16 0 29 2795 topology 2876 3727
-> 15 0 29 2795 topology 2823 3728
-> 16 0 29 2795 topology 2825 3728
-> 15 0 29 2795 topology 2877 3729
-> 16 0 29 2795 topology 2879 3729
-> 15 0 29 2795 topology 2826 3730
-> 16 0 29 2795 topology 2828 3730
-> 15 0 29 2795 topology 2880 3731
-> 16 0 29 2795 topology 2882 3731
-> 15 0 29 2795 topology 2829 3732
-> 16 0 29 2795 topology 2831 3732
-> 15 0 29 2795 topology 2883 3733
-> 16 0 29 2795 topology 2885 3733
-> 15 0 29 2795 topology 2832 3734
-> 16 0 29 2795 topology 2834 3734
-> 15 0 28 2795 topology 2846 3735
-> 16 0 28 2795 topology 2905 3735
-> 15 0 29 2795 topology 2886 3736
-> 16 0 29 2795 topology 2888 3736
-> 15 0 29 2795 topology 2814 3737
-> 16 0 29 2795 topology 2815 3737
-> 15 0 28 2795 topology 2822 3738
-> 16 0 28 2795 topology 2905 3738
-> 15 0 28 2795 topology 2798 3739
-> 16 0 28 2795 topology 2905 3739
-> 15 0 29 2795 topology 2835 3740
-> 16 0 29 2795 topology 2837 3740
-> 15 0 29 2795 topology 2889 3741
-> 16 0 29 2795 topology 2891 3741
-> 15 0 29 2795 topology 2844 3742
-> 16 0 29 2795 topology 2845 3742
-> 15 0 28 2795 topology 2882 3743
-> 16 0 28 2795 topology 2905 3743
-> 15 0 29 2795 topology 2838 3744
-> 16 0 29 2795 topology 2840 3744
-> 15 0 28 2795 topology 2858 3745
-> 16 0 28 2795 topology 2905 3745
-> 15 0 29 2795 topology 2892 3746
-> 16 0 29 2795 topology 2894 3746
-> 15 0 29 2795 topology 2820 3747
-> 16 0 29 2795 topology 2821 3747
-> 15 0 28 2795 topology 2834 3748
-> 16 0 28 2795 topology 2905 3748
-> 15 0 29 2795 topology 2874 3749
-> 16 0 29 2795 topology 2875 3749
-> 15 0 28 2795 topology 2810 3750
-> 16 0 28 2795 topology 2905 3750
-> 15 0 29 2795 topology 2895 3751
-> 16 0 29 2795 topology 2897 3751
-> 15 0 29 2795 topology 2796 3752
-> 16 0 29 2795 topology 2797 3752
-> 15 0 29 2795 topology 2850 3753
-> 16 0 29 2795 topology 2851 3753
-> 15 0 28 2795 topology 2894 3754
-> 16 0 28 2795 topology 2905 3754
-> 15 0 28 2795 topology 2870 3755
-> 16 0 28 2795 topology 2905 3755
-> 15 0 29 2795 topology 2898 3756
-> 16 0 29 2795 topology 2900 3756
-> 15 0 29 2795 topology 2826 3757
-> 16 0 29 2795 topology 2827 3757
-> 15 0 29 2795 topology 2880 3758
-> 16 0 29 2795 topology 2881 3758
-> 15 0 29 2795 topology 2802 3759
-> 16 0 29 2795 topology 2803 3759
-> 15 0 28 2795 topology 2812 3760
-> 16 0 28 2795 topology 2905 3760
-> 15 0 29 2795 topology 2856 3761
-> 16 0 29 2795 topology 2857 3761
-> 15 0 28 2795 topology 2842 3762
-> 16 0 28 2795 topology 2905 3762
-> 15 0 29 2795 topology 2832 3763
-> 16 0 29 2795 topology 2833 3763
-> 15 0 28 2795 topology 2872 3764
-> 16 0 28 2795 topology 2905 3764
-> 15 0 29 2795 topology 2886 3765
-> 16 0 29 2795 topology 2887 3765
-> 15 0 28 2795 topology 2902 3766
-> 16 0 28 2795 topology 2905 3766
-> 15 0 29 2795 topology 2808 3767
-> 16 0 29 2795 topology 2809 3767
-> 15 0 28 2795 topology 2824 3768
-> 16 0 28 2795 topology 2905 3768
-> 15 0 29 2795 topology 2862 3769
-> 16 0 29 2795 topology 2863 3769
-> 15 0 28 2795 topology 2854 3770
-> 16 0 28 2795 topology 2905 3770
-> 15 0 29 2795 topology 2838 3771
-> 16 0 29 2795 topology 2839 3771
-> 15 0 28 2795 topology 2884 3772
-> 16 0 28 2795 topology 2905 3772
-> 15 0 29 2795 topology 2892 3773
-> 16 0 29 2795 topology 2893 3773
-> 15 0 28 2795 topology 2806 3774
-> 16 0 28 2795 topology 2905 3774
-> 15 0 28 2795 topology 2836 3775
-> 16 0 28 2795 topology 2905 3775
-> 15 0 29 2795 topology 2868 3776
-> 16 0 29 2795 topology 2869 3776
-> 15 0 28 2795 topology 2866 3777
-> 16 0 28 2795 topology 2905 3777
-> 15 0 28 2795 topology 2896 3778
-> 16 0 28 2795 topology 2905 3778
-> 15 0 29 2795 topology 2898 3779
-> 16 0 29 2795 topology 2899 3779
-> 15 0 28 2795 topology 2813 3780
-> 16 0 28 2795 topology 2905 3780
-> 15 0 28 2795 topology 2873 3781
-> 16 0 28 2795 topology 2905 3781
-> 15 0 28 2795 topology 2849 3782
-> 16 0 28 2795 topology 2905 3782
-> 15 0 28 2795 topology 2825 3783
-> 16 0 28 2795 topology 2905 3783
-> 15 0 28 2795 topology 2801 3784
-> 16 0 28 2795 topology 2905 3784
-> 15 0 28 2795 topology 2885 3785
-> 16 0 28 2795 topology 2905 3785
-> 15 0 28 2795 topology 2861 3786
-> 16 0 28 2795 topology 2905 3786
-> 15 0 28 2795 topology 2837 3787
-> 16 0 28 2795 topology 2905 3787
-> 15 0 28 2795 topology 2897 3788
-> 16 0 28 2795 topology 2905 3788
-> 15 0 28 2795 topology 2821 3789
-> 16 0 28 2795 topology 2905 3789
-> 15 0 28 2795 topology 2851 3790
-> 16 0 28 2795 topology 2905 3790
-> 15 0 28 2795 topology 2881 3791
-> 16 0 28 2795 topology 2905 3791
-> 15 0 28 2795 topology 2803 3792
-> 16 0 28 2795 topology 2905 3792
-> 15 0 28 2795 topology 2833 3793
-> 16 0 28 2795 topology 2905 3793
-> 15 0 28 2795 topology 2863 3794
-> 16 0 28 2795 topology 2905 3794
-> 15 0 29 2795 topology 2841 3795
-> 16 0 29 2795 topology 2843 3795
-> 15 0 28 2795 topology 2893 3796
-> 16 0 28 2795 topology 2905 3796
-> 15 0 29 2795 topology 2844 3797
-> 16 0 29 2795 topology 2846 3797
-> 15 0 29 2795 topology 2847 3798
-> 16 0 29 2795 topology 2849 3798
-> 15 0 29 2795 topology 2901 3799
-> 16 0 29 2795 topology 2903 3799
-> 15 0 28 2906 topology 2933 3800
+> 15 0 28 2795 topology 2902 3726
+> 16 0 28 2795 topology 2905 3726
+> 15 0 29 2795 topology 2904 3727
+> 16 0 29 2795 topology 2905 3727
+> 15 0 30 2795 topology 2796 3728
+> 16 0 30 2795 topology 2798 3728
+> 15 0 30 2795 topology 2796 3729
+> 16 0 30 2795 topology 2797 3729
+> 15 0 30 2795 topology 2799 3730
+> 16 0 30 2795 topology 2801 3730
+> 15 0 30 2795 topology 2799 3731
+> 16 0 30 2795 topology 2800 3731
+> 15 0 30 2795 topology 2802 3732
+> 16 0 30 2795 topology 2804 3732
+> 15 0 30 2795 topology 2802 3733
+> 16 0 30 2795 topology 2803 3733
+> 15 0 30 2795 topology 2805 3734
+> 16 0 30 2795 topology 2807 3734
+> 15 0 30 2795 topology 2805 3735
+> 16 0 30 2795 topology 2806 3735
+> 15 0 30 2795 topology 2808 3736
+> 16 0 30 2795 topology 2810 3736
+> 15 0 30 2795 topology 2808 3737
+> 16 0 30 2795 topology 2809 3737
+> 15 0 30 2795 topology 2811 3738
+> 16 0 30 2795 topology 2813 3738
+> 15 0 30 2795 topology 2811 3739
+> 16 0 30 2795 topology 2812 3739
+> 15 0 30 2795 topology 2814 3740
+> 16 0 30 2795 topology 2816 3740
+> 15 0 30 2795 topology 2814 3741
+> 16 0 30 2795 topology 2815 3741
+> 15 0 30 2795 topology 2817 3742
+> 16 0 30 2795 topology 2819 3742
+> 15 0 30 2795 topology 2817 3743
+> 16 0 30 2795 topology 2818 3743
+> 15 0 30 2795 topology 2820 3744
+> 16 0 30 2795 topology 2822 3744
+> 15 0 30 2795 topology 2820 3745
+> 16 0 30 2795 topology 2821 3745
+> 15 0 30 2795 topology 2823 3746
+> 16 0 30 2795 topology 2825 3746
+> 15 0 30 2795 topology 2823 3747
+> 16 0 30 2795 topology 2824 3747
+> 15 0 30 2795 topology 2826 3748
+> 16 0 30 2795 topology 2828 3748
+> 15 0 30 2795 topology 2826 3749
+> 16 0 30 2795 topology 2827 3749
+> 15 0 30 2795 topology 2829 3750
+> 16 0 30 2795 topology 2831 3750
+> 15 0 30 2795 topology 2829 3751
+> 16 0 30 2795 topology 2830 3751
+> 15 0 30 2795 topology 2832 3752
+> 16 0 30 2795 topology 2834 3752
+> 15 0 30 2795 topology 2832 3753
+> 16 0 30 2795 topology 2833 3753
+> 15 0 30 2795 topology 2835 3754
+> 16 0 30 2795 topology 2837 3754
+> 15 0 30 2795 topology 2835 3755
+> 16 0 30 2795 topology 2836 3755
+> 15 0 30 2795 topology 2838 3756
+> 16 0 30 2795 topology 2840 3756
+> 15 0 30 2795 topology 2838 3757
+> 16 0 30 2795 topology 2839 3757
+> 15 0 30 2795 topology 2841 3758
+> 16 0 30 2795 topology 2843 3758
+> 15 0 30 2795 topology 2841 3759
+> 16 0 30 2795 topology 2842 3759
+> 15 0 30 2795 topology 2844 3760
+> 16 0 30 2795 topology 2846 3760
+> 15 0 30 2795 topology 2844 3761
+> 16 0 30 2795 topology 2845 3761
+> 15 0 30 2795 topology 2847 3762
+> 16 0 30 2795 topology 2849 3762
+> 15 0 30 2795 topology 2847 3763
+> 16 0 30 2795 topology 2848 3763
+> 15 0 30 2795 topology 2850 3764
+> 16 0 30 2795 topology 2852 3764
+> 15 0 30 2795 topology 2850 3765
+> 16 0 30 2795 topology 2851 3765
+> 15 0 30 2795 topology 2853 3766
+> 16 0 30 2795 topology 2855 3766
+> 15 0 30 2795 topology 2853 3767
+> 16 0 30 2795 topology 2854 3767
+> 15 0 30 2795 topology 2856 3768
+> 16 0 30 2795 topology 2858 3768
+> 15 0 30 2795 topology 2856 3769
+> 16 0 30 2795 topology 2857 3769
+> 15 0 30 2795 topology 2859 3770
+> 16 0 30 2795 topology 2861 3770
+> 15 0 30 2795 topology 2859 3771
+> 16 0 30 2795 topology 2860 3771
+> 15 0 30 2795 topology 2862 3772
+> 16 0 30 2795 topology 2864 3772
+> 15 0 30 2795 topology 2862 3773
+> 16 0 30 2795 topology 2863 3773
+> 15 0 30 2795 topology 2865 3774
+> 16 0 30 2795 topology 2867 3774
+> 15 0 30 2795 topology 2865 3775
+> 16 0 30 2795 topology 2866 3775
+> 15 0 30 2795 topology 2868 3776
+> 16 0 30 2795 topology 2870 3776
+> 15 0 30 2795 topology 2868 3777
+> 16 0 30 2795 topology 2869 3777
+> 15 0 30 2795 topology 2871 3778
+> 16 0 30 2795 topology 2873 3778
+> 15 0 30 2795 topology 2871 3779
+> 16 0 30 2795 topology 2872 3779
+> 15 0 30 2795 topology 2874 3780
+> 16 0 30 2795 topology 2876 3780
+> 15 0 30 2795 topology 2874 3781
+> 16 0 30 2795 topology 2875 3781
+> 15 0 30 2795 topology 2877 3782
+> 16 0 30 2795 topology 2879 3782
+> 15 0 30 2795 topology 2877 3783
+> 16 0 30 2795 topology 2878 3783
+> 15 0 30 2795 topology 2880 3784
+> 16 0 30 2795 topology 2882 3784
+> 15 0 30 2795 topology 2880 3785
+> 16 0 30 2795 topology 2881 3785
+> 15 0 30 2795 topology 2883 3786
+> 16 0 30 2795 topology 2885 3786
+> 15 0 30 2795 topology 2883 3787
+> 16 0 30 2795 topology 2884 3787
+> 15 0 30 2795 topology 2886 3788
+> 16 0 30 2795 topology 2888 3788
+> 15 0 30 2795 topology 2886 3789
+> 16 0 30 2795 topology 2887 3789
+> 15 0 30 2795 topology 2889 3790
+> 16 0 30 2795 topology 2891 3790
+> 15 0 30 2795 topology 2889 3791
+> 16 0 30 2795 topology 2890 3791
+> 15 0 30 2795 topology 2892 3792
+> 16 0 30 2795 topology 2894 3792
+> 15 0 30 2795 topology 2892 3793
+> 16 0 30 2795 topology 2893 3793
+> 15 0 30 2795 topology 2895 3794
+> 16 0 30 2795 topology 2897 3794
+> 15 0 30 2795 topology 2895 3795
+> 16 0 30 2795 topology 2896 3795
+> 15 0 30 2795 topology 2898 3796
+> 16 0 30 2795 topology 2900 3796
+> 15 0 30 2795 topology 2898 3797
+> 16 0 30 2795 topology 2899 3797
+> 15 0 30 2795 topology 2901 3798
+> 16 0 30 2795 topology 2903 3798
+> 15 0 30 2795 topology 2901 3799
+> 16 0 30 2795 topology 2902 3799
+> 15 0 28 2906 topology 2909 3800
 > 16 0 28 2906 topology 2980 3800
-> 15 0 28 2906 topology 2969 3801
+> 15 0 28 2906 topology 2908 3801
 > 16 0 28 2906 topology 2980 3801
-> 15 0 28 2906 topology 2945 3802
+> 15 0 28 2906 topology 2912 3802
 > 16 0 28 2906 topology 2980 3802
-> 15 0 28 2906 topology 2957 3803
+> 15 0 28 2906 topology 2911 3803
 > 16 0 28 2906 topology 2980 3803
-> 15 0 28 2906 topology 2918 3804
+> 15 0 28 2906 topology 2915 3804
 > 16 0 28 2906 topology 2980 3804
-> 15 0 29 2906 topology 2928 3805
-> 16 0 29 2906 topology 2930 3805
-> 15 0 28 2906 topology 2935 3806
+> 15 0 28 2906 topology 2914 3805
+> 16 0 28 2906 topology 2980 3805
+> 15 0 28 2906 topology 2918 3806
 > 16 0 28 2906 topology 2980 3806
-> 15 0 28 2906 topology 2965 3807
+> 15 0 28 2906 topology 2917 3807
 > 16 0 28 2906 topology 2980 3807
-> 15 0 29 2906 topology 2931 3808
-> 16 0 29 2906 topology 2933 3808
-> 15 0 29 2906 topology 2934 3809
-> 16 0 29 2906 topology 2936 3809
-> 15 0 28 2906 topology 2947 3810
+> 15 0 28 2906 topology 2921 3808
+> 16 0 28 2906 topology 2980 3808
+> 15 0 28 2906 topology 2920 3809
+> 16 0 28 2906 topology 2980 3809
+> 15 0 28 2906 topology 2924 3810
 > 16 0 28 2906 topology 2980 3810
-> 15 0 28 2906 topology 2977 3811
+> 15 0 28 2906 topology 2923 3811
 > 16 0 28 2906 topology 2980 3811
-> 15 0 29 2906 topology 2937 3812
-> 16 0 29 2906 topology 2939 3812
-> 15 0 29 2906 topology 2940 3813
-> 16 0 29 2906 topology 2942 3813
-> 15 0 29 2906 topology 2943 3814
-> 16 0 29 2906 topology 2945 3814
-> 15 0 28 2906 topology 2914 3815
+> 15 0 28 2906 topology 2927 3812
+> 16 0 28 2906 topology 2980 3812
+> 15 0 28 2906 topology 2926 3813
+> 16 0 28 2906 topology 2980 3813
+> 15 0 28 2906 topology 2930 3814
+> 16 0 28 2906 topology 2980 3814
+> 15 0 28 2906 topology 2929 3815
 > 16 0 28 2906 topology 2980 3815
-> 15 0 29 2906 topology 2946 3816
-> 16 0 29 2906 topology 2948 3816
-> 15 0 29 2906 topology 2928 3817
-> 16 0 29 2906 topology 2929 3817
-> 15 0 29 2906 topology 2949 3818
-> 16 0 29 2906 topology 2951 3818
-> 15 0 28 2906 topology 2926 3819
+> 15 0 28 2906 topology 2933 3816
+> 16 0 28 2906 topology 2980 3816
+> 15 0 28 2906 topology 2932 3817
+> 16 0 28 2906 topology 2980 3817
+> 15 0 28 2906 topology 2936 3818
+> 16 0 28 2906 topology 2980 3818
+> 15 0 28 2906 topology 2935 3819
 > 16 0 28 2906 topology 2980 3819
-> 15 0 29 2906 topology 2958 3820
-> 16 0 29 2906 topology 2959 3820
-> 15 0 29 2906 topology 2952 3821
-> 16 0 29 2906 topology 2954 3821
-> 15 0 29 2906 topology 2934 3822
-> 16 0 29 2906 topology 2935 3822
-> 15 0 29 2906 topology 2955 3823
-> 16 0 29 2906 topology 2957 3823
-> 15 0 28 2906 topology 2960 3824
+> 15 0 28 2906 topology 2939 3820
+> 16 0 28 2906 topology 2980 3820
+> 15 0 28 2906 topology 2938 3821
+> 16 0 28 2906 topology 2980 3821
+> 15 0 28 2906 topology 2942 3822
+> 16 0 28 2906 topology 2980 3822
+> 15 0 28 2906 topology 2941 3823
+> 16 0 28 2906 topology 2980 3823
+> 15 0 28 2906 topology 2945 3824
 > 16 0 28 2906 topology 2980 3824
-> 15 0 28 2906 topology 2936 3825
+> 15 0 28 2906 topology 2944 3825
 > 16 0 28 2906 topology 2980 3825
-> 15 0 29 2906 topology 2964 3826
-> 16 0 29 2906 topology 2965 3826
-> 15 0 29 2906 topology 2940 3827
-> 16 0 29 2906 topology 2941 3827
-> 15 0 28 2906 topology 2972 3828
+> 15 0 28 2906 topology 2948 3826
+> 16 0 28 2906 topology 2980 3826
+> 15 0 28 2906 topology 2947 3827
+> 16 0 28 2906 topology 2980 3827
+> 15 0 28 2906 topology 2951 3828
 > 16 0 28 2906 topology 2980 3828
-> 15 0 28 2906 topology 2948 3829
+> 15 0 28 2906 topology 2950 3829
 > 16 0 28 2906 topology 2980 3829
-> 15 0 29 2906 topology 2970 3830
-> 16 0 29 2906 topology 2971 3830
-> 15 0 29 2906 topology 2946 3831
-> 16 0 29 2906 topology 2947 3831
-> 15 0 29 2906 topology 2976 3832
-> 16 0 29 2906 topology 2977 3832
-> 15 0 28 2906 topology 2909 3833
+> 15 0 28 2906 topology 2954 3830
+> 16 0 28 2906 topology 2980 3830
+> 15 0 28 2906 topology 2953 3831
+> 16 0 28 2906 topology 2980 3831
+> 15 0 28 2906 topology 2957 3832
+> 16 0 28 2906 topology 2980 3832
+> 15 0 28 2906 topology 2956 3833
 > 16 0 28 2906 topology 2980 3833
-> 15 0 29 2906 topology 2952 3834
-> 16 0 29 2906 topology 2953 3834
-> 15 0 28 2906 topology 2932 3835
+> 15 0 28 2906 topology 2960 3834
+> 16 0 28 2906 topology 2980 3834
+> 15 0 28 2906 topology 2959 3835
 > 16 0 28 2906 topology 2980 3835
-> 15 0 28 2906 topology 2921 3836
+> 15 0 28 2906 topology 2963 3836
 > 16 0 28 2906 topology 2980 3836
 > 15 0 28 2906 topology 2962 3837
 > 16 0 28 2906 topology 2980 3837
-> 15 0 29 2906 topology 2907 3838
-> 16 0 29 2906 topology 2908 3838
-> 15 0 28 2906 topology 2944 3839
+> 15 0 28 2906 topology 2966 3838
+> 16 0 28 2906 topology 2980 3838
+> 15 0 28 2906 topology 2965 3839
 > 16 0 28 2906 topology 2980 3839
-> 15 0 28 2906 topology 2974 3840
+> 15 0 28 2906 topology 2969 3840
 > 16 0 28 2906 topology 2980 3840
-> 15 0 29 2906 topology 2913 3841
-> 16 0 29 2906 topology 2914 3841
-> 15 0 28 2906 topology 2956 3842
+> 15 0 28 2906 topology 2968 3841
+> 16 0 28 2906 topology 2980 3841
+> 15 0 28 2906 topology 2972 3842
 > 16 0 28 2906 topology 2980 3842
-> 15 0 28 2906 topology 2911 3843
+> 15 0 28 2906 topology 2971 3843
 > 16 0 28 2906 topology 2980 3843
-> 15 0 29 2906 topology 2919 3844
-> 16 0 29 2906 topology 2920 3844
-> 15 0 28 2906 topology 2923 3845
+> 15 0 28 2906 topology 2975 3844
+> 16 0 28 2906 topology 2980 3844
+> 15 0 28 2906 topology 2974 3845
 > 16 0 28 2906 topology 2980 3845
-> 15 0 29 2906 topology 2925 3846
-> 16 0 29 2906 topology 2926 3846
-> 15 0 28 2906 topology 2963 3847
+> 15 0 28 2906 topology 2978 3846
+> 16 0 28 2906 topology 2980 3846
+> 15 0 28 2906 topology 2977 3847
 > 16 0 28 2906 topology 2980 3847
-> 15 0 28 2906 topology 2939 3848
-> 16 0 28 2906 topology 2980 3848
-> 15 0 28 2906 topology 2975 3849
-> 16 0 28 2906 topology 2980 3849
-> 15 0 28 2906 topology 2951 3850
-> 16 0 28 2906 topology 2980 3850
-> 15 0 28 2906 topology 2912 3851
-> 16 0 28 2906 topology 2980 3851
-> 15 0 28 2906 topology 2929 3852
-> 16 0 28 2906 topology 2980 3852
-> 15 0 28 2906 topology 2959 3853
-> 16 0 28 2906 topology 2980 3853
-> 15 0 28 2906 topology 2924 3854
-> 16 0 28 2906 topology 2980 3854
-> 15 0 28 2906 topology 2941 3855
-> 16 0 28 2906 topology 2980 3855
-> 15 0 29 2906 topology 2958 3856
-> 16 0 29 2906 topology 2960 3856
-> 15 0 28 2906 topology 2971 3857
-> 16 0 28 2906 topology 2980 3857
-> 15 0 29 2906 topology 2961 3858
-> 16 0 29 2906 topology 2963 3858
-> 15 0 28 2906 topology 2953 3859
-> 16 0 28 2906 topology 2980 3859
-> 15 0 29 2906 topology 2964 3860
-> 16 0 29 2906 topology 2966 3860
-> 15 0 30 2906 topology 2979 3861
-> 16 0 30 2906 topology 2980 3861
-> 15 0 29 2906 topology 2967 3862
-> 16 0 29 2906 topology 2969 3862
-> 15 0 28 2906 topology 2908 3863
-> 16 0 28 2906 topology 2980 3863
-> 15 0 29 2906 topology 2970 3864
-> 16 0 29 2906 topology 2972 3864
-> 15 0 29 2906 topology 2973 3865
-> 16 0 29 2906 topology 2975 3865
-> 15 0 28 2906 topology 2920 3866
-> 16 0 28 2906 topology 2980 3866
-> 15 0 29 2906 topology 2976 3867
-> 16 0 29 2906 topology 2978 3867
-> 15 0 29 2906 topology 2931 3868
-> 16 0 29 2906 topology 2932 3868
-> 15 0 28 2906 topology 2930 3869
-> 16 0 28 2906 topology 2980 3869
-> 15 0 29 2906 topology 2961 3870
-> 16 0 29 2906 topology 2962 3870
-> 15 0 29 2906 topology 2937 3871
-> 16 0 29 2906 topology 2938 3871
-> 15 0 28 2906 topology 2966 3872
-> 16 0 28 2906 topology 2980 3872
-> 15 0 28 2906 topology 2942 3873
-> 16 0 28 2906 topology 2980 3873
-> 15 0 29 2906 topology 2967 3874
-> 16 0 29 2906 topology 2968 3874
-> 15 0 29 2906 topology 2907 3875
-> 16 0 29 2906 topology 2909 3875
-> 15 0 29 2906 topology 2943 3876
-> 16 0 29 2906 topology 2944 3876
-> 15 0 29 2906 topology 2910 3877
-> 16 0 29 2906 topology 2912 3877
-> 15 0 28 2906 topology 2978 3878
-> 16 0 28 2906 topology 2980 3878
-> 15 0 28 2906 topology 2954 3879
-> 16 0 28 2906 topology 2980 3879
-> 15 0 29 2906 topology 2973 3880
-> 16 0 29 2906 topology 2974 3880
-> 15 0 29 2906 topology 2913 3881
-> 16 0 29 2906 topology 2915 3881
-> 15 0 29 2906 topology 2949 3882
-> 16 0 29 2906 topology 2950 3882
-> 15 0 29 2906 topology 2916 3883
-> 16 0 29 2906 topology 2918 3883
-> 15 0 28 2906 topology 2915 3884
-> 16 0 28 2906 topology 2980 3884
-> 15 0 29 2906 topology 2919 3885
-> 16 0 29 2906 topology 2921 3885
-> 15 0 29 2906 topology 2955 3886
-> 16 0 29 2906 topology 2956 3886
-> 15 0 29 2906 topology 2922 3887
-> 16 0 29 2906 topology 2924 3887
-> 15 0 28 2906 topology 2938 3888
-> 16 0 28 2906 topology 2980 3888
-> 15 0 29 2906 topology 2925 3889
-> 16 0 29 2906 topology 2927 3889
-> 15 0 28 2906 topology 2927 3890
-> 16 0 28 2906 topology 2980 3890
-> 15 0 28 2906 topology 2968 3891
-> 16 0 28 2906 topology 2980 3891
-> 15 0 29 2906 topology 2910 3892
-> 16 0 29 2906 topology 2911 3892
-> 15 0 28 2906 topology 2950 3893
-> 16 0 28 2906 topology 2980 3893
-> 15 0 29 2906 topology 2916 3894
-> 16 0 29 2906 topology 2917 3894
-> 15 0 28 2906 topology 2917 3895
-> 16 0 28 2906 topology 2980 3895
-> 15 0 29 2906 topology 2922 3896
-> 16 0 29 2906 topology 2923 3896
-> 15 0 29 2981 topology 3033 3897
-> 16 0 29 2981 topology 3035 3897
-> 15 0 29 2981 topology 3087 3898
-> 16 0 29 2981 topology 3089 3898
-> 15 0 29 2981 topology 2982 3899
-> 16 0 29 2981 topology 2984 3899
-> 15 0 29 2981 topology 3036 3900
-> 16 0 29 2981 topology 3038 3900
-> 15 0 29 2981 topology 2991 3901
-> 16 0 29 2981 topology 2992 3901
-> 15 0 29 2981 topology 2985 3902
-> 16 0 29 2981 topology 2987 3902
-> 15 0 29 2981 topology 3039 3903
-> 16 0 29 2981 topology 3041 3903
-> 15 0 29 2981 topology 3021 3904
-> 16 0 29 2981 topology 3022 3904
-> 15 0 29 2981 topology 2988 3905
-> 16 0 29 2981 topology 2990 3905
-> 15 0 29 2981 topology 3042 3906
-> 16 0 29 2981 topology 3044 3906
-> 15 0 29 2981 topology 2997 3907
-> 16 0 29 2981 topology 2998 3907
-> 15 0 28 2981 topology 3023 3908
+> 15 0 29 2906 topology 2979 3848
+> 16 0 29 2906 topology 2980 3848
+> 15 0 30 2906 topology 2907 3849
+> 16 0 30 2906 topology 2909 3849
+> 15 0 30 2906 topology 2907 3850
+> 16 0 30 2906 topology 2908 3850
+> 15 0 30 2906 topology 2910 3851
+> 16 0 30 2906 topology 2912 3851
+> 15 0 30 2906 topology 2910 3852
+> 16 0 30 2906 topology 2911 3852
+> 15 0 30 2906 topology 2913 3853
+> 16 0 30 2906 topology 2915 3853
+> 15 0 30 2906 topology 2913 3854
+> 16 0 30 2906 topology 2914 3854
+> 15 0 30 2906 topology 2916 3855
+> 16 0 30 2906 topology 2918 3855
+> 15 0 30 2906 topology 2916 3856
+> 16 0 30 2906 topology 2917 3856
+> 15 0 30 2906 topology 2919 3857
+> 16 0 30 2906 topology 2921 3857
+> 15 0 30 2906 topology 2919 3858
+> 16 0 30 2906 topology 2920 3858
+> 15 0 30 2906 topology 2922 3859
+> 16 0 30 2906 topology 2924 3859
+> 15 0 30 2906 topology 2922 3860
+> 16 0 30 2906 topology 2923 3860
+> 15 0 30 2906 topology 2925 3861
+> 16 0 30 2906 topology 2927 3861
+> 15 0 30 2906 topology 2925 3862
+> 16 0 30 2906 topology 2926 3862
+> 15 0 30 2906 topology 2928 3863
+> 16 0 30 2906 topology 2930 3863
+> 15 0 30 2906 topology 2928 3864
+> 16 0 30 2906 topology 2929 3864
+> 15 0 30 2906 topology 2931 3865
+> 16 0 30 2906 topology 2933 3865
+> 15 0 30 2906 topology 2931 3866
+> 16 0 30 2906 topology 2932 3866
+> 15 0 30 2906 topology 2934 3867
+> 16 0 30 2906 topology 2936 3867
+> 15 0 30 2906 topology 2934 3868
+> 16 0 30 2906 topology 2935 3868
+> 15 0 30 2906 topology 2937 3869
+> 16 0 30 2906 topology 2939 3869
+> 15 0 30 2906 topology 2937 3870
+> 16 0 30 2906 topology 2938 3870
+> 15 0 30 2906 topology 2940 3871
+> 16 0 30 2906 topology 2942 3871
+> 15 0 30 2906 topology 2940 3872
+> 16 0 30 2906 topology 2941 3872
+> 15 0 30 2906 topology 2943 3873
+> 16 0 30 2906 topology 2945 3873
+> 15 0 30 2906 topology 2943 3874
+> 16 0 30 2906 topology 2944 3874
+> 15 0 30 2906 topology 2946 3875
+> 16 0 30 2906 topology 2948 3875
+> 15 0 30 2906 topology 2946 3876
+> 16 0 30 2906 topology 2947 3876
+> 15 0 30 2906 topology 2949 3877
+> 16 0 30 2906 topology 2951 3877
+> 15 0 30 2906 topology 2949 3878
+> 16 0 30 2906 topology 2950 3878
+> 15 0 30 2906 topology 2952 3879
+> 16 0 30 2906 topology 2954 3879
+> 15 0 30 2906 topology 2952 3880
+> 16 0 30 2906 topology 2953 3880
+> 15 0 30 2906 topology 2955 3881
+> 16 0 30 2906 topology 2957 3881
+> 15 0 30 2906 topology 2955 3882
+> 16 0 30 2906 topology 2956 3882
+> 15 0 30 2906 topology 2958 3883
+> 16 0 30 2906 topology 2960 3883
+> 15 0 30 2906 topology 2958 3884
+> 16 0 30 2906 topology 2959 3884
+> 15 0 30 2906 topology 2961 3885
+> 16 0 30 2906 topology 2963 3885
+> 15 0 30 2906 topology 2961 3886
+> 16 0 30 2906 topology 2962 3886
+> 15 0 30 2906 topology 2964 3887
+> 16 0 30 2906 topology 2966 3887
+> 15 0 30 2906 topology 2964 3888
+> 16 0 30 2906 topology 2965 3888
+> 15 0 30 2906 topology 2967 3889
+> 16 0 30 2906 topology 2969 3889
+> 15 0 30 2906 topology 2967 3890
+> 16 0 30 2906 topology 2968 3890
+> 15 0 30 2906 topology 2970 3891
+> 16 0 30 2906 topology 2972 3891
+> 15 0 30 2906 topology 2970 3892
+> 16 0 30 2906 topology 2971 3892
+> 15 0 30 2906 topology 2973 3893
+> 16 0 30 2906 topology 2975 3893
+> 15 0 30 2906 topology 2973 3894
+> 16 0 30 2906 topology 2974 3894
+> 15 0 30 2906 topology 2976 3895
+> 16 0 30 2906 topology 2978 3895
+> 15 0 30 2906 topology 2976 3896
+> 16 0 30 2906 topology 2977 3896
+> 15 0 28 2981 topology 2984 3897
+> 16 0 28 2981 topology 3091 3897
+> 15 0 28 2981 topology 2983 3898
+> 16 0 28 2981 topology 3091 3898
+> 15 0 28 2981 topology 2987 3899
+> 16 0 28 2981 topology 3091 3899
+> 15 0 28 2981 topology 2986 3900
+> 16 0 28 2981 topology 3091 3900
+> 15 0 28 2981 topology 2990 3901
+> 16 0 28 2981 topology 3091 3901
+> 15 0 28 2981 topology 2989 3902
+> 16 0 28 2981 topology 3091 3902
+> 15 0 28 2981 topology 2993 3903
+> 16 0 28 2981 topology 3091 3903
+> 15 0 28 2981 topology 2992 3904
+> 16 0 28 2981 topology 3091 3904
+> 15 0 28 2981 topology 2996 3905
+> 16 0 28 2981 topology 3091 3905
+> 15 0 28 2981 topology 2995 3906
+> 16 0 28 2981 topology 3091 3906
+> 15 0 28 2981 topology 2999 3907
+> 16 0 28 2981 topology 3091 3907
+> 15 0 28 2981 topology 2998 3908
 > 16 0 28 2981 topology 3091 3908
-> 15 0 29 2981 topology 3051 3909
-> 16 0 29 2981 topology 3052 3909
-> 15 0 28 2981 topology 2999 3910
+> 15 0 28 2981 topology 3002 3909
+> 16 0 28 2981 topology 3091 3909
+> 15 0 28 2981 topology 3001 3910
 > 16 0 28 2981 topology 3091 3910
-> 15 0 29 2981 topology 3045 3911
-> 16 0 29 2981 topology 3047 3911
-> 15 0 29 2981 topology 3027 3912
-> 16 0 29 2981 topology 3028 3912
-> 15 0 29 2981 topology 3081 3913
-> 16 0 29 2981 topology 3082 3913
-> 15 0 28 2981 topology 3083 3914
+> 15 0 28 2981 topology 3005 3911
+> 16 0 28 2981 topology 3091 3911
+> 15 0 28 2981 topology 3004 3912
+> 16 0 28 2981 topology 3091 3912
+> 15 0 28 2981 topology 3008 3913
+> 16 0 28 2981 topology 3091 3913
+> 15 0 28 2981 topology 3007 3914
 > 16 0 28 2981 topology 3091 3914
-> 15 0 29 2981 topology 3048 3915
-> 16 0 29 2981 topology 3050 3915
-> 15 0 28 2981 topology 3059 3916
+> 15 0 28 2981 topology 3011 3915
+> 16 0 28 2981 topology 3091 3915
+> 15 0 28 2981 topology 3010 3916
 > 16 0 28 2981 topology 3091 3916
-> 15 0 29 2981 topology 3003 3917
-> 16 0 29 2981 topology 3004 3917
-> 15 0 28 2981 topology 3035 3918
+> 15 0 28 2981 topology 3014 3917
+> 16 0 28 2981 topology 3091 3917
+> 15 0 28 2981 topology 3013 3918
 > 16 0 28 2981 topology 3091 3918
-> 15 0 29 2981 topology 3057 3919
-> 16 0 29 2981 topology 3058 3919
-> 15 0 28 2981 topology 3011 3920
+> 15 0 28 2981 topology 3017 3919
+> 16 0 28 2981 topology 3091 3919
+> 15 0 28 2981 topology 3016 3920
 > 16 0 28 2981 topology 3091 3920
-> 15 0 28 2981 topology 2987 3921
+> 15 0 28 2981 topology 3020 3921
 > 16 0 28 2981 topology 3091 3921
-> 15 0 29 2981 topology 3033 3922
-> 16 0 29 2981 topology 3034 3922
-> 15 0 29 2981 topology 3087 3923
-> 16 0 29 2981 topology 3088 3923
-> 15 0 28 2981 topology 3071 3924
+> 15 0 28 2981 topology 3019 3922
+> 16 0 28 2981 topology 3091 3922
+> 15 0 28 2981 topology 3023 3923
+> 16 0 28 2981 topology 3091 3923
+> 15 0 28 2981 topology 3022 3924
 > 16 0 28 2981 topology 3091 3924
-> 15 0 29 2981 topology 3009 3925
-> 16 0 29 2981 topology 3010 3925
-> 15 0 28 2981 topology 3047 3926
+> 15 0 28 2981 topology 3026 3925
+> 16 0 28 2981 topology 3091 3925
+> 15 0 28 2981 topology 3025 3926
 > 16 0 28 2981 topology 3091 3926
-> 15 0 29 2981 topology 3063 3927
-> 16 0 29 2981 topology 3064 3927
-> 15 0 29 2981 topology 2985 3928
-> 16 0 29 2981 topology 2986 3928
-> 15 0 29 2981 topology 3039 3929
-> 16 0 29 2981 topology 3040 3929
-> 15 0 29 2981 topology 3015 3930
-> 16 0 29 2981 topology 3016 3930
-> 15 0 29 2981 topology 3069 3931
-> 16 0 29 2981 topology 3070 3931
-> 15 0 28 2981 topology 2995 3932
+> 15 0 28 2981 topology 3029 3927
+> 16 0 28 2981 topology 3091 3927
+> 15 0 28 2981 topology 3028 3928
+> 16 0 28 2981 topology 3091 3928
+> 15 0 28 2981 topology 3032 3929
+> 16 0 28 2981 topology 3091 3929
+> 15 0 28 2981 topology 3031 3930
+> 16 0 28 2981 topology 3091 3930
+> 15 0 28 2981 topology 3035 3931
+> 16 0 28 2981 topology 3091 3931
+> 15 0 28 2981 topology 3034 3932
 > 16 0 28 2981 topology 3091 3932
-> 15 0 28 2981 topology 3025 3933
+> 15 0 28 2981 topology 3038 3933
 > 16 0 28 2981 topology 3091 3933
-> 15 0 29 2981 topology 3045 3934
-> 16 0 29 2981 topology 3046 3934
-> 15 0 28 2981 topology 3055 3935
+> 15 0 28 2981 topology 3037 3934
+> 16 0 28 2981 topology 3091 3934
+> 15 0 28 2981 topology 3041 3935
 > 16 0 28 2981 topology 3091 3935
-> 15 0 29 2981 topology 3075 3936
-> 16 0 29 2981 topology 3076 3936
-> 15 0 28 2981 topology 3085 3937
+> 15 0 28 2981 topology 3040 3936
+> 16 0 28 2981 topology 3091 3936
+> 15 0 28 2981 topology 3044 3937
 > 16 0 28 2981 topology 3091 3937
-> 15 0 28 2981 topology 3007 3938
+> 15 0 28 2981 topology 3043 3938
 > 16 0 28 2981 topology 3091 3938
-> 15 0 28 2981 topology 3037 3939
+> 15 0 28 2981 topology 3047 3939
 > 16 0 28 2981 topology 3091 3939
-> 15 0 28 2981 topology 3067 3940
+> 15 0 28 2981 topology 3046 3940
 > 16 0 28 2981 topology 3091 3940
-> 15 0 28 2981 topology 2989 3941
+> 15 0 28 2981 topology 3050 3941
 > 16 0 28 2981 topology 3091 3941
-> 15 0 28 2981 topology 3019 3942
+> 15 0 28 2981 topology 3049 3942
 > 16 0 28 2981 topology 3091 3942
-> 15 0 28 2981 topology 3049 3943
+> 15 0 28 2981 topology 3053 3943
 > 16 0 28 2981 topology 3091 3943
-> 15 0 28 2981 topology 3079 3944
+> 15 0 28 2981 topology 3052 3944
 > 16 0 28 2981 topology 3091 3944
-> 15 0 28 2981 topology 3026 3945
+> 15 0 28 2981 topology 3056 3945
 > 16 0 28 2981 topology 3091 3945
-> 15 0 28 2981 topology 3002 3946
+> 15 0 28 2981 topology 3055 3946
 > 16 0 28 2981 topology 3091 3946
-> 15 0 28 2981 topology 3086 3947
+> 15 0 28 2981 topology 3059 3947
 > 16 0 28 2981 topology 3091 3947
-> 15 0 28 2981 topology 3062 3948
+> 15 0 28 2981 topology 3058 3948
 > 16 0 28 2981 topology 3091 3948
-> 15 0 28 2981 topology 3038 3949
+> 15 0 28 2981 topology 3062 3949
 > 16 0 28 2981 topology 3091 3949
-> 15 0 28 2981 topology 3014 3950
+> 15 0 28 2981 topology 3061 3950
 > 16 0 28 2981 topology 3091 3950
-> 15 0 28 2981 topology 2990 3951
+> 15 0 28 2981 topology 3065 3951
 > 16 0 28 2981 topology 3091 3951
-> 15 0 28 2981 topology 3074 3952
+> 15 0 28 2981 topology 3064 3952
 > 16 0 28 2981 topology 3091 3952
-> 15 0 28 2981 topology 3050 3953
+> 15 0 28 2981 topology 3068 3953
 > 16 0 28 2981 topology 3091 3953
-> 15 0 28 2981 topology 2992 3954
+> 15 0 28 2981 topology 3067 3954
 > 16 0 28 2981 topology 3091 3954
-> 15 0 28 2981 topology 3022 3955
+> 15 0 28 2981 topology 3071 3955
 > 16 0 28 2981 topology 3091 3955
-> 15 0 28 2981 topology 3052 3956
+> 15 0 28 2981 topology 3070 3956
 > 16 0 28 2981 topology 3091 3956
-> 15 0 29 2981 topology 2991 3957
-> 16 0 29 2981 topology 2993 3957
-> 15 0 28 2981 topology 3082 3958
+> 15 0 28 2981 topology 3074 3957
+> 16 0 28 2981 topology 3091 3957
+> 15 0 28 2981 topology 3073 3958
 > 16 0 28 2981 topology 3091 3958
-> 15 0 28 2981 topology 3004 3959
+> 15 0 28 2981 topology 3077 3959
 > 16 0 28 2981 topology 3091 3959
-> 15 0 29 2981 topology 2994 3960
-> 16 0 29 2981 topology 2996 3960
-> 15 0 28 2981 topology 3034 3961
+> 15 0 28 2981 topology 3076 3960
+> 16 0 28 2981 topology 3091 3960
+> 15 0 28 2981 topology 3080 3961
 > 16 0 28 2981 topology 3091 3961
-> 15 0 28 2981 topology 3064 3962
+> 15 0 28 2981 topology 3079 3962
 > 16 0 28 2981 topology 3091 3962
-> 15 0 28 2981 topology 2986 3963
+> 15 0 28 2981 topology 3083 3963
 > 16 0 28 2981 topology 3091 3963
-> 15 0 29 2981 topology 2997 3964
-> 16 0 29 2981 topology 2999 3964
-> 15 0 29 2981 topology 3051 3965
-> 16 0 29 2981 topology 3053 3965
-> 15 0 28 2981 topology 3016 3966
+> 15 0 28 2981 topology 3082 3964
+> 16 0 28 2981 topology 3091 3964
+> 15 0 28 2981 topology 3086 3965
+> 16 0 28 2981 topology 3091 3965
+> 15 0 28 2981 topology 3085 3966
 > 16 0 28 2981 topology 3091 3966
-> 15 0 29 2981 topology 3000 3967
-> 16 0 29 2981 topology 3002 3967
-> 15 0 28 2981 topology 3046 3968
+> 15 0 28 2981 topology 3089 3967
+> 16 0 28 2981 topology 3091 3967
+> 15 0 28 2981 topology 3088 3968
 > 16 0 28 2981 topology 3091 3968
-> 15 0 29 2981 topology 3054 3969
-> 16 0 29 2981 topology 3056 3969
-> 15 0 28 2981 topology 3076 3970
-> 16 0 28 2981 topology 3091 3970
-> 15 0 29 2981 topology 3003 3971
-> 16 0 29 2981 topology 3005 3971
-> 15 0 29 2981 topology 3057 3972
-> 16 0 29 2981 topology 3059 3972
-> 15 0 29 2981 topology 3006 3973
-> 16 0 29 2981 topology 3008 3973
-> 15 0 29 2981 topology 3060 3974
-> 16 0 29 2981 topology 3062 3974
-> 15 0 29 2981 topology 3009 3975
-> 16 0 29 2981 topology 3011 3975
-> 15 0 29 2981 topology 3063 3976
-> 16 0 29 2981 topology 3065 3976
-> 15 0 29 2981 topology 3012 3977
-> 16 0 29 2981 topology 3014 3977
-> 15 0 29 2981 topology 3066 3978
-> 16 0 29 2981 topology 3068 3978
-> 15 0 29 2981 topology 2994 3979
-> 16 0 29 2981 topology 2995 3979
-> 15 0 28 2981 topology 2993 3980
-> 16 0 28 2981 topology 3091 3980
-> 15 0 29 2981 topology 3015 3981
-> 16 0 29 2981 topology 3017 3981
-> 15 0 29 2981 topology 3069 3982
-> 16 0 29 2981 topology 3071 3982
-> 15 0 29 2981 topology 3024 3983
-> 16 0 29 2981 topology 3025 3983
-> 15 0 29 2981 topology 3018 3984
-> 16 0 29 2981 topology 3020 3984
-> 15 0 28 2981 topology 3053 3985
-> 16 0 28 2981 topology 3091 3985
-> 15 0 29 2981 topology 3072 3986
-> 16 0 29 2981 topology 3074 3986
-> 15 0 29 2981 topology 3000 3987
-> 16 0 29 2981 topology 3001 3987
-> 15 0 28 2981 topology 3029 3988
-> 16 0 28 2981 topology 3091 3988
-> 15 0 29 2981 topology 3054 3989
-> 16 0 29 2981 topology 3055 3989
-> 15 0 28 2981 topology 3005 3990
-> 16 0 28 2981 topology 3091 3990
-> 15 0 29 2981 topology 3075 3991
-> 16 0 29 2981 topology 3077 3991
-> 15 0 29 2981 topology 3030 3992
-> 16 0 29 2981 topology 3031 3992
-> 15 0 29 2981 topology 3084 3993
-> 16 0 29 2981 topology 3085 3993
-> 15 0 28 2981 topology 3089 3994
-> 16 0 28 2981 topology 3091 3994
-> 15 0 28 2981 topology 3065 3995
-> 16 0 28 2981 topology 3091 3995
-> 15 0 29 2981 topology 3078 3996
-> 16 0 29 2981 topology 3080 3996
-> 15 0 29 2981 topology 3006 3997
-> 16 0 29 2981 topology 3007 3997
-> 15 0 28 2981 topology 3041 3998
-> 16 0 28 2981 topology 3091 3998
-> 15 0 29 2981 topology 3060 3999
-> 16 0 29 2981 topology 3061 3999
-> 15 0 28 2981 topology 3017 4000
-> 16 0 28 2981 topology 3091 4000
-> 15 0 29 2981 topology 2982 4001
-> 16 0 29 2981 topology 2983 4001
-> 15 0 29 2981 topology 3036 4002
-> 16 0 29 2981 topology 3037 4002
-> 15 0 28 2981 topology 3077 4003
-> 16 0 28 2981 topology 3091 4003
-> 15 0 29 2981 topology 3012 4004
-> 16 0 29 2981 topology 3013 4004
-> 15 0 29 2981 topology 3066 4005
-> 16 0 29 2981 topology 3067 4005
-> 15 0 29 2981 topology 2988 4006
-> 16 0 29 2981 topology 2989 4006
-> 15 0 29 2981 topology 3042 4007
-> 16 0 29 2981 topology 3043 4007
-> 15 0 29 2981 topology 3018 4008
-> 16 0 29 2981 topology 3019 4008
-> 15 0 29 2981 topology 3072 4009
-> 16 0 29 2981 topology 3073 4009
-> 15 0 28 2981 topology 3001 4010
-> 16 0 28 2981 topology 3091 4010
-> 15 0 28 2981 topology 3031 4011
-> 16 0 28 2981 topology 3091 4011
-> 15 0 29 2981 topology 3048 4012
-> 16 0 29 2981 topology 3049 4012
-> 15 0 28 2981 topology 3061 4013
-> 16 0 28 2981 topology 3091 4013
-> 15 0 28 2981 topology 2983 4014
-> 16 0 28 2981 topology 3091 4014
-> 15 0 29 2981 topology 3078 4015
-> 16 0 29 2981 topology 3079 4015
-> 15 0 28 2981 topology 3013 4016
-> 16 0 28 2981 topology 3091 4016
-> 15 0 28 2981 topology 3043 4017
-> 16 0 28 2981 topology 3091 4017
-> 15 0 28 2981 topology 3073 4018
-> 16 0 28 2981 topology 3091 4018
-> 15 0 28 2981 topology 2996 4019
-> 16 0 28 2981 topology 3091 4019
-> 15 0 28 2981 topology 3056 4020
-> 16 0 28 2981 topology 3091 4020
-> 15 0 28 2981 topology 3032 4021
-> 16 0 28 2981 topology 3091 4021
-> 15 0 28 2981 topology 3008 4022
-> 16 0 28 2981 topology 3091 4022
-> 15 0 28 2981 topology 2984 4023
-> 16 0 28 2981 topology 3091 4023
-> 15 0 28 2981 topology 3068 4024
-> 16 0 28 2981 topology 3091 4024
-> 15 0 28 2981 topology 3044 4025
-> 16 0 28 2981 topology 3091 4025
-> 15 0 28 2981 topology 3020 4026
-> 16 0 28 2981 topology 3091 4026
-> 15 0 28 2981 topology 3080 4027
-> 16 0 28 2981 topology 3091 4027
-> 15 0 28 2981 topology 2998 4028
-> 16 0 28 2981 topology 3091 4028
-> 15 0 28 2981 topology 3028 4029
-> 16 0 28 2981 topology 3091 4029
-> 15 0 28 2981 topology 3058 4030
-> 16 0 28 2981 topology 3091 4030
-> 15 0 29 2981 topology 3021 4031
-> 16 0 29 2981 topology 3023 4031
-> 15 0 28 2981 topology 3088 4032
-> 16 0 28 2981 topology 3091 4032
-> 15 0 28 2981 topology 3010 4033
-> 16 0 28 2981 topology 3091 4033
-> 15 0 30 2981 topology 3090 4034
-> 16 0 30 2981 topology 3091 4034
-> 15 0 29 2981 topology 3024 4035
-> 16 0 29 2981 topology 3026 4035
-> 15 0 28 2981 topology 3040 4036
-> 16 0 28 2981 topology 3091 4036
-> 15 0 28 2981 topology 3070 4037
-> 16 0 28 2981 topology 3091 4037
-> 15 0 29 2981 topology 3027 4038
-> 16 0 29 2981 topology 3029 4038
-> 15 0 29 2981 topology 3081 4039
-> 16 0 29 2981 topology 3083 4039
-> 15 0 29 2981 topology 3030 4040
-> 16 0 29 2981 topology 3032 4040
-> 15 0 29 2981 topology 3084 4041
-> 16 0 29 2981 topology 3086 4041
-> 15 0 28 3092 topology 3190 4042
+> 15 0 29 2981 topology 3090 3969
+> 16 0 29 2981 topology 3091 3969
+> 15 0 30 2981 topology 2982 3970
+> 16 0 30 2981 topology 2984 3970
+> 15 0 30 2981 topology 2982 3971
+> 16 0 30 2981 topology 2983 3971
+> 15 0 30 2981 topology 2985 3972
+> 16 0 30 2981 topology 2987 3972
+> 15 0 30 2981 topology 2985 3973
+> 16 0 30 2981 topology 2986 3973
+> 15 0 30 2981 topology 2988 3974
+> 16 0 30 2981 topology 2990 3974
+> 15 0 30 2981 topology 2988 3975
+> 16 0 30 2981 topology 2989 3975
+> 15 0 30 2981 topology 2991 3976
+> 16 0 30 2981 topology 2993 3976
+> 15 0 30 2981 topology 2991 3977
+> 16 0 30 2981 topology 2992 3977
+> 15 0 30 2981 topology 2994 3978
+> 16 0 30 2981 topology 2996 3978
+> 15 0 30 2981 topology 2994 3979
+> 16 0 30 2981 topology 2995 3979
+> 15 0 30 2981 topology 2997 3980
+> 16 0 30 2981 topology 2999 3980
+> 15 0 30 2981 topology 2997 3981
+> 16 0 30 2981 topology 2998 3981
+> 15 0 30 2981 topology 3000 3982
+> 16 0 30 2981 topology 3002 3982
+> 15 0 30 2981 topology 3000 3983
+> 16 0 30 2981 topology 3001 3983
+> 15 0 30 2981 topology 3003 3984
+> 16 0 30 2981 topology 3005 3984
+> 15 0 30 2981 topology 3003 3985
+> 16 0 30 2981 topology 3004 3985
+> 15 0 30 2981 topology 3006 3986
+> 16 0 30 2981 topology 3008 3986
+> 15 0 30 2981 topology 3006 3987
+> 16 0 30 2981 topology 3007 3987
+> 15 0 30 2981 topology 3009 3988
+> 16 0 30 2981 topology 3011 3988
+> 15 0 30 2981 topology 3009 3989
+> 16 0 30 2981 topology 3010 3989
+> 15 0 30 2981 topology 3012 3990
+> 16 0 30 2981 topology 3014 3990
+> 15 0 30 2981 topology 3012 3991
+> 16 0 30 2981 topology 3013 3991
+> 15 0 30 2981 topology 3015 3992
+> 16 0 30 2981 topology 3017 3992
+> 15 0 30 2981 topology 3015 3993
+> 16 0 30 2981 topology 3016 3993
+> 15 0 30 2981 topology 3018 3994
+> 16 0 30 2981 topology 3020 3994
+> 15 0 30 2981 topology 3018 3995
+> 16 0 30 2981 topology 3019 3995
+> 15 0 30 2981 topology 3021 3996
+> 16 0 30 2981 topology 3023 3996
+> 15 0 30 2981 topology 3021 3997
+> 16 0 30 2981 topology 3022 3997
+> 15 0 30 2981 topology 3024 3998
+> 16 0 30 2981 topology 3026 3998
+> 15 0 30 2981 topology 3024 3999
+> 16 0 30 2981 topology 3025 3999
+> 15 0 30 2981 topology 3027 4000
+> 16 0 30 2981 topology 3029 4000
+> 15 0 30 2981 topology 3027 4001
+> 16 0 30 2981 topology 3028 4001
+> 15 0 30 2981 topology 3030 4002
+> 16 0 30 2981 topology 3032 4002
+> 15 0 30 2981 topology 3030 4003
+> 16 0 30 2981 topology 3031 4003
+> 15 0 30 2981 topology 3033 4004
+> 16 0 30 2981 topology 3035 4004
+> 15 0 30 2981 topology 3033 4005
+> 16 0 30 2981 topology 3034 4005
+> 15 0 30 2981 topology 3036 4006
+> 16 0 30 2981 topology 3038 4006
+> 15 0 30 2981 topology 3036 4007
+> 16 0 30 2981 topology 3037 4007
+> 15 0 30 2981 topology 3039 4008
+> 16 0 30 2981 topology 3041 4008
+> 15 0 30 2981 topology 3039 4009
+> 16 0 30 2981 topology 3040 4009
+> 15 0 30 2981 topology 3042 4010
+> 16 0 30 2981 topology 3044 4010
+> 15 0 30 2981 topology 3042 4011
+> 16 0 30 2981 topology 3043 4011
+> 15 0 30 2981 topology 3045 4012
+> 16 0 30 2981 topology 3047 4012
+> 15 0 30 2981 topology 3045 4013
+> 16 0 30 2981 topology 3046 4013
+> 15 0 30 2981 topology 3048 4014
+> 16 0 30 2981 topology 3050 4014
+> 15 0 30 2981 topology 3048 4015
+> 16 0 30 2981 topology 3049 4015
+> 15 0 30 2981 topology 3051 4016
+> 16 0 30 2981 topology 3053 4016
+> 15 0 30 2981 topology 3051 4017
+> 16 0 30 2981 topology 3052 4017
+> 15 0 30 2981 topology 3054 4018
+> 16 0 30 2981 topology 3056 4018
+> 15 0 30 2981 topology 3054 4019
+> 16 0 30 2981 topology 3055 4019
+> 15 0 30 2981 topology 3057 4020
+> 16 0 30 2981 topology 3059 4020
+> 15 0 30 2981 topology 3057 4021
+> 16 0 30 2981 topology 3058 4021
+> 15 0 30 2981 topology 3060 4022
+> 16 0 30 2981 topology 3062 4022
+> 15 0 30 2981 topology 3060 4023
+> 16 0 30 2981 topology 3061 4023
+> 15 0 30 2981 topology 3063 4024
+> 16 0 30 2981 topology 3065 4024
+> 15 0 30 2981 topology 3063 4025
+> 16 0 30 2981 topology 3064 4025
+> 15 0 30 2981 topology 3066 4026
+> 16 0 30 2981 topology 3068 4026
+> 15 0 30 2981 topology 3066 4027
+> 16 0 30 2981 topology 3067 4027
+> 15 0 30 2981 topology 3069 4028
+> 16 0 30 2981 topology 3071 4028
+> 15 0 30 2981 topology 3069 4029
+> 16 0 30 2981 topology 3070 4029
+> 15 0 30 2981 topology 3072 4030
+> 16 0 30 2981 topology 3074 4030
+> 15 0 30 2981 topology 3072 4031
+> 16 0 30 2981 topology 3073 4031
+> 15 0 30 2981 topology 3075 4032
+> 16 0 30 2981 topology 3077 4032
+> 15 0 30 2981 topology 3075 4033
+> 16 0 30 2981 topology 3076 4033
+> 15 0 30 2981 topology 3078 4034
+> 16 0 30 2981 topology 3080 4034
+> 15 0 30 2981 topology 3078 4035
+> 16 0 30 2981 topology 3079 4035
+> 15 0 30 2981 topology 3081 4036
+> 16 0 30 2981 topology 3083 4036
+> 15 0 30 2981 topology 3081 4037
+> 16 0 30 2981 topology 3082 4037
+> 15 0 30 2981 topology 3084 4038
+> 16 0 30 2981 topology 3086 4038
+> 15 0 30 2981 topology 3084 4039
+> 16 0 30 2981 topology 3085 4039
+> 15 0 30 2981 topology 3087 4040
+> 16 0 30 2981 topology 3089 4040
+> 15 0 30 2981 topology 3087 4041
+> 16 0 30 2981 topology 3088 4041
+> 15 0 28 3092 topology 3095 4042
 > 16 0 28 3092 topology 3202 4042
-> 15 0 29 3092 topology 3198 4043
-> 16 0 29 3092 topology 3199 4043
-> 15 0 28 3092 topology 3112 4044
+> 15 0 28 3092 topology 3094 4043
+> 16 0 28 3092 topology 3202 4043
+> 15 0 28 3092 topology 3098 4044
 > 16 0 28 3092 topology 3202 4044
-> 15 0 28 3092 topology 3142 4045
+> 15 0 28 3092 topology 3097 4045
 > 16 0 28 3092 topology 3202 4045
-> 15 0 28 3092 topology 3172 4046
+> 15 0 28 3092 topology 3101 4046
 > 16 0 28 3092 topology 3202 4046
-> 15 0 28 3092 topology 3149 4047
+> 15 0 28 3092 topology 3100 4047
 > 16 0 28 3092 topology 3202 4047
-> 15 0 28 3092 topology 3125 4048
+> 15 0 28 3092 topology 3104 4048
 > 16 0 28 3092 topology 3202 4048
-> 15 0 28 3092 topology 3101 4049
+> 15 0 28 3092 topology 3103 4049
 > 16 0 28 3092 topology 3202 4049
-> 15 0 28 3092 topology 3185 4050
+> 15 0 28 3092 topology 3107 4050
 > 16 0 28 3092 topology 3202 4050
-> 15 0 28 3092 topology 3161 4051
+> 15 0 28 3092 topology 3106 4051
 > 16 0 28 3092 topology 3202 4051
-> 15 0 28 3092 topology 3137 4052
+> 15 0 28 3092 topology 3110 4052
 > 16 0 28 3092 topology 3202 4052
-> 15 0 28 3092 topology 3113 4053
+> 15 0 28 3092 topology 3109 4053
 > 16 0 28 3092 topology 3202 4053
-> 15 0 28 3092 topology 3197 4054
+> 15 0 28 3092 topology 3113 4054
 > 16 0 28 3092 topology 3202 4054
-> 15 0 28 3092 topology 3173 4055
+> 15 0 28 3092 topology 3112 4055
 > 16 0 28 3092 topology 3202 4055
-> 15 0 28 3092 topology 3115 4056
+> 15 0 28 3092 topology 3116 4056
 > 16 0 28 3092 topology 3202 4056
-> 15 0 28 3092 topology 3145 4057
+> 15 0 28 3092 topology 3115 4057
 > 16 0 28 3092 topology 3202 4057
-> 15 0 28 3092 topology 3175 4058
+> 15 0 28 3092 topology 3119 4058
 > 16 0 28 3092 topology 3202 4058
-> 15 0 30 3092 topology 3201 4059
-> 16 0 30 3092 topology 3202 4059
-> 15 0 28 3092 topology 3097 4060
+> 15 0 28 3092 topology 3118 4059
+> 16 0 28 3092 topology 3202 4059
+> 15 0 28 3092 topology 3122 4060
 > 16 0 28 3092 topology 3202 4060
-> 15 0 28 3092 topology 3127 4061
+> 15 0 28 3092 topology 3121 4061
 > 16 0 28 3092 topology 3202 4061
-> 15 0 28 3092 topology 3157 4062
+> 15 0 28 3092 topology 3125 4062
 > 16 0 28 3092 topology 3202 4062
-> 15 0 28 3092 topology 3187 4063
+> 15 0 28 3092 topology 3124 4063
 > 16 0 28 3092 topology 3202 4063
-> 15 0 28 3092 topology 3109 4064
+> 15 0 28 3092 topology 3128 4064
 > 16 0 28 3092 topology 3202 4064
-> 15 0 28 3092 topology 3139 4065
+> 15 0 28 3092 topology 3127 4065
 > 16 0 28 3092 topology 3202 4065
-> 15 0 29 3092 topology 3144 4066
-> 16 0 29 3092 topology 3146 4066
-> 15 0 28 3092 topology 3169 4067
+> 15 0 28 3092 topology 3131 4066
+> 16 0 28 3092 topology 3202 4066
+> 15 0 28 3092 topology 3130 4067
 > 16 0 28 3092 topology 3202 4067
-> 15 0 29 3092 topology 3093 4068
-> 16 0 29 3092 topology 3095 4068
-> 15 0 29 3092 topology 3147 4069
-> 16 0 29 3092 topology 3149 4069
-> 15 0 28 3092 topology 3199 4070
+> 15 0 28 3092 topology 3134 4068
+> 16 0 28 3092 topology 3202 4068
+> 15 0 28 3092 topology 3133 4069
+> 16 0 28 3092 topology 3202 4069
+> 15 0 28 3092 topology 3137 4070
 > 16 0 28 3092 topology 3202 4070
-> 15 0 29 3092 topology 3096 4071
-> 16 0 29 3092 topology 3098 4071
-> 15 0 29 3092 topology 3150 4072
-> 16 0 29 3092 topology 3152 4072
-> 15 0 29 3092 topology 3099 4073
-> 16 0 29 3092 topology 3101 4073
-> 15 0 29 3092 topology 3153 4074
-> 16 0 29 3092 topology 3155 4074
-> 15 0 29 3092 topology 3102 4075
-> 16 0 29 3092 topology 3104 4075
-> 15 0 29 3092 topology 3156 4076
-> 16 0 29 3092 topology 3158 4076
-> 15 0 29 3092 topology 3105 4077
-> 16 0 29 3092 topology 3107 4077
-> 15 0 29 3092 topology 3159 4078
-> 16 0 29 3092 topology 3161 4078
-> 15 0 28 3092 topology 3116 4079
+> 15 0 28 3092 topology 3136 4071
+> 16 0 28 3092 topology 3202 4071
+> 15 0 28 3092 topology 3140 4072
+> 16 0 28 3092 topology 3202 4072
+> 15 0 28 3092 topology 3139 4073
+> 16 0 28 3092 topology 3202 4073
+> 15 0 28 3092 topology 3143 4074
+> 16 0 28 3092 topology 3202 4074
+> 15 0 28 3092 topology 3142 4075
+> 16 0 28 3092 topology 3202 4075
+> 15 0 28 3092 topology 3146 4076
+> 16 0 28 3092 topology 3202 4076
+> 15 0 28 3092 topology 3145 4077
+> 16 0 28 3092 topology 3202 4077
+> 15 0 28 3092 topology 3149 4078
+> 16 0 28 3092 topology 3202 4078
+> 15 0 28 3092 topology 3148 4079
 > 16 0 28 3092 topology 3202 4079
-> 15 0 29 3092 topology 3108 4080
-> 16 0 29 3092 topology 3110 4080
-> 15 0 29 3092 topology 3162 4081
-> 16 0 29 3092 topology 3164 4081
-> 15 0 29 3092 topology 3117 4082
-> 16 0 29 3092 topology 3118 4082
-> 15 0 28 3092 topology 3176 4083
+> 15 0 28 3092 topology 3152 4080
+> 16 0 28 3092 topology 3202 4080
+> 15 0 28 3092 topology 3151 4081
+> 16 0 28 3092 topology 3202 4081
+> 15 0 28 3092 topology 3155 4082
+> 16 0 28 3092 topology 3202 4082
+> 15 0 28 3092 topology 3154 4083
 > 16 0 28 3092 topology 3202 4083
-> 15 0 29 3092 topology 3111 4084
-> 16 0 29 3092 topology 3113 4084
-> 15 0 28 3092 topology 3152 4085
+> 15 0 28 3092 topology 3158 4084
+> 16 0 28 3092 topology 3202 4084
+> 15 0 28 3092 topology 3157 4085
 > 16 0 28 3092 topology 3202 4085
-> 15 0 29 3092 topology 3165 4086
-> 16 0 29 3092 topology 3167 4086
-> 15 0 29 3092 topology 3093 4087
-> 16 0 29 3092 topology 3094 4087
-> 15 0 28 3092 topology 3128 4088
+> 15 0 28 3092 topology 3161 4086
+> 16 0 28 3092 topology 3202 4086
+> 15 0 28 3092 topology 3160 4087
+> 16 0 28 3092 topology 3202 4087
+> 15 0 28 3092 topology 3164 4088
 > 16 0 28 3092 topology 3202 4088
-> 15 0 29 3092 topology 3147 4089
-> 16 0 29 3092 topology 3148 4089
-> 15 0 28 3092 topology 3104 4090
+> 15 0 28 3092 topology 3163 4089
+> 16 0 28 3092 topology 3202 4089
+> 15 0 28 3092 topology 3167 4090
 > 16 0 28 3092 topology 3202 4090
-> 15 0 29 3092 topology 3168 4091
-> 16 0 29 3092 topology 3170 4091
-> 15 0 29 3092 topology 3123 4092
-> 16 0 29 3092 topology 3124 4092
-> 15 0 29 3092 topology 3177 4093
-> 16 0 29 3092 topology 3178 4093
-> 15 0 28 3092 topology 3188 4094
+> 15 0 28 3092 topology 3166 4091
+> 16 0 28 3092 topology 3202 4091
+> 15 0 28 3092 topology 3170 4092
+> 16 0 28 3092 topology 3202 4092
+> 15 0 28 3092 topology 3169 4093
+> 16 0 28 3092 topology 3202 4093
+> 15 0 28 3092 topology 3173 4094
 > 16 0 28 3092 topology 3202 4094
-> 15 0 28 3092 topology 3164 4095
+> 15 0 28 3092 topology 3172 4095
 > 16 0 28 3092 topology 3202 4095
-> 15 0 29 3092 topology 3171 4096
-> 16 0 29 3092 topology 3173 4096
-> 15 0 29 3092 topology 3099 4097
-> 16 0 29 3092 topology 3100 4097
-> 15 0 28 3092 topology 3140 4098
+> 15 0 28 3092 topology 3176 4096
+> 16 0 28 3092 topology 3202 4096
+> 15 0 28 3092 topology 3175 4097
+> 16 0 28 3092 topology 3202 4097
+> 15 0 28 3092 topology 3179 4098
 > 16 0 28 3092 topology 3202 4098
-> 15 0 29 3092 topology 3153 4099
-> 16 0 29 3092 topology 3154 4099
-> 15 0 29 3092 topology 3129 4100
-> 16 0 29 3092 topology 3130 4100
-> 15 0 29 3092 topology 3183 4101
-> 16 0 29 3092 topology 3184 4101
-> 15 0 28 3092 topology 3200 4102
+> 15 0 28 3092 topology 3178 4099
+> 16 0 28 3092 topology 3202 4099
+> 15 0 28 3092 topology 3182 4100
+> 16 0 28 3092 topology 3202 4100
+> 15 0 28 3092 topology 3181 4101
+> 16 0 28 3092 topology 3202 4101
+> 15 0 28 3092 topology 3185 4102
 > 16 0 28 3092 topology 3202 4102
-> 15 0 29 3092 topology 3105 4103
-> 16 0 29 3092 topology 3106 4103
-> 15 0 29 3092 topology 3159 4104
-> 16 0 29 3092 topology 3160 4104
-> 15 0 29 3092 topology 3135 4105
-> 16 0 29 3092 topology 3136 4105
-> 15 0 29 3092 topology 3189 4106
-> 16 0 29 3092 topology 3190 4106
-> 15 0 28 3092 topology 3094 4107
+> 15 0 28 3092 topology 3184 4103
+> 16 0 28 3092 topology 3202 4103
+> 15 0 28 3092 topology 3188 4104
+> 16 0 28 3092 topology 3202 4104
+> 15 0 28 3092 topology 3187 4105
+> 16 0 28 3092 topology 3202 4105
+> 15 0 28 3092 topology 3191 4106
+> 16 0 28 3092 topology 3202 4106
+> 15 0 28 3092 topology 3190 4107
 > 16 0 28 3092 topology 3202 4107
-> 15 0 29 3092 topology 3111 4108
-> 16 0 29 3092 topology 3112 4108
-> 15 0 28 3092 topology 3124 4109
+> 15 0 28 3092 topology 3194 4108
+> 16 0 28 3092 topology 3202 4108
+> 15 0 28 3092 topology 3193 4109
 > 16 0 28 3092 topology 3202 4109
-> 15 0 29 3092 topology 3165 4110
-> 16 0 29 3092 topology 3166 4110
-> 15 0 28 3092 topology 3154 4111
+> 15 0 28 3092 topology 3197 4110
+> 16 0 28 3092 topology 3202 4110
+> 15 0 28 3092 topology 3196 4111
 > 16 0 28 3092 topology 3202 4111
-> 15 0 29 3092 topology 3141 4112
-> 16 0 29 3092 topology 3142 4112
-> 15 0 28 3092 topology 3184 4113
+> 15 0 28 3092 topology 3200 4112
+> 16 0 28 3092 topology 3202 4112
+> 15 0 28 3092 topology 3199 4113
 > 16 0 28 3092 topology 3202 4113
-> 15 0 29 3092 topology 3195 4114
-> 16 0 29 3092 topology 3196 4114
-> 15 0 28 3092 topology 3106 4115
-> 16 0 28 3092 topology 3202 4115
-> 15 0 28 3092 topology 3136 4116
-> 16 0 28 3092 topology 3202 4116
-> 15 0 29 3092 topology 3171 4117
-> 16 0 29 3092 topology 3172 4117
-> 15 0 28 3092 topology 3166 4118
-> 16 0 28 3092 topology 3202 4118
-> 15 0 28 3092 topology 3196 4119
-> 16 0 28 3092 topology 3202 4119
-> 15 0 28 3092 topology 3119 4120
-> 16 0 28 3092 topology 3202 4120
-> 15 0 28 3092 topology 3095 4121
-> 16 0 28 3092 topology 3202 4121
-> 15 0 28 3092 topology 3179 4122
-> 16 0 28 3092 topology 3202 4122
-> 15 0 28 3092 topology 3155 4123
-> 16 0 28 3092 topology 3202 4123
-> 15 0 28 3092 topology 3131 4124
-> 16 0 28 3092 topology 3202 4124
-> 15 0 28 3092 topology 3107 4125
-> 16 0 28 3092 topology 3202 4125
-> 15 0 28 3092 topology 3191 4126
-> 16 0 28 3092 topology 3202 4126
-> 15 0 28 3092 topology 3167 4127
-> 16 0 28 3092 topology 3202 4127
-> 15 0 28 3092 topology 3143 4128
-> 16 0 28 3092 topology 3202 4128
-> 15 0 28 3092 topology 3121 4129
-> 16 0 28 3092 topology 3202 4129
-> 15 0 28 3092 topology 3151 4130
-> 16 0 28 3092 topology 3202 4130
-> 15 0 28 3092 topology 3181 4131
-> 16 0 28 3092 topology 3202 4131
-> 15 0 28 3092 topology 3103 4132
-> 16 0 28 3092 topology 3202 4132
-> 15 0 29 3092 topology 3114 4133
-> 16 0 29 3092 topology 3116 4133
-> 15 0 28 3092 topology 3133 4134
-> 16 0 28 3092 topology 3202 4134
-> 15 0 28 3092 topology 3163 4135
-> 16 0 28 3092 topology 3202 4135
-> 15 0 29 3092 topology 3117 4136
-> 16 0 29 3092 topology 3119 4136
-> 15 0 28 3092 topology 3193 4137
-> 16 0 28 3092 topology 3202 4137
-> 15 0 29 3092 topology 3120 4138
-> 16 0 29 3092 topology 3122 4138
-> 15 0 29 3092 topology 3174 4139
-> 16 0 29 3092 topology 3176 4139
-> 15 0 29 3092 topology 3123 4140
-> 16 0 29 3092 topology 3125 4140
-> 15 0 29 3092 topology 3177 4141
-> 16 0 29 3092 topology 3179 4141
-> 15 0 29 3092 topology 3126 4142
-> 16 0 29 3092 topology 3128 4142
-> 15 0 29 3092 topology 3180 4143
-> 16 0 29 3092 topology 3182 4143
-> 15 0 29 3092 topology 3129 4144
-> 16 0 29 3092 topology 3131 4144
-> 15 0 29 3092 topology 3183 4145
-> 16 0 29 3092 topology 3185 4145
-> 15 0 29 3092 topology 3132 4146
-> 16 0 29 3092 topology 3134 4146
-> 15 0 29 3092 topology 3186 4147
-> 16 0 29 3092 topology 3188 4147
-> 15 0 29 3092 topology 3114 4148
-> 16 0 29 3092 topology 3115 4148
-> 15 0 29 3092 topology 3135 4149
-> 16 0 29 3092 topology 3137 4149
-> 15 0 28 3092 topology 3146 4150
-> 16 0 28 3092 topology 3202 4150
-> 15 0 29 3092 topology 3189 4151
-> 16 0 29 3092 topology 3191 4151
-> 15 0 28 3092 topology 3122 4152
-> 16 0 28 3092 topology 3202 4152
-> 15 0 29 3092 topology 3144 4153
-> 16 0 29 3092 topology 3145 4153
-> 15 0 28 3092 topology 3098 4154
-> 16 0 28 3092 topology 3202 4154
-> 15 0 29 3092 topology 3138 4155
-> 16 0 29 3092 topology 3140 4155
-> 15 0 29 3092 topology 3192 4156
-> 16 0 29 3092 topology 3194 4156
-> 15 0 29 3092 topology 3120 4157
-> 16 0 29 3092 topology 3121 4157
-> 15 0 29 3092 topology 3174 4158
-> 16 0 29 3092 topology 3175 4158
-> 15 0 28 3092 topology 3182 4159
-> 16 0 28 3092 topology 3202 4159
-> 15 0 29 3092 topology 3141 4160
-> 16 0 29 3092 topology 3143 4160
-> 15 0 28 3092 topology 3158 4161
-> 16 0 28 3092 topology 3202 4161
-> 15 0 29 3092 topology 3195 4162
-> 16 0 29 3092 topology 3197 4162
-> 15 0 29 3092 topology 3096 4163
-> 16 0 29 3092 topology 3097 4163
-> 15 0 28 3092 topology 3134 4164
-> 16 0 28 3092 topology 3202 4164
-> 15 0 29 3092 topology 3150 4165
-> 16 0 29 3092 topology 3151 4165
-> 15 0 28 3092 topology 3110 4166
-> 16 0 28 3092 topology 3202 4166
-> 15 0 29 3092 topology 3198 4167
-> 16 0 29 3092 topology 3200 4167
-> 15 0 29 3092 topology 3126 4168
-> 16 0 29 3092 topology 3127 4168
-> 15 0 29 3092 topology 3180 4169
-> 16 0 29 3092 topology 3181 4169
-> 15 0 28 3092 topology 3194 4170
-> 16 0 28 3092 topology 3202 4170
-> 15 0 28 3092 topology 3170 4171
-> 16 0 28 3092 topology 3202 4171
-> 15 0 29 3092 topology 3102 4172
-> 16 0 29 3092 topology 3103 4172
-> 15 0 29 3092 topology 3156 4173
-> 16 0 29 3092 topology 3157 4173
-> 15 0 29 3092 topology 3132 4174
-> 16 0 29 3092 topology 3133 4174
-> 15 0 29 3092 topology 3186 4175
-> 16 0 29 3092 topology 3187 4175
-> 15 0 29 3092 topology 3108 4176
-> 16 0 29 3092 topology 3109 4176
-> 15 0 28 3092 topology 3118 4177
-> 16 0 28 3092 topology 3202 4177
-> 15 0 29 3092 topology 3162 4178
-> 16 0 29 3092 topology 3163 4178
-> 15 0 28 3092 topology 3148 4179
-> 16 0 28 3092 topology 3202 4179
-> 15 0 29 3092 topology 3138 4180
-> 16 0 29 3092 topology 3139 4180
-> 15 0 28 3092 topology 3178 4181
-> 16 0 28 3092 topology 3202 4181
-> 15 0 29 3092 topology 3192 4182
-> 16 0 29 3092 topology 3193 4182
-> 15 0 28 3092 topology 3100 4183
-> 16 0 28 3092 topology 3202 4183
-> 15 0 28 3092 topology 3130 4184
-> 16 0 28 3092 topology 3202 4184
-> 15 0 29 3092 topology 3168 4185
-> 16 0 29 3092 topology 3169 4185
-> 15 0 28 3092 topology 3160 4186
-> 16 0 28 3092 topology 3202 4186
-> 15 0 28 3203 topology 3242 4187
+> 15 0 29 3092 topology 3201 4114
+> 16 0 29 3092 topology 3202 4114
+> 15 0 30 3092 topology 3093 4115
+> 16 0 30 3092 topology 3095 4115
+> 15 0 30 3092 topology 3093 4116
+> 16 0 30 3092 topology 3094 4116
+> 15 0 30 3092 topology 3096 4117
+> 16 0 30 3092 topology 3098 4117
+> 15 0 30 3092 topology 3096 4118
+> 16 0 30 3092 topology 3097 4118
+> 15 0 30 3092 topology 3099 4119
+> 16 0 30 3092 topology 3101 4119
+> 15 0 30 3092 topology 3099 4120
+> 16 0 30 3092 topology 3100 4120
+> 15 0 30 3092 topology 3102 4121
+> 16 0 30 3092 topology 3104 4121
+> 15 0 30 3092 topology 3102 4122
+> 16 0 30 3092 topology 3103 4122
+> 15 0 30 3092 topology 3105 4123
+> 16 0 30 3092 topology 3107 4123
+> 15 0 30 3092 topology 3105 4124
+> 16 0 30 3092 topology 3106 4124
+> 15 0 30 3092 topology 3108 4125
+> 16 0 30 3092 topology 3110 4125
+> 15 0 30 3092 topology 3108 4126
+> 16 0 30 3092 topology 3109 4126
+> 15 0 30 3092 topology 3111 4127
+> 16 0 30 3092 topology 3113 4127
+> 15 0 30 3092 topology 3111 4128
+> 16 0 30 3092 topology 3112 4128
+> 15 0 30 3092 topology 3114 4129
+> 16 0 30 3092 topology 3116 4129
+> 15 0 30 3092 topology 3114 4130
+> 16 0 30 3092 topology 3115 4130
+> 15 0 30 3092 topology 3117 4131
+> 16 0 30 3092 topology 3119 4131
+> 15 0 30 3092 topology 3117 4132
+> 16 0 30 3092 topology 3118 4132
+> 15 0 30 3092 topology 3120 4133
+> 16 0 30 3092 topology 3122 4133
+> 15 0 30 3092 topology 3120 4134
+> 16 0 30 3092 topology 3121 4134
+> 15 0 30 3092 topology 3123 4135
+> 16 0 30 3092 topology 3125 4135
+> 15 0 30 3092 topology 3123 4136
+> 16 0 30 3092 topology 3124 4136
+> 15 0 30 3092 topology 3126 4137
+> 16 0 30 3092 topology 3128 4137
+> 15 0 30 3092 topology 3126 4138
+> 16 0 30 3092 topology 3127 4138
+> 15 0 30 3092 topology 3129 4139
+> 16 0 30 3092 topology 3131 4139
+> 15 0 30 3092 topology 3129 4140
+> 16 0 30 3092 topology 3130 4140
+> 15 0 30 3092 topology 3132 4141
+> 16 0 30 3092 topology 3134 4141
+> 15 0 30 3092 topology 3132 4142
+> 16 0 30 3092 topology 3133 4142
+> 15 0 30 3092 topology 3135 4143
+> 16 0 30 3092 topology 3137 4143
+> 15 0 30 3092 topology 3135 4144
+> 16 0 30 3092 topology 3136 4144
+> 15 0 30 3092 topology 3138 4145
+> 16 0 30 3092 topology 3140 4145
+> 15 0 30 3092 topology 3138 4146
+> 16 0 30 3092 topology 3139 4146
+> 15 0 30 3092 topology 3141 4147
+> 16 0 30 3092 topology 3143 4147
+> 15 0 30 3092 topology 3141 4148
+> 16 0 30 3092 topology 3142 4148
+> 15 0 30 3092 topology 3144 4149
+> 16 0 30 3092 topology 3146 4149
+> 15 0 30 3092 topology 3144 4150
+> 16 0 30 3092 topology 3145 4150
+> 15 0 30 3092 topology 3147 4151
+> 16 0 30 3092 topology 3149 4151
+> 15 0 30 3092 topology 3147 4152
+> 16 0 30 3092 topology 3148 4152
+> 15 0 30 3092 topology 3150 4153
+> 16 0 30 3092 topology 3152 4153
+> 15 0 30 3092 topology 3150 4154
+> 16 0 30 3092 topology 3151 4154
+> 15 0 30 3092 topology 3153 4155
+> 16 0 30 3092 topology 3155 4155
+> 15 0 30 3092 topology 3153 4156
+> 16 0 30 3092 topology 3154 4156
+> 15 0 30 3092 topology 3156 4157
+> 16 0 30 3092 topology 3158 4157
+> 15 0 30 3092 topology 3156 4158
+> 16 0 30 3092 topology 3157 4158
+> 15 0 30 3092 topology 3159 4159
+> 16 0 30 3092 topology 3161 4159
+> 15 0 30 3092 topology 3159 4160
+> 16 0 30 3092 topology 3160 4160
+> 15 0 30 3092 topology 3162 4161
+> 16 0 30 3092 topology 3164 4161
+> 15 0 30 3092 topology 3162 4162
+> 16 0 30 3092 topology 3163 4162
+> 15 0 30 3092 topology 3165 4163
+> 16 0 30 3092 topology 3167 4163
+> 15 0 30 3092 topology 3165 4164
+> 16 0 30 3092 topology 3166 4164
+> 15 0 30 3092 topology 3168 4165
+> 16 0 30 3092 topology 3170 4165
+> 15 0 30 3092 topology 3168 4166
+> 16 0 30 3092 topology 3169 4166
+> 15 0 30 3092 topology 3171 4167
+> 16 0 30 3092 topology 3173 4167
+> 15 0 30 3092 topology 3171 4168
+> 16 0 30 3092 topology 3172 4168
+> 15 0 30 3092 topology 3174 4169
+> 16 0 30 3092 topology 3176 4169
+> 15 0 30 3092 topology 3174 4170
+> 16 0 30 3092 topology 3175 4170
+> 15 0 30 3092 topology 3177 4171
+> 16 0 30 3092 topology 3179 4171
+> 15 0 30 3092 topology 3177 4172
+> 16 0 30 3092 topology 3178 4172
+> 15 0 30 3092 topology 3180 4173
+> 16 0 30 3092 topology 3182 4173
+> 15 0 30 3092 topology 3180 4174
+> 16 0 30 3092 topology 3181 4174
+> 15 0 30 3092 topology 3183 4175
+> 16 0 30 3092 topology 3185 4175
+> 15 0 30 3092 topology 3183 4176
+> 16 0 30 3092 topology 3184 4176
+> 15 0 30 3092 topology 3186 4177
+> 16 0 30 3092 topology 3188 4177
+> 15 0 30 3092 topology 3186 4178
+> 16 0 30 3092 topology 3187 4178
+> 15 0 30 3092 topology 3189 4179
+> 16 0 30 3092 topology 3191 4179
+> 15 0 30 3092 topology 3189 4180
+> 16 0 30 3092 topology 3190 4180
+> 15 0 30 3092 topology 3192 4181
+> 16 0 30 3092 topology 3194 4181
+> 15 0 30 3092 topology 3192 4182
+> 16 0 30 3092 topology 3193 4182
+> 15 0 30 3092 topology 3195 4183
+> 16 0 30 3092 topology 3197 4183
+> 15 0 30 3092 topology 3195 4184
+> 16 0 30 3092 topology 3196 4184
+> 15 0 30 3092 topology 3198 4185
+> 16 0 30 3092 topology 3200 4185
+> 15 0 30 3092 topology 3198 4186
+> 16 0 30 3092 topology 3199 4186
+> 15 0 28 3203 topology 3206 4187
 > 16 0 28 3203 topology 3271 4187
-> 15 0 28 3203 topology 3254 4188
+> 15 0 28 3203 topology 3205 4188
 > 16 0 28 3203 topology 3271 4188
-> 15 0 28 3203 topology 3266 4189
+> 15 0 28 3203 topology 3209 4189
 > 16 0 28 3203 topology 3271 4189
-> 15 0 28 3203 topology 3215 4190
+> 15 0 28 3203 topology 3208 4190
 > 16 0 28 3203 topology 3271 4190
-> 15 0 28 3203 topology 3238 4191
+> 15 0 28 3203 topology 3212 4191
 > 16 0 28 3203 topology 3271 4191
-> 15 0 28 3203 topology 3227 4192
+> 15 0 28 3203 topology 3211 4192
 > 16 0 28 3203 topology 3271 4192
-> 15 0 28 3203 topology 3268 4193
+> 15 0 28 3203 topology 3215 4193
 > 16 0 28 3203 topology 3271 4193
-> 15 0 29 3203 topology 3237 4194
-> 16 0 29 3203 topology 3239 4194
-> 15 0 28 3203 topology 3250 4195
+> 15 0 28 3203 topology 3214 4194
+> 16 0 28 3203 topology 3271 4194
+> 15 0 28 3203 topology 3218 4195
 > 16 0 28 3203 topology 3271 4195
-> 15 0 29 3203 topology 3240 4196
-> 16 0 29 3203 topology 3242 4196
-> 15 0 29 3203 topology 3243 4197
-> 16 0 29 3203 topology 3245 4197
-> 15 0 28 3203 topology 3262 4198
+> 15 0 28 3203 topology 3217 4196
+> 16 0 28 3203 topology 3271 4196
+> 15 0 28 3203 topology 3221 4197
+> 16 0 28 3203 topology 3271 4197
+> 15 0 28 3203 topology 3220 4198
 > 16 0 28 3203 topology 3271 4198
-> 15 0 29 3203 topology 3246 4199
-> 16 0 29 3203 topology 3248 4199
-> 15 0 28 3203 topology 3217 4200
+> 15 0 28 3203 topology 3224 4199
+> 16 0 28 3203 topology 3271 4199
+> 15 0 28 3203 topology 3223 4200
 > 16 0 28 3203 topology 3271 4200
-> 15 0 29 3203 topology 3249 4201
-> 16 0 29 3203 topology 3251 4201
-> 15 0 29 3203 topology 3252 4202
-> 16 0 29 3203 topology 3254 4202
-> 15 0 28 3203 topology 3229 4203
+> 15 0 28 3203 topology 3227 4201
+> 16 0 28 3203 topology 3271 4201
+> 15 0 28 3203 topology 3226 4202
+> 16 0 28 3203 topology 3271 4202
+> 15 0 28 3203 topology 3230 4203
 > 16 0 28 3203 topology 3271 4203
-> 15 0 29 3203 topology 3255 4204
-> 16 0 29 3203 topology 3257 4204
-> 15 0 29 3203 topology 3237 4205
-> 16 0 29 3203 topology 3238 4205
-> 15 0 29 3203 topology 3258 4206
-> 16 0 29 3203 topology 3260 4206
-> 15 0 29 3203 topology 3267 4207
-> 16 0 29 3203 topology 3268 4207
-> 15 0 29 3203 topology 3261 4208
-> 16 0 29 3203 topology 3263 4208
-> 15 0 28 3203 topology 3269 4209
+> 15 0 28 3203 topology 3229 4204
+> 16 0 28 3203 topology 3271 4204
+> 15 0 28 3203 topology 3233 4205
+> 16 0 28 3203 topology 3271 4205
+> 15 0 28 3203 topology 3232 4206
+> 16 0 28 3203 topology 3271 4206
+> 15 0 28 3203 topology 3236 4207
+> 16 0 28 3203 topology 3271 4207
+> 15 0 28 3203 topology 3235 4208
+> 16 0 28 3203 topology 3271 4208
+> 15 0 28 3203 topology 3239 4209
 > 16 0 28 3203 topology 3271 4209
-> 15 0 29 3203 topology 3243 4210
-> 16 0 29 3203 topology 3244 4210
-> 15 0 28 3203 topology 3245 4211
+> 15 0 28 3203 topology 3238 4210
+> 16 0 28 3203 topology 3271 4210
+> 15 0 28 3203 topology 3242 4211
 > 16 0 28 3203 topology 3271 4211
-> 15 0 29 3203 topology 3264 4212
-> 16 0 29 3203 topology 3266 4212
-> 15 0 29 3203 topology 3249 4213
-> 16 0 29 3203 topology 3250 4213
-> 15 0 28 3203 topology 3257 4214
+> 15 0 28 3203 topology 3241 4212
+> 16 0 28 3203 topology 3271 4212
+> 15 0 28 3203 topology 3245 4213
+> 16 0 28 3203 topology 3271 4213
+> 15 0 28 3203 topology 3244 4214
 > 16 0 28 3203 topology 3271 4214
-> 15 0 29 3203 topology 3255 4215
-> 16 0 29 3203 topology 3256 4215
-> 15 0 28 3203 topology 3218 4216
+> 15 0 28 3203 topology 3248 4215
+> 16 0 28 3203 topology 3271 4215
+> 15 0 28 3203 topology 3247 4216
 > 16 0 28 3203 topology 3271 4216
-> 15 0 29 3203 topology 3261 4217
-> 16 0 29 3203 topology 3262 4217
-> 15 0 28 3203 topology 3230 4218
+> 15 0 28 3203 topology 3251 4217
+> 16 0 28 3203 topology 3271 4217
+> 15 0 28 3203 topology 3250 4218
 > 16 0 28 3203 topology 3271 4218
-> 15 0 28 3203 topology 3206 4219
+> 15 0 28 3203 topology 3254 4219
 > 16 0 28 3203 topology 3271 4219
-> 15 0 29 3203 topology 3210 4220
-> 16 0 29 3203 topology 3211 4220
-> 15 0 28 3203 topology 3247 4221
+> 15 0 28 3203 topology 3253 4220
+> 16 0 28 3203 topology 3271 4220
+> 15 0 28 3203 topology 3257 4221
 > 16 0 28 3203 topology 3271 4221
-> 15 0 29 3203 topology 3204 4222
-> 16 0 29 3203 topology 3206 4222
-> 15 0 29 3203 topology 3216 4223
-> 16 0 29 3203 topology 3217 4223
+> 15 0 28 3203 topology 3256 4222
+> 16 0 28 3203 topology 3271 4222
+> 15 0 28 3203 topology 3260 4223
+> 16 0 28 3203 topology 3271 4223
 > 15 0 28 3203 topology 3259 4224
 > 16 0 28 3203 topology 3271 4224
-> 15 0 30 3203 topology 3270 4225
-> 16 0 30 3203 topology 3271 4225
-> 15 0 28 3203 topology 3214 4226
+> 15 0 28 3203 topology 3263 4225
+> 16 0 28 3203 topology 3271 4225
+> 15 0 28 3203 topology 3262 4226
 > 16 0 28 3203 topology 3271 4226
-> 15 0 29 3203 topology 3222 4227
-> 16 0 29 3203 topology 3223 4227
-> 15 0 28 3203 topology 3226 4228
+> 15 0 28 3203 topology 3266 4227
+> 16 0 28 3203 topology 3271 4227
+> 15 0 28 3203 topology 3265 4228
 > 16 0 28 3203 topology 3271 4228
-> 15 0 29 3203 topology 3228 4229
-> 16 0 29 3203 topology 3229 4229
-> 15 0 29 3203 topology 3204 4230
-> 16 0 29 3203 topology 3205 4230
-> 15 0 29 3203 topology 3234 4231
-> 16 0 29 3203 topology 3235 4231
-> 15 0 28 3203 topology 3248 4232
-> 16 0 28 3203 topology 3271 4232
-> 15 0 28 3203 topology 3260 4233
-> 16 0 28 3203 topology 3271 4233
-> 15 0 28 3203 topology 3209 4234
-> 16 0 28 3203 topology 3271 4234
-> 15 0 28 3203 topology 3221 4235
-> 16 0 28 3203 topology 3271 4235
-> 15 0 28 3203 topology 3244 4236
-> 16 0 28 3203 topology 3271 4236
-> 15 0 28 3203 topology 3233 4237
-> 16 0 28 3203 topology 3271 4237
-> 15 0 28 3203 topology 3256 4238
-> 16 0 28 3203 topology 3271 4238
-> 15 0 29 3203 topology 3267 4239
-> 16 0 29 3203 topology 3269 4239
-> 15 0 28 3203 topology 3211 4240
-> 16 0 28 3203 topology 3271 4240
-> 15 0 28 3203 topology 3223 4241
-> 16 0 28 3203 topology 3271 4241
-> 15 0 28 3203 topology 3205 4242
-> 16 0 28 3203 topology 3271 4242
-> 15 0 28 3203 topology 3235 4243
-> 16 0 28 3203 topology 3271 4243
-> 15 0 28 3203 topology 3239 4244
-> 16 0 28 3203 topology 3271 4244
-> 15 0 29 3203 topology 3240 4245
-> 16 0 29 3203 topology 3241 4245
-> 15 0 29 3203 topology 3207 4246
-> 16 0 29 3203 topology 3209 4246
-> 15 0 29 3203 topology 3210 4247
-> 16 0 29 3203 topology 3212 4247
-> 15 0 29 3203 topology 3246 4248
-> 16 0 29 3203 topology 3247 4248
-> 15 0 28 3203 topology 3251 4249
-> 16 0 28 3203 topology 3271 4249
-> 15 0 29 3203 topology 3213 4250
-> 16 0 29 3203 topology 3215 4250
-> 15 0 29 3203 topology 3216 4251
-> 16 0 29 3203 topology 3218 4251
-> 15 0 29 3203 topology 3252 4252
-> 16 0 29 3203 topology 3253 4252
-> 15 0 28 3203 topology 3263 4253
-> 16 0 28 3203 topology 3271 4253
-> 15 0 28 3203 topology 3212 4254
-> 16 0 28 3203 topology 3271 4254
-> 15 0 29 3203 topology 3219 4255
-> 16 0 29 3203 topology 3221 4255
-> 15 0 29 3203 topology 3222 4256
-> 16 0 29 3203 topology 3224 4256
-> 15 0 29 3203 topology 3258 4257
-> 16 0 29 3203 topology 3259 4257
-> 15 0 28 3203 topology 3224 4258
-> 16 0 28 3203 topology 3271 4258
-> 15 0 29 3203 topology 3225 4259
-> 16 0 29 3203 topology 3227 4259
-> 15 0 29 3203 topology 3207 4260
-> 16 0 29 3203 topology 3208 4260
-> 15 0 28 3203 topology 3241 4261
-> 16 0 28 3203 topology 3271 4261
-> 15 0 29 3203 topology 3228 4262
-> 16 0 29 3203 topology 3230 4262
-> 15 0 29 3203 topology 3264 4263
-> 16 0 29 3203 topology 3265 4263
-> 15 0 29 3203 topology 3231 4264
-> 16 0 29 3203 topology 3233 4264
-> 15 0 28 3203 topology 3236 4265
-> 16 0 28 3203 topology 3271 4265
-> 15 0 29 3203 topology 3213 4266
-> 16 0 29 3203 topology 3214 4266
-> 15 0 28 3203 topology 3253 4267
-> 16 0 28 3203 topology 3271 4267
-> 15 0 29 3203 topology 3234 4268
-> 16 0 29 3203 topology 3236 4268
-> 15 0 28 3203 topology 3208 4269
-> 16 0 28 3203 topology 3271 4269
-> 15 0 29 3203 topology 3219 4270
-> 16 0 29 3203 topology 3220 4270
-> 15 0 28 3203 topology 3265 4271
-> 16 0 28 3203 topology 3271 4271
-> 15 0 28 3203 topology 3220 4272
-> 16 0 28 3203 topology 3271 4272
-> 15 0 29 3203 topology 3225 4273
-> 16 0 29 3203 topology 3226 4273
-> 15 0 28 3203 topology 3232 4274
-> 16 0 28 3203 topology 3271 4274
-> 15 0 29 3203 topology 3231 4275
-> 16 0 29 3203 topology 3232 4275
-> 15 0 28 3272 topology 3281 4276
+> 15 0 28 3203 topology 3269 4229
+> 16 0 28 3203 topology 3271 4229
+> 15 0 28 3203 topology 3268 4230
+> 16 0 28 3203 topology 3271 4230
+> 15 0 29 3203 topology 3270 4231
+> 16 0 29 3203 topology 3271 4231
+> 15 0 30 3203 topology 3204 4232
+> 16 0 30 3203 topology 3206 4232
+> 15 0 30 3203 topology 3204 4233
+> 16 0 30 3203 topology 3205 4233
+> 15 0 30 3203 topology 3207 4234
+> 16 0 30 3203 topology 3209 4234
+> 15 0 30 3203 topology 3207 4235
+> 16 0 30 3203 topology 3208 4235
+> 15 0 30 3203 topology 3210 4236
+> 16 0 30 3203 topology 3212 4236
+> 15 0 30 3203 topology 3210 4237
+> 16 0 30 3203 topology 3211 4237
+> 15 0 30 3203 topology 3213 4238
+> 16 0 30 3203 topology 3215 4238
+> 15 0 30 3203 topology 3213 4239
+> 16 0 30 3203 topology 3214 4239
+> 15 0 30 3203 topology 3216 4240
+> 16 0 30 3203 topology 3218 4240
+> 15 0 30 3203 topology 3216 4241
+> 16 0 30 3203 topology 3217 4241
+> 15 0 30 3203 topology 3219 4242
+> 16 0 30 3203 topology 3221 4242
+> 15 0 30 3203 topology 3219 4243
+> 16 0 30 3203 topology 3220 4243
+> 15 0 30 3203 topology 3222 4244
+> 16 0 30 3203 topology 3224 4244
+> 15 0 30 3203 topology 3222 4245
+> 16 0 30 3203 topology 3223 4245
+> 15 0 30 3203 topology 3225 4246
+> 16 0 30 3203 topology 3227 4246
+> 15 0 30 3203 topology 3225 4247
+> 16 0 30 3203 topology 3226 4247
+> 15 0 30 3203 topology 3228 4248
+> 16 0 30 3203 topology 3230 4248
+> 15 0 30 3203 topology 3228 4249
+> 16 0 30 3203 topology 3229 4249
+> 15 0 30 3203 topology 3231 4250
+> 16 0 30 3203 topology 3233 4250
+> 15 0 30 3203 topology 3231 4251
+> 16 0 30 3203 topology 3232 4251
+> 15 0 30 3203 topology 3234 4252
+> 16 0 30 3203 topology 3236 4252
+> 15 0 30 3203 topology 3234 4253
+> 16 0 30 3203 topology 3235 4253
+> 15 0 30 3203 topology 3237 4254
+> 16 0 30 3203 topology 3239 4254
+> 15 0 30 3203 topology 3237 4255
+> 16 0 30 3203 topology 3238 4255
+> 15 0 30 3203 topology 3240 4256
+> 16 0 30 3203 topology 3242 4256
+> 15 0 30 3203 topology 3240 4257
+> 16 0 30 3203 topology 3241 4257
+> 15 0 30 3203 topology 3243 4258
+> 16 0 30 3203 topology 3245 4258
+> 15 0 30 3203 topology 3243 4259
+> 16 0 30 3203 topology 3244 4259
+> 15 0 30 3203 topology 3246 4260
+> 16 0 30 3203 topology 3248 4260
+> 15 0 30 3203 topology 3246 4261
+> 16 0 30 3203 topology 3247 4261
+> 15 0 30 3203 topology 3249 4262
+> 16 0 30 3203 topology 3251 4262
+> 15 0 30 3203 topology 3249 4263
+> 16 0 30 3203 topology 3250 4263
+> 15 0 30 3203 topology 3252 4264
+> 16 0 30 3203 topology 3254 4264
+> 15 0 30 3203 topology 3252 4265
+> 16 0 30 3203 topology 3253 4265
+> 15 0 30 3203 topology 3255 4266
+> 16 0 30 3203 topology 3257 4266
+> 15 0 30 3203 topology 3255 4267
+> 16 0 30 3203 topology 3256 4267
+> 15 0 30 3203 topology 3258 4268
+> 16 0 30 3203 topology 3260 4268
+> 15 0 30 3203 topology 3258 4269
+> 16 0 30 3203 topology 3259 4269
+> 15 0 30 3203 topology 3261 4270
+> 16 0 30 3203 topology 3263 4270
+> 15 0 30 3203 topology 3261 4271
+> 16 0 30 3203 topology 3262 4271
+> 15 0 30 3203 topology 3264 4272
+> 16 0 30 3203 topology 3266 4272
+> 15 0 30 3203 topology 3264 4273
+> 16 0 30 3203 topology 3265 4273
+> 15 0 30 3203 topology 3267 4274
+> 16 0 30 3203 topology 3269 4274
+> 15 0 30 3203 topology 3267 4275
+> 16 0 30 3203 topology 3268 4275
+> 15 0 28 3272 topology 3275 4276
 > 16 0 28 3272 topology 3292 4276
-> 15 0 28 3272 topology 3277 4277
+> 15 0 28 3272 topology 3274 4277
 > 16 0 28 3272 topology 3292 4277
-> 15 0 28 3272 topology 3289 4278
+> 15 0 28 3272 topology 3278 4278
 > 16 0 28 3272 topology 3292 4278
-> 15 0 29 3272 topology 3273 4279
-> 16 0 29 3272 topology 3274 4279
-> 15 0 29 3272 topology 3279 4280
-> 16 0 29 3272 topology 3280 4280
-> 15 0 29 3272 topology 3285 4281
-> 16 0 29 3272 topology 3286 4281
+> 15 0 28 3272 topology 3277 4279
+> 16 0 28 3272 topology 3292 4279
+> 15 0 28 3272 topology 3281 4280
+> 16 0 28 3272 topology 3292 4280
+> 15 0 28 3272 topology 3280 4281
+> 16 0 28 3272 topology 3292 4281
 > 15 0 28 3272 topology 3284 4282
 > 16 0 28 3272 topology 3292 4282
-> 15 0 28 3272 topology 3274 4283
+> 15 0 28 3272 topology 3283 4283
 > 16 0 28 3272 topology 3292 4283
-> 15 0 30 3272 topology 3291 4284
-> 16 0 30 3272 topology 3292 4284
+> 15 0 28 3272 topology 3287 4284
+> 16 0 28 3272 topology 3292 4284
 > 15 0 28 3272 topology 3286 4285
 > 16 0 28 3272 topology 3292 4285
-> 15 0 28 3272 topology 3275 4286
+> 15 0 28 3272 topology 3290 4286
 > 16 0 28 3272 topology 3292 4286
-> 15 0 28 3272 topology 3287 4287
+> 15 0 28 3272 topology 3289 4287
 > 16 0 28 3272 topology 3292 4287
-> 15 0 29 3272 topology 3273 4288
-> 16 0 29 3272 topology 3275 4288
-> 15 0 29 3272 topology 3276 4289
-> 16 0 29 3272 topology 3278 4289
-> 15 0 29 3272 topology 3279 4290
-> 16 0 29 3272 topology 3281 4290
-> 15 0 28 3272 topology 3283 4291
-> 16 0 28 3272 topology 3292 4291
-> 15 0 29 3272 topology 3282 4292
-> 16 0 29 3272 topology 3284 4292
-> 15 0 29 3272 topology 3285 4293
-> 16 0 29 3272 topology 3287 4293
-> 15 0 29 3272 topology 3288 4294
-> 16 0 29 3272 topology 3290 4294
-> 15 0 29 3272 topology 3276 4295
-> 16 0 29 3272 topology 3277 4295
-> 15 0 29 3272 topology 3282 4296
-> 16 0 29 3272 topology 3283 4296
-> 15 0 28 3272 topology 3278 4297
-> 16 0 28 3272 topology 3292 4297
-> 15 0 29 3272 topology 3288 4298
-> 16 0 29 3272 topology 3289 4298
-> 15 0 28 3272 topology 3290 4299
-> 16 0 28 3272 topology 3292 4299
-> 15 0 28 3272 topology 3280 4300
-> 16 0 28 3272 topology 3292 4300
-> 15 0 29 3293 topology 3294 4301
-> 16 0 29 3293 topology 3295 4301
-> 15 0 29 3293 topology 3300 4302
-> 16 0 29 3293 topology 3301 4302
-> 15 0 28 3293 topology 3302 4303
+> 15 0 29 3272 topology 3291 4288
+> 16 0 29 3272 topology 3292 4288
+> 15 0 30 3272 topology 3273 4289
+> 16 0 30 3272 topology 3275 4289
+> 15 0 30 3272 topology 3273 4290
+> 16 0 30 3272 topology 3274 4290
+> 15 0 30 3272 topology 3276 4291
+> 16 0 30 3272 topology 3278 4291
+> 15 0 30 3272 topology 3276 4292
+> 16 0 30 3272 topology 3277 4292
+> 15 0 30 3272 topology 3279 4293
+> 16 0 30 3272 topology 3281 4293
+> 15 0 30 3272 topology 3279 4294
+> 16 0 30 3272 topology 3280 4294
+> 15 0 30 3272 topology 3282 4295
+> 16 0 30 3272 topology 3284 4295
+> 15 0 30 3272 topology 3282 4296
+> 16 0 30 3272 topology 3283 4296
+> 15 0 30 3272 topology 3285 4297
+> 16 0 30 3272 topology 3287 4297
+> 15 0 30 3272 topology 3285 4298
+> 16 0 30 3272 topology 3286 4298
+> 15 0 30 3272 topology 3288 4299
+> 16 0 30 3272 topology 3290 4299
+> 15 0 30 3272 topology 3288 4300
+> 16 0 30 3272 topology 3289 4300
+> 15 0 28 3293 topology 3296 4301
+> 16 0 28 3293 topology 3313 4301
+> 15 0 28 3293 topology 3295 4302
+> 16 0 28 3293 topology 3313 4302
+> 15 0 28 3293 topology 3299 4303
 > 16 0 28 3293 topology 3313 4303
-> 15 0 28 3293 topology 3304 4304
+> 15 0 28 3293 topology 3298 4304
 > 16 0 28 3293 topology 3313 4304
-> 15 0 28 3293 topology 3298 4305
+> 15 0 28 3293 topology 3302 4305
 > 16 0 28 3293 topology 3313 4305
-> 15 0 28 3293 topology 3305 4306
+> 15 0 28 3293 topology 3301 4306
 > 16 0 28 3293 topology 3313 4306
-> 15 0 29 3293 topology 3303 4307
-> 16 0 29 3293 topology 3305 4307
-> 15 0 29 3293 topology 3306 4308
-> 16 0 29 3293 topology 3308 4308
-> 15 0 30 3293 topology 3312 4309
-> 16 0 30 3293 topology 3313 4309
-> 15 0 29 3293 topology 3309 4310
-> 16 0 29 3293 topology 3311 4310
-> 15 0 28 3293 topology 3295 4311
+> 15 0 28 3293 topology 3305 4307
+> 16 0 28 3293 topology 3313 4307
+> 15 0 28 3293 topology 3304 4308
+> 16 0 28 3293 topology 3313 4308
+> 15 0 28 3293 topology 3308 4309
+> 16 0 28 3293 topology 3313 4309
+> 15 0 28 3293 topology 3307 4310
+> 16 0 28 3293 topology 3313 4310
+> 15 0 28 3293 topology 3311 4311
 > 16 0 28 3293 topology 3313 4311
-> 15 0 29 3293 topology 3303 4312
-> 16 0 29 3293 topology 3304 4312
-> 15 0 29 3293 topology 3309 4313
-> 16 0 29 3293 topology 3310 4313
-> 15 0 28 3293 topology 3308 4314
-> 16 0 28 3293 topology 3313 4314
-> 15 0 28 3293 topology 3296 4315
-> 16 0 28 3293 topology 3313 4315
-> 15 0 29 3293 topology 3297 4316
-> 16 0 29 3293 topology 3298 4316
-> 15 0 28 3293 topology 3310 4317
-> 16 0 28 3293 topology 3313 4317
-> 15 0 28 3293 topology 3311 4318
-> 16 0 28 3293 topology 3313 4318
-> 15 0 28 3293 topology 3299 4319
-> 16 0 28 3293 topology 3313 4319
-> 15 0 28 3293 topology 3307 4320
-> 16 0 28 3293 topology 3313 4320
-> 15 0 28 3293 topology 3301 4321
-> 16 0 28 3293 topology 3313 4321
-> 15 0 29 3293 topology 3294 4322
-> 16 0 29 3293 topology 3296 4322
-> 15 0 29 3293 topology 3297 4323
-> 16 0 29 3293 topology 3299 4323
-> 15 0 29 3293 topology 3306 4324
-> 16 0 29 3293 topology 3307 4324
-> 15 0 29 3293 topology 3300 4325
-> 16 0 29 3293 topology 3302 4325
+> 15 0 28 3293 topology 3310 4312
+> 16 0 28 3293 topology 3313 4312
+> 15 0 29 3293 topology 3312 4313
+> 16 0 29 3293 topology 3313 4313
+> 15 0 30 3293 topology 3294 4314
+> 16 0 30 3293 topology 3296 4314
+> 15 0 30 3293 topology 3294 4315
+> 16 0 30 3293 topology 3295 4315
+> 15 0 30 3293 topology 3297 4316
+> 16 0 30 3293 topology 3299 4316
+> 15 0 30 3293 topology 3297 4317
+> 16 0 30 3293 topology 3298 4317
+> 15 0 30 3293 topology 3300 4318
+> 16 0 30 3293 topology 3302 4318
+> 15 0 30 3293 topology 3300 4319
+> 16 0 30 3293 topology 3301 4319
+> 15 0 30 3293 topology 3303 4320
+> 16 0 30 3293 topology 3305 4320
+> 15 0 30 3293 topology 3303 4321
+> 16 0 30 3293 topology 3304 4321
+> 15 0 30 3293 topology 3306 4322
+> 16 0 30 3293 topology 3308 4322
+> 15 0 30 3293 topology 3306 4323
+> 16 0 30 3293 topology 3307 4323
+> 15 0 30 3293 topology 3309 4324
+> 16 0 30 3293 topology 3311 4324
+> 15 0 30 3293 topology 3309 4325
+> 16 0 30 3293 topology 3310 4325
 > 15 0 31 2350 topology 3316 4326
-> 16 0 31 2350 topology 2793 4326
+> 16 0 31 2350 topology 3315 4326
 > 15 0 31 2350 topology 3316 4327
-> 16 0 31 2350 topology 3201 4327
+> 16 0 31 2350 topology 2571 4327
 > 15 0 31 2350 topology 3316 4328
-> 16 0 31 2350 topology 3312 4328
+> 16 0 31 2350 topology 2682 4328
 > 15 0 31 2350 topology 3316 4329
-> 16 0 31 2350 topology 2904 4329
+> 16 0 31 2350 topology 2793 4329
 > 15 0 31 2350 topology 3316 4330
-> 16 0 31 2350 topology 2571 4330
+> 16 0 31 2350 topology 2904 4330
 > 15 0 31 2350 topology 3316 4331
-> 16 0 31 2350 topology 3315 4331
+> 16 0 31 2350 topology 2979 4331
 > 15 0 31 2350 topology 3316 4332
-> 16 0 31 2350 topology 3270 4332
+> 16 0 31 2350 topology 3090 4332
 > 15 0 31 2350 topology 3316 4333
-> 16 0 31 2350 topology 2979 4333
-> 15 0 32 2350 topology 2460 4334
-> 16 0 32 2350 topology 3316 4334
+> 16 0 31 2350 topology 3201 4333
+> 15 0 31 2350 topology 3316 4334
+> 16 0 31 2350 topology 3270 4334
 > 15 0 31 2350 topology 3316 4335
-> 16 0 31 2350 topology 2682 4335
+> 16 0 31 2350 topology 3291 4335
 > 15 0 31 2350 topology 3316 4336
-> 16 0 31 2350 topology 3090 4336
-> 15 0 31 2350 topology 3316 4337
-> 16 0 31 2350 topology 3291 4337
-> 15 0 23 3318 topology 3375 4338
+> 16 0 31 2350 topology 3312 4336
+> 15 0 32 2350 topology 2460 4337
+> 16 0 32 2350 topology 3316 4337
+> 15 0 23 3318 topology 3348 4338
 > 16 0 23 3318 topology 3410 4338
-> 15 0 24 3318 topology 3385 4339
-> 16 0 24 3318 topology 3387 4339
-> 15 0 24 3318 topology 3361 4340
-> 16 0 24 3318 topology 3363 4340
-> 15 0 23 3318 topology 3347 4341
+> 15 0 23 3318 topology 3347 4339
+> 16 0 23 3318 topology 3410 4339
+> 15 0 23 3318 topology 3351 4340
+> 16 0 23 3318 topology 3410 4340
+> 15 0 23 3318 topology 3350 4341
 > 16 0 23 3318 topology 3410 4341
-> 15 0 25 3318 topology 3409 4342
-> 16 0 25 3318 topology 3410 4342
-> 15 0 24 3318 topology 3337 4343
-> 16 0 24 3318 topology 3339 4343
-> 15 0 23 3318 topology 3377 4344
+> 15 0 23 3318 topology 3354 4342
+> 16 0 23 3318 topology 3410 4342
+> 15 0 23 3318 topology 3353 4343
+> 16 0 23 3318 topology 3410 4343
+> 15 0 23 3318 topology 3357 4344
 > 16 0 23 3318 topology 3410 4344
-> 15 0 24 3318 topology 3391 4345
-> 16 0 24 3318 topology 3393 4345
-> 15 0 24 3318 topology 3346 4346
-> 16 0 24 3318 topology 3347 4346
-> 15 0 23 3318 topology 3407 4347
+> 15 0 23 3318 topology 3356 4345
+> 16 0 23 3318 topology 3410 4345
+> 15 0 23 3318 topology 3360 4346
+> 16 0 23 3318 topology 3410 4346
+> 15 0 23 3318 topology 3359 4347
 > 16 0 23 3318 topology 3410 4347
-> 15 0 24 3318 topology 3367 4348
-> 16 0 24 3318 topology 3369 4348
-> 15 0 24 3318 topology 3349 4349
-> 16 0 24 3318 topology 3350 4349
-> 15 0 23 3318 topology 3359 4350
+> 15 0 23 3318 topology 3363 4348
+> 16 0 23 3318 topology 3410 4348
+> 15 0 23 3318 topology 3362 4349
+> 16 0 23 3318 topology 3410 4349
+> 15 0 23 3318 topology 3366 4350
 > 16 0 23 3318 topology 3410 4350
-> 15 0 23 3318 topology 3389 4351
+> 15 0 23 3318 topology 3365 4351
 > 16 0 23 3318 topology 3410 4351
-> 15 0 24 3318 topology 3397 4352
-> 16 0 24 3318 topology 3399 4352
-> 15 0 23 3318 topology 3330 4353
+> 15 0 23 3318 topology 3369 4352
+> 16 0 23 3318 topology 3410 4352
+> 15 0 23 3318 topology 3368 4353
 > 16 0 23 3318 topology 3410 4353
-> 15 0 24 3318 topology 3352 4354
-> 16 0 24 3318 topology 3353 4354
-> 15 0 24 3318 topology 3406 4355
-> 16 0 24 3318 topology 3407 4355
-> 15 0 24 3318 topology 3373 4356
-> 16 0 24 3318 topology 3375 4356
-> 15 0 24 3318 topology 3328 4357
-> 16 0 24 3318 topology 3329 4357
-> 15 0 24 3318 topology 3355 4358
-> 16 0 24 3318 topology 3356 4358
-> 15 0 23 3318 topology 3371 4359
+> 15 0 23 3318 topology 3372 4354
+> 16 0 23 3318 topology 3410 4354
+> 15 0 23 3318 topology 3371 4355
+> 16 0 23 3318 topology 3410 4355
+> 15 0 23 3318 topology 3375 4356
+> 16 0 23 3318 topology 3410 4356
+> 15 0 23 3318 topology 3374 4357
+> 16 0 23 3318 topology 3410 4357
+> 15 0 23 3318 topology 3321 4358
+> 16 0 23 3318 topology 3410 4358
+> 15 0 23 3318 topology 3320 4359
 > 16 0 23 3318 topology 3410 4359
-> 15 0 23 3318 topology 3401 4360
+> 15 0 23 3318 topology 3378 4360
 > 16 0 23 3318 topology 3410 4360
-> 15 0 24 3318 topology 3403 4361
-> 16 0 24 3318 topology 3405 4361
-> 15 0 23 3318 topology 3342 4362
+> 15 0 23 3318 topology 3377 4361
+> 16 0 23 3318 topology 3410 4361
+> 15 0 23 3318 topology 3381 4362
 > 16 0 23 3318 topology 3410 4362
-> 15 0 24 3318 topology 3358 4363
-> 16 0 24 3318 topology 3359 4363
-> 15 0 24 3318 topology 3361 4364
-> 16 0 24 3318 topology 3362 4364
-> 15 0 24 3318 topology 3364 4365
-> 16 0 24 3318 topology 3365 4365
-> 15 0 24 3318 topology 3340 4366
-> 16 0 24 3318 topology 3341 4366
-> 15 0 24 3318 topology 3367 4367
-> 16 0 24 3318 topology 3368 4367
-> 15 0 23 3318 topology 3326 4368
+> 15 0 23 3318 topology 3380 4363
+> 16 0 23 3318 topology 3410 4363
+> 15 0 23 3318 topology 3384 4364
+> 16 0 23 3318 topology 3410 4364
+> 15 0 23 3318 topology 3383 4365
+> 16 0 23 3318 topology 3410 4365
+> 15 0 23 3318 topology 3387 4366
+> 16 0 23 3318 topology 3410 4366
+> 15 0 23 3318 topology 3386 4367
+> 16 0 23 3318 topology 3410 4367
+> 15 0 23 3318 topology 3390 4368
 > 16 0 23 3318 topology 3410 4368
-> 15 0 24 3318 topology 3370 4369
-> 16 0 24 3318 topology 3371 4369
-> 15 0 24 3318 topology 3373 4370
-> 16 0 24 3318 topology 3374 4370
-> 15 0 23 3318 topology 3378 4371
+> 15 0 23 3318 topology 3389 4369
+> 16 0 23 3318 topology 3410 4369
+> 15 0 23 3318 topology 3393 4370
+> 16 0 23 3318 topology 3410 4370
+> 15 0 23 3318 topology 3392 4371
 > 16 0 23 3318 topology 3410 4371
-> 15 0 23 3318 topology 3354 4372
+> 15 0 23 3318 topology 3396 4372
 > 16 0 23 3318 topology 3410 4372
-> 15 0 23 3318 topology 3338 4373
+> 15 0 23 3318 topology 3395 4373
 > 16 0 23 3318 topology 3410 4373
-> 15 0 23 3318 topology 3390 4374
+> 15 0 23 3318 topology 3399 4374
 > 16 0 23 3318 topology 3410 4374
-> 15 0 23 3318 topology 3366 4375
+> 15 0 23 3318 topology 3398 4375
 > 16 0 23 3318 topology 3410 4375
-> 15 0 24 3318 topology 3328 4376
-> 16 0 24 3318 topology 3330 4376
-> 15 0 23 3318 topology 3402 4377
+> 15 0 23 3318 topology 3402 4376
+> 16 0 23 3318 topology 3410 4376
+> 15 0 23 3318 topology 3401 4377
 > 16 0 23 3318 topology 3410 4377
-> 15 0 23 3318 topology 3321 4378
+> 15 0 23 3318 topology 3405 4378
 > 16 0 23 3318 topology 3410 4378
-> 15 0 24 3318 topology 3340 4379
-> 16 0 24 3318 topology 3342 4379
-> 15 0 23 3318 topology 3356 4380
+> 15 0 23 3318 topology 3404 4379
+> 16 0 23 3318 topology 3410 4379
+> 15 0 23 3318 topology 3324 4380
 > 16 0 23 3318 topology 3410 4380
-> 15 0 23 3318 topology 3386 4381
+> 15 0 23 3318 topology 3323 4381
 > 16 0 23 3318 topology 3410 4381
-> 15 0 24 3318 topology 3325 4382
-> 16 0 24 3318 topology 3326 4382
-> 15 0 23 3318 topology 3333 4383
+> 15 0 23 3318 topology 3408 4382
+> 16 0 23 3318 topology 3410 4382
+> 15 0 23 3318 topology 3407 4383
 > 16 0 23 3318 topology 3410 4383
-> 15 0 23 3318 topology 3368 4384
+> 15 0 23 3318 topology 3327 4384
 > 16 0 23 3318 topology 3410 4384
-> 15 0 23 3318 topology 3398 4385
+> 15 0 23 3318 topology 3326 4385
 > 16 0 23 3318 topology 3410 4385
-> 15 0 23 3318 topology 3345 4386
+> 15 0 23 3318 topology 3330 4386
 > 16 0 23 3318 topology 3410 4386
-> 15 0 24 3318 topology 3337 4387
-> 16 0 24 3318 topology 3338 4387
-> 15 0 23 3318 topology 3323 4388
+> 15 0 23 3318 topology 3329 4387
+> 16 0 23 3318 topology 3410 4387
+> 15 0 23 3318 topology 3333 4388
 > 16 0 23 3318 topology 3410 4388
-> 15 0 24 3318 topology 3319 4389
-> 16 0 24 3318 topology 3321 4389
-> 15 0 23 3318 topology 3335 4390
+> 15 0 23 3318 topology 3332 4389
+> 16 0 23 3318 topology 3410 4389
+> 15 0 23 3318 topology 3336 4390
 > 16 0 23 3318 topology 3410 4390
-> 15 0 24 3318 topology 3346 4391
-> 16 0 24 3318 topology 3348 4391
-> 15 0 23 3318 topology 3381 4392
+> 15 0 23 3318 topology 3335 4391
+> 16 0 23 3318 topology 3410 4391
+> 15 0 23 3318 topology 3339 4392
 > 16 0 23 3318 topology 3410 4392
-> 15 0 23 3318 topology 3357 4393
+> 15 0 23 3318 topology 3338 4393
 > 16 0 23 3318 topology 3410 4393
-> 15 0 24 3318 topology 3376 4394
-> 16 0 24 3318 topology 3378 4394
-> 15 0 24 3318 topology 3352 4395
-> 16 0 24 3318 topology 3354 4395
-> 15 0 23 3318 topology 3393 4396
+> 15 0 23 3318 topology 3342 4394
+> 16 0 23 3318 topology 3410 4394
+> 15 0 23 3318 topology 3341 4395
+> 16 0 23 3318 topology 3410 4395
+> 15 0 23 3318 topology 3345 4396
 > 16 0 23 3318 topology 3410 4396
-> 15 0 24 3318 topology 3406 4397
-> 16 0 24 3318 topology 3408 4397
-> 15 0 23 3318 topology 3369 4398
-> 16 0 23 3318 topology 3410 4398
-> 15 0 24 3318 topology 3382 4399
-> 16 0 24 3318 topology 3384 4399
-> 15 0 24 3318 topology 3331 4400
-> 16 0 24 3318 topology 3333 4400
-> 15 0 24 3318 topology 3358 4401
-> 16 0 24 3318 topology 3360 4401
-> 15 0 23 3318 topology 3405 4402
-> 16 0 23 3318 topology 3410 4402
-> 15 0 24 3318 topology 3388 4403
-> 16 0 24 3318 topology 3390 4403
-> 15 0 24 3318 topology 3364 4404
-> 16 0 24 3318 topology 3366 4404
-> 15 0 23 3318 topology 3353 4405
-> 16 0 23 3318 topology 3410 4405
-> 15 0 23 3318 topology 3383 4406
-> 16 0 23 3318 topology 3410 4406
-> 15 0 24 3318 topology 3394 4407
-> 16 0 24 3318 topology 3396 4407
-> 15 0 24 3318 topology 3322 4408
-> 16 0 24 3318 topology 3323 4408
-> 15 0 23 3318 topology 3324 4409
-> 16 0 23 3318 topology 3410 4409
-> 15 0 24 3318 topology 3376 4410
-> 16 0 24 3318 topology 3377 4410
-> 15 0 24 3318 topology 3343 4411
-> 16 0 24 3318 topology 3345 4411
-> 15 0 24 3318 topology 3370 4412
-> 16 0 24 3318 topology 3372 4412
-> 15 0 23 3318 topology 3365 4413
-> 16 0 23 3318 topology 3410 4413
-> 15 0 24 3318 topology 3379 4414
-> 16 0 24 3318 topology 3380 4414
-> 15 0 23 3318 topology 3395 4415
-> 16 0 23 3318 topology 3410 4415
-> 15 0 24 3318 topology 3400 4416
-> 16 0 24 3318 topology 3402 4416
-> 15 0 23 3318 topology 3336 4417
-> 16 0 23 3318 topology 3410 4417
-> 15 0 24 3318 topology 3382 4418
-> 16 0 24 3318 topology 3383 4418
-> 15 0 24 3318 topology 3385 4419
-> 16 0 24 3318 topology 3386 4419
-> 15 0 24 3318 topology 3334 4420
-> 16 0 24 3318 topology 3335 4420
-> 15 0 24 3318 topology 3388 4421
-> 16 0 24 3318 topology 3389 4421
-> 15 0 24 3318 topology 3391 4422
-> 16 0 24 3318 topology 3392 4422
-> 15 0 23 3318 topology 3320 4423
-> 16 0 23 3318 topology 3410 4423
-> 15 0 24 3318 topology 3394 4424
-> 16 0 24 3318 topology 3395 4424
-> 15 0 24 3318 topology 3397 4425
-> 16 0 24 3318 topology 3398 4425
-> 15 0 23 3318 topology 3348 4426
-> 16 0 23 3318 topology 3410 4426
-> 15 0 23 3318 topology 3332 4427
-> 16 0 23 3318 topology 3410 4427
-> 15 0 24 3318 topology 3400 4428
-> 16 0 24 3318 topology 3401 4428
-> 15 0 23 3318 topology 3408 4429
-> 16 0 23 3318 topology 3410 4429
-> 15 0 23 3318 topology 3384 4430
-> 16 0 23 3318 topology 3410 4430
-> 15 0 24 3318 topology 3403 4431
-> 16 0 24 3318 topology 3404 4431
-> 15 0 24 3318 topology 3322 4432
-> 16 0 24 3318 topology 3324 4432
-> 15 0 23 3318 topology 3360 4433
-> 16 0 23 3318 topology 3410 4433
-> 15 0 23 3318 topology 3344 4434
-> 16 0 23 3318 topology 3410 4434
-> 15 0 23 3318 topology 3396 4435
-> 16 0 23 3318 topology 3410 4435
-> 15 0 23 3318 topology 3372 4436
-> 16 0 23 3318 topology 3410 4436
-> 15 0 24 3318 topology 3334 4437
-> 16 0 24 3318 topology 3336 4437
-> 15 0 23 3318 topology 3350 4438
-> 16 0 23 3318 topology 3410 4438
-> 15 0 24 3318 topology 3319 4439
-> 16 0 24 3318 topology 3320 4439
-> 15 0 23 3318 topology 3380 4440
-> 16 0 23 3318 topology 3410 4440
-> 15 0 23 3318 topology 3327 4441
-> 16 0 23 3318 topology 3410 4441
-> 15 0 23 3318 topology 3362 4442
-> 16 0 23 3318 topology 3410 4442
-> 15 0 23 3318 topology 3392 4443
-> 16 0 23 3318 topology 3410 4443
-> 15 0 23 3318 topology 3339 4444
-> 16 0 23 3318 topology 3410 4444
-> 15 0 23 3318 topology 3374 4445
-> 16 0 23 3318 topology 3410 4445
-> 15 0 24 3318 topology 3331 4446
-> 16 0 24 3318 topology 3332 4446
-> 15 0 23 3318 topology 3404 4447
-> 16 0 23 3318 topology 3410 4447
-> 15 0 24 3318 topology 3343 4448
-> 16 0 24 3318 topology 3344 4448
-> 15 0 23 3318 topology 3329 4449
-> 16 0 23 3318 topology 3410 4449
-> 15 0 23 3318 topology 3351 4450
-> 16 0 23 3318 topology 3410 4450
-> 15 0 23 3318 topology 3341 4451
-> 16 0 23 3318 topology 3410 4451
-> 15 0 24 3318 topology 3349 4452
-> 16 0 24 3318 topology 3351 4452
-> 15 0 23 3318 topology 3387 4453
-> 16 0 23 3318 topology 3410 4453
-> 15 0 23 3318 topology 3363 4454
-> 16 0 23 3318 topology 3410 4454
-> 15 0 24 3318 topology 3325 4455
-> 16 0 24 3318 topology 3327 4455
-> 15 0 24 3318 topology 3379 4456
-> 16 0 24 3318 topology 3381 4456
-> 15 0 24 3318 topology 3355 4457
-> 16 0 24 3318 topology 3357 4457
-> 15 0 23 3318 topology 3399 4458
-> 16 0 23 3318 topology 3410 4458
+> 15 0 23 3318 topology 3344 4397
+> 16 0 23 3318 topology 3410 4397
+> 15 0 24 3318 topology 3409 4398
+> 16 0 24 3318 topology 3410 4398
+> 15 0 25 3318 topology 3346 4399
+> 16 0 25 3318 topology 3348 4399
+> 15 0 25 3318 topology 3346 4400
+> 16 0 25 3318 topology 3347 4400
+> 15 0 25 3318 topology 3349 4401
+> 16 0 25 3318 topology 3351 4401
+> 15 0 25 3318 topology 3349 4402
+> 16 0 25 3318 topology 3350 4402
+> 15 0 25 3318 topology 3352 4403
+> 16 0 25 3318 topology 3354 4403
+> 15 0 25 3318 topology 3352 4404
+> 16 0 25 3318 topology 3353 4404
+> 15 0 25 3318 topology 3355 4405
+> 16 0 25 3318 topology 3357 4405
+> 15 0 25 3318 topology 3355 4406
+> 16 0 25 3318 topology 3356 4406
+> 15 0 25 3318 topology 3358 4407
+> 16 0 25 3318 topology 3360 4407
+> 15 0 25 3318 topology 3358 4408
+> 16 0 25 3318 topology 3359 4408
+> 15 0 25 3318 topology 3361 4409
+> 16 0 25 3318 topology 3363 4409
+> 15 0 25 3318 topology 3361 4410
+> 16 0 25 3318 topology 3362 4410
+> 15 0 25 3318 topology 3364 4411
+> 16 0 25 3318 topology 3366 4411
+> 15 0 25 3318 topology 3364 4412
+> 16 0 25 3318 topology 3365 4412
+> 15 0 25 3318 topology 3367 4413
+> 16 0 25 3318 topology 3369 4413
+> 15 0 25 3318 topology 3367 4414
+> 16 0 25 3318 topology 3368 4414
+> 15 0 25 3318 topology 3370 4415
+> 16 0 25 3318 topology 3372 4415
+> 15 0 25 3318 topology 3370 4416
+> 16 0 25 3318 topology 3371 4416
+> 15 0 25 3318 topology 3373 4417
+> 16 0 25 3318 topology 3375 4417
+> 15 0 25 3318 topology 3373 4418
+> 16 0 25 3318 topology 3374 4418
+> 15 0 25 3318 topology 3319 4419
+> 16 0 25 3318 topology 3321 4419
+> 15 0 25 3318 topology 3319 4420
+> 16 0 25 3318 topology 3320 4420
+> 15 0 25 3318 topology 3376 4421
+> 16 0 25 3318 topology 3378 4421
+> 15 0 25 3318 topology 3376 4422
+> 16 0 25 3318 topology 3377 4422
+> 15 0 25 3318 topology 3379 4423
+> 16 0 25 3318 topology 3381 4423
+> 15 0 25 3318 topology 3379 4424
+> 16 0 25 3318 topology 3380 4424
+> 15 0 25 3318 topology 3382 4425
+> 16 0 25 3318 topology 3384 4425
+> 15 0 25 3318 topology 3382 4426
+> 16 0 25 3318 topology 3383 4426
+> 15 0 25 3318 topology 3385 4427
+> 16 0 25 3318 topology 3387 4427
+> 15 0 25 3318 topology 3385 4428
+> 16 0 25 3318 topology 3386 4428
+> 15 0 25 3318 topology 3388 4429
+> 16 0 25 3318 topology 3390 4429
+> 15 0 25 3318 topology 3388 4430
+> 16 0 25 3318 topology 3389 4430
+> 15 0 25 3318 topology 3391 4431
+> 16 0 25 3318 topology 3393 4431
+> 15 0 25 3318 topology 3391 4432
+> 16 0 25 3318 topology 3392 4432
+> 15 0 25 3318 topology 3394 4433
+> 16 0 25 3318 topology 3396 4433
+> 15 0 25 3318 topology 3394 4434
+> 16 0 25 3318 topology 3395 4434
+> 15 0 25 3318 topology 3397 4435
+> 16 0 25 3318 topology 3399 4435
+> 15 0 25 3318 topology 3397 4436
+> 16 0 25 3318 topology 3398 4436
+> 15 0 25 3318 topology 3400 4437
+> 16 0 25 3318 topology 3402 4437
+> 15 0 25 3318 topology 3400 4438
+> 16 0 25 3318 topology 3401 4438
+> 15 0 25 3318 topology 3403 4439
+> 16 0 25 3318 topology 3405 4439
+> 15 0 25 3318 topology 3403 4440
+> 16 0 25 3318 topology 3404 4440
+> 15 0 25 3318 topology 3322 4441
+> 16 0 25 3318 topology 3324 4441
+> 15 0 25 3318 topology 3322 4442
+> 16 0 25 3318 topology 3323 4442
+> 15 0 25 3318 topology 3406 4443
+> 16 0 25 3318 topology 3408 4443
+> 15 0 25 3318 topology 3406 4444
+> 16 0 25 3318 topology 3407 4444
+> 15 0 25 3318 topology 3325 4445
+> 16 0 25 3318 topology 3327 4445
+> 15 0 25 3318 topology 3325 4446
+> 16 0 25 3318 topology 3326 4446
+> 15 0 25 3318 topology 3328 4447
+> 16 0 25 3318 topology 3330 4447
+> 15 0 25 3318 topology 3328 4448
+> 16 0 25 3318 topology 3329 4448
+> 15 0 25 3318 topology 3331 4449
+> 16 0 25 3318 topology 3333 4449
+> 15 0 25 3318 topology 3331 4450
+> 16 0 25 3318 topology 3332 4450
+> 15 0 25 3318 topology 3334 4451
+> 16 0 25 3318 topology 3336 4451
+> 15 0 25 3318 topology 3334 4452
+> 16 0 25 3318 topology 3335 4452
+> 15 0 25 3318 topology 3337 4453
+> 16 0 25 3318 topology 3339 4453
+> 15 0 25 3318 topology 3337 4454
+> 16 0 25 3318 topology 3338 4454
+> 15 0 25 3318 topology 3340 4455
+> 16 0 25 3318 topology 3342 4455
+> 15 0 25 3318 topology 3340 4456
+> 16 0 25 3318 topology 3341 4456
+> 15 0 25 3318 topology 3343 4457
+> 16 0 25 3318 topology 3345 4457
+> 15 0 25 3318 topology 3343 4458
+> 16 0 25 3318 topology 3344 4458
 > 15 0 26 2349 topology 3317 4459
 > 16 0 26 2349 topology 3413 4459
 > 15 0 26 2349 topology 3411 4460
-> 16 0 26 2349 topology 3409 4460
-> 15 0 21 2349 topology 3317 4461
-> 16 0 21 2349 topology 3411 4461
-> 15 0 33 2349 topology 3315 4462
-> 16 0 33 2349 topology 3317 4462
+> 16 0 26 2349 topology 3413 4460
+> 15 0 34 2349 topology 3315 4461
+> 16 0 34 2349 topology 3317 4461
+> 15 0 20 2349 topology 3317 4462
+> 16 0 20 2349 topology 3411 4462
 > 15 0 26 2349 topology 3411 4463
-> 16 0 26 2349 topology 3413 4463
-> 15 0 24 3416 topology 3501 4464
-> 16 0 24 3416 topology 3502 4464
-> 15 0 24 3416 topology 3555 4465
-> 16 0 24 3416 topology 3556 4465
-> 15 0 24 3416 topology 3420 4466
-> 16 0 24 3416 topology 3422 4466
-> 15 0 24 3416 topology 3447 4467
-> 16 0 24 3416 topology 3449 4467
-> 15 0 23 3416 topology 3449 4468
+> 16 0 26 2349 topology 3409 4463
+> 15 0 23 3416 topology 3446 4464
+> 16 0 23 3416 topology 3610 4464
+> 15 0 23 3416 topology 3445 4465
+> 16 0 23 3416 topology 3610 4465
+> 15 0 23 3416 topology 3449 4466
+> 16 0 23 3416 topology 3610 4466
+> 15 0 23 3416 topology 3448 4467
+> 16 0 23 3416 topology 3610 4467
+> 15 0 23 3416 topology 3452 4468
 > 16 0 23 3416 topology 3610 4468
-> 15 0 23 3416 topology 3433 4469
+> 15 0 23 3416 topology 3451 4469
 > 16 0 23 3416 topology 3610 4469
-> 15 0 24 3416 topology 3558 4470
-> 16 0 24 3416 topology 3559 4470
-> 15 0 24 3416 topology 3477 4471
-> 16 0 24 3416 topology 3479 4471
-> 15 0 23 3416 topology 3509 4472
+> 15 0 23 3416 topology 3455 4470
+> 16 0 23 3416 topology 3610 4470
+> 15 0 23 3416 topology 3454 4471
+> 16 0 23 3416 topology 3610 4471
+> 15 0 23 3416 topology 3458 4472
 > 16 0 23 3416 topology 3610 4472
-> 15 0 23 3416 topology 3485 4473
+> 15 0 23 3416 topology 3457 4473
 > 16 0 23 3416 topology 3610 4473
-> 15 0 24 3416 topology 3561 4474
-> 16 0 24 3416 topology 3562 4474
-> 15 0 24 3416 topology 3453 4475
-> 16 0 24 3416 topology 3455 4475
-> 15 0 23 3416 topology 3461 4476
+> 15 0 23 3416 topology 3461 4474
+> 16 0 23 3416 topology 3610 4474
+> 15 0 23 3416 topology 3460 4475
+> 16 0 23 3416 topology 3610 4475
+> 15 0 23 3416 topology 3464 4476
 > 16 0 23 3416 topology 3610 4476
-> 15 0 24 3416 topology 3507 4477
-> 16 0 24 3416 topology 3509 4477
-> 15 0 23 3416 topology 3569 4478
+> 15 0 23 3416 topology 3463 4477
+> 16 0 23 3416 topology 3610 4477
+> 15 0 23 3416 topology 3467 4478
 > 16 0 23 3416 topology 3610 4478
-> 15 0 23 3416 topology 3545 4479
+> 15 0 23 3416 topology 3466 4479
 > 16 0 23 3416 topology 3610 4479
-> 15 0 24 3416 topology 3483 4480
-> 16 0 24 3416 topology 3485 4480
-> 15 0 23 3416 topology 3521 4481
+> 15 0 23 3416 topology 3470 4480
+> 16 0 23 3416 topology 3610 4480
+> 15 0 23 3416 topology 3469 4481
 > 16 0 23 3416 topology 3610 4481
-> 15 0 24 3416 topology 3537 4482
-> 16 0 24 3416 topology 3539 4482
-> 15 0 23 3416 topology 3497 4483
+> 15 0 23 3416 topology 3473 4482
+> 16 0 23 3416 topology 3610 4482
+> 15 0 23 3416 topology 3472 4483
 > 16 0 23 3416 topology 3610 4483
-> 15 0 23 3416 topology 3605 4484
+> 15 0 23 3416 topology 3419 4484
 > 16 0 23 3416 topology 3610 4484
-> 15 0 24 3416 topology 3432 4485
-> 16 0 24 3416 topology 3434 4485
-> 15 0 24 3416 topology 3459 4486
-> 16 0 24 3416 topology 3461 4486
-> 15 0 23 3416 topology 3473 4487
+> 15 0 23 3416 topology 3418 4485
+> 16 0 23 3416 topology 3610 4485
+> 15 0 23 3416 topology 3476 4486
+> 16 0 23 3416 topology 3610 4486
+> 15 0 23 3416 topology 3475 4487
 > 16 0 23 3416 topology 3610 4487
-> 15 0 24 3416 topology 3513 4488
-> 16 0 24 3416 topology 3515 4488
-> 15 0 24 3416 topology 3567 4489
-> 16 0 24 3416 topology 3569 4489
-> 15 0 23 3416 topology 3581 4490
+> 15 0 23 3416 topology 3479 4488
+> 16 0 23 3416 topology 3610 4488
+> 15 0 23 3416 topology 3478 4489
+> 16 0 23 3416 topology 3610 4489
+> 15 0 23 3416 topology 3482 4490
 > 16 0 23 3416 topology 3610 4490
-> 15 0 23 3416 topology 3557 4491
+> 15 0 23 3416 topology 3481 4491
 > 16 0 23 3416 topology 3610 4491
-> 15 0 24 3416 topology 3489 4492
-> 16 0 24 3416 topology 3491 4492
-> 15 0 23 3416 topology 3533 4493
+> 15 0 23 3416 topology 3485 4492
+> 16 0 23 3416 topology 3610 4492
+> 15 0 23 3416 topology 3484 4493
 > 16 0 23 3416 topology 3610 4493
-> 15 0 24 3416 topology 3543 4494
-> 16 0 24 3416 topology 3545 4494
-> 15 0 24 3416 topology 3597 4495
-> 16 0 24 3416 topology 3599 4495
-> 15 0 23 3416 topology 3445 4496
+> 15 0 23 3416 topology 3488 4494
+> 16 0 23 3416 topology 3610 4494
+> 15 0 23 3416 topology 3487 4495
+> 16 0 23 3416 topology 3610 4495
+> 15 0 23 3416 topology 3491 4496
 > 16 0 23 3416 topology 3610 4496
-> 15 0 24 3416 topology 3465 4497
-> 16 0 24 3416 topology 3467 4497
-> 15 0 24 3416 topology 3519 4498
-> 16 0 24 3416 topology 3521 4498
-> 15 0 24 3416 topology 3573 4499
-> 16 0 24 3416 topology 3575 4499
-> 15 0 23 3416 topology 3593 4500
+> 15 0 23 3416 topology 3490 4497
+> 16 0 23 3416 topology 3610 4497
+> 15 0 23 3416 topology 3494 4498
+> 16 0 23 3416 topology 3610 4498
+> 15 0 23 3416 topology 3493 4499
+> 16 0 23 3416 topology 3610 4499
+> 15 0 23 3416 topology 3497 4500
 > 16 0 23 3416 topology 3610 4500
-> 15 0 24 3416 topology 3420 4501
-> 16 0 24 3416 topology 3421 4501
-> 15 0 23 3416 topology 3475 4502
+> 15 0 23 3416 topology 3496 4501
+> 16 0 23 3416 topology 3610 4501
+> 15 0 23 3416 topology 3500 4502
 > 16 0 23 3416 topology 3610 4502
-> 15 0 24 3416 topology 3495 4503
-> 16 0 24 3416 topology 3497 4503
-> 15 0 23 3416 topology 3505 4504
+> 15 0 23 3416 topology 3499 4503
+> 16 0 23 3416 topology 3610 4503
+> 15 0 23 3416 topology 3503 4504
 > 16 0 23 3416 topology 3610 4504
-> 15 0 24 3416 topology 3549 4505
-> 16 0 24 3416 topology 3551 4505
-> 15 0 24 3416 topology 3603 4506
-> 16 0 24 3416 topology 3605 4506
-> 15 0 25 3416 topology 3609 4507
-> 16 0 25 3416 topology 3610 4507
-> 15 0 23 3416 topology 3535 4508
+> 15 0 23 3416 topology 3502 4505
+> 16 0 23 3416 topology 3610 4505
+> 15 0 23 3416 topology 3422 4506
+> 16 0 23 3416 topology 3610 4506
+> 15 0 23 3416 topology 3421 4507
+> 16 0 23 3416 topology 3610 4507
+> 15 0 23 3416 topology 3506 4508
 > 16 0 23 3416 topology 3610 4508
-> 15 0 23 3416 topology 3422 4509
+> 15 0 23 3416 topology 3505 4509
 > 16 0 23 3416 topology 3610 4509
-> 15 0 23 3416 topology 3457 4510
+> 15 0 23 3416 topology 3509 4510
 > 16 0 23 3416 topology 3610 4510
-> 15 0 24 3416 topology 3471 4511
-> 16 0 24 3416 topology 3473 4511
-> 15 0 24 3416 topology 3525 4512
-> 16 0 24 3416 topology 3527 4512
-> 15 0 23 3416 topology 3565 4513
+> 15 0 23 3416 topology 3508 4511
+> 16 0 23 3416 topology 3610 4511
+> 15 0 23 3416 topology 3512 4512
+> 16 0 23 3416 topology 3610 4512
+> 15 0 23 3416 topology 3511 4513
 > 16 0 23 3416 topology 3610 4513
-> 15 0 24 3416 topology 3579 4514
-> 16 0 24 3416 topology 3581 4514
-> 15 0 23 3416 topology 3487 4515
+> 15 0 23 3416 topology 3515 4514
+> 16 0 23 3416 topology 3610 4514
+> 15 0 23 3416 topology 3514 4515
 > 16 0 23 3416 topology 3610 4515
-> 15 0 23 3416 topology 3595 4516
+> 15 0 23 3416 topology 3518 4516
 > 16 0 23 3416 topology 3610 4516
-> 15 0 24 3416 topology 3501 4517
-> 16 0 24 3416 topology 3503 4517
-> 15 0 23 3416 topology 3517 4518
+> 15 0 23 3416 topology 3517 4517
+> 16 0 23 3416 topology 3610 4517
+> 15 0 23 3416 topology 3521 4518
 > 16 0 23 3416 topology 3610 4518
-> 15 0 24 3416 topology 3555 4519
-> 16 0 24 3416 topology 3557 4519
-> 15 0 23 3416 topology 3547 4520
+> 15 0 23 3416 topology 3520 4519
+> 16 0 23 3416 topology 3610 4519
+> 15 0 23 3416 topology 3524 4520
 > 16 0 23 3416 topology 3610 4520
-> 15 0 23 3416 topology 3434 4521
+> 15 0 23 3416 topology 3523 4521
 > 16 0 23 3416 topology 3610 4521
-> 15 0 23 3416 topology 3469 4522
+> 15 0 23 3416 topology 3527 4522
 > 16 0 23 3416 topology 3610 4522
-> 15 0 24 3416 topology 3531 4523
-> 16 0 24 3416 topology 3533 4523
-> 15 0 23 3416 topology 3577 4524
+> 15 0 23 3416 topology 3526 4523
+> 16 0 23 3416 topology 3610 4523
+> 15 0 23 3416 topology 3530 4524
 > 16 0 23 3416 topology 3610 4524
-> 15 0 24 3416 topology 3585 4525
-> 16 0 24 3416 topology 3587 4525
-> 15 0 24 3416 topology 3432 4526
-> 16 0 24 3416 topology 3433 4526
-> 15 0 23 3416 topology 3499 4527
+> 15 0 23 3416 topology 3529 4525
+> 16 0 23 3416 topology 3610 4525
+> 15 0 23 3416 topology 3533 4526
+> 16 0 23 3416 topology 3610 4526
+> 15 0 23 3416 topology 3532 4527
 > 16 0 23 3416 topology 3610 4527
-> 15 0 23 3416 topology 3607 4528
+> 15 0 23 3416 topology 3425 4528
 > 16 0 23 3416 topology 3610 4528
-> 15 0 23 3416 topology 3529 4529
+> 15 0 23 3416 topology 3424 4529
 > 16 0 23 3416 topology 3610 4529
-> 15 0 24 3416 topology 3561 4530
-> 16 0 24 3416 topology 3563 4530
-> 15 0 23 3416 topology 3559 4531
+> 15 0 23 3416 topology 3536 4530
+> 16 0 23 3416 topology 3610 4530
+> 15 0 23 3416 topology 3535 4531
 > 16 0 23 3416 topology 3610 4531
-> 15 0 23 3416 topology 3589 4532
+> 15 0 23 3416 topology 3539 4532
 > 16 0 23 3416 topology 3610 4532
-> 15 0 24 3416 topology 3591 4533
-> 16 0 24 3416 topology 3593 4533
-> 15 0 23 3416 topology 3418 4534
+> 15 0 23 3416 topology 3538 4533
+> 16 0 23 3416 topology 3610 4533
+> 15 0 23 3416 topology 3542 4534
 > 16 0 23 3416 topology 3610 4534
-> 15 0 23 3416 topology 3430 4535
+> 15 0 23 3416 topology 3541 4535
 > 16 0 23 3416 topology 3610 4535
-> 15 0 23 3416 topology 3476 4536
+> 15 0 23 3416 topology 3545 4536
 > 16 0 23 3416 topology 3610 4536
-> 15 0 23 3416 topology 3452 4537
+> 15 0 23 3416 topology 3544 4537
 > 16 0 23 3416 topology 3610 4537
-> 15 0 24 3416 topology 3423 4538
-> 16 0 24 3416 topology 3425 4538
-> 15 0 23 3416 topology 3536 4539
+> 15 0 23 3416 topology 3548 4538
+> 16 0 23 3416 topology 3610 4538
+> 15 0 23 3416 topology 3547 4539
 > 16 0 23 3416 topology 3610 4539
-> 15 0 23 3416 topology 3512 4540
+> 15 0 23 3416 topology 3551 4540
 > 16 0 23 3416 topology 3610 4540
-> 15 0 23 3416 topology 3442 4541
+> 15 0 23 3416 topology 3550 4541
 > 16 0 23 3416 topology 3610 4541
-> 15 0 23 3416 topology 3488 4542
+> 15 0 23 3416 topology 3554 4542
 > 16 0 23 3416 topology 3610 4542
-> 15 0 23 3416 topology 3596 4543
+> 15 0 23 3416 topology 3553 4543
 > 16 0 23 3416 topology 3610 4543
-> 15 0 23 3416 topology 3464 4544
+> 15 0 23 3416 topology 3557 4544
 > 16 0 23 3416 topology 3610 4544
-> 15 0 23 3416 topology 3572 4545
+> 15 0 23 3416 topology 3556 4545
 > 16 0 23 3416 topology 3610 4545
-> 15 0 23 3416 topology 3548 4546
+> 15 0 23 3416 topology 3560 4546
 > 16 0 23 3416 topology 3610 4546
-> 15 0 23 3416 topology 3524 4547
+> 15 0 23 3416 topology 3559 4547
 > 16 0 23 3416 topology 3610 4547
-> 15 0 23 3416 topology 3500 4548
+> 15 0 23 3416 topology 3563 4548
 > 16 0 23 3416 topology 3610 4548
-> 15 0 23 3416 topology 3608 4549
+> 15 0 23 3416 topology 3562 4549
 > 16 0 23 3416 topology 3610 4549
-> 15 0 23 3416 topology 3584 4550
+> 15 0 23 3416 topology 3428 4550
 > 16 0 23 3416 topology 3610 4550
-> 15 0 24 3416 topology 3435 4551
-> 16 0 24 3416 topology 3437 4551
-> 15 0 23 3416 topology 3560 4552
+> 15 0 23 3416 topology 3427 4551
+> 16 0 23 3416 topology 3610 4551
+> 15 0 23 3416 topology 3566 4552
 > 16 0 23 3416 topology 3610 4552
-> 15 0 24 3416 topology 3417 4553
-> 16 0 24 3416 topology 3418 4553
-> 15 0 24 3416 topology 3444 4554
-> 16 0 24 3416 topology 3445 4554
-> 15 0 24 3416 topology 3447 4555
-> 16 0 24 3416 topology 3448 4555
-> 15 0 24 3416 topology 3450 4556
-> 16 0 24 3416 topology 3451 4556
-> 15 0 23 3416 topology 3454 4557
+> 15 0 23 3416 topology 3565 4553
+> 16 0 23 3416 topology 3610 4553
+> 15 0 23 3416 topology 3569 4554
+> 16 0 23 3416 topology 3610 4554
+> 15 0 23 3416 topology 3568 4555
+> 16 0 23 3416 topology 3610 4555
+> 15 0 23 3416 topology 3572 4556
+> 16 0 23 3416 topology 3610 4556
+> 15 0 23 3416 topology 3571 4557
 > 16 0 23 3416 topology 3610 4557
-> 15 0 24 3416 topology 3504 4558
-> 16 0 24 3416 topology 3505 4558
-> 15 0 23 3416 topology 3484 4559
+> 15 0 23 3416 topology 3575 4558
+> 16 0 23 3416 topology 3610 4558
+> 15 0 23 3416 topology 3574 4559
 > 16 0 23 3416 topology 3610 4559
-> 15 0 23 3416 topology 3425 4560
+> 15 0 23 3416 topology 3578 4560
 > 16 0 23 3416 topology 3610 4560
-> 15 0 24 3416 topology 3453 4561
-> 16 0 24 3416 topology 3454 4561
-> 15 0 24 3416 topology 3507 4562
-> 16 0 24 3416 topology 3508 4562
-> 15 0 23 3416 topology 3514 4563
+> 15 0 23 3416 topology 3577 4561
+> 16 0 23 3416 topology 3610 4561
+> 15 0 23 3416 topology 3581 4562
+> 16 0 23 3416 topology 3610 4562
+> 15 0 23 3416 topology 3580 4563
 > 16 0 23 3416 topology 3610 4563
-> 15 0 23 3416 topology 3544 4564
+> 15 0 23 3416 topology 3584 4564
 > 16 0 23 3416 topology 3610 4564
-> 15 0 24 3416 topology 3429 4565
-> 16 0 24 3416 topology 3430 4565
-> 15 0 24 3416 topology 3456 4566
-> 16 0 24 3416 topology 3457 4566
-> 15 0 23 3416 topology 3466 4567
+> 15 0 23 3416 topology 3583 4565
+> 16 0 23 3416 topology 3610 4565
+> 15 0 23 3416 topology 3587 4566
+> 16 0 23 3416 topology 3610 4566
+> 15 0 23 3416 topology 3586 4567
 > 16 0 23 3416 topology 3610 4567
-> 15 0 24 3416 topology 3510 4568
-> 16 0 24 3416 topology 3511 4568
-> 15 0 24 3416 topology 3564 4569
-> 16 0 24 3416 topology 3565 4569
-> 15 0 23 3416 topology 3574 4570
+> 15 0 23 3416 topology 3590 4568
+> 16 0 23 3416 topology 3610 4568
+> 15 0 23 3416 topology 3589 4569
+> 16 0 23 3416 topology 3610 4569
+> 15 0 23 3416 topology 3593 4570
 > 16 0 23 3416 topology 3610 4570
-> 15 0 23 3416 topology 3496 4571
+> 15 0 23 3416 topology 3592 4571
 > 16 0 23 3416 topology 3610 4571
-> 15 0 23 3416 topology 3604 4572
+> 15 0 23 3416 topology 3431 4572
 > 16 0 23 3416 topology 3610 4572
-> 15 0 23 3416 topology 3437 4573
+> 15 0 23 3416 topology 3430 4573
 > 16 0 23 3416 topology 3610 4573
-> 15 0 24 3416 topology 3459 4574
-> 16 0 24 3416 topology 3460 4574
-> 15 0 24 3416 topology 3513 4575
-> 16 0 24 3416 topology 3514 4575
-> 15 0 23 3416 topology 3526 4576
+> 15 0 23 3416 topology 3596 4574
+> 16 0 23 3416 topology 3610 4574
+> 15 0 23 3416 topology 3595 4575
+> 16 0 23 3416 topology 3610 4575
+> 15 0 23 3416 topology 3599 4576
 > 16 0 23 3416 topology 3610 4576
-> 15 0 24 3416 topology 3567 4577
-> 16 0 24 3416 topology 3568 4577
-> 15 0 23 3416 topology 3556 4578
+> 15 0 23 3416 topology 3598 4577
+> 16 0 23 3416 topology 3610 4577
+> 15 0 23 3416 topology 3602 4578
 > 16 0 23 3416 topology 3610 4578
-> 15 0 24 3416 topology 3462 4579
-> 16 0 24 3416 topology 3463 4579
-> 15 0 24 3416 topology 3516 4580
-> 16 0 24 3416 topology 3517 4580
-> 15 0 24 3416 topology 3570 4581
-> 16 0 24 3416 topology 3571 4581
-> 15 0 23 3416 topology 3586 4582
+> 15 0 23 3416 topology 3601 4579
+> 16 0 23 3416 topology 3610 4579
+> 15 0 23 3416 topology 3605 4580
+> 16 0 23 3416 topology 3610 4580
+> 15 0 23 3416 topology 3604 4581
+> 16 0 23 3416 topology 3610 4581
+> 15 0 23 3416 topology 3608 4582
 > 16 0 23 3416 topology 3610 4582
-> 15 0 24 3416 topology 3465 4583
-> 16 0 24 3416 topology 3466 4583
-> 15 0 24 3416 topology 3519 4584
-> 16 0 24 3416 topology 3520 4584
-> 15 0 24 3416 topology 3573 4585
-> 16 0 24 3416 topology 3574 4585
-> 15 0 24 3416 topology 3441 4586
-> 16 0 24 3416 topology 3442 4586
-> 15 0 24 3416 topology 3468 4587
-> 16 0 24 3416 topology 3469 4587
-> 15 0 24 3416 topology 3522 4588
-> 16 0 24 3416 topology 3523 4588
-> 15 0 24 3416 topology 3576 4589
-> 16 0 24 3416 topology 3577 4589
-> 15 0 24 3416 topology 3471 4590
-> 16 0 24 3416 topology 3472 4590
-> 15 0 24 3416 topology 3525 4591
-> 16 0 24 3416 topology 3526 4591
-> 15 0 24 3416 topology 3579 4592
-> 16 0 24 3416 topology 3580 4592
-> 15 0 24 3416 topology 3444 4593
-> 16 0 24 3416 topology 3446 4593
-> 15 0 23 3416 topology 3427 4594
-> 16 0 23 3416 topology 3610 4594
-> 15 0 24 3416 topology 3528 4595
-> 16 0 24 3416 topology 3529 4595
-> 15 0 24 3416 topology 3582 4596
-> 16 0 24 3416 topology 3583 4596
-> 15 0 24 3416 topology 3474 4597
-> 16 0 24 3416 topology 3476 4597
-> 15 0 23 3416 topology 3479 4598
-> 16 0 23 3416 topology 3610 4598
-> 15 0 24 3416 topology 3531 4599
-> 16 0 24 3416 topology 3532 4599
-> 15 0 24 3416 topology 3585 4600
-> 16 0 24 3416 topology 3586 4600
-> 15 0 24 3416 topology 3450 4601
-> 16 0 24 3416 topology 3452 4601
-> 15 0 23 3416 topology 3455 4602
-> 16 0 23 3416 topology 3610 4602
-> 15 0 24 3416 topology 3504 4603
-> 16 0 24 3416 topology 3506 4603
-> 15 0 23 3416 topology 3439 4604
-> 16 0 23 3416 topology 3610 4604
-> 15 0 23 3416 topology 3539 4605
-> 16 0 23 3416 topology 3610 4605
-> 15 0 24 3416 topology 3588 4606
-> 16 0 24 3416 topology 3589 4606
-> 15 0 24 3416 topology 3426 4607
-> 16 0 24 3416 topology 3428 4607
-> 15 0 24 3416 topology 3480 4608
-> 16 0 24 3416 topology 3482 4608
-> 15 0 23 3416 topology 3515 4609
-> 16 0 23 3416 topology 3610 4609
-> 15 0 24 3416 topology 3534 4610
-> 16 0 24 3416 topology 3536 4610
-> 15 0 23 3416 topology 3491 4611
-> 16 0 23 3416 topology 3610 4611
-> 15 0 24 3416 topology 3591 4612
-> 16 0 24 3416 topology 3592 4612
-> 15 0 23 3416 topology 3599 4613
-> 16 0 23 3416 topology 3610 4613
-> 15 0 24 3416 topology 3456 4614
-> 16 0 24 3416 topology 3458 4614
-> 15 0 23 3416 topology 3467 4615
-> 16 0 23 3416 topology 3610 4615
-> 15 0 24 3416 topology 3510 4616
-> 16 0 24 3416 topology 3512 4616
-> 15 0 24 3416 topology 3564 4617
-> 16 0 24 3416 topology 3566 4617
-> 15 0 23 3416 topology 3575 4618
-> 16 0 23 3416 topology 3610 4618
-> 15 0 23 3416 topology 3551 4619
-> 16 0 23 3416 topology 3610 4619
-> 15 0 24 3416 topology 3486 4620
-> 16 0 24 3416 topology 3488 4620
-> 15 0 23 3416 topology 3527 4621
-> 16 0 23 3416 topology 3610 4621
-> 15 0 24 3416 topology 3540 4622
-> 16 0 24 3416 topology 3542 4622
-> 15 0 24 3416 topology 3594 4623
-> 16 0 24 3416 topology 3596 4623
-> 15 0 23 3416 topology 3503 4624
-> 16 0 23 3416 topology 3610 4624
-> 15 0 24 3416 topology 3462 4625
-> 16 0 24 3416 topology 3464 4625
-> 15 0 24 3416 topology 3516 4626
-> 16 0 24 3416 topology 3518 4626
-> 15 0 24 3416 topology 3570 4627
-> 16 0 24 3416 topology 3572 4627
-> 15 0 23 3416 topology 3587 4628
-> 16 0 23 3416 topology 3610 4628
-> 15 0 23 3416 topology 3563 4629
-> 16 0 23 3416 topology 3610 4629
-> 15 0 24 3416 topology 3438 4630
-> 16 0 24 3416 topology 3440 4630
-> 15 0 24 3416 topology 3492 4631
-> 16 0 24 3416 topology 3494 4631
-> 15 0 24 3416 topology 3546 4632
-> 16 0 24 3416 topology 3548 4632
-> 15 0 24 3416 topology 3600 4633
-> 16 0 24 3416 topology 3602 4633
-> 15 0 23 3416 topology 3451 4634
-> 16 0 23 3416 topology 3610 4634
-> 15 0 24 3416 topology 3468 4635
-> 16 0 24 3416 topology 3470 4635
-> 15 0 24 3416 topology 3522 4636
-> 16 0 24 3416 topology 3524 4636
-> 15 0 24 3416 topology 3576 4637
-> 16 0 24 3416 topology 3578 4637
-> 15 0 23 3416 topology 3481 4638
-> 16 0 23 3416 topology 3610 4638
-> 15 0 24 3416 topology 3498 4639
-> 16 0 24 3416 topology 3500 4639
-> 15 0 23 3416 topology 3511 4640
-> 16 0 23 3416 topology 3610 4640
-> 15 0 24 3416 topology 3552 4641
-> 16 0 24 3416 topology 3554 4641
-> 15 0 24 3416 topology 3606 4642
-> 16 0 24 3416 topology 3608 4642
-> 15 0 24 3416 topology 3426 4643
-> 16 0 24 3416 topology 3427 4643
-> 15 0 23 3416 topology 3541 4644
-> 16 0 23 3416 topology 3610 4644
-> 15 0 23 3416 topology 3428 4645
-> 16 0 23 3416 topology 3610 4645
-> 15 0 23 3416 topology 3463 4646
-> 16 0 23 3416 topology 3610 4646
-> 15 0 24 3416 topology 3528 4647
-> 16 0 24 3416 topology 3530 4647
-> 15 0 23 3416 topology 3571 4648
-> 16 0 23 3416 topology 3610 4648
-> 15 0 24 3416 topology 3582 4649
-> 16 0 24 3416 topology 3584 4649
-> 15 0 23 3416 topology 3493 4650
-> 16 0 23 3416 topology 3610 4650
-> 15 0 23 3416 topology 3601 4651
-> 16 0 23 3416 topology 3610 4651
-> 15 0 23 3416 topology 3523 4652
-> 16 0 23 3416 topology 3610 4652
-> 15 0 24 3416 topology 3558 4653
-> 16 0 24 3416 topology 3560 4653
-> 15 0 23 3416 topology 3553 4654
-> 16 0 23 3416 topology 3610 4654
-> 15 0 23 3416 topology 3440 4655
-> 16 0 23 3416 topology 3610 4655
-> 15 0 23 3416 topology 3583 4656
-> 16 0 23 3416 topology 3610 4656
-> 15 0 24 3416 topology 3588 4657
-> 16 0 24 3416 topology 3590 4657
-> 15 0 24 3416 topology 3438 4658
-> 16 0 24 3416 topology 3439 4658
-> 15 0 24 3416 topology 3417 4659
-> 16 0 24 3416 topology 3419 4659
-> 15 0 23 3416 topology 3424 4660
-> 16 0 23 3416 topology 3610 4660
-> 15 0 23 3416 topology 3446 4661
-> 16 0 23 3416 topology 3610 4661
-> 15 0 23 3416 topology 3506 4662
-> 16 0 23 3416 topology 3610 4662
-> 15 0 23 3416 topology 3436 4663
-> 16 0 23 3416 topology 3610 4663
-> 15 0 23 3416 topology 3482 4664
-> 16 0 23 3416 topology 3610 4664
-> 15 0 23 3416 topology 3458 4665
-> 16 0 23 3416 topology 3610 4665
-> 15 0 23 3416 topology 3566 4666
-> 16 0 23 3416 topology 3610 4666
-> 15 0 23 3416 topology 3542 4667
-> 16 0 23 3416 topology 3610 4667
-> 15 0 23 3416 topology 3518 4668
-> 16 0 23 3416 topology 3610 4668
-> 15 0 24 3416 topology 3429 4669
-> 16 0 24 3416 topology 3431 4669
-> 15 0 23 3416 topology 3494 4670
-> 16 0 23 3416 topology 3610 4670
-> 15 0 23 3416 topology 3602 4671
-> 16 0 23 3416 topology 3610 4671
-> 15 0 23 3416 topology 3470 4672
-> 16 0 23 3416 topology 3610 4672
-> 15 0 23 3416 topology 3578 4673
-> 16 0 23 3416 topology 3610 4673
-> 15 0 23 3416 topology 3554 4674
-> 16 0 23 3416 topology 3610 4674
-> 15 0 23 3416 topology 3530 4675
-> 16 0 23 3416 topology 3610 4675
-> 15 0 23 3416 topology 3590 4676
-> 16 0 23 3416 topology 3610 4676
-> 15 0 23 3416 topology 3448 4677
-> 16 0 23 3416 topology 3610 4677
-> 15 0 24 3416 topology 3474 4678
-> 16 0 24 3416 topology 3475 4678
-> 15 0 24 3416 topology 3441 4679
-> 16 0 24 3416 topology 3443 4679
-> 15 0 23 3416 topology 3478 4680
-> 16 0 23 3416 topology 3610 4680
-> 15 0 23 3416 topology 3419 4681
-> 16 0 23 3416 topology 3610 4681
-> 15 0 24 3416 topology 3423 4682
-> 16 0 24 3416 topology 3424 4682
-> 15 0 24 3416 topology 3477 4683
-> 16 0 24 3416 topology 3478 4683
-> 15 0 23 3416 topology 3508 4684
-> 16 0 23 3416 topology 3610 4684
-> 15 0 23 3416 topology 3538 4685
-> 16 0 23 3416 topology 3610 4685
-> 15 0 23 3416 topology 3460 4686
-> 16 0 23 3416 topology 3610 4686
-> 15 0 24 3416 topology 3480 4687
-> 16 0 24 3416 topology 3481 4687
-> 15 0 24 3416 topology 3534 4688
-> 16 0 24 3416 topology 3535 4688
-> 15 0 23 3416 topology 3568 4689
-> 16 0 23 3416 topology 3610 4689
-> 15 0 23 3416 topology 3490 4690
-> 16 0 23 3416 topology 3610 4690
-> 15 0 23 3416 topology 3598 4691
-> 16 0 23 3416 topology 3610 4691
-> 15 0 23 3416 topology 3431 4692
-> 16 0 23 3416 topology 3610 4692
-> 15 0 24 3416 topology 3483 4693
-> 16 0 24 3416 topology 3484 4693
-> 15 0 23 3416 topology 3520 4694
-> 16 0 23 3416 topology 3610 4694
-> 15 0 24 3416 topology 3537 4695
-> 16 0 24 3416 topology 3538 4695
-> 15 0 23 3416 topology 3550 4696
-> 16 0 23 3416 topology 3610 4696
-> 15 0 23 3416 topology 3472 4697
-> 16 0 23 3416 topology 3610 4697
-> 15 0 24 3416 topology 3486 4698
-> 16 0 24 3416 topology 3487 4698
-> 15 0 24 3416 topology 3540 4699
-> 16 0 24 3416 topology 3541 4699
-> 15 0 23 3416 topology 3580 4700
-> 16 0 23 3416 topology 3610 4700
-> 15 0 24 3416 topology 3594 4701
-> 16 0 24 3416 topology 3595 4701
-> 15 0 23 3416 topology 3502 4702
-> 16 0 23 3416 topology 3610 4702
-> 15 0 24 3416 topology 3435 4703
-> 16 0 24 3416 topology 3436 4703
-> 15 0 23 3416 topology 3443 4704
-> 16 0 23 3416 topology 3610 4704
-> 15 0 24 3416 topology 3489 4705
-> 16 0 24 3416 topology 3490 4705
-> 15 0 23 3416 topology 3532 4706
-> 16 0 23 3416 topology 3610 4706
-> 15 0 24 3416 topology 3543 4707
-> 16 0 24 3416 topology 3544 4707
-> 15 0 24 3416 topology 3597 4708
-> 16 0 24 3416 topology 3598 4708
-> 15 0 23 3416 topology 3562 4709
-> 16 0 23 3416 topology 3610 4709
-> 15 0 24 3416 topology 3492 4710
-> 16 0 24 3416 topology 3493 4710
-> 15 0 24 3416 topology 3546 4711
-> 16 0 24 3416 topology 3547 4711
-> 15 0 23 3416 topology 3592 4712
-> 16 0 23 3416 topology 3610 4712
-> 15 0 24 3416 topology 3600 4713
-> 16 0 24 3416 topology 3601 4713
-> 15 0 24 3416 topology 3495 4714
-> 16 0 24 3416 topology 3496 4714
-> 15 0 24 3416 topology 3549 4715
-> 16 0 24 3416 topology 3550 4715
-> 15 0 24 3416 topology 3603 4716
-> 16 0 24 3416 topology 3604 4716
-> 15 0 23 3416 topology 3421 4717
-> 16 0 23 3416 topology 3610 4717
-> 15 0 24 3416 topology 3498 4718
-> 16 0 24 3416 topology 3499 4718
-> 15 0 24 3416 topology 3552 4719
-> 16 0 24 3416 topology 3553 4719
-> 15 0 24 3416 topology 3606 4720
-> 16 0 24 3416 topology 3607 4720
-> 15 0 24 3612 topology 3664 4721
-> 16 0 24 3612 topology 3666 4721
-> 15 0 23 3612 topology 3674 4722
+> 15 0 23 3416 topology 3607 4583
+> 16 0 23 3416 topology 3610 4583
+> 15 0 23 3416 topology 3434 4584
+> 16 0 23 3416 topology 3610 4584
+> 15 0 23 3416 topology 3433 4585
+> 16 0 23 3416 topology 3610 4585
+> 15 0 23 3416 topology 3437 4586
+> 16 0 23 3416 topology 3610 4586
+> 15 0 23 3416 topology 3436 4587
+> 16 0 23 3416 topology 3610 4587
+> 15 0 23 3416 topology 3440 4588
+> 16 0 23 3416 topology 3610 4588
+> 15 0 23 3416 topology 3439 4589
+> 16 0 23 3416 topology 3610 4589
+> 15 0 23 3416 topology 3443 4590
+> 16 0 23 3416 topology 3610 4590
+> 15 0 23 3416 topology 3442 4591
+> 16 0 23 3416 topology 3610 4591
+> 15 0 24 3416 topology 3609 4592
+> 16 0 24 3416 topology 3610 4592
+> 15 0 25 3416 topology 3444 4593
+> 16 0 25 3416 topology 3446 4593
+> 15 0 25 3416 topology 3444 4594
+> 16 0 25 3416 topology 3445 4594
+> 15 0 25 3416 topology 3447 4595
+> 16 0 25 3416 topology 3449 4595
+> 15 0 25 3416 topology 3447 4596
+> 16 0 25 3416 topology 3448 4596
+> 15 0 25 3416 topology 3450 4597
+> 16 0 25 3416 topology 3452 4597
+> 15 0 25 3416 topology 3450 4598
+> 16 0 25 3416 topology 3451 4598
+> 15 0 25 3416 topology 3453 4599
+> 16 0 25 3416 topology 3455 4599
+> 15 0 25 3416 topology 3453 4600
+> 16 0 25 3416 topology 3454 4600
+> 15 0 25 3416 topology 3456 4601
+> 16 0 25 3416 topology 3458 4601
+> 15 0 25 3416 topology 3456 4602
+> 16 0 25 3416 topology 3457 4602
+> 15 0 25 3416 topology 3459 4603
+> 16 0 25 3416 topology 3461 4603
+> 15 0 25 3416 topology 3459 4604
+> 16 0 25 3416 topology 3460 4604
+> 15 0 25 3416 topology 3462 4605
+> 16 0 25 3416 topology 3464 4605
+> 15 0 25 3416 topology 3462 4606
+> 16 0 25 3416 topology 3463 4606
+> 15 0 25 3416 topology 3465 4607
+> 16 0 25 3416 topology 3467 4607
+> 15 0 25 3416 topology 3465 4608
+> 16 0 25 3416 topology 3466 4608
+> 15 0 25 3416 topology 3468 4609
+> 16 0 25 3416 topology 3470 4609
+> 15 0 25 3416 topology 3468 4610
+> 16 0 25 3416 topology 3469 4610
+> 15 0 25 3416 topology 3471 4611
+> 16 0 25 3416 topology 3473 4611
+> 15 0 25 3416 topology 3471 4612
+> 16 0 25 3416 topology 3472 4612
+> 15 0 25 3416 topology 3417 4613
+> 16 0 25 3416 topology 3419 4613
+> 15 0 25 3416 topology 3417 4614
+> 16 0 25 3416 topology 3418 4614
+> 15 0 25 3416 topology 3474 4615
+> 16 0 25 3416 topology 3476 4615
+> 15 0 25 3416 topology 3474 4616
+> 16 0 25 3416 topology 3475 4616
+> 15 0 25 3416 topology 3477 4617
+> 16 0 25 3416 topology 3479 4617
+> 15 0 25 3416 topology 3477 4618
+> 16 0 25 3416 topology 3478 4618
+> 15 0 25 3416 topology 3480 4619
+> 16 0 25 3416 topology 3482 4619
+> 15 0 25 3416 topology 3480 4620
+> 16 0 25 3416 topology 3481 4620
+> 15 0 25 3416 topology 3483 4621
+> 16 0 25 3416 topology 3485 4621
+> 15 0 25 3416 topology 3483 4622
+> 16 0 25 3416 topology 3484 4622
+> 15 0 25 3416 topology 3486 4623
+> 16 0 25 3416 topology 3488 4623
+> 15 0 25 3416 topology 3486 4624
+> 16 0 25 3416 topology 3487 4624
+> 15 0 25 3416 topology 3489 4625
+> 16 0 25 3416 topology 3491 4625
+> 15 0 25 3416 topology 3489 4626
+> 16 0 25 3416 topology 3490 4626
+> 15 0 25 3416 topology 3492 4627
+> 16 0 25 3416 topology 3494 4627
+> 15 0 25 3416 topology 3492 4628
+> 16 0 25 3416 topology 3493 4628
+> 15 0 25 3416 topology 3495 4629
+> 16 0 25 3416 topology 3497 4629
+> 15 0 25 3416 topology 3495 4630
+> 16 0 25 3416 topology 3496 4630
+> 15 0 25 3416 topology 3498 4631
+> 16 0 25 3416 topology 3500 4631
+> 15 0 25 3416 topology 3498 4632
+> 16 0 25 3416 topology 3499 4632
+> 15 0 25 3416 topology 3501 4633
+> 16 0 25 3416 topology 3503 4633
+> 15 0 25 3416 topology 3501 4634
+> 16 0 25 3416 topology 3502 4634
+> 15 0 25 3416 topology 3420 4635
+> 16 0 25 3416 topology 3422 4635
+> 15 0 25 3416 topology 3420 4636
+> 16 0 25 3416 topology 3421 4636
+> 15 0 25 3416 topology 3504 4637
+> 16 0 25 3416 topology 3506 4637
+> 15 0 25 3416 topology 3504 4638
+> 16 0 25 3416 topology 3505 4638
+> 15 0 25 3416 topology 3507 4639
+> 16 0 25 3416 topology 3509 4639
+> 15 0 25 3416 topology 3507 4640
+> 16 0 25 3416 topology 3508 4640
+> 15 0 25 3416 topology 3510 4641
+> 16 0 25 3416 topology 3512 4641
+> 15 0 25 3416 topology 3510 4642
+> 16 0 25 3416 topology 3511 4642
+> 15 0 25 3416 topology 3513 4643
+> 16 0 25 3416 topology 3515 4643
+> 15 0 25 3416 topology 3513 4644
+> 16 0 25 3416 topology 3514 4644
+> 15 0 25 3416 topology 3516 4645
+> 16 0 25 3416 topology 3518 4645
+> 15 0 25 3416 topology 3516 4646
+> 16 0 25 3416 topology 3517 4646
+> 15 0 25 3416 topology 3519 4647
+> 16 0 25 3416 topology 3521 4647
+> 15 0 25 3416 topology 3519 4648
+> 16 0 25 3416 topology 3520 4648
+> 15 0 25 3416 topology 3522 4649
+> 16 0 25 3416 topology 3524 4649
+> 15 0 25 3416 topology 3522 4650
+> 16 0 25 3416 topology 3523 4650
+> 15 0 25 3416 topology 3525 4651
+> 16 0 25 3416 topology 3527 4651
+> 15 0 25 3416 topology 3525 4652
+> 16 0 25 3416 topology 3526 4652
+> 15 0 25 3416 topology 3528 4653
+> 16 0 25 3416 topology 3530 4653
+> 15 0 25 3416 topology 3528 4654
+> 16 0 25 3416 topology 3529 4654
+> 15 0 25 3416 topology 3531 4655
+> 16 0 25 3416 topology 3533 4655
+> 15 0 25 3416 topology 3531 4656
+> 16 0 25 3416 topology 3532 4656
+> 15 0 25 3416 topology 3423 4657
+> 16 0 25 3416 topology 3425 4657
+> 15 0 25 3416 topology 3423 4658
+> 16 0 25 3416 topology 3424 4658
+> 15 0 25 3416 topology 3534 4659
+> 16 0 25 3416 topology 3536 4659
+> 15 0 25 3416 topology 3534 4660
+> 16 0 25 3416 topology 3535 4660
+> 15 0 25 3416 topology 3537 4661
+> 16 0 25 3416 topology 3539 4661
+> 15 0 25 3416 topology 3537 4662
+> 16 0 25 3416 topology 3538 4662
+> 15 0 25 3416 topology 3540 4663
+> 16 0 25 3416 topology 3542 4663
+> 15 0 25 3416 topology 3540 4664
+> 16 0 25 3416 topology 3541 4664
+> 15 0 25 3416 topology 3543 4665
+> 16 0 25 3416 topology 3545 4665
+> 15 0 25 3416 topology 3543 4666
+> 16 0 25 3416 topology 3544 4666
+> 15 0 25 3416 topology 3546 4667
+> 16 0 25 3416 topology 3548 4667
+> 15 0 25 3416 topology 3546 4668
+> 16 0 25 3416 topology 3547 4668
+> 15 0 25 3416 topology 3549 4669
+> 16 0 25 3416 topology 3551 4669
+> 15 0 25 3416 topology 3549 4670
+> 16 0 25 3416 topology 3550 4670
+> 15 0 25 3416 topology 3552 4671
+> 16 0 25 3416 topology 3554 4671
+> 15 0 25 3416 topology 3552 4672
+> 16 0 25 3416 topology 3553 4672
+> 15 0 25 3416 topology 3555 4673
+> 16 0 25 3416 topology 3557 4673
+> 15 0 25 3416 topology 3555 4674
+> 16 0 25 3416 topology 3556 4674
+> 15 0 25 3416 topology 3558 4675
+> 16 0 25 3416 topology 3560 4675
+> 15 0 25 3416 topology 3558 4676
+> 16 0 25 3416 topology 3559 4676
+> 15 0 25 3416 topology 3561 4677
+> 16 0 25 3416 topology 3563 4677
+> 15 0 25 3416 topology 3561 4678
+> 16 0 25 3416 topology 3562 4678
+> 15 0 25 3416 topology 3426 4679
+> 16 0 25 3416 topology 3428 4679
+> 15 0 25 3416 topology 3426 4680
+> 16 0 25 3416 topology 3427 4680
+> 15 0 25 3416 topology 3564 4681
+> 16 0 25 3416 topology 3566 4681
+> 15 0 25 3416 topology 3564 4682
+> 16 0 25 3416 topology 3565 4682
+> 15 0 25 3416 topology 3567 4683
+> 16 0 25 3416 topology 3569 4683
+> 15 0 25 3416 topology 3567 4684
+> 16 0 25 3416 topology 3568 4684
+> 15 0 25 3416 topology 3570 4685
+> 16 0 25 3416 topology 3572 4685
+> 15 0 25 3416 topology 3570 4686
+> 16 0 25 3416 topology 3571 4686
+> 15 0 25 3416 topology 3573 4687
+> 16 0 25 3416 topology 3575 4687
+> 15 0 25 3416 topology 3573 4688
+> 16 0 25 3416 topology 3574 4688
+> 15 0 25 3416 topology 3576 4689
+> 16 0 25 3416 topology 3578 4689
+> 15 0 25 3416 topology 3576 4690
+> 16 0 25 3416 topology 3577 4690
+> 15 0 25 3416 topology 3579 4691
+> 16 0 25 3416 topology 3581 4691
+> 15 0 25 3416 topology 3579 4692
+> 16 0 25 3416 topology 3580 4692
+> 15 0 25 3416 topology 3582 4693
+> 16 0 25 3416 topology 3584 4693
+> 15 0 25 3416 topology 3582 4694
+> 16 0 25 3416 topology 3583 4694
+> 15 0 25 3416 topology 3585 4695
+> 16 0 25 3416 topology 3587 4695
+> 15 0 25 3416 topology 3585 4696
+> 16 0 25 3416 topology 3586 4696
+> 15 0 25 3416 topology 3588 4697
+> 16 0 25 3416 topology 3590 4697
+> 15 0 25 3416 topology 3588 4698
+> 16 0 25 3416 topology 3589 4698
+> 15 0 25 3416 topology 3591 4699
+> 16 0 25 3416 topology 3593 4699
+> 15 0 25 3416 topology 3591 4700
+> 16 0 25 3416 topology 3592 4700
+> 15 0 25 3416 topology 3429 4701
+> 16 0 25 3416 topology 3431 4701
+> 15 0 25 3416 topology 3429 4702
+> 16 0 25 3416 topology 3430 4702
+> 15 0 25 3416 topology 3594 4703
+> 16 0 25 3416 topology 3596 4703
+> 15 0 25 3416 topology 3594 4704
+> 16 0 25 3416 topology 3595 4704
+> 15 0 25 3416 topology 3597 4705
+> 16 0 25 3416 topology 3599 4705
+> 15 0 25 3416 topology 3597 4706
+> 16 0 25 3416 topology 3598 4706
+> 15 0 25 3416 topology 3600 4707
+> 16 0 25 3416 topology 3602 4707
+> 15 0 25 3416 topology 3600 4708
+> 16 0 25 3416 topology 3601 4708
+> 15 0 25 3416 topology 3603 4709
+> 16 0 25 3416 topology 3605 4709
+> 15 0 25 3416 topology 3603 4710
+> 16 0 25 3416 topology 3604 4710
+> 15 0 25 3416 topology 3606 4711
+> 16 0 25 3416 topology 3608 4711
+> 15 0 25 3416 topology 3606 4712
+> 16 0 25 3416 topology 3607 4712
+> 15 0 25 3416 topology 3432 4713
+> 16 0 25 3416 topology 3434 4713
+> 15 0 25 3416 topology 3432 4714
+> 16 0 25 3416 topology 3433 4714
+> 15 0 25 3416 topology 3435 4715
+> 16 0 25 3416 topology 3437 4715
+> 15 0 25 3416 topology 3435 4716
+> 16 0 25 3416 topology 3436 4716
+> 15 0 25 3416 topology 3438 4717
+> 16 0 25 3416 topology 3440 4717
+> 15 0 25 3416 topology 3438 4718
+> 16 0 25 3416 topology 3439 4718
+> 15 0 25 3416 topology 3441 4719
+> 16 0 25 3416 topology 3443 4719
+> 15 0 25 3416 topology 3441 4720
+> 16 0 25 3416 topology 3442 4720
+> 15 0 23 3612 topology 3642 4721
+> 16 0 23 3612 topology 3713 4721
+> 15 0 23 3612 topology 3641 4722
 > 16 0 23 3612 topology 3713 4722
-> 15 0 23 3612 topology 3615 4723
+> 15 0 23 3612 topology 3645 4723
 > 16 0 23 3612 topology 3713 4723
-> 15 0 24 3612 topology 3619 4724
-> 16 0 24 3612 topology 3620 4724
-> 15 0 24 3612 topology 3673 4725
-> 16 0 24 3612 topology 3674 4725
-> 15 0 23 3612 topology 3704 4726
+> 15 0 23 3612 topology 3644 4724
+> 16 0 23 3612 topology 3713 4724
+> 15 0 23 3612 topology 3648 4725
+> 16 0 23 3612 topology 3713 4725
+> 15 0 23 3612 topology 3647 4726
 > 16 0 23 3612 topology 3713 4726
-> 15 0 24 3612 topology 3622 4727
-> 16 0 24 3612 topology 3623 4727
-> 15 0 23 3612 topology 3656 4728
+> 15 0 23 3612 topology 3651 4727
+> 16 0 23 3612 topology 3713 4727
+> 15 0 23 3612 topology 3650 4728
 > 16 0 23 3612 topology 3713 4728
-> 15 0 23 3612 topology 3686 4729
+> 15 0 23 3612 topology 3654 4729
 > 16 0 23 3612 topology 3713 4729
-> 15 0 24 3612 topology 3697 4730
-> 16 0 24 3612 topology 3699 4730
-> 15 0 24 3612 topology 3625 4731
-> 16 0 24 3612 topology 3626 4731
-> 15 0 23 3612 topology 3627 4732
+> 15 0 23 3612 topology 3653 4730
+> 16 0 23 3612 topology 3713 4730
+> 15 0 23 3612 topology 3657 4731
+> 16 0 23 3612 topology 3713 4731
+> 15 0 23 3612 topology 3656 4732
 > 16 0 23 3612 topology 3713 4732
-> 15 0 24 3612 topology 3652 4733
-> 16 0 24 3612 topology 3653 4733
-> 15 0 24 3612 topology 3706 4734
-> 16 0 24 3612 topology 3707 4734
-> 15 0 24 3612 topology 3628 4735
-> 16 0 24 3612 topology 3629 4735
-> 15 0 23 3612 topology 3668 4736
+> 15 0 23 3612 topology 3660 4733
+> 16 0 23 3612 topology 3713 4733
+> 15 0 23 3612 topology 3659 4734
+> 16 0 23 3612 topology 3713 4734
+> 15 0 23 3612 topology 3663 4735
+> 16 0 23 3612 topology 3713 4735
+> 15 0 23 3612 topology 3662 4736
 > 16 0 23 3612 topology 3713 4736
-> 15 0 23 3612 topology 3698 4737
+> 15 0 23 3612 topology 3666 4737
 > 16 0 23 3612 topology 3713 4737
-> 15 0 24 3612 topology 3631 4738
-> 16 0 24 3612 topology 3632 4738
-> 15 0 23 3612 topology 3639 4739
+> 15 0 23 3612 topology 3665 4738
+> 16 0 23 3612 topology 3713 4738
+> 15 0 23 3612 topology 3669 4739
 > 16 0 23 3612 topology 3713 4739
-> 15 0 24 3612 topology 3685 4740
-> 16 0 24 3612 topology 3686 4740
-> 15 0 24 3612 topology 3634 4741
-> 16 0 24 3612 topology 3635 4741
-> 15 0 24 3612 topology 3637 4742
-> 16 0 24 3612 topology 3638 4742
-> 15 0 24 3612 topology 3664 4743
-> 16 0 24 3612 topology 3665 4743
-> 15 0 23 3612 topology 3617 4744
+> 15 0 23 3612 topology 3668 4740
+> 16 0 23 3612 topology 3713 4740
+> 15 0 23 3612 topology 3615 4741
+> 16 0 23 3612 topology 3713 4741
+> 15 0 23 3612 topology 3614 4742
+> 16 0 23 3612 topology 3713 4742
+> 15 0 23 3612 topology 3672 4743
+> 16 0 23 3612 topology 3713 4743
+> 15 0 23 3612 topology 3671 4744
 > 16 0 23 3612 topology 3713 4744
-> 15 0 24 3612 topology 3613 4745
-> 16 0 24 3612 topology 3615 4745
-> 15 0 24 3612 topology 3697 4746
-> 16 0 24 3612 topology 3698 4746
-> 15 0 23 3612 topology 3645 4747
+> 15 0 23 3612 topology 3675 4745
+> 16 0 23 3612 topology 3713 4745
+> 15 0 23 3612 topology 3674 4746
+> 16 0 23 3612 topology 3713 4746
+> 15 0 23 3612 topology 3678 4747
 > 16 0 23 3612 topology 3713 4747
-> 15 0 24 3612 topology 3670 4748
-> 16 0 24 3612 topology 3672 4748
-> 15 0 23 3612 topology 3629 4749
+> 15 0 23 3612 topology 3677 4748
+> 16 0 23 3612 topology 3713 4748
+> 15 0 23 3612 topology 3681 4749
 > 16 0 23 3612 topology 3713 4749
-> 15 0 24 3612 topology 3619 4750
-> 16 0 24 3612 topology 3621 4750
-> 15 0 23 3612 topology 3705 4751
+> 15 0 23 3612 topology 3680 4750
+> 16 0 23 3612 topology 3713 4750
+> 15 0 23 3612 topology 3684 4751
 > 16 0 23 3612 topology 3713 4751
-> 15 0 23 3612 topology 3681 4752
+> 15 0 23 3612 topology 3683 4752
 > 16 0 23 3612 topology 3713 4752
-> 15 0 24 3612 topology 3649 4753
-> 16 0 24 3612 topology 3651 4753
-> 15 0 23 3612 topology 3657 4754
+> 15 0 23 3612 topology 3687 4753
+> 16 0 23 3612 topology 3713 4753
+> 15 0 23 3612 topology 3686 4754
 > 16 0 23 3612 topology 3713 4754
-> 15 0 24 3612 topology 3703 4755
-> 16 0 24 3612 topology 3705 4755
-> 15 0 24 3612 topology 3625 4756
-> 16 0 24 3612 topology 3627 4756
+> 15 0 23 3612 topology 3690 4755
+> 16 0 23 3612 topology 3713 4755
+> 15 0 23 3612 topology 3689 4756
+> 16 0 23 3612 topology 3713 4756
 > 15 0 23 3612 topology 3693 4757
 > 16 0 23 3612 topology 3713 4757
-> 15 0 23 3612 topology 3669 4758
+> 15 0 23 3612 topology 3692 4758
 > 16 0 23 3612 topology 3713 4758
-> 15 0 24 3612 topology 3682 4759
-> 16 0 24 3612 topology 3684 4759
-> 15 0 24 3612 topology 3631 4760
-> 16 0 24 3612 topology 3633 4760
-> 15 0 23 3612 topology 3641 4761
+> 15 0 23 3612 topology 3696 4759
+> 16 0 23 3612 topology 3713 4759
+> 15 0 23 3612 topology 3695 4760
+> 16 0 23 3612 topology 3713 4760
+> 15 0 23 3612 topology 3699 4761
 > 16 0 23 3612 topology 3713 4761
-> 15 0 24 3612 topology 3661 4762
-> 16 0 24 3612 topology 3663 4762
-> 15 0 24 3612 topology 3643 4763
-> 16 0 24 3612 topology 3644 4763
-> 15 0 23 3612 topology 3671 4764
+> 15 0 23 3612 topology 3698 4762
+> 16 0 23 3612 topology 3713 4762
+> 15 0 23 3612 topology 3618 4763
+> 16 0 23 3612 topology 3713 4763
+> 15 0 23 3612 topology 3617 4764
 > 16 0 23 3612 topology 3713 4764
-> 15 0 24 3612 topology 3637 4765
-> 16 0 24 3612 topology 3639 4765
+> 15 0 23 3612 topology 3702 4765
+> 16 0 23 3612 topology 3713 4765
 > 15 0 23 3612 topology 3701 4766
 > 16 0 23 3612 topology 3713 4766
-> 15 0 23 3612 topology 3618 4767
+> 15 0 23 3612 topology 3705 4767
 > 16 0 23 3612 topology 3713 4767
-> 15 0 23 3612 topology 3653 4768
+> 15 0 23 3612 topology 3704 4768
 > 16 0 23 3612 topology 3713 4768
-> 15 0 24 3612 topology 3694 4769
-> 16 0 24 3612 topology 3696 4769
-> 15 0 24 3612 topology 3676 4770
-> 16 0 24 3612 topology 3677 4770
-> 15 0 23 3612 topology 3683 4771
+> 15 0 23 3612 topology 3708 4769
+> 16 0 23 3612 topology 3713 4769
+> 15 0 23 3612 topology 3707 4770
+> 16 0 23 3612 topology 3713 4770
+> 15 0 23 3612 topology 3711 4771
 > 16 0 23 3612 topology 3713 4771
-> 15 0 23 3612 topology 3630 4772
+> 15 0 23 3612 topology 3710 4772
 > 16 0 23 3612 topology 3713 4772
-> 15 0 23 3612 topology 3665 4773
+> 15 0 23 3612 topology 3621 4773
 > 16 0 23 3612 topology 3713 4773
-> 15 0 24 3612 topology 3655 4774
-> 16 0 24 3612 topology 3656 4774
-> 15 0 23 3612 topology 3695 4775
+> 15 0 23 3612 topology 3620 4774
+> 16 0 23 3612 topology 3713 4774
+> 15 0 23 3612 topology 3624 4775
 > 16 0 23 3612 topology 3713 4775
-> 15 0 24 3612 topology 3709 4776
-> 16 0 24 3612 topology 3710 4776
-> 15 0 25 3612 topology 3712 4777
-> 16 0 25 3612 topology 3713 4777
-> 15 0 24 3612 topology 3688 4778
-> 16 0 24 3612 topology 3689 4778
-> 15 0 23 3612 topology 3614 4779
+> 15 0 23 3612 topology 3623 4776
+> 16 0 23 3612 topology 3713 4776
+> 15 0 23 3612 topology 3627 4777
+> 16 0 23 3612 topology 3713 4777
+> 15 0 23 3612 topology 3626 4778
+> 16 0 23 3612 topology 3713 4778
+> 15 0 23 3612 topology 3630 4779
 > 16 0 23 3612 topology 3713 4779
-> 15 0 24 3612 topology 3667 4780
-> 16 0 24 3612 topology 3668 4780
-> 15 0 23 3612 topology 3626 4781
+> 15 0 23 3612 topology 3629 4780
+> 16 0 23 3612 topology 3713 4780
+> 15 0 23 3612 topology 3633 4781
 > 16 0 23 3612 topology 3713 4781
-> 15 0 23 3612 topology 3672 4782
+> 15 0 23 3612 topology 3632 4782
 > 16 0 23 3612 topology 3713 4782
-> 15 0 23 3612 topology 3648 4783
+> 15 0 23 3612 topology 3636 4783
 > 16 0 23 3612 topology 3713 4783
-> 15 0 24 3612 topology 3646 4784
-> 16 0 24 3612 topology 3648 4784
-> 15 0 24 3612 topology 3700 4785
-> 16 0 24 3612 topology 3702 4785
-> 15 0 23 3612 topology 3708 4786
+> 15 0 23 3612 topology 3635 4784
+> 16 0 23 3612 topology 3713 4784
+> 15 0 23 3612 topology 3639 4785
+> 16 0 23 3612 topology 3713 4785
+> 15 0 23 3612 topology 3638 4786
 > 16 0 23 3612 topology 3713 4786
-> 15 0 23 3612 topology 3638 4787
-> 16 0 23 3612 topology 3713 4787
-> 15 0 23 3612 topology 3684 4788
-> 16 0 23 3612 topology 3713 4788
-> 15 0 23 3612 topology 3660 4789
-> 16 0 23 3612 topology 3713 4789
-> 15 0 24 3612 topology 3679 4790
-> 16 0 24 3612 topology 3681 4790
-> 15 0 23 3612 topology 3696 4791
-> 16 0 23 3612 topology 3713 4791
-> 15 0 24 3612 topology 3658 4792
-> 16 0 24 3612 topology 3660 4792
-> 15 0 24 3612 topology 3691 4793
-> 16 0 24 3612 topology 3693 4793
-> 15 0 24 3612 topology 3646 4794
-> 16 0 24 3612 topology 3647 4794
-> 15 0 23 3612 topology 3650 4795
-> 16 0 23 3612 topology 3713 4795
-> 15 0 24 3612 topology 3700 4796
-> 16 0 24 3612 topology 3701 4796
-> 15 0 23 3612 topology 3680 4797
-> 16 0 23 3612 topology 3713 4797
-> 15 0 23 3612 topology 3621 4798
-> 16 0 23 3612 topology 3713 4798
-> 15 0 23 3612 topology 3710 4799
-> 16 0 23 3612 topology 3713 4799
-> 15 0 23 3612 topology 3662 4800
-> 16 0 23 3612 topology 3713 4800
-> 15 0 24 3612 topology 3679 4801
-> 16 0 24 3612 topology 3680 4801
-> 15 0 23 3612 topology 3692 4802
-> 16 0 23 3612 topology 3713 4802
-> 15 0 23 3612 topology 3633 4803
-> 16 0 23 3612 topology 3713 4803
-> 15 0 24 3612 topology 3658 4804
-> 16 0 24 3612 topology 3659 4804
-> 15 0 24 3612 topology 3691 4805
-> 16 0 24 3612 topology 3692 4805
-> 15 0 23 3612 topology 3623 4806
-> 16 0 23 3612 topology 3713 4806
-> 15 0 24 3612 topology 3616 4807
-> 16 0 24 3612 topology 3618 4807
-> 15 0 24 3612 topology 3643 4808
-> 16 0 24 3612 topology 3645 4808
-> 15 0 23 3612 topology 3675 4809
-> 16 0 23 3612 topology 3713 4809
-> 15 0 23 3612 topology 3651 4810
-> 16 0 23 3612 topology 3713 4810
-> 15 0 23 3612 topology 3635 4811
-> 16 0 23 3612 topology 3713 4811
-> 15 0 24 3612 topology 3622 4812
-> 16 0 24 3612 topology 3624 4812
-> 15 0 24 3612 topology 3676 4813
-> 16 0 24 3612 topology 3678 4813
-> 15 0 23 3612 topology 3711 4814
-> 16 0 23 3612 topology 3713 4814
-> 15 0 23 3612 topology 3687 4815
-> 16 0 23 3612 topology 3713 4815
-> 15 0 23 3612 topology 3663 4816
-> 16 0 23 3612 topology 3713 4816
-> 15 0 24 3612 topology 3628 4817
-> 16 0 24 3612 topology 3630 4817
-> 15 0 24 3612 topology 3655 4818
-> 16 0 24 3612 topology 3657 4818
-> 15 0 24 3612 topology 3709 4819
-> 16 0 24 3612 topology 3711 4819
-> 15 0 23 3612 topology 3699 4820
-> 16 0 23 3612 topology 3713 4820
-> 15 0 24 3612 topology 3634 4821
-> 16 0 24 3612 topology 3636 4821
-> 15 0 24 3612 topology 3688 4822
-> 16 0 24 3612 topology 3690 4822
-> 15 0 24 3612 topology 3670 4823
-> 16 0 24 3612 topology 3671 4823
-> 15 0 23 3612 topology 3647 4824
-> 16 0 23 3612 topology 3713 4824
-> 15 0 23 3612 topology 3677 4825
-> 16 0 23 3612 topology 3713 4825
-> 15 0 24 3612 topology 3667 4826
-> 16 0 24 3612 topology 3669 4826
-> 15 0 23 3612 topology 3707 4827
-> 16 0 23 3612 topology 3713 4827
-> 15 0 24 3612 topology 3649 4828
-> 16 0 24 3612 topology 3650 4828
-> 15 0 24 3612 topology 3703 4829
-> 16 0 24 3612 topology 3704 4829
-> 15 0 23 3612 topology 3624 4830
-> 16 0 23 3612 topology 3713 4830
-> 15 0 23 3612 topology 3659 4831
-> 16 0 23 3612 topology 3713 4831
-> 15 0 23 3612 topology 3689 4832
-> 16 0 23 3612 topology 3713 4832
-> 15 0 24 3612 topology 3682 4833
-> 16 0 24 3612 topology 3683 4833
-> 15 0 23 3612 topology 3636 4834
-> 16 0 23 3612 topology 3713 4834
-> 15 0 24 3612 topology 3661 4835
-> 16 0 24 3612 topology 3662 4835
-> 15 0 24 3612 topology 3694 4836
-> 16 0 24 3612 topology 3695 4836
-> 15 0 23 3612 topology 3620 4837
-> 16 0 23 3612 topology 3713 4837
-> 15 0 24 3612 topology 3640 4838
-> 16 0 24 3612 topology 3642 4838
-> 15 0 23 3612 topology 3642 4839
-> 16 0 23 3612 topology 3713 4839
-> 15 0 23 3612 topology 3702 4840
-> 16 0 23 3612 topology 3713 4840
-> 15 0 23 3612 topology 3632 4841
-> 16 0 23 3612 topology 3713 4841
-> 15 0 24 3612 topology 3673 4842
-> 16 0 24 3612 topology 3675 4842
-> 15 0 23 3612 topology 3678 4843
-> 16 0 23 3612 topology 3713 4843
-> 15 0 23 3612 topology 3654 4844
-> 16 0 23 3612 topology 3713 4844
-> 15 0 24 3612 topology 3652 4845
-> 16 0 24 3612 topology 3654 4845
-> 15 0 23 3612 topology 3690 4846
-> 16 0 23 3612 topology 3713 4846
-> 15 0 24 3612 topology 3706 4847
-> 16 0 24 3612 topology 3708 4847
-> 15 0 23 3612 topology 3666 4848
-> 16 0 23 3612 topology 3713 4848
-> 15 0 24 3612 topology 3685 4849
-> 16 0 24 3612 topology 3687 4849
-> 15 0 24 3612 topology 3613 4850
-> 16 0 24 3612 topology 3614 4850
-> 15 0 24 3612 topology 3640 4851
-> 16 0 24 3612 topology 3641 4851
-> 15 0 24 3612 topology 3616 4852
-> 16 0 24 3612 topology 3617 4852
-> 15 0 23 3612 topology 3644 4853
-> 16 0 23 3612 topology 3713 4853
-> 15 0 23 3715 topology 3721 4854
+> 15 0 24 3612 topology 3712 4787
+> 16 0 24 3612 topology 3713 4787
+> 15 0 25 3612 topology 3640 4788
+> 16 0 25 3612 topology 3642 4788
+> 15 0 25 3612 topology 3640 4789
+> 16 0 25 3612 topology 3641 4789
+> 15 0 25 3612 topology 3643 4790
+> 16 0 25 3612 topology 3645 4790
+> 15 0 25 3612 topology 3643 4791
+> 16 0 25 3612 topology 3644 4791
+> 15 0 25 3612 topology 3646 4792
+> 16 0 25 3612 topology 3648 4792
+> 15 0 25 3612 topology 3646 4793
+> 16 0 25 3612 topology 3647 4793
+> 15 0 25 3612 topology 3649 4794
+> 16 0 25 3612 topology 3651 4794
+> 15 0 25 3612 topology 3649 4795
+> 16 0 25 3612 topology 3650 4795
+> 15 0 25 3612 topology 3652 4796
+> 16 0 25 3612 topology 3654 4796
+> 15 0 25 3612 topology 3652 4797
+> 16 0 25 3612 topology 3653 4797
+> 15 0 25 3612 topology 3655 4798
+> 16 0 25 3612 topology 3657 4798
+> 15 0 25 3612 topology 3655 4799
+> 16 0 25 3612 topology 3656 4799
+> 15 0 25 3612 topology 3658 4800
+> 16 0 25 3612 topology 3660 4800
+> 15 0 25 3612 topology 3658 4801
+> 16 0 25 3612 topology 3659 4801
+> 15 0 25 3612 topology 3661 4802
+> 16 0 25 3612 topology 3663 4802
+> 15 0 25 3612 topology 3661 4803
+> 16 0 25 3612 topology 3662 4803
+> 15 0 25 3612 topology 3664 4804
+> 16 0 25 3612 topology 3666 4804
+> 15 0 25 3612 topology 3664 4805
+> 16 0 25 3612 topology 3665 4805
+> 15 0 25 3612 topology 3667 4806
+> 16 0 25 3612 topology 3669 4806
+> 15 0 25 3612 topology 3667 4807
+> 16 0 25 3612 topology 3668 4807
+> 15 0 25 3612 topology 3613 4808
+> 16 0 25 3612 topology 3615 4808
+> 15 0 25 3612 topology 3613 4809
+> 16 0 25 3612 topology 3614 4809
+> 15 0 25 3612 topology 3670 4810
+> 16 0 25 3612 topology 3672 4810
+> 15 0 25 3612 topology 3670 4811
+> 16 0 25 3612 topology 3671 4811
+> 15 0 25 3612 topology 3673 4812
+> 16 0 25 3612 topology 3675 4812
+> 15 0 25 3612 topology 3673 4813
+> 16 0 25 3612 topology 3674 4813
+> 15 0 25 3612 topology 3676 4814
+> 16 0 25 3612 topology 3678 4814
+> 15 0 25 3612 topology 3676 4815
+> 16 0 25 3612 topology 3677 4815
+> 15 0 25 3612 topology 3679 4816
+> 16 0 25 3612 topology 3681 4816
+> 15 0 25 3612 topology 3679 4817
+> 16 0 25 3612 topology 3680 4817
+> 15 0 25 3612 topology 3682 4818
+> 16 0 25 3612 topology 3684 4818
+> 15 0 25 3612 topology 3682 4819
+> 16 0 25 3612 topology 3683 4819
+> 15 0 25 3612 topology 3685 4820
+> 16 0 25 3612 topology 3687 4820
+> 15 0 25 3612 topology 3685 4821
+> 16 0 25 3612 topology 3686 4821
+> 15 0 25 3612 topology 3688 4822
+> 16 0 25 3612 topology 3690 4822
+> 15 0 25 3612 topology 3688 4823
+> 16 0 25 3612 topology 3689 4823
+> 15 0 25 3612 topology 3691 4824
+> 16 0 25 3612 topology 3693 4824
+> 15 0 25 3612 topology 3691 4825
+> 16 0 25 3612 topology 3692 4825
+> 15 0 25 3612 topology 3694 4826
+> 16 0 25 3612 topology 3696 4826
+> 15 0 25 3612 topology 3694 4827
+> 16 0 25 3612 topology 3695 4827
+> 15 0 25 3612 topology 3697 4828
+> 16 0 25 3612 topology 3699 4828
+> 15 0 25 3612 topology 3697 4829
+> 16 0 25 3612 topology 3698 4829
+> 15 0 25 3612 topology 3616 4830
+> 16 0 25 3612 topology 3618 4830
+> 15 0 25 3612 topology 3616 4831
+> 16 0 25 3612 topology 3617 4831
+> 15 0 25 3612 topology 3700 4832
+> 16 0 25 3612 topology 3702 4832
+> 15 0 25 3612 topology 3700 4833
+> 16 0 25 3612 topology 3701 4833
+> 15 0 25 3612 topology 3703 4834
+> 16 0 25 3612 topology 3705 4834
+> 15 0 25 3612 topology 3703 4835
+> 16 0 25 3612 topology 3704 4835
+> 15 0 25 3612 topology 3706 4836
+> 16 0 25 3612 topology 3708 4836
+> 15 0 25 3612 topology 3706 4837
+> 16 0 25 3612 topology 3707 4837
+> 15 0 25 3612 topology 3709 4838
+> 16 0 25 3612 topology 3711 4838
+> 15 0 25 3612 topology 3709 4839
+> 16 0 25 3612 topology 3710 4839
+> 15 0 25 3612 topology 3619 4840
+> 16 0 25 3612 topology 3621 4840
+> 15 0 25 3612 topology 3619 4841
+> 16 0 25 3612 topology 3620 4841
+> 15 0 25 3612 topology 3622 4842
+> 16 0 25 3612 topology 3624 4842
+> 15 0 25 3612 topology 3622 4843
+> 16 0 25 3612 topology 3623 4843
+> 15 0 25 3612 topology 3625 4844
+> 16 0 25 3612 topology 3627 4844
+> 15 0 25 3612 topology 3625 4845
+> 16 0 25 3612 topology 3626 4845
+> 15 0 25 3612 topology 3628 4846
+> 16 0 25 3612 topology 3630 4846
+> 15 0 25 3612 topology 3628 4847
+> 16 0 25 3612 topology 3629 4847
+> 15 0 25 3612 topology 3631 4848
+> 16 0 25 3612 topology 3633 4848
+> 15 0 25 3612 topology 3631 4849
+> 16 0 25 3612 topology 3632 4849
+> 15 0 25 3612 topology 3634 4850
+> 16 0 25 3612 topology 3636 4850
+> 15 0 25 3612 topology 3634 4851
+> 16 0 25 3612 topology 3635 4851
+> 15 0 25 3612 topology 3637 4852
+> 16 0 25 3612 topology 3639 4852
+> 15 0 25 3612 topology 3637 4853
+> 16 0 25 3612 topology 3638 4853
+> 15 0 23 3715 topology 3745 4854
 > 16 0 23 3715 topology 3792 4854
-> 15 0 24 3715 topology 3779 4855
-> 16 0 24 3715 topology 3780 4855
-> 15 0 23 3715 topology 3762 4856
+> 15 0 23 3715 topology 3744 4855
+> 16 0 23 3715 topology 3792 4855
+> 15 0 23 3715 topology 3748 4856
 > 16 0 23 3715 topology 3792 4856
-> 15 0 24 3715 topology 3782 4857
-> 16 0 24 3715 topology 3783 4857
-> 15 0 23 3715 topology 3733 4858
+> 15 0 23 3715 topology 3747 4857
+> 16 0 23 3715 topology 3792 4857
+> 15 0 23 3715 topology 3751 4858
 > 16 0 23 3715 topology 3792 4858
-> 15 0 24 3715 topology 3731 4859
-> 16 0 24 3715 topology 3732 4859
-> 15 0 24 3715 topology 3785 4860
-> 16 0 24 3715 topology 3786 4860
-> 15 0 24 3715 topology 3788 4861
-> 16 0 24 3715 topology 3789 4861
-> 15 0 23 3715 topology 3717 4862
+> 15 0 23 3715 topology 3750 4859
+> 16 0 23 3715 topology 3792 4859
+> 15 0 23 3715 topology 3754 4860
+> 16 0 23 3715 topology 3792 4860
+> 15 0 23 3715 topology 3753 4861
+> 16 0 23 3715 topology 3792 4861
+> 15 0 23 3715 topology 3757 4862
 > 16 0 23 3715 topology 3792 4862
-> 15 0 24 3715 topology 3716 4863
-> 16 0 24 3715 topology 3718 4863
-> 15 0 24 3715 topology 3743 4864
-> 16 0 24 3715 topology 3745 4864
-> 15 0 23 3715 topology 3745 4865
+> 15 0 23 3715 topology 3756 4863
+> 16 0 23 3715 topology 3792 4863
+> 15 0 23 3715 topology 3760 4864
+> 16 0 23 3715 topology 3792 4864
+> 15 0 23 3715 topology 3759 4865
 > 16 0 23 3715 topology 3792 4865
-> 15 0 23 3715 topology 3729 4866
+> 15 0 23 3715 topology 3763 4866
 > 16 0 23 3715 topology 3792 4866
-> 15 0 24 3715 topology 3773 4867
-> 16 0 24 3715 topology 3775 4867
-> 15 0 24 3715 topology 3749 4868
-> 16 0 24 3715 topology 3751 4868
-> 15 0 23 3715 topology 3781 4869
+> 15 0 23 3715 topology 3762 4867
+> 16 0 23 3715 topology 3792 4867
+> 15 0 23 3715 topology 3766 4868
+> 16 0 23 3715 topology 3792 4868
+> 15 0 23 3715 topology 3765 4869
 > 16 0 23 3715 topology 3792 4869
-> 15 0 23 3715 topology 3757 4870
+> 15 0 23 3715 topology 3769 4870
 > 16 0 23 3715 topology 3792 4870
-> 15 0 23 3715 topology 3741 4871
+> 15 0 23 3715 topology 3768 4871
 > 16 0 23 3715 topology 3792 4871
-> 15 0 24 3715 topology 3779 4872
-> 16 0 24 3715 topology 3781 4872
-> 15 0 24 3715 topology 3728 4873
-> 16 0 24 3715 topology 3730 4873
-> 15 0 24 3715 topology 3755 4874
-> 16 0 24 3715 topology 3757 4874
-> 15 0 23 3715 topology 3769 4875
+> 15 0 23 3715 topology 3772 4872
+> 16 0 23 3715 topology 3792 4872
+> 15 0 23 3715 topology 3771 4873
+> 16 0 23 3715 topology 3792 4873
+> 15 0 23 3715 topology 3718 4874
+> 16 0 23 3715 topology 3792 4874
+> 15 0 23 3715 topology 3717 4875
 > 16 0 23 3715 topology 3792 4875
-> 15 0 24 3715 topology 3785 4876
-> 16 0 24 3715 topology 3787 4876
-> 15 0 24 3715 topology 3761 4877
-> 16 0 24 3715 topology 3763 4877
-> 15 0 24 3715 topology 3716 4878
-> 16 0 24 3715 topology 3717 4878
-> 15 0 23 3715 topology 3747 4879
+> 15 0 23 3715 topology 3775 4876
+> 16 0 23 3715 topology 3792 4876
+> 15 0 23 3715 topology 3774 4877
+> 16 0 23 3715 topology 3792 4877
+> 15 0 23 3715 topology 3778 4878
+> 16 0 23 3715 topology 3792 4878
+> 15 0 23 3715 topology 3777 4879
 > 16 0 23 3715 topology 3792 4879
-> 15 0 24 3715 topology 3740 4880
-> 16 0 24 3715 topology 3742 4880
-> 15 0 24 3715 topology 3767 4881
-> 16 0 24 3715 topology 3769 4881
-> 15 0 23 3715 topology 3777 4882
+> 15 0 23 3715 topology 3781 4880
+> 16 0 23 3715 topology 3792 4880
+> 15 0 23 3715 topology 3780 4881
+> 16 0 23 3715 topology 3792 4881
+> 15 0 23 3715 topology 3784 4882
 > 16 0 23 3715 topology 3792 4882
-> 15 0 23 3715 topology 3724 4883
+> 15 0 23 3715 topology 3783 4883
 > 16 0 23 3715 topology 3792 4883
-> 15 0 23 3715 topology 3759 4884
+> 15 0 23 3715 topology 3787 4884
 > 16 0 23 3715 topology 3792 4884
-> 15 0 23 3715 topology 3789 4885
+> 15 0 23 3715 topology 3786 4885
 > 16 0 23 3715 topology 3792 4885
-> 15 0 24 3715 topology 3728 4886
-> 16 0 24 3715 topology 3729 4886
-> 15 0 23 3715 topology 3736 4887
+> 15 0 23 3715 topology 3790 4886
+> 16 0 23 3715 topology 3792 4886
+> 15 0 23 3715 topology 3789 4887
 > 16 0 23 3715 topology 3792 4887
-> 15 0 23 3715 topology 3771 4888
+> 15 0 23 3715 topology 3721 4888
 > 16 0 23 3715 topology 3792 4888
-> 15 0 24 3715 topology 3740 4889
-> 16 0 24 3715 topology 3741 4889
-> 15 0 23 3715 topology 3726 4890
+> 15 0 23 3715 topology 3720 4889
+> 16 0 23 3715 topology 3792 4889
+> 15 0 23 3715 topology 3724 4890
 > 16 0 23 3715 topology 3792 4890
-> 15 0 24 3715 topology 3719 4891
-> 16 0 24 3715 topology 3721 4891
-> 15 0 23 3715 topology 3748 4892
+> 15 0 23 3715 topology 3723 4891
+> 16 0 23 3715 topology 3792 4891
+> 15 0 23 3715 topology 3727 4892
 > 16 0 23 3715 topology 3792 4892
-> 15 0 23 3715 topology 3738 4893
+> 15 0 23 3715 topology 3726 4893
 > 16 0 23 3715 topology 3792 4893
-> 15 0 23 3715 topology 3784 4894
+> 15 0 23 3715 topology 3730 4894
 > 16 0 23 3715 topology 3792 4894
-> 15 0 23 3715 topology 3760 4895
+> 15 0 23 3715 topology 3729 4895
 > 16 0 23 3715 topology 3792 4895
-> 15 0 24 3715 topology 3731 4896
-> 16 0 24 3715 topology 3733 4896
-> 15 0 23 3715 topology 3772 4897
+> 15 0 23 3715 topology 3733 4896
+> 16 0 23 3715 topology 3792 4896
+> 15 0 23 3715 topology 3732 4897
 > 16 0 23 3715 topology 3792 4897
-> 15 0 24 3715 topology 3743 4898
-> 16 0 24 3715 topology 3744 4898
-> 15 0 23 3715 topology 3744 4899
+> 15 0 23 3715 topology 3736 4898
+> 16 0 23 3715 topology 3792 4898
+> 15 0 23 3715 topology 3735 4899
 > 16 0 23 3715 topology 3792 4899
-> 15 0 24 3715 topology 3746 4900
-> 16 0 24 3715 topology 3747 4900
-> 15 0 23 3715 topology 3774 4901
+> 15 0 23 3715 topology 3739 4900
+> 16 0 23 3715 topology 3792 4900
+> 15 0 23 3715 topology 3738 4901
 > 16 0 23 3715 topology 3792 4901
-> 15 0 24 3715 topology 3749 4902
-> 16 0 24 3715 topology 3750 4902
-> 15 0 23 3715 topology 3756 4903
+> 15 0 23 3715 topology 3742 4902
+> 16 0 23 3715 topology 3792 4902
+> 15 0 23 3715 topology 3741 4903
 > 16 0 23 3715 topology 3792 4903
-> 15 0 24 3715 topology 3725 4904
-> 16 0 24 3715 topology 3726 4904
-> 15 0 24 3715 topology 3752 4905
-> 16 0 24 3715 topology 3753 4905
-> 15 0 23 3715 topology 3786 4906
-> 16 0 23 3715 topology 3792 4906
-> 15 0 23 3715 topology 3727 4907
-> 16 0 23 3715 topology 3792 4907
-> 15 0 24 3715 topology 3755 4908
-> 16 0 24 3715 topology 3756 4908
-> 15 0 23 3715 topology 3768 4909
-> 16 0 23 3715 topology 3792 4909
-> 15 0 24 3715 topology 3758 4910
-> 16 0 24 3715 topology 3759 4910
-> 15 0 23 3715 topology 3739 4911
-> 16 0 23 3715 topology 3792 4911
-> 15 0 24 3715 topology 3761 4912
-> 16 0 24 3715 topology 3762 4912
-> 15 0 24 3715 topology 3737 4913
-> 16 0 24 3715 topology 3738 4913
-> 15 0 24 3715 topology 3764 4914
-> 16 0 24 3715 topology 3765 4914
-> 15 0 24 3715 topology 3767 4915
-> 16 0 24 3715 topology 3768 4915
-> 15 0 24 3715 topology 3770 4916
-> 16 0 24 3715 topology 3771 4916
-> 15 0 23 3715 topology 3723 4917
-> 16 0 23 3715 topology 3792 4917
-> 15 0 24 3715 topology 3746 4918
-> 16 0 24 3715 topology 3748 4918
-> 15 0 23 3715 topology 3775 4919
-> 16 0 23 3715 topology 3792 4919
-> 15 0 23 3715 topology 3751 4920
-> 16 0 23 3715 topology 3792 4920
-> 15 0 24 3715 topology 3722 4921
-> 16 0 24 3715 topology 3724 4921
-> 15 0 23 3715 topology 3735 4922
-> 16 0 23 3715 topology 3792 4922
-> 15 0 24 3715 topology 3776 4923
-> 16 0 24 3715 topology 3778 4923
-> 15 0 24 3715 topology 3752 4924
-> 16 0 24 3715 topology 3754 4924
-> 15 0 23 3715 topology 3787 4925
-> 16 0 23 3715 topology 3792 4925
-> 15 0 23 3715 topology 3763 4926
-> 16 0 23 3715 topology 3792 4926
-> 15 0 25 3715 topology 3791 4927
-> 16 0 25 3715 topology 3792 4927
-> 15 0 24 3715 topology 3782 4928
-> 16 0 24 3715 topology 3784 4928
-> 15 0 24 3715 topology 3758 4929
-> 16 0 24 3715 topology 3760 4929
-> 15 0 24 3715 topology 3734 4930
-> 16 0 24 3715 topology 3736 4930
-> 15 0 24 3715 topology 3788 4931
-> 16 0 24 3715 topology 3790 4931
-> 15 0 24 3715 topology 3764 4932
-> 16 0 24 3715 topology 3766 4932
-> 15 0 23 3715 topology 3718 4933
-> 16 0 23 3715 topology 3792 4933
-> 15 0 24 3715 topology 3722 4934
-> 16 0 24 3715 topology 3723 4934
-> 15 0 23 3715 topology 3753 4935
-> 16 0 23 3715 topology 3792 4935
-> 15 0 24 3715 topology 3770 4936
-> 16 0 24 3715 topology 3772 4936
-> 15 0 23 3715 topology 3783 4937
-> 16 0 23 3715 topology 3792 4937
-> 15 0 23 3715 topology 3730 4938
-> 16 0 23 3715 topology 3792 4938
-> 15 0 23 3715 topology 3765 4939
-> 16 0 23 3715 topology 3792 4939
-> 15 0 24 3715 topology 3734 4940
-> 16 0 24 3715 topology 3735 4940
-> 15 0 23 3715 topology 3742 4941
-> 16 0 23 3715 topology 3792 4941
-> 15 0 23 3715 topology 3720 4942
-> 16 0 23 3715 topology 3792 4942
-> 15 0 23 3715 topology 3732 4943
-> 16 0 23 3715 topology 3792 4943
-> 15 0 23 3715 topology 3778 4944
-> 16 0 23 3715 topology 3792 4944
-> 15 0 23 3715 topology 3754 4945
-> 16 0 23 3715 topology 3792 4945
-> 15 0 24 3715 topology 3725 4946
-> 16 0 24 3715 topology 3727 4946
-> 15 0 23 3715 topology 3790 4947
-> 16 0 23 3715 topology 3792 4947
-> 15 0 23 3715 topology 3766 4948
-> 16 0 23 3715 topology 3792 4948
-> 15 0 24 3715 topology 3737 4949
-> 16 0 24 3715 topology 3739 4949
-> 15 0 24 3715 topology 3719 4950
-> 16 0 24 3715 topology 3720 4950
-> 15 0 24 3715 topology 3773 4951
-> 16 0 24 3715 topology 3774 4951
-> 15 0 23 3715 topology 3750 4952
-> 16 0 23 3715 topology 3792 4952
-> 15 0 24 3715 topology 3776 4953
-> 16 0 24 3715 topology 3777 4953
-> 15 0 23 3715 topology 3780 4954
-> 16 0 23 3715 topology 3792 4954
-> 15 0 23 3794 topology 3907 4955
+> 15 0 24 3715 topology 3791 4904
+> 16 0 24 3715 topology 3792 4904
+> 15 0 25 3715 topology 3743 4905
+> 16 0 25 3715 topology 3745 4905
+> 15 0 25 3715 topology 3743 4906
+> 16 0 25 3715 topology 3744 4906
+> 15 0 25 3715 topology 3746 4907
+> 16 0 25 3715 topology 3748 4907
+> 15 0 25 3715 topology 3746 4908
+> 16 0 25 3715 topology 3747 4908
+> 15 0 25 3715 topology 3749 4909
+> 16 0 25 3715 topology 3751 4909
+> 15 0 25 3715 topology 3749 4910
+> 16 0 25 3715 topology 3750 4910
+> 15 0 25 3715 topology 3752 4911
+> 16 0 25 3715 topology 3754 4911
+> 15 0 25 3715 topology 3752 4912
+> 16 0 25 3715 topology 3753 4912
+> 15 0 25 3715 topology 3755 4913
+> 16 0 25 3715 topology 3757 4913
+> 15 0 25 3715 topology 3755 4914
+> 16 0 25 3715 topology 3756 4914
+> 15 0 25 3715 topology 3758 4915
+> 16 0 25 3715 topology 3760 4915
+> 15 0 25 3715 topology 3758 4916
+> 16 0 25 3715 topology 3759 4916
+> 15 0 25 3715 topology 3761 4917
+> 16 0 25 3715 topology 3763 4917
+> 15 0 25 3715 topology 3761 4918
+> 16 0 25 3715 topology 3762 4918
+> 15 0 25 3715 topology 3764 4919
+> 16 0 25 3715 topology 3766 4919
+> 15 0 25 3715 topology 3764 4920
+> 16 0 25 3715 topology 3765 4920
+> 15 0 25 3715 topology 3767 4921
+> 16 0 25 3715 topology 3769 4921
+> 15 0 25 3715 topology 3767 4922
+> 16 0 25 3715 topology 3768 4922
+> 15 0 25 3715 topology 3770 4923
+> 16 0 25 3715 topology 3772 4923
+> 15 0 25 3715 topology 3770 4924
+> 16 0 25 3715 topology 3771 4924
+> 15 0 25 3715 topology 3716 4925
+> 16 0 25 3715 topology 3718 4925
+> 15 0 25 3715 topology 3716 4926
+> 16 0 25 3715 topology 3717 4926
+> 15 0 25 3715 topology 3773 4927
+> 16 0 25 3715 topology 3775 4927
+> 15 0 25 3715 topology 3773 4928
+> 16 0 25 3715 topology 3774 4928
+> 15 0 25 3715 topology 3776 4929
+> 16 0 25 3715 topology 3778 4929
+> 15 0 25 3715 topology 3776 4930
+> 16 0 25 3715 topology 3777 4930
+> 15 0 25 3715 topology 3779 4931
+> 16 0 25 3715 topology 3781 4931
+> 15 0 25 3715 topology 3779 4932
+> 16 0 25 3715 topology 3780 4932
+> 15 0 25 3715 topology 3782 4933
+> 16 0 25 3715 topology 3784 4933
+> 15 0 25 3715 topology 3782 4934
+> 16 0 25 3715 topology 3783 4934
+> 15 0 25 3715 topology 3785 4935
+> 16 0 25 3715 topology 3787 4935
+> 15 0 25 3715 topology 3785 4936
+> 16 0 25 3715 topology 3786 4936
+> 15 0 25 3715 topology 3788 4937
+> 16 0 25 3715 topology 3790 4937
+> 15 0 25 3715 topology 3788 4938
+> 16 0 25 3715 topology 3789 4938
+> 15 0 25 3715 topology 3719 4939
+> 16 0 25 3715 topology 3721 4939
+> 15 0 25 3715 topology 3719 4940
+> 16 0 25 3715 topology 3720 4940
+> 15 0 25 3715 topology 3722 4941
+> 16 0 25 3715 topology 3724 4941
+> 15 0 25 3715 topology 3722 4942
+> 16 0 25 3715 topology 3723 4942
+> 15 0 25 3715 topology 3725 4943
+> 16 0 25 3715 topology 3727 4943
+> 15 0 25 3715 topology 3725 4944
+> 16 0 25 3715 topology 3726 4944
+> 15 0 25 3715 topology 3728 4945
+> 16 0 25 3715 topology 3730 4945
+> 15 0 25 3715 topology 3728 4946
+> 16 0 25 3715 topology 3729 4946
+> 15 0 25 3715 topology 3731 4947
+> 16 0 25 3715 topology 3733 4947
+> 15 0 25 3715 topology 3731 4948
+> 16 0 25 3715 topology 3732 4948
+> 15 0 25 3715 topology 3734 4949
+> 16 0 25 3715 topology 3736 4949
+> 15 0 25 3715 topology 3734 4950
+> 16 0 25 3715 topology 3735 4950
+> 15 0 25 3715 topology 3737 4951
+> 16 0 25 3715 topology 3739 4951
+> 15 0 25 3715 topology 3737 4952
+> 16 0 25 3715 topology 3738 4952
+> 15 0 25 3715 topology 3740 4953
+> 16 0 25 3715 topology 3742 4953
+> 15 0 25 3715 topology 3740 4954
+> 16 0 25 3715 topology 3741 4954
+> 15 0 23 3794 topology 3824 4955
 > 16 0 23 3794 topology 3916 4955
-> 15 0 24 3794 topology 3870 4956
-> 16 0 24 3794 topology 3871 4956
-> 15 0 23 3794 topology 3796 4957
+> 15 0 23 3794 topology 3823 4956
+> 16 0 23 3794 topology 3916 4956
+> 15 0 23 3794 topology 3827 4957
 > 16 0 23 3794 topology 3916 4957
-> 15 0 24 3794 topology 3849 4958
-> 16 0 24 3794 topology 3850 4958
-> 15 0 24 3794 topology 3903 4959
-> 16 0 24 3794 topology 3904 4959
-> 15 0 23 3794 topology 3808 4960
+> 15 0 23 3794 topology 3826 4958
+> 16 0 23 3794 topology 3916 4958
+> 15 0 23 3794 topology 3830 4959
+> 16 0 23 3794 topology 3916 4959
+> 15 0 23 3794 topology 3829 4960
 > 16 0 23 3794 topology 3916 4960
-> 15 0 23 3794 topology 3854 4961
+> 15 0 23 3794 topology 3833 4961
 > 16 0 23 3794 topology 3916 4961
-> 15 0 23 3794 topology 3830 4962
+> 15 0 23 3794 topology 3832 4962
 > 16 0 23 3794 topology 3916 4962
-> 15 0 24 3794 topology 3828 4963
-> 16 0 24 3794 topology 3830 4963
-> 15 0 24 3794 topology 3882 4964
-> 16 0 24 3794 topology 3884 4964
-> 15 0 23 3794 topology 3914 4965
+> 15 0 23 3794 topology 3836 4963
+> 16 0 23 3794 topology 3916 4963
+> 15 0 23 3794 topology 3835 4964
+> 16 0 23 3794 topology 3916 4964
+> 15 0 23 3794 topology 3839 4965
 > 16 0 23 3794 topology 3916 4965
-> 15 0 23 3794 topology 3890 4966
+> 15 0 23 3794 topology 3838 4966
 > 16 0 23 3794 topology 3916 4966
-> 15 0 23 3794 topology 3820 4967
+> 15 0 23 3794 topology 3842 4967
 > 16 0 23 3794 topology 3916 4967
-> 15 0 23 3794 topology 3866 4968
+> 15 0 23 3794 topology 3841 4968
 > 16 0 23 3794 topology 3916 4968
-> 15 0 23 3794 topology 3842 4969
+> 15 0 23 3794 topology 3845 4969
 > 16 0 23 3794 topology 3916 4969
-> 15 0 24 3794 topology 3861 4970
-> 16 0 24 3794 topology 3863 4970
-> 15 0 23 3794 topology 3902 4971
+> 15 0 23 3794 topology 3844 4970
+> 16 0 23 3794 topology 3916 4970
+> 15 0 23 3794 topology 3848 4971
 > 16 0 23 3794 topology 3916 4971
-> 15 0 23 3794 topology 3878 4972
+> 15 0 23 3794 topology 3847 4972
 > 16 0 23 3794 topology 3916 4972
-> 15 0 24 3794 topology 3840 4973
-> 16 0 24 3794 topology 3842 4973
-> 15 0 24 3794 topology 3894 4974
-> 16 0 24 3794 topology 3896 4974
-> 15 0 24 3794 topology 3873 4975
-> 16 0 24 3794 topology 3875 4975
-> 15 0 24 3794 topology 3828 4976
-> 16 0 24 3794 topology 3829 4976
-> 15 0 23 3794 topology 3832 4977
+> 15 0 23 3794 topology 3851 4973
+> 16 0 23 3794 topology 3916 4973
+> 15 0 23 3794 topology 3850 4974
+> 16 0 23 3794 topology 3916 4974
+> 15 0 23 3794 topology 3797 4975
+> 16 0 23 3794 topology 3916 4975
+> 15 0 23 3794 topology 3796 4976
+> 16 0 23 3794 topology 3916 4976
+> 15 0 23 3794 topology 3854 4977
 > 16 0 23 3794 topology 3916 4977
-> 15 0 24 3794 topology 3882 4978
-> 16 0 24 3794 topology 3883 4978
-> 15 0 23 3794 topology 3862 4979
+> 15 0 23 3794 topology 3853 4978
+> 16 0 23 3794 topology 3916 4978
+> 15 0 23 3794 topology 3857 4979
 > 16 0 23 3794 topology 3916 4979
-> 15 0 23 3794 topology 3803 4980
+> 15 0 23 3794 topology 3856 4980
 > 16 0 23 3794 topology 3916 4980
-> 15 0 23 3794 topology 3892 4981
+> 15 0 23 3794 topology 3860 4981
 > 16 0 23 3794 topology 3916 4981
-> 15 0 24 3794 topology 3906 4982
-> 16 0 24 3794 topology 3908 4982
-> 15 0 23 3794 topology 3844 4983
+> 15 0 23 3794 topology 3859 4982
+> 16 0 23 3794 topology 3916 4982
+> 15 0 23 3794 topology 3863 4983
 > 16 0 23 3794 topology 3916 4983
-> 15 0 24 3794 topology 3861 4984
-> 16 0 24 3794 topology 3862 4984
-> 15 0 23 3794 topology 3874 4985
+> 15 0 23 3794 topology 3862 4984
+> 16 0 23 3794 topology 3916 4984
+> 15 0 23 3794 topology 3866 4985
 > 16 0 23 3794 topology 3916 4985
-> 15 0 23 3794 topology 3815 4986
+> 15 0 23 3794 topology 3865 4986
 > 16 0 23 3794 topology 3916 4986
-> 15 0 23 3794 topology 3904 4987
+> 15 0 23 3794 topology 3869 4987
 > 16 0 23 3794 topology 3916 4987
-> 15 0 24 3794 topology 3840 4988
-> 16 0 24 3794 topology 3841 4988
-> 15 0 24 3794 topology 3894 4989
-> 16 0 24 3794 topology 3895 4989
-> 15 0 24 3794 topology 3873 4990
-> 16 0 24 3794 topology 3874 4990
-> 15 0 23 3794 topology 3805 4991
+> 15 0 23 3794 topology 3868 4988
+> 16 0 23 3794 topology 3916 4988
+> 15 0 23 3794 topology 3872 4989
+> 16 0 23 3794 topology 3916 4989
+> 15 0 23 3794 topology 3871 4990
+> 16 0 23 3794 topology 3916 4990
+> 15 0 23 3794 topology 3875 4991
 > 16 0 23 3794 topology 3916 4991
-> 15 0 24 3794 topology 3906 4992
-> 16 0 24 3794 topology 3907 4992
-> 15 0 24 3794 topology 3798 4993
-> 16 0 24 3794 topology 3800 4993
-> 15 0 24 3794 topology 3825 4994
-> 16 0 24 3794 topology 3827 4994
-> 15 0 23 3794 topology 3857 4995
+> 15 0 23 3794 topology 3874 4992
+> 16 0 23 3794 topology 3916 4992
+> 15 0 23 3794 topology 3878 4993
+> 16 0 23 3794 topology 3916 4993
+> 15 0 23 3794 topology 3877 4994
+> 16 0 23 3794 topology 3916 4994
+> 15 0 23 3794 topology 3881 4995
 > 16 0 23 3794 topology 3916 4995
-> 15 0 23 3794 topology 3833 4996
+> 15 0 23 3794 topology 3880 4996
 > 16 0 23 3794 topology 3916 4996
-> 15 0 25 3794 topology 3915 4997
-> 16 0 25 3794 topology 3916 4997
-> 15 0 23 3794 topology 3817 4998
+> 15 0 23 3794 topology 3800 4997
+> 16 0 23 3794 topology 3916 4997
+> 15 0 23 3794 topology 3799 4998
 > 16 0 23 3794 topology 3916 4998
-> 15 0 24 3794 topology 3804 4999
-> 16 0 24 3794 topology 3806 4999
-> 15 0 24 3794 topology 3858 5000
-> 16 0 24 3794 topology 3860 5000
-> 15 0 23 3794 topology 3893 5001
+> 15 0 23 3794 topology 3884 4999
+> 16 0 23 3794 topology 3916 4999
+> 15 0 23 3794 topology 3883 5000
+> 16 0 23 3794 topology 3916 5000
+> 15 0 23 3794 topology 3887 5001
 > 16 0 23 3794 topology 3916 5001
-> 15 0 24 3794 topology 3912 5002
-> 16 0 24 3794 topology 3914 5002
-> 15 0 23 3794 topology 3869 5003
+> 15 0 23 3794 topology 3886 5002
+> 16 0 23 3794 topology 3916 5002
+> 15 0 23 3794 topology 3890 5003
 > 16 0 23 3794 topology 3916 5003
-> 15 0 23 3794 topology 3845 5004
+> 15 0 23 3794 topology 3889 5004
 > 16 0 23 3794 topology 3916 5004
-> 15 0 24 3794 topology 3810 5005
-> 16 0 24 3794 topology 3812 5005
-> 15 0 24 3794 topology 3837 5006
-> 16 0 24 3794 topology 3839 5006
-> 15 0 24 3794 topology 3891 5007
-> 16 0 24 3794 topology 3893 5007
-> 15 0 23 3794 topology 3905 5008
+> 15 0 23 3794 topology 3893 5005
+> 16 0 23 3794 topology 3916 5005
+> 15 0 23 3794 topology 3892 5006
+> 16 0 23 3794 topology 3916 5006
+> 15 0 23 3794 topology 3896 5007
+> 16 0 23 3794 topology 3916 5007
+> 15 0 23 3794 topology 3895 5008
 > 16 0 23 3794 topology 3916 5008
-> 15 0 23 3794 topology 3881 5009
+> 15 0 23 3794 topology 3899 5009
 > 16 0 23 3794 topology 3916 5009
-> 15 0 24 3794 topology 3816 5010
-> 16 0 24 3794 topology 3818 5010
-> 15 0 24 3794 topology 3870 5011
-> 16 0 24 3794 topology 3872 5011
-> 15 0 24 3794 topology 3852 5012
-> 16 0 24 3794 topology 3853 5012
-> 15 0 23 3794 topology 3829 5013
+> 15 0 23 3794 topology 3898 5010
+> 16 0 23 3794 topology 3916 5010
+> 15 0 23 3794 topology 3902 5011
+> 16 0 23 3794 topology 3916 5011
+> 15 0 23 3794 topology 3901 5012
+> 16 0 23 3794 topology 3916 5012
+> 15 0 23 3794 topology 3905 5013
 > 16 0 23 3794 topology 3916 5013
-> 15 0 23 3794 topology 3859 5014
+> 15 0 23 3794 topology 3904 5014
 > 16 0 23 3794 topology 3916 5014
-> 15 0 24 3794 topology 3849 5015
-> 16 0 24 3794 topology 3851 5015
-> 15 0 23 3794 topology 3889 5016
+> 15 0 23 3794 topology 3908 5015
+> 16 0 23 3794 topology 3916 5015
+> 15 0 23 3794 topology 3907 5016
 > 16 0 23 3794 topology 3916 5016
-> 15 0 24 3794 topology 3903 5017
-> 16 0 24 3794 topology 3905 5017
-> 15 0 24 3794 topology 3831 5018
-> 16 0 24 3794 topology 3832 5018
-> 15 0 24 3794 topology 3885 5019
-> 16 0 24 3794 topology 3886 5019
-> 15 0 23 3794 topology 3806 5020
+> 15 0 23 3794 topology 3911 5017
+> 16 0 23 3794 topology 3916 5017
+> 15 0 23 3794 topology 3910 5018
+> 16 0 23 3794 topology 3916 5018
+> 15 0 23 3794 topology 3803 5019
+> 16 0 23 3794 topology 3916 5019
+> 15 0 23 3794 topology 3802 5020
 > 16 0 23 3794 topology 3916 5020
-> 15 0 23 3794 topology 3841 5021
+> 15 0 23 3794 topology 3914 5021
 > 16 0 23 3794 topology 3916 5021
-> 15 0 23 3794 topology 3871 5022
+> 15 0 23 3794 topology 3913 5022
 > 16 0 23 3794 topology 3916 5022
-> 15 0 23 3794 topology 3901 5023
+> 15 0 23 3794 topology 3806 5023
 > 16 0 23 3794 topology 3916 5023
-> 15 0 24 3794 topology 3864 5024
-> 16 0 24 3794 topology 3865 5024
-> 15 0 23 3794 topology 3818 5025
+> 15 0 23 3794 topology 3805 5024
+> 16 0 23 3794 topology 3916 5024
+> 15 0 23 3794 topology 3809 5025
 > 16 0 23 3794 topology 3916 5025
-> 15 0 24 3794 topology 3843 5026
-> 16 0 24 3794 topology 3844 5026
-> 15 0 24 3794 topology 3897 5027
-> 16 0 24 3794 topology 3898 5027
-> 15 0 24 3794 topology 3876 5028
-> 16 0 24 3794 topology 3877 5028
-> 15 0 23 3794 topology 3802 5029
+> 15 0 23 3794 topology 3808 5026
+> 16 0 23 3794 topology 3916 5026
+> 15 0 23 3794 topology 3812 5027
+> 16 0 23 3794 topology 3916 5027
+> 15 0 23 3794 topology 3811 5028
+> 16 0 23 3794 topology 3916 5028
+> 15 0 23 3794 topology 3815 5029
 > 16 0 23 3794 topology 3916 5029
-> 15 0 24 3794 topology 3822 5030
-> 16 0 24 3794 topology 3824 5030
-> 15 0 23 3794 topology 3824 5031
+> 15 0 23 3794 topology 3814 5030
+> 16 0 23 3794 topology 3916 5030
+> 15 0 23 3794 topology 3818 5031
 > 16 0 23 3794 topology 3916 5031
-> 15 0 23 3794 topology 3884 5032
+> 15 0 23 3794 topology 3817 5032
 > 16 0 23 3794 topology 3916 5032
-> 15 0 24 3794 topology 3909 5033
-> 16 0 24 3794 topology 3910 5033
-> 15 0 23 3794 topology 3814 5034
+> 15 0 23 3794 topology 3821 5033
+> 16 0 23 3794 topology 3916 5033
+> 15 0 23 3794 topology 3820 5034
 > 16 0 23 3794 topology 3916 5034
-> 15 0 24 3794 topology 3855 5035
-> 16 0 24 3794 topology 3857 5035
-> 15 0 23 3794 topology 3860 5036
-> 16 0 23 3794 topology 3916 5036
-> 15 0 23 3794 topology 3836 5037
-> 16 0 23 3794 topology 3916 5037
-> 15 0 23 3794 topology 3896 5038
-> 16 0 23 3794 topology 3916 5038
-> 15 0 24 3794 topology 3834 5039
-> 16 0 24 3794 topology 3836 5039
-> 15 0 23 3794 topology 3872 5040
-> 16 0 23 3794 topology 3916 5040
-> 15 0 24 3794 topology 3888 5041
-> 16 0 24 3794 topology 3890 5041
-> 15 0 23 3794 topology 3848 5042
-> 16 0 23 3794 topology 3916 5042
-> 15 0 23 3794 topology 3908 5043
-> 16 0 23 3794 topology 3916 5043
-> 15 0 24 3794 topology 3867 5044
-> 16 0 24 3794 topology 3869 5044
-> 15 0 24 3794 topology 3795 5045
-> 16 0 24 3794 topology 3796 5045
-> 15 0 24 3794 topology 3822 5046
-> 16 0 24 3794 topology 3823 5046
-> 15 0 24 3794 topology 3798 5047
-> 16 0 24 3794 topology 3799 5047
-> 15 0 23 3794 topology 3826 5048
-> 16 0 23 3794 topology 3916 5048
-> 15 0 24 3794 topology 3846 5049
-> 16 0 24 3794 topology 3848 5049
-> 15 0 23 3794 topology 3856 5050
-> 16 0 23 3794 topology 3916 5050
-> 15 0 24 3794 topology 3900 5051
-> 16 0 24 3794 topology 3902 5051
-> 15 0 23 3794 topology 3797 5052
-> 16 0 23 3794 topology 3916 5052
-> 15 0 24 3794 topology 3801 5053
-> 16 0 24 3794 topology 3802 5053
-> 15 0 24 3794 topology 3855 5054
-> 16 0 24 3794 topology 3856 5054
-> 15 0 23 3794 topology 3886 5055
-> 16 0 23 3794 topology 3916 5055
-> 15 0 24 3794 topology 3804 5056
-> 16 0 24 3794 topology 3805 5056
-> 15 0 23 3794 topology 3838 5057
-> 16 0 23 3794 topology 3916 5057
-> 15 0 23 3794 topology 3868 5058
-> 16 0 23 3794 topology 3916 5058
-> 15 0 24 3794 topology 3879 5059
-> 16 0 24 3794 topology 3881 5059
-> 15 0 24 3794 topology 3807 5060
-> 16 0 24 3794 topology 3808 5060
-> 15 0 23 3794 topology 3809 5061
-> 16 0 23 3794 topology 3916 5061
-> 15 0 24 3794 topology 3834 5062
-> 16 0 24 3794 topology 3835 5062
-> 15 0 24 3794 topology 3888 5063
-> 16 0 24 3794 topology 3889 5063
-> 15 0 23 3794 topology 3898 5064
-> 16 0 23 3794 topology 3916 5064
-> 15 0 24 3794 topology 3810 5065
-> 16 0 24 3794 topology 3811 5065
-> 15 0 23 3794 topology 3850 5066
-> 16 0 23 3794 topology 3916 5066
-> 15 0 23 3794 topology 3880 5067
-> 16 0 23 3794 topology 3916 5067
-> 15 0 24 3794 topology 3813 5068
-> 16 0 24 3794 topology 3814 5068
-> 15 0 23 3794 topology 3821 5069
-> 16 0 23 3794 topology 3916 5069
-> 15 0 24 3794 topology 3867 5070
-> 16 0 24 3794 topology 3868 5070
-> 15 0 23 3794 topology 3910 5071
-> 16 0 23 3794 topology 3916 5071
-> 15 0 24 3794 topology 3816 5072
-> 16 0 24 3794 topology 3817 5072
-> 15 0 24 3794 topology 3819 5073
-> 16 0 24 3794 topology 3820 5073
-> 15 0 24 3794 topology 3846 5074
-> 16 0 24 3794 topology 3847 5074
-> 15 0 24 3794 topology 3900 5075
-> 16 0 24 3794 topology 3901 5075
-> 15 0 23 3794 topology 3799 5076
-> 16 0 23 3794 topology 3916 5076
-> 15 0 24 3794 topology 3795 5077
-> 16 0 24 3794 topology 3797 5077
-> 15 0 24 3794 topology 3879 5078
-> 16 0 24 3794 topology 3880 5078
-> 15 0 23 3794 topology 3827 5079
-> 16 0 23 3794 topology 3916 5079
-> 15 0 24 3794 topology 3852 5080
-> 16 0 24 3794 topology 3854 5080
-> 15 0 23 3794 topology 3811 5081
-> 16 0 23 3794 topology 3916 5081
-> 15 0 24 3794 topology 3801 5082
-> 16 0 24 3794 topology 3803 5082
-> 15 0 23 3794 topology 3887 5083
-> 16 0 23 3794 topology 3916 5083
-> 15 0 23 3794 topology 3863 5084
-> 16 0 23 3794 topology 3916 5084
-> 15 0 24 3794 topology 3831 5085
-> 16 0 24 3794 topology 3833 5085
-> 15 0 23 3794 topology 3839 5086
-> 16 0 23 3794 topology 3916 5086
-> 15 0 24 3794 topology 3885 5087
-> 16 0 24 3794 topology 3887 5087
-> 15 0 24 3794 topology 3807 5088
-> 16 0 24 3794 topology 3809 5088
-> 15 0 23 3794 topology 3899 5089
-> 16 0 23 3794 topology 3916 5089
-> 15 0 23 3794 topology 3875 5090
-> 16 0 23 3794 topology 3916 5090
-> 15 0 23 3794 topology 3851 5091
-> 16 0 23 3794 topology 3916 5091
-> 15 0 24 3794 topology 3864 5092
-> 16 0 24 3794 topology 3866 5092
-> 15 0 24 3794 topology 3813 5093
-> 16 0 24 3794 topology 3815 5093
-> 15 0 23 3794 topology 3911 5094
-> 16 0 23 3794 topology 3916 5094
-> 15 0 23 3794 topology 3823 5095
-> 16 0 23 3794 topology 3916 5095
-> 15 0 24 3794 topology 3843 5096
-> 16 0 24 3794 topology 3845 5096
-> 15 0 24 3794 topology 3897 5097
-> 16 0 24 3794 topology 3899 5097
-> 15 0 24 3794 topology 3825 5098
-> 16 0 24 3794 topology 3826 5098
-> 15 0 23 3794 topology 3853 5099
-> 16 0 23 3794 topology 3916 5099
-> 15 0 24 3794 topology 3819 5100
-> 16 0 24 3794 topology 3821 5100
-> 15 0 23 3794 topology 3883 5101
-> 16 0 23 3794 topology 3916 5101
-> 15 0 23 3794 topology 3913 5102
-> 16 0 23 3794 topology 3916 5102
-> 15 0 23 3794 topology 3800 5103
-> 16 0 23 3794 topology 3916 5103
-> 15 0 23 3794 topology 3835 5104
-> 16 0 23 3794 topology 3916 5104
-> 15 0 24 3794 topology 3876 5105
-> 16 0 24 3794 topology 3878 5105
-> 15 0 24 3794 topology 3858 5106
-> 16 0 24 3794 topology 3859 5106
-> 15 0 23 3794 topology 3865 5107
-> 16 0 23 3794 topology 3916 5107
-> 15 0 24 3794 topology 3912 5108
-> 16 0 24 3794 topology 3913 5108
-> 15 0 23 3794 topology 3895 5109
-> 16 0 23 3794 topology 3916 5109
-> 15 0 23 3794 topology 3812 5110
-> 16 0 23 3794 topology 3916 5110
-> 15 0 23 3794 topology 3847 5111
-> 16 0 23 3794 topology 3916 5111
-> 15 0 24 3794 topology 3909 5112
-> 16 0 24 3794 topology 3911 5112
-> 15 0 24 3794 topology 3837 5113
-> 16 0 24 3794 topology 3838 5113
-> 15 0 23 3794 topology 3877 5114
-> 16 0 23 3794 topology 3916 5114
-> 15 0 24 3794 topology 3891 5115
-> 16 0 24 3794 topology 3892 5115
-> 15 0 21 3415 topology 3611 5116
-> 16 0 21 3415 topology 3917 5116
+> 15 0 24 3794 topology 3915 5035
+> 16 0 24 3794 topology 3916 5035
+> 15 0 25 3794 topology 3822 5036
+> 16 0 25 3794 topology 3824 5036
+> 15 0 25 3794 topology 3822 5037
+> 16 0 25 3794 topology 3823 5037
+> 15 0 25 3794 topology 3825 5038
+> 16 0 25 3794 topology 3827 5038
+> 15 0 25 3794 topology 3825 5039
+> 16 0 25 3794 topology 3826 5039
+> 15 0 25 3794 topology 3828 5040
+> 16 0 25 3794 topology 3830 5040
+> 15 0 25 3794 topology 3828 5041
+> 16 0 25 3794 topology 3829 5041
+> 15 0 25 3794 topology 3831 5042
+> 16 0 25 3794 topology 3833 5042
+> 15 0 25 3794 topology 3831 5043
+> 16 0 25 3794 topology 3832 5043
+> 15 0 25 3794 topology 3834 5044
+> 16 0 25 3794 topology 3836 5044
+> 15 0 25 3794 topology 3834 5045
+> 16 0 25 3794 topology 3835 5045
+> 15 0 25 3794 topology 3837 5046
+> 16 0 25 3794 topology 3839 5046
+> 15 0 25 3794 topology 3837 5047
+> 16 0 25 3794 topology 3838 5047
+> 15 0 25 3794 topology 3840 5048
+> 16 0 25 3794 topology 3842 5048
+> 15 0 25 3794 topology 3840 5049
+> 16 0 25 3794 topology 3841 5049
+> 15 0 25 3794 topology 3843 5050
+> 16 0 25 3794 topology 3845 5050
+> 15 0 25 3794 topology 3843 5051
+> 16 0 25 3794 topology 3844 5051
+> 15 0 25 3794 topology 3846 5052
+> 16 0 25 3794 topology 3848 5052
+> 15 0 25 3794 topology 3846 5053
+> 16 0 25 3794 topology 3847 5053
+> 15 0 25 3794 topology 3849 5054
+> 16 0 25 3794 topology 3851 5054
+> 15 0 25 3794 topology 3849 5055
+> 16 0 25 3794 topology 3850 5055
+> 15 0 25 3794 topology 3795 5056
+> 16 0 25 3794 topology 3797 5056
+> 15 0 25 3794 topology 3795 5057
+> 16 0 25 3794 topology 3796 5057
+> 15 0 25 3794 topology 3852 5058
+> 16 0 25 3794 topology 3854 5058
+> 15 0 25 3794 topology 3852 5059
+> 16 0 25 3794 topology 3853 5059
+> 15 0 25 3794 topology 3855 5060
+> 16 0 25 3794 topology 3857 5060
+> 15 0 25 3794 topology 3855 5061
+> 16 0 25 3794 topology 3856 5061
+> 15 0 25 3794 topology 3858 5062
+> 16 0 25 3794 topology 3860 5062
+> 15 0 25 3794 topology 3858 5063
+> 16 0 25 3794 topology 3859 5063
+> 15 0 25 3794 topology 3861 5064
+> 16 0 25 3794 topology 3863 5064
+> 15 0 25 3794 topology 3861 5065
+> 16 0 25 3794 topology 3862 5065
+> 15 0 25 3794 topology 3864 5066
+> 16 0 25 3794 topology 3866 5066
+> 15 0 25 3794 topology 3864 5067
+> 16 0 25 3794 topology 3865 5067
+> 15 0 25 3794 topology 3867 5068
+> 16 0 25 3794 topology 3869 5068
+> 15 0 25 3794 topology 3867 5069
+> 16 0 25 3794 topology 3868 5069
+> 15 0 25 3794 topology 3870 5070
+> 16 0 25 3794 topology 3872 5070
+> 15 0 25 3794 topology 3870 5071
+> 16 0 25 3794 topology 3871 5071
+> 15 0 25 3794 topology 3873 5072
+> 16 0 25 3794 topology 3875 5072
+> 15 0 25 3794 topology 3873 5073
+> 16 0 25 3794 topology 3874 5073
+> 15 0 25 3794 topology 3876 5074
+> 16 0 25 3794 topology 3878 5074
+> 15 0 25 3794 topology 3876 5075
+> 16 0 25 3794 topology 3877 5075
+> 15 0 25 3794 topology 3879 5076
+> 16 0 25 3794 topology 3881 5076
+> 15 0 25 3794 topology 3879 5077
+> 16 0 25 3794 topology 3880 5077
+> 15 0 25 3794 topology 3798 5078
+> 16 0 25 3794 topology 3800 5078
+> 15 0 25 3794 topology 3798 5079
+> 16 0 25 3794 topology 3799 5079
+> 15 0 25 3794 topology 3882 5080
+> 16 0 25 3794 topology 3884 5080
+> 15 0 25 3794 topology 3882 5081
+> 16 0 25 3794 topology 3883 5081
+> 15 0 25 3794 topology 3885 5082
+> 16 0 25 3794 topology 3887 5082
+> 15 0 25 3794 topology 3885 5083
+> 16 0 25 3794 topology 3886 5083
+> 15 0 25 3794 topology 3888 5084
+> 16 0 25 3794 topology 3890 5084
+> 15 0 25 3794 topology 3888 5085
+> 16 0 25 3794 topology 3889 5085
+> 15 0 25 3794 topology 3891 5086
+> 16 0 25 3794 topology 3893 5086
+> 15 0 25 3794 topology 3891 5087
+> 16 0 25 3794 topology 3892 5087
+> 15 0 25 3794 topology 3894 5088
+> 16 0 25 3794 topology 3896 5088
+> 15 0 25 3794 topology 3894 5089
+> 16 0 25 3794 topology 3895 5089
+> 15 0 25 3794 topology 3897 5090
+> 16 0 25 3794 topology 3899 5090
+> 15 0 25 3794 topology 3897 5091
+> 16 0 25 3794 topology 3898 5091
+> 15 0 25 3794 topology 3900 5092
+> 16 0 25 3794 topology 3902 5092
+> 15 0 25 3794 topology 3900 5093
+> 16 0 25 3794 topology 3901 5093
+> 15 0 25 3794 topology 3903 5094
+> 16 0 25 3794 topology 3905 5094
+> 15 0 25 3794 topology 3903 5095
+> 16 0 25 3794 topology 3904 5095
+> 15 0 25 3794 topology 3906 5096
+> 16 0 25 3794 topology 3908 5096
+> 15 0 25 3794 topology 3906 5097
+> 16 0 25 3794 topology 3907 5097
+> 15 0 25 3794 topology 3909 5098
+> 16 0 25 3794 topology 3911 5098
+> 15 0 25 3794 topology 3909 5099
+> 16 0 25 3794 topology 3910 5099
+> 15 0 25 3794 topology 3801 5100
+> 16 0 25 3794 topology 3803 5100
+> 15 0 25 3794 topology 3801 5101
+> 16 0 25 3794 topology 3802 5101
+> 15 0 25 3794 topology 3912 5102
+> 16 0 25 3794 topology 3914 5102
+> 15 0 25 3794 topology 3912 5103
+> 16 0 25 3794 topology 3913 5103
+> 15 0 25 3794 topology 3804 5104
+> 16 0 25 3794 topology 3806 5104
+> 15 0 25 3794 topology 3804 5105
+> 16 0 25 3794 topology 3805 5105
+> 15 0 25 3794 topology 3807 5106
+> 16 0 25 3794 topology 3809 5106
+> 15 0 25 3794 topology 3807 5107
+> 16 0 25 3794 topology 3808 5107
+> 15 0 25 3794 topology 3810 5108
+> 16 0 25 3794 topology 3812 5108
+> 15 0 25 3794 topology 3810 5109
+> 16 0 25 3794 topology 3811 5109
+> 15 0 25 3794 topology 3813 5110
+> 16 0 25 3794 topology 3815 5110
+> 15 0 25 3794 topology 3813 5111
+> 16 0 25 3794 topology 3814 5111
+> 15 0 25 3794 topology 3816 5112
+> 16 0 25 3794 topology 3818 5112
+> 15 0 25 3794 topology 3816 5113
+> 16 0 25 3794 topology 3817 5113
+> 15 0 25 3794 topology 3819 5114
+> 16 0 25 3794 topology 3821 5114
+> 15 0 25 3794 topology 3819 5115
+> 16 0 25 3794 topology 3820 5115
+> 15 0 26 3415 topology 3611 5116
+> 16 0 26 3415 topology 3919 5116
 > 15 0 26 3415 topology 3714 5117
 > 16 0 26 3415 topology 3919 5117
-> 15 0 21 3415 topology 3611 5118
-> 16 0 21 3415 topology 3793 5118
-> 15 0 26 3415 topology 3793 5119
-> 16 0 26 3415 topology 3791 5119
-> 15 0 26 3415 topology 3611 5120
-> 16 0 26 3415 topology 3919 5120
-> 15 0 26 3415 topology 3917 5121
-> 16 0 26 3415 topology 3919 5121
-> 15 0 21 3415 topology 3793 5122
-> 16 0 21 3415 topology 3917 5122
-> 15 0 26 3415 topology 3714 5123
-> 16 0 26 3415 topology 3712 5123
-> 15 0 26 3415 topology 3917 5124
-> 16 0 26 3415 topology 3915 5124
-> 15 0 21 3415 topology 3714 5125
-> 16 0 21 3415 topology 3793 5125
-> 15 0 26 3415 topology 3793 5126
-> 16 0 26 3415 topology 3919 5126
-> 15 0 21 3415 topology 3611 5127
-> 16 0 21 3415 topology 3714 5127
-> 15 0 27 3415 topology 3609 5128
-> 16 0 27 3415 topology 3611 5128
-> 15 0 21 3415 topology 3714 5129
-> 16 0 21 3415 topology 3917 5129
-> 15 0 23 3922 topology 4059 5130
+> 15 0 26 3415 topology 3793 5118
+> 16 0 26 3415 topology 3919 5118
+> 15 0 26 3415 topology 3917 5119
+> 16 0 26 3415 topology 3919 5119
+> 15 0 27 3415 topology 3609 5120
+> 16 0 27 3415 topology 3611 5120
+> 15 0 20 3415 topology 3611 5121
+> 16 0 20 3415 topology 3714 5121
+> 15 0 20 3415 topology 3611 5122
+> 16 0 20 3415 topology 3793 5122
+> 15 0 20 3415 topology 3714 5123
+> 16 0 20 3415 topology 3793 5123
+> 15 0 20 3415 topology 3611 5124
+> 16 0 20 3415 topology 3917 5124
+> 15 0 20 3415 topology 3714 5125
+> 16 0 20 3415 topology 3917 5125
+> 15 0 20 3415 topology 3793 5126
+> 16 0 20 3415 topology 3917 5126
+> 15 0 26 3415 topology 3714 5127
+> 16 0 26 3415 topology 3712 5127
+> 15 0 26 3415 topology 3793 5128
+> 16 0 26 3415 topology 3791 5128
+> 15 0 26 3415 topology 3917 5129
+> 16 0 26 3415 topology 3915 5129
+> 15 0 23 3922 topology 3952 5130
 > 16 0 23 3922 topology 4092 5130
-> 15 0 24 3922 topology 3926 5131
-> 16 0 24 3922 topology 3928 5131
-> 15 0 23 3922 topology 3952 5132
+> 15 0 23 3922 topology 3951 5131
+> 16 0 23 3922 topology 4092 5131
+> 15 0 23 3922 topology 3955 5132
 > 16 0 23 3922 topology 4092 5132
-> 15 0 23 3922 topology 3936 5133
+> 15 0 23 3922 topology 3954 5133
 > 16 0 23 3922 topology 4092 5133
-> 15 0 23 3922 topology 3988 5134
+> 15 0 23 3922 topology 3958 5134
 > 16 0 23 3922 topology 4092 5134
-> 15 0 23 3922 topology 4072 5135
+> 15 0 23 3922 topology 3957 5135
 > 16 0 23 3922 topology 4092 5135
-> 15 0 23 3922 topology 4024 5136
+> 15 0 23 3922 topology 3961 5136
 > 16 0 23 3922 topology 4092 5136
-> 15 0 24 3922 topology 3953 5137
-> 16 0 24 3922 topology 3954 5137
-> 15 0 23 3922 topology 3976 5138
+> 15 0 23 3922 topology 3960 5137
+> 16 0 23 3922 topology 4092 5137
+> 15 0 23 3922 topology 3964 5138
 > 16 0 23 3922 topology 4092 5138
-> 15 0 23 3922 topology 4060 5139
+> 15 0 23 3922 topology 3963 5139
 > 16 0 23 3922 topology 4092 5139
-> 15 0 24 3922 topology 4013 5140
-> 16 0 24 3922 topology 4014 5140
-> 15 0 24 3922 topology 3989 5141
-> 16 0 24 3922 topology 3990 5141
-> 15 0 24 3922 topology 3938 5142
-> 16 0 24 3922 topology 3939 5142
-> 15 0 24 3922 topology 3965 5143
-> 16 0 24 3922 topology 3966 5143
-> 15 0 23 3922 topology 3984 5144
+> 15 0 23 3922 topology 3967 5140
+> 16 0 23 3922 topology 4092 5140
+> 15 0 23 3922 topology 3966 5141
+> 16 0 23 3922 topology 4092 5141
+> 15 0 23 3922 topology 3970 5142
+> 16 0 23 3922 topology 4092 5142
+> 15 0 23 3922 topology 3969 5143
+> 16 0 23 3922 topology 4092 5143
+> 15 0 23 3922 topology 3973 5144
 > 16 0 23 3922 topology 4092 5144
-> 15 0 24 3922 topology 4073 5145
-> 16 0 24 3922 topology 4074 5145
-> 15 0 23 3922 topology 4044 5146
+> 15 0 23 3922 topology 3972 5145
+> 16 0 23 3922 topology 4092 5145
+> 15 0 23 3922 topology 3976 5146
 > 16 0 23 3922 topology 4092 5146
-> 15 0 24 3922 topology 4049 5147
-> 16 0 24 3922 topology 4050 5147
-> 15 0 23 3922 topology 3966 5148
+> 15 0 23 3922 topology 3975 5147
+> 16 0 23 3922 topology 4092 5147
+> 15 0 23 3922 topology 3979 5148
 > 16 0 23 3922 topology 4092 5148
-> 15 0 24 3922 topology 4025 5149
-> 16 0 24 3922 topology 4026 5149
-> 15 0 23 3922 topology 4026 5150
+> 15 0 23 3922 topology 3978 5149
+> 16 0 23 3922 topology 4092 5149
+> 15 0 23 3922 topology 3925 5150
 > 16 0 23 3922 topology 4092 5150
-> 15 0 24 3922 topology 4001 5151
-> 16 0 24 3922 topology 4002 5151
-> 15 0 23 3922 topology 3943 5152
+> 15 0 23 3922 topology 3924 5151
+> 16 0 23 3922 topology 4092 5151
+> 15 0 23 3922 topology 3982 5152
 > 16 0 23 3922 topology 4092 5152
-> 15 0 23 3922 topology 4086 5153
+> 15 0 23 3922 topology 3981 5153
 > 16 0 23 3922 topology 4092 5153
-> 15 0 24 3922 topology 3977 5154
-> 16 0 24 3922 topology 3978 5154
-> 15 0 23 3922 topology 4008 5155
+> 15 0 23 3922 topology 3985 5154
+> 16 0 23 3922 topology 4092 5154
+> 15 0 23 3922 topology 3984 5155
 > 16 0 23 3922 topology 4092 5155
-> 15 0 24 3922 topology 4085 5156
-> 16 0 24 3922 topology 4086 5156
-> 15 0 24 3922 topology 4061 5157
-> 16 0 24 3922 topology 4062 5157
-> 15 0 23 3922 topology 4068 5158
+> 15 0 23 3922 topology 3988 5156
+> 16 0 23 3922 topology 4092 5156
+> 15 0 23 3922 topology 3987 5157
+> 16 0 23 3922 topology 4092 5157
+> 15 0 23 3922 topology 3991 5158
 > 16 0 23 3922 topology 4092 5158
-> 15 0 24 3922 topology 3980 5159
-> 16 0 24 3922 topology 3982 5159
-> 15 0 24 3922 topology 4037 5160
-> 16 0 24 3922 topology 4038 5160
-> 15 0 24 3922 topology 3986 5161
-> 16 0 24 3922 topology 3988 5161
-> 15 0 24 3922 topology 3935 5162
-> 16 0 24 3922 topology 3937 5162
-> 15 0 24 3922 topology 4043 5163
-> 16 0 24 3922 topology 4045 5163
-> 15 0 24 3922 topology 3992 5164
-> 16 0 24 3922 topology 3994 5164
-> 15 0 23 3922 topology 4015 5165
+> 15 0 23 3922 topology 3990 5159
+> 16 0 23 3922 topology 4092 5159
+> 15 0 23 3922 topology 3994 5160
+> 16 0 23 3922 topology 4092 5160
+> 15 0 23 3922 topology 3993 5161
+> 16 0 23 3922 topology 4092 5161
+> 15 0 23 3922 topology 3997 5162
+> 16 0 23 3922 topology 4092 5162
+> 15 0 23 3922 topology 3996 5163
+> 16 0 23 3922 topology 4092 5163
+> 15 0 23 3922 topology 4000 5164
+> 16 0 23 3922 topology 4092 5164
+> 15 0 23 3922 topology 3999 5165
 > 16 0 23 3922 topology 4092 5165
-> 15 0 23 3922 topology 3945 5166
+> 15 0 23 3922 topology 4003 5166
 > 16 0 23 3922 topology 4092 5166
-> 15 0 24 3922 topology 4049 5167
-> 16 0 24 3922 topology 4051 5167
-> 15 0 23 3922 topology 3967 5168
+> 15 0 23 3922 topology 4002 5167
+> 16 0 23 3922 topology 4092 5167
+> 15 0 23 3922 topology 4006 5168
 > 16 0 23 3922 topology 4092 5168
-> 15 0 24 3922 topology 3998 5169
-> 16 0 24 3922 topology 4000 5169
-> 15 0 23 3922 topology 4051 5170
+> 15 0 23 3922 topology 4005 5169
+> 16 0 23 3922 topology 4092 5169
+> 15 0 23 3922 topology 4009 5170
 > 16 0 23 3922 topology 4092 5170
-> 15 0 23 3922 topology 4003 5171
+> 15 0 23 3922 topology 4008 5171
 > 16 0 23 3922 topology 4092 5171
-> 15 0 24 3922 topology 4055 5172
-> 16 0 24 3922 topology 4057 5172
-> 15 0 23 3922 topology 4087 5173
+> 15 0 23 3922 topology 3928 5172
+> 16 0 23 3922 topology 4092 5172
+> 15 0 23 3922 topology 3927 5173
 > 16 0 23 3922 topology 4092 5173
-> 15 0 24 3922 topology 4004 5174
-> 16 0 24 3922 topology 4006 5174
-> 15 0 23 3922 topology 4039 5175
+> 15 0 23 3922 topology 4012 5174
+> 16 0 23 3922 topology 4092 5174
+> 15 0 23 3922 topology 4011 5175
 > 16 0 23 3922 topology 4092 5175
-> 15 0 24 3922 topology 4061 5176
-> 16 0 24 3922 topology 4063 5176
-> 15 0 23 3922 topology 3951 5177
+> 15 0 23 3922 topology 4015 5176
+> 16 0 23 3922 topology 4092 5176
+> 15 0 23 3922 topology 4014 5177
 > 16 0 23 3922 topology 4092 5177
-> 15 0 23 3922 topology 4011 5178
+> 15 0 23 3922 topology 4018 5178
 > 16 0 23 3922 topology 4092 5178
-> 15 0 24 3922 topology 4067 5179
-> 16 0 24 3922 topology 4069 5179
-> 15 0 24 3922 topology 3941 5180
-> 16 0 24 3922 topology 3942 5180
-> 15 0 23 3922 topology 4071 5181
+> 15 0 23 3922 topology 4017 5179
+> 16 0 23 3922 topology 4092 5179
+> 15 0 23 3922 topology 4021 5180
+> 16 0 23 3922 topology 4092 5180
+> 15 0 23 3922 topology 4020 5181
 > 16 0 23 3922 topology 4092 5181
-> 15 0 23 3922 topology 3993 5182
+> 15 0 23 3922 topology 4024 5182
 > 16 0 23 3922 topology 4092 5182
-> 15 0 23 3922 topology 3934 5183
+> 15 0 23 3922 topology 4023 5183
 > 16 0 23 3922 topology 4092 5183
-> 15 0 23 3922 topology 4053 5184
+> 15 0 23 3922 topology 4027 5184
 > 16 0 23 3922 topology 4092 5184
-> 15 0 23 3922 topology 3975 5185
+> 15 0 23 3922 topology 4026 5185
 > 16 0 23 3922 topology 4092 5185
-> 15 0 23 3922 topology 4035 5186
+> 15 0 23 3922 topology 4030 5186
 > 16 0 23 3922 topology 4092 5186
-> 15 0 23 3922 topology 3930 5187
+> 15 0 23 3922 topology 4029 5187
 > 16 0 23 3922 topology 4092 5187
-> 15 0 23 3922 topology 3958 5188
+> 15 0 23 3922 topology 4033 5188
 > 16 0 23 3922 topology 4092 5188
-> 15 0 23 3922 topology 4042 5189
+> 15 0 23 3922 topology 4032 5189
 > 16 0 23 3922 topology 4092 5189
-> 15 0 23 3922 topology 3994 5190
+> 15 0 23 3922 topology 4036 5190
 > 16 0 23 3922 topology 4092 5190
-> 15 0 24 3922 topology 3944 5191
-> 16 0 24 3922 topology 3946 5191
-> 15 0 23 3922 topology 4078 5192
+> 15 0 23 3922 topology 4035 5191
+> 16 0 23 3922 topology 4092 5191
+> 15 0 23 3922 topology 4039 5192
 > 16 0 23 3922 topology 4092 5192
-> 15 0 24 3922 topology 3980 5193
-> 16 0 24 3922 topology 3981 5193
-> 15 0 23 3922 topology 4030 5194
+> 15 0 23 3922 topology 4038 5193
+> 16 0 23 3922 topology 4092 5193
+> 15 0 23 3922 topology 3931 5194
 > 16 0 23 3922 topology 4092 5194
-> 15 0 24 3922 topology 3956 5195
-> 16 0 24 3922 topology 3957 5195
-> 15 0 24 3922 topology 4040 5196
-> 16 0 24 3922 topology 4041 5196
-> 15 0 23 3922 topology 4066 5197
+> 15 0 23 3922 topology 3930 5195
+> 16 0 23 3922 topology 4092 5195
+> 15 0 23 3922 topology 4042 5196
+> 16 0 23 3922 topology 4092 5196
+> 15 0 23 3922 topology 4041 5197
 > 16 0 23 3922 topology 4092 5197
-> 15 0 24 3922 topology 4016 5198
-> 16 0 24 3922 topology 4017 5198
-> 15 0 24 3922 topology 3992 5199
-> 16 0 24 3922 topology 3993 5199
-> 15 0 23 3922 topology 3925 5200
+> 15 0 23 3922 topology 4045 5198
+> 16 0 23 3922 topology 4092 5198
+> 15 0 23 3922 topology 4044 5199
+> 16 0 23 3922 topology 4092 5199
+> 15 0 23 3922 topology 4048 5200
 > 16 0 23 3922 topology 4092 5200
-> 15 0 23 3922 topology 3960 5201
+> 15 0 23 3922 topology 4047 5201
 > 16 0 23 3922 topology 4092 5201
-> 15 0 24 3922 topology 3968 5202
-> 16 0 24 3922 topology 3969 5202
-> 15 0 24 3922 topology 4076 5203
-> 16 0 24 3922 topology 4077 5203
-> 15 0 23 3922 topology 4020 5204
+> 15 0 23 3922 topology 4051 5202
+> 16 0 23 3922 topology 4092 5202
+> 15 0 23 3922 topology 4050 5203
+> 16 0 23 3922 topology 4092 5203
+> 15 0 23 3922 topology 4054 5204
 > 16 0 23 3922 topology 4092 5204
-> 15 0 24 3922 topology 3944 5205
-> 16 0 24 3922 topology 3945 5205
-> 15 0 24 3922 topology 4052 5206
-> 16 0 24 3922 topology 4053 5206
-> 15 0 23 3922 topology 4080 5207
+> 15 0 23 3922 topology 4053 5205
+> 16 0 23 3922 topology 4092 5205
+> 15 0 23 3922 topology 4057 5206
+> 16 0 23 3922 topology 4092 5206
+> 15 0 23 3922 topology 4056 5207
 > 16 0 23 3922 topology 4092 5207
-> 15 0 23 3922 topology 4002 5208
+> 15 0 23 3922 topology 4060 5208
 > 16 0 23 3922 topology 4092 5208
-> 15 0 24 3922 topology 4028 5209
-> 16 0 24 3922 topology 4029 5209
-> 15 0 24 3922 topology 4004 5210
-> 16 0 24 3922 topology 4005 5210
+> 15 0 23 3922 topology 4059 5209
+> 16 0 23 3922 topology 4092 5209
+> 15 0 23 3922 topology 4063 5210
+> 16 0 23 3922 topology 4092 5210
 > 15 0 23 3922 topology 4062 5211
 > 16 0 23 3922 topology 4092 5211
-> 15 0 23 3922 topology 3949 5212
+> 15 0 23 3922 topology 4066 5212
 > 16 0 23 3922 topology 4092 5212
-> 15 0 24 3922 topology 3950 5213
-> 16 0 24 3922 topology 3952 5213
-> 15 0 24 3922 topology 4088 5214
-> 16 0 24 3922 topology 4089 5214
-> 15 0 24 3922 topology 4064 5215
-> 16 0 24 3922 topology 4065 5215
-> 15 0 24 3922 topology 3929 5216
-> 16 0 24 3922 topology 3931 5216
-> 15 0 24 3922 topology 3956 5217
-> 16 0 24 3922 topology 3958 5217
-> 15 0 24 3922 topology 4013 5218
-> 16 0 24 3922 topology 4015 5218
-> 15 0 24 3922 topology 3962 5219
-> 16 0 24 3922 topology 3964 5219
-> 15 0 24 3922 topology 4070 5220
-> 16 0 24 3922 topology 4072 5220
-> 15 0 23 3922 topology 3939 5221
+> 15 0 23 3922 topology 4065 5213
+> 16 0 23 3922 topology 4092 5213
+> 15 0 23 3922 topology 4069 5214
+> 16 0 23 3922 topology 4092 5214
+> 15 0 23 3922 topology 4068 5215
+> 16 0 23 3922 topology 4092 5215
+> 15 0 23 3922 topology 3934 5216
+> 16 0 23 3922 topology 4092 5216
+> 15 0 23 3922 topology 3933 5217
+> 16 0 23 3922 topology 4092 5217
+> 15 0 23 3922 topology 4072 5218
+> 16 0 23 3922 topology 4092 5218
+> 15 0 23 3922 topology 4071 5219
+> 16 0 23 3922 topology 4092 5219
+> 15 0 23 3922 topology 4075 5220
+> 16 0 23 3922 topology 4092 5220
+> 15 0 23 3922 topology 4074 5221
 > 16 0 23 3922 topology 4092 5221
-> 15 0 23 3922 topology 3985 5222
+> 15 0 23 3922 topology 4078 5222
 > 16 0 23 3922 topology 4092 5222
-> 15 0 24 3922 topology 4019 5223
-> 16 0 24 3922 topology 4021 5223
-> 15 0 24 3922 topology 3968 5224
-> 16 0 24 3922 topology 3970 5224
-> 15 0 24 3922 topology 4076 5225
-> 16 0 24 3922 topology 4078 5225
-> 15 0 24 3922 topology 3923 5226
-> 16 0 24 3922 topology 3924 5226
-> 15 0 23 3922 topology 4021 5227
+> 15 0 23 3922 topology 4077 5223
+> 16 0 23 3922 topology 4092 5223
+> 15 0 23 3922 topology 4081 5224
+> 16 0 23 3922 topology 4092 5224
+> 15 0 23 3922 topology 4080 5225
+> 16 0 23 3922 topology 4092 5225
+> 15 0 23 3922 topology 4084 5226
+> 16 0 23 3922 topology 4092 5226
+> 15 0 23 3922 topology 4083 5227
 > 16 0 23 3922 topology 4092 5227
-> 15 0 24 3922 topology 4025 5228
-> 16 0 24 3922 topology 4027 5228
-> 15 0 23 3922 topology 3973 5229
+> 15 0 23 3922 topology 4087 5228
+> 16 0 23 3922 topology 4092 5228
+> 15 0 23 3922 topology 4086 5229
 > 16 0 23 3922 topology 4092 5229
-> 15 0 24 3922 topology 3974 5230
-> 16 0 24 3922 topology 3976 5230
-> 15 0 23 3922 topology 4057 5231
+> 15 0 23 3922 topology 4090 5230
+> 16 0 23 3922 topology 4092 5230
+> 15 0 23 3922 topology 4089 5231
 > 16 0 23 3922 topology 4092 5231
-> 15 0 24 3922 topology 4082 5232
-> 16 0 24 3922 topology 4084 5232
-> 15 0 23 3922 topology 4009 5233
+> 15 0 23 3922 topology 3937 5232
+> 16 0 23 3922 topology 4092 5232
+> 15 0 23 3922 topology 3936 5233
 > 16 0 23 3922 topology 4092 5233
-> 15 0 24 3922 topology 4031 5234
-> 16 0 24 3922 topology 4033 5234
-> 15 0 24 3922 topology 4088 5235
-> 16 0 24 3922 topology 4090 5235
-> 15 0 24 3922 topology 4037 5236
-> 16 0 24 3922 topology 4039 5236
-> 15 0 23 3922 topology 3987 5237
+> 15 0 23 3922 topology 3940 5234
+> 16 0 23 3922 topology 4092 5234
+> 15 0 23 3922 topology 3939 5235
+> 16 0 23 3922 topology 4092 5235
+> 15 0 23 3922 topology 3943 5236
+> 16 0 23 3922 topology 4092 5236
+> 15 0 23 3922 topology 3942 5237
 > 16 0 23 3922 topology 4092 5237
-> 15 0 23 3922 topology 4047 5238
+> 15 0 23 3922 topology 3946 5238
 > 16 0 23 3922 topology 4092 5238
-> 15 0 23 3922 topology 3969 5239
+> 15 0 23 3922 topology 3945 5239
 > 16 0 23 3922 topology 4092 5239
-> 15 0 23 3922 topology 4029 5240
+> 15 0 23 3922 topology 3949 5240
 > 16 0 23 3922 topology 4092 5240
-> 15 0 24 3922 topology 3947 5241
-> 16 0 24 3922 topology 3948 5241
-> 15 0 23 3922 topology 3940 5242
-> 16 0 23 3922 topology 4092 5242
-> 15 0 23 3922 topology 4089 5243
-> 16 0 23 3922 topology 4092 5243
-> 15 0 23 3922 topology 3924 5244
-> 16 0 23 3922 topology 4092 5244
-> 15 0 23 3922 topology 4012 5245
-> 16 0 23 3922 topology 4092 5245
-> 15 0 24 3922 topology 3938 5246
-> 16 0 24 3922 topology 3940 5246
-> 15 0 23 3922 topology 3964 5247
-> 16 0 23 3922 topology 4092 5247
-> 15 0 23 3922 topology 4048 5248
-> 16 0 23 3922 topology 4092 5248
-> 15 0 23 3922 topology 3948 5249
-> 16 0 23 3922 topology 4092 5249
-> 15 0 23 3922 topology 4000 5250
-> 16 0 23 3922 topology 4092 5250
-> 15 0 24 3922 topology 3926 5251
-> 16 0 24 3922 topology 3927 5251
-> 15 0 23 3922 topology 4084 5252
-> 16 0 23 3922 topology 4092 5252
-> 15 0 24 3922 topology 3983 5253
-> 16 0 24 3922 topology 3984 5253
-> 15 0 23 3922 topology 4036 5254
-> 16 0 23 3922 topology 4092 5254
-> 15 0 24 3922 topology 3959 5255
-> 16 0 24 3922 topology 3960 5255
-> 15 0 24 3922 topology 4043 5256
-> 16 0 24 3922 topology 4044 5256
-> 15 0 23 3922 topology 3954 5257
-> 16 0 23 3922 topology 4092 5257
-> 15 0 24 3922 topology 4019 5258
-> 16 0 24 3922 topology 4020 5258
-> 15 0 23 3922 topology 4014 5259
-> 16 0 23 3922 topology 4092 5259
-> 15 0 24 3922 topology 3995 5260
-> 16 0 24 3922 topology 3996 5260
-> 15 0 23 3922 topology 3931 5261
-> 16 0 23 3922 topology 4092 5261
-> 15 0 23 3922 topology 4074 5262
-> 16 0 23 3922 topology 4092 5262
-> 15 0 23 3922 topology 3996 5263
-> 16 0 23 3922 topology 4092 5263
-> 15 0 24 3922 topology 3971 5264
-> 16 0 24 3922 topology 3972 5264
-> 15 0 24 3922 topology 4079 5265
-> 16 0 24 3922 topology 4080 5265
-> 15 0 23 3922 topology 4056 5266
-> 16 0 23 3922 topology 4092 5266
-> 15 0 24 3922 topology 4055 5267
-> 16 0 24 3922 topology 4056 5267
-> 15 0 23 3922 topology 3978 5268
-> 16 0 23 3922 topology 4092 5268
-> 15 0 24 3922 topology 4031 5269
-> 16 0 24 3922 topology 4032 5269
-> 15 0 23 3922 topology 4038 5270
-> 16 0 23 3922 topology 4092 5270
-> 15 0 24 3922 topology 3923 5271
-> 16 0 24 3922 topology 3925 5271
-> 15 0 24 3922 topology 4007 5272
-> 16 0 24 3922 topology 4008 5272
-> 15 0 24 3922 topology 3983 5273
-> 16 0 24 3922 topology 3985 5273
-> 15 0 24 3922 topology 4067 5274
-> 16 0 24 3922 topology 4068 5274
-> 15 0 24 3922 topology 4040 5275
-> 16 0 24 3922 topology 4042 5275
-> 15 0 24 3922 topology 3989 5276
-> 16 0 24 3922 topology 3991 5276
-> 15 0 23 3922 topology 3933 5277
-> 16 0 23 3922 topology 4092 5277
-> 15 0 23 3922 topology 3955 5278
-> 16 0 23 3922 topology 4092 5278
-> 15 0 24 3922 topology 4046 5279
-> 16 0 24 3922 topology 4048 5279
-> 15 0 24 3922 topology 3995 5280
-> 16 0 24 3922 topology 3997 5280
-> 15 0 23 3922 topology 3991 5281
-> 16 0 23 3922 topology 4092 5281
-> 15 0 23 3922 topology 4075 5282
-> 16 0 23 3922 topology 4092 5282
-> 15 0 24 3922 topology 4052 5283
-> 16 0 24 3922 topology 4054 5283
-> 15 0 23 3922 topology 4027 5284
-> 16 0 23 3922 topology 4092 5284
-> 15 0 24 3922 topology 4001 5285
-> 16 0 24 3922 topology 4003 5285
-> 15 0 24 3922 topology 3947 5286
-> 16 0 24 3922 topology 3949 5286
-> 15 0 23 3922 topology 3979 5287
-> 16 0 23 3922 topology 4092 5287
-> 15 0 24 3922 topology 3929 5288
-> 16 0 24 3922 topology 3930 5288
-> 15 0 23 3922 topology 4063 5289
-> 16 0 23 3922 topology 4092 5289
-> 15 0 24 3922 topology 4058 5290
-> 16 0 24 3922 topology 4060 5290
-> 15 0 24 3922 topology 4007 5291
-> 16 0 24 3922 topology 4009 5291
-> 15 0 23 3922 topology 3981 5292
-> 16 0 23 3922 topology 4092 5292
-> 15 0 24 3922 topology 4064 5293
-> 16 0 24 3922 topology 4066 5293
-> 15 0 23 3922 topology 4041 5294
-> 16 0 23 3922 topology 4092 5294
-> 15 0 23 3922 topology 3963 5295
-> 16 0 23 3922 topology 4092 5295
-> 15 0 23 3922 topology 4023 5296
-> 16 0 23 3922 topology 4092 5296
-> 15 0 23 3922 topology 4083 5297
-> 16 0 23 3922 topology 4092 5297
-> 15 0 23 3922 topology 4005 5298
-> 16 0 23 3922 topology 4092 5298
-> 15 0 23 3922 topology 3946 5299
-> 16 0 23 3922 topology 4092 5299
-> 15 0 23 3922 topology 4065 5300
-> 16 0 23 3922 topology 4092 5300
-> 15 0 24 3922 topology 3932 5301
-> 16 0 24 3922 topology 3934 5301
-> 15 0 25 3922 topology 4091 5302
-> 16 0 25 3922 topology 4092 5302
-> 15 0 23 3922 topology 3982 5303
-> 16 0 23 3922 topology 4092 5303
-> 15 0 23 3922 topology 3942 5304
-> 16 0 23 3922 topology 4092 5304
-> 15 0 23 3922 topology 4018 5305
-> 16 0 23 3922 topology 4092 5305
-> 15 0 24 3922 topology 3950 5306
-> 16 0 24 3922 topology 3951 5306
-> 15 0 23 3922 topology 3970 5307
-> 16 0 23 3922 topology 4092 5307
-> 15 0 23 3922 topology 4054 5308
-> 16 0 23 3922 topology 4092 5308
-> 15 0 24 3922 topology 4010 5309
-> 16 0 24 3922 topology 4011 5309
-> 15 0 23 3922 topology 4006 5310
-> 16 0 23 3922 topology 4092 5310
-> 15 0 23 3922 topology 4090 5311
-> 16 0 23 3922 topology 4092 5311
-> 15 0 24 3922 topology 3986 5312
-> 16 0 24 3922 topology 3987 5312
-> 15 0 24 3922 topology 3932 5313
-> 16 0 24 3922 topology 3933 5313
-> 15 0 24 3922 topology 3962 5314
-> 16 0 24 3922 topology 3963 5314
-> 15 0 24 3922 topology 4070 5315
-> 16 0 24 3922 topology 4071 5315
-> 15 0 24 3922 topology 4046 5316
-> 16 0 24 3922 topology 4047 5316
-> 15 0 24 3922 topology 4022 5317
-> 16 0 24 3922 topology 4023 5317
-> 15 0 23 3922 topology 3990 5318
-> 16 0 23 3922 topology 4092 5318
-> 15 0 23 3922 topology 4050 5319
-> 16 0 23 3922 topology 4092 5319
-> 15 0 24 3922 topology 3998 5320
-> 16 0 24 3922 topology 3999 5320
-> 15 0 23 3922 topology 3972 5321
-> 16 0 23 3922 topology 4092 5321
-> 15 0 23 3922 topology 3937 5322
-> 16 0 23 3922 topology 4092 5322
-> 15 0 24 3922 topology 3974 5323
-> 16 0 24 3922 topology 3975 5323
-> 15 0 24 3922 topology 4082 5324
-> 16 0 24 3922 topology 4083 5324
-> 15 0 23 3922 topology 4032 5325
-> 16 0 23 3922 topology 4092 5325
-> 15 0 24 3922 topology 4058 5326
-> 16 0 24 3922 topology 4059 5326
-> 15 0 24 3922 topology 4034 5327
-> 16 0 24 3922 topology 4035 5327
-> 15 0 24 3922 topology 3953 5328
-> 16 0 24 3922 topology 3955 5328
-> 15 0 24 3922 topology 4010 5329
-> 16 0 24 3922 topology 4012 5329
-> 15 0 24 3922 topology 3959 5330
-> 16 0 24 3922 topology 3961 5330
-> 15 0 23 3922 topology 3927 5331
-> 16 0 23 3922 topology 4092 5331
-> 15 0 24 3922 topology 4016 5332
-> 16 0 24 3922 topology 4018 5332
-> 15 0 24 3922 topology 3965 5333
-> 16 0 24 3922 topology 3967 5333
-> 15 0 24 3922 topology 4073 5334
-> 16 0 24 3922 topology 4075 5334
-> 15 0 23 3922 topology 3961 5335
-> 16 0 23 3922 topology 4092 5335
-> 15 0 23 3922 topology 4045 5336
-> 16 0 23 3922 topology 4092 5336
-> 15 0 24 3922 topology 4022 5337
-> 16 0 24 3922 topology 4024 5337
-> 15 0 24 3922 topology 3941 5338
-> 16 0 24 3922 topology 3943 5338
-> 15 0 23 3922 topology 3997 5339
-> 16 0 23 3922 topology 4092 5339
-> 15 0 24 3922 topology 3971 5340
-> 16 0 24 3922 topology 3973 5340
-> 15 0 24 3922 topology 4079 5341
-> 16 0 24 3922 topology 4081 5341
-> 15 0 23 3922 topology 4081 5342
-> 16 0 23 3922 topology 4092 5342
-> 15 0 24 3922 topology 4028 5343
-> 16 0 24 3922 topology 4030 5343
-> 15 0 23 3922 topology 4033 5344
-> 16 0 23 3922 topology 4092 5344
-> 15 0 24 3922 topology 3977 5345
-> 16 0 24 3922 topology 3979 5345
-> 15 0 24 3922 topology 4085 5346
-> 16 0 24 3922 topology 4087 5346
-> 15 0 24 3922 topology 4034 5347
-> 16 0 24 3922 topology 4036 5347
-> 15 0 23 3922 topology 4069 5348
-> 16 0 23 3922 topology 4092 5348
-> 15 0 24 3922 topology 3935 5349
-> 16 0 24 3922 topology 3936 5349
-> 15 0 23 3922 topology 3957 5350
-> 16 0 23 3922 topology 4092 5350
-> 15 0 23 3922 topology 4017 5351
-> 16 0 23 3922 topology 4092 5351
-> 15 0 23 3922 topology 3928 5352
-> 16 0 23 3922 topology 4092 5352
-> 15 0 23 3922 topology 4077 5353
-> 16 0 23 3922 topology 4092 5353
-> 15 0 23 3922 topology 3999 5354
-> 16 0 23 3922 topology 4092 5354
-> 15 0 23 4094 topology 4130 5355
+> 15 0 23 3922 topology 3948 5241
+> 16 0 23 3922 topology 4092 5241
+> 15 0 24 3922 topology 4091 5242
+> 16 0 24 3922 topology 4092 5242
+> 15 0 25 3922 topology 3950 5243
+> 16 0 25 3922 topology 3952 5243
+> 15 0 25 3922 topology 3950 5244
+> 16 0 25 3922 topology 3951 5244
+> 15 0 25 3922 topology 3953 5245
+> 16 0 25 3922 topology 3955 5245
+> 15 0 25 3922 topology 3953 5246
+> 16 0 25 3922 topology 3954 5246
+> 15 0 25 3922 topology 3956 5247
+> 16 0 25 3922 topology 3958 5247
+> 15 0 25 3922 topology 3956 5248
+> 16 0 25 3922 topology 3957 5248
+> 15 0 25 3922 topology 3959 5249
+> 16 0 25 3922 topology 3961 5249
+> 15 0 25 3922 topology 3959 5250
+> 16 0 25 3922 topology 3960 5250
+> 15 0 25 3922 topology 3962 5251
+> 16 0 25 3922 topology 3964 5251
+> 15 0 25 3922 topology 3962 5252
+> 16 0 25 3922 topology 3963 5252
+> 15 0 25 3922 topology 3965 5253
+> 16 0 25 3922 topology 3967 5253
+> 15 0 25 3922 topology 3965 5254
+> 16 0 25 3922 topology 3966 5254
+> 15 0 25 3922 topology 3968 5255
+> 16 0 25 3922 topology 3970 5255
+> 15 0 25 3922 topology 3968 5256
+> 16 0 25 3922 topology 3969 5256
+> 15 0 25 3922 topology 3971 5257
+> 16 0 25 3922 topology 3973 5257
+> 15 0 25 3922 topology 3971 5258
+> 16 0 25 3922 topology 3972 5258
+> 15 0 25 3922 topology 3974 5259
+> 16 0 25 3922 topology 3976 5259
+> 15 0 25 3922 topology 3974 5260
+> 16 0 25 3922 topology 3975 5260
+> 15 0 25 3922 topology 3977 5261
+> 16 0 25 3922 topology 3979 5261
+> 15 0 25 3922 topology 3977 5262
+> 16 0 25 3922 topology 3978 5262
+> 15 0 25 3922 topology 3923 5263
+> 16 0 25 3922 topology 3925 5263
+> 15 0 25 3922 topology 3923 5264
+> 16 0 25 3922 topology 3924 5264
+> 15 0 25 3922 topology 3980 5265
+> 16 0 25 3922 topology 3982 5265
+> 15 0 25 3922 topology 3980 5266
+> 16 0 25 3922 topology 3981 5266
+> 15 0 25 3922 topology 3983 5267
+> 16 0 25 3922 topology 3985 5267
+> 15 0 25 3922 topology 3983 5268
+> 16 0 25 3922 topology 3984 5268
+> 15 0 25 3922 topology 3986 5269
+> 16 0 25 3922 topology 3988 5269
+> 15 0 25 3922 topology 3986 5270
+> 16 0 25 3922 topology 3987 5270
+> 15 0 25 3922 topology 3989 5271
+> 16 0 25 3922 topology 3991 5271
+> 15 0 25 3922 topology 3989 5272
+> 16 0 25 3922 topology 3990 5272
+> 15 0 25 3922 topology 3992 5273
+> 16 0 25 3922 topology 3994 5273
+> 15 0 25 3922 topology 3992 5274
+> 16 0 25 3922 topology 3993 5274
+> 15 0 25 3922 topology 3995 5275
+> 16 0 25 3922 topology 3997 5275
+> 15 0 25 3922 topology 3995 5276
+> 16 0 25 3922 topology 3996 5276
+> 15 0 25 3922 topology 3998 5277
+> 16 0 25 3922 topology 4000 5277
+> 15 0 25 3922 topology 3998 5278
+> 16 0 25 3922 topology 3999 5278
+> 15 0 25 3922 topology 4001 5279
+> 16 0 25 3922 topology 4003 5279
+> 15 0 25 3922 topology 4001 5280
+> 16 0 25 3922 topology 4002 5280
+> 15 0 25 3922 topology 4004 5281
+> 16 0 25 3922 topology 4006 5281
+> 15 0 25 3922 topology 4004 5282
+> 16 0 25 3922 topology 4005 5282
+> 15 0 25 3922 topology 4007 5283
+> 16 0 25 3922 topology 4009 5283
+> 15 0 25 3922 topology 4007 5284
+> 16 0 25 3922 topology 4008 5284
+> 15 0 25 3922 topology 3926 5285
+> 16 0 25 3922 topology 3928 5285
+> 15 0 25 3922 topology 3926 5286
+> 16 0 25 3922 topology 3927 5286
+> 15 0 25 3922 topology 4010 5287
+> 16 0 25 3922 topology 4012 5287
+> 15 0 25 3922 topology 4010 5288
+> 16 0 25 3922 topology 4011 5288
+> 15 0 25 3922 topology 4013 5289
+> 16 0 25 3922 topology 4015 5289
+> 15 0 25 3922 topology 4013 5290
+> 16 0 25 3922 topology 4014 5290
+> 15 0 25 3922 topology 4016 5291
+> 16 0 25 3922 topology 4018 5291
+> 15 0 25 3922 topology 4016 5292
+> 16 0 25 3922 topology 4017 5292
+> 15 0 25 3922 topology 4019 5293
+> 16 0 25 3922 topology 4021 5293
+> 15 0 25 3922 topology 4019 5294
+> 16 0 25 3922 topology 4020 5294
+> 15 0 25 3922 topology 4022 5295
+> 16 0 25 3922 topology 4024 5295
+> 15 0 25 3922 topology 4022 5296
+> 16 0 25 3922 topology 4023 5296
+> 15 0 25 3922 topology 4025 5297
+> 16 0 25 3922 topology 4027 5297
+> 15 0 25 3922 topology 4025 5298
+> 16 0 25 3922 topology 4026 5298
+> 15 0 25 3922 topology 4028 5299
+> 16 0 25 3922 topology 4030 5299
+> 15 0 25 3922 topology 4028 5300
+> 16 0 25 3922 topology 4029 5300
+> 15 0 25 3922 topology 4031 5301
+> 16 0 25 3922 topology 4033 5301
+> 15 0 25 3922 topology 4031 5302
+> 16 0 25 3922 topology 4032 5302
+> 15 0 25 3922 topology 4034 5303
+> 16 0 25 3922 topology 4036 5303
+> 15 0 25 3922 topology 4034 5304
+> 16 0 25 3922 topology 4035 5304
+> 15 0 25 3922 topology 4037 5305
+> 16 0 25 3922 topology 4039 5305
+> 15 0 25 3922 topology 4037 5306
+> 16 0 25 3922 topology 4038 5306
+> 15 0 25 3922 topology 3929 5307
+> 16 0 25 3922 topology 3931 5307
+> 15 0 25 3922 topology 3929 5308
+> 16 0 25 3922 topology 3930 5308
+> 15 0 25 3922 topology 4040 5309
+> 16 0 25 3922 topology 4042 5309
+> 15 0 25 3922 topology 4040 5310
+> 16 0 25 3922 topology 4041 5310
+> 15 0 25 3922 topology 4043 5311
+> 16 0 25 3922 topology 4045 5311
+> 15 0 25 3922 topology 4043 5312
+> 16 0 25 3922 topology 4044 5312
+> 15 0 25 3922 topology 4046 5313
+> 16 0 25 3922 topology 4048 5313
+> 15 0 25 3922 topology 4046 5314
+> 16 0 25 3922 topology 4047 5314
+> 15 0 25 3922 topology 4049 5315
+> 16 0 25 3922 topology 4051 5315
+> 15 0 25 3922 topology 4049 5316
+> 16 0 25 3922 topology 4050 5316
+> 15 0 25 3922 topology 4052 5317
+> 16 0 25 3922 topology 4054 5317
+> 15 0 25 3922 topology 4052 5318
+> 16 0 25 3922 topology 4053 5318
+> 15 0 25 3922 topology 4055 5319
+> 16 0 25 3922 topology 4057 5319
+> 15 0 25 3922 topology 4055 5320
+> 16 0 25 3922 topology 4056 5320
+> 15 0 25 3922 topology 4058 5321
+> 16 0 25 3922 topology 4060 5321
+> 15 0 25 3922 topology 4058 5322
+> 16 0 25 3922 topology 4059 5322
+> 15 0 25 3922 topology 4061 5323
+> 16 0 25 3922 topology 4063 5323
+> 15 0 25 3922 topology 4061 5324
+> 16 0 25 3922 topology 4062 5324
+> 15 0 25 3922 topology 4064 5325
+> 16 0 25 3922 topology 4066 5325
+> 15 0 25 3922 topology 4064 5326
+> 16 0 25 3922 topology 4065 5326
+> 15 0 25 3922 topology 4067 5327
+> 16 0 25 3922 topology 4069 5327
+> 15 0 25 3922 topology 4067 5328
+> 16 0 25 3922 topology 4068 5328
+> 15 0 25 3922 topology 3932 5329
+> 16 0 25 3922 topology 3934 5329
+> 15 0 25 3922 topology 3932 5330
+> 16 0 25 3922 topology 3933 5330
+> 15 0 25 3922 topology 4070 5331
+> 16 0 25 3922 topology 4072 5331
+> 15 0 25 3922 topology 4070 5332
+> 16 0 25 3922 topology 4071 5332
+> 15 0 25 3922 topology 4073 5333
+> 16 0 25 3922 topology 4075 5333
+> 15 0 25 3922 topology 4073 5334
+> 16 0 25 3922 topology 4074 5334
+> 15 0 25 3922 topology 4076 5335
+> 16 0 25 3922 topology 4078 5335
+> 15 0 25 3922 topology 4076 5336
+> 16 0 25 3922 topology 4077 5336
+> 15 0 25 3922 topology 4079 5337
+> 16 0 25 3922 topology 4081 5337
+> 15 0 25 3922 topology 4079 5338
+> 16 0 25 3922 topology 4080 5338
+> 15 0 25 3922 topology 4082 5339
+> 16 0 25 3922 topology 4084 5339
+> 15 0 25 3922 topology 4082 5340
+> 16 0 25 3922 topology 4083 5340
+> 15 0 25 3922 topology 4085 5341
+> 16 0 25 3922 topology 4087 5341
+> 15 0 25 3922 topology 4085 5342
+> 16 0 25 3922 topology 4086 5342
+> 15 0 25 3922 topology 4088 5343
+> 16 0 25 3922 topology 4090 5343
+> 15 0 25 3922 topology 4088 5344
+> 16 0 25 3922 topology 4089 5344
+> 15 0 25 3922 topology 3935 5345
+> 16 0 25 3922 topology 3937 5345
+> 15 0 25 3922 topology 3935 5346
+> 16 0 25 3922 topology 3936 5346
+> 15 0 25 3922 topology 3938 5347
+> 16 0 25 3922 topology 3940 5347
+> 15 0 25 3922 topology 3938 5348
+> 16 0 25 3922 topology 3939 5348
+> 15 0 25 3922 topology 3941 5349
+> 16 0 25 3922 topology 3943 5349
+> 15 0 25 3922 topology 3941 5350
+> 16 0 25 3922 topology 3942 5350
+> 15 0 25 3922 topology 3944 5351
+> 16 0 25 3922 topology 3946 5351
+> 15 0 25 3922 topology 3944 5352
+> 16 0 25 3922 topology 3945 5352
+> 15 0 25 3922 topology 3947 5353
+> 16 0 25 3922 topology 3949 5353
+> 15 0 25 3922 topology 3947 5354
+> 16 0 25 3922 topology 3948 5354
+> 15 0 23 4094 topology 4124 5355
 > 16 0 23 4094 topology 4246 5355
-> 15 0 23 4094 topology 4114 5356
+> 15 0 23 4094 topology 4123 5356
 > 16 0 23 4094 topology 4246 5356
-> 15 0 23 4094 topology 4214 5357
+> 15 0 23 4094 topology 4127 5357
 > 16 0 23 4094 topology 4246 5357
-> 15 0 24 4094 topology 4167 5358
-> 16 0 24 4094 topology 4169 5358
-> 15 0 24 4094 topology 4122 5359
-> 16 0 24 4094 topology 4123 5359
-> 15 0 23 4094 topology 4166 5360
+> 15 0 23 4094 topology 4126 5358
+> 16 0 23 4094 topology 4246 5358
+> 15 0 23 4094 topology 4130 5359
+> 16 0 23 4094 topology 4246 5359
+> 15 0 23 4094 topology 4129 5360
 > 16 0 23 4094 topology 4246 5360
-> 15 0 24 4094 topology 4146 5361
-> 16 0 24 4094 topology 4148 5361
-> 15 0 23 4094 topology 4202 5362
+> 15 0 23 4094 topology 4133 5361
+> 16 0 23 4094 topology 4246 5361
+> 15 0 23 4094 topology 4132 5362
 > 16 0 23 4094 topology 4246 5362
-> 15 0 24 4094 topology 4155 5363
-> 16 0 24 4094 topology 4156 5363
-> 15 0 23 4094 topology 4238 5364
+> 15 0 23 4094 topology 4136 5363
+> 16 0 23 4094 topology 4246 5363
+> 15 0 23 4094 topology 4135 5364
 > 16 0 23 4094 topology 4246 5364
-> 15 0 24 4094 topology 4233 5365
-> 16 0 24 4094 topology 4235 5365
-> 15 0 24 4094 topology 4188 5366
-> 16 0 24 4094 topology 4189 5366
-> 15 0 23 4094 topology 4132 5367
+> 15 0 23 4094 topology 4139 5365
+> 16 0 23 4094 topology 4246 5365
+> 15 0 23 4094 topology 4138 5366
+> 16 0 23 4094 topology 4246 5366
+> 15 0 23 4094 topology 4142 5367
 > 16 0 23 4094 topology 4246 5367
-> 15 0 24 4094 topology 4221 5368
-> 16 0 24 4094 topology 4222 5368
-> 15 0 23 4094 topology 4192 5369
+> 15 0 23 4094 topology 4141 5368
+> 16 0 23 4094 topology 4246 5368
+> 15 0 23 4094 topology 4145 5369
 > 16 0 23 4094 topology 4246 5369
-> 15 0 23 4094 topology 4109 5370
+> 15 0 23 4094 topology 4144 5370
 > 16 0 23 4094 topology 4246 5370
-> 15 0 24 4094 topology 4146 5371
-> 16 0 24 4094 topology 4147 5371
-> 15 0 23 4094 topology 4174 5372
+> 15 0 23 4094 topology 4148 5371
+> 16 0 23 4094 topology 4246 5371
+> 15 0 23 4094 topology 4147 5372
 > 16 0 23 4094 topology 4246 5372
-> 15 0 23 4094 topology 4234 5373
+> 15 0 23 4094 topology 4151 5373
 > 16 0 23 4094 topology 4246 5373
-> 15 0 24 4094 topology 4179 5374
-> 16 0 24 4094 topology 4180 5374
-> 15 0 24 4094 topology 4125 5375
-> 16 0 24 4094 topology 4127 5375
-> 15 0 23 4094 topology 4099 5376
+> 15 0 23 4094 topology 4150 5374
+> 16 0 23 4094 topology 4246 5374
+> 15 0 23 4094 topology 4097 5375
+> 16 0 23 4094 topology 4246 5375
+> 15 0 23 4094 topology 4096 5376
 > 16 0 23 4094 topology 4246 5376
-> 15 0 24 4094 topology 4212 5377
-> 16 0 24 4094 topology 4214 5377
-> 15 0 23 4094 topology 4157 5378
+> 15 0 23 4094 topology 4154 5377
+> 16 0 23 4094 topology 4246 5377
+> 15 0 23 4094 topology 4153 5378
 > 16 0 23 4094 topology 4246 5378
-> 15 0 24 4094 topology 4191 5379
-> 16 0 24 4094 topology 4193 5379
-> 15 0 23 4094 topology 4193 5380
+> 15 0 23 4094 topology 4157 5379
+> 16 0 23 4094 topology 4246 5379
+> 15 0 23 4094 topology 4156 5380
 > 16 0 23 4094 topology 4246 5380
-> 15 0 24 4094 topology 4170 5381
-> 16 0 24 4094 topology 4172 5381
-> 15 0 23 4094 topology 4145 5382
+> 15 0 23 4094 topology 4160 5381
+> 16 0 23 4094 topology 4246 5381
+> 15 0 23 4094 topology 4159 5382
 > 16 0 23 4094 topology 4246 5382
-> 15 0 24 4094 topology 4152 5383
-> 16 0 24 4094 topology 4153 5383
-> 15 0 25 4094 topology 4245 5384
-> 16 0 25 4094 topology 4246 5384
-> 15 0 23 4094 topology 4229 5385
+> 15 0 23 4094 topology 4163 5383
+> 16 0 23 4094 topology 4246 5383
+> 15 0 23 4094 topology 4162 5384
+> 16 0 23 4094 topology 4246 5384
+> 15 0 23 4094 topology 4166 5385
 > 16 0 23 4094 topology 4246 5385
-> 15 0 24 4094 topology 4149 5386
-> 16 0 24 4094 topology 4151 5386
-> 15 0 23 4094 topology 4181 5387
+> 15 0 23 4094 topology 4165 5386
+> 16 0 23 4094 topology 4246 5386
+> 15 0 23 4094 topology 4169 5387
 > 16 0 23 4094 topology 4246 5387
-> 15 0 24 4094 topology 4104 5388
-> 16 0 24 4094 topology 4105 5388
-> 15 0 24 4094 topology 4185 5389
-> 16 0 24 4094 topology 4186 5389
-> 15 0 24 4094 topology 4236 5390
-> 16 0 24 4094 topology 4238 5390
-> 15 0 24 4094 topology 4218 5391
-> 16 0 24 4094 topology 4219 5391
-> 15 0 23 4094 topology 4159 5392
+> 15 0 23 4094 topology 4168 5388
+> 16 0 23 4094 topology 4246 5388
+> 15 0 23 4094 topology 4172 5389
+> 16 0 23 4094 topology 4246 5389
+> 15 0 23 4094 topology 4171 5390
+> 16 0 23 4094 topology 4246 5390
+> 15 0 23 4094 topology 4175 5391
+> 16 0 23 4094 topology 4246 5391
+> 15 0 23 4094 topology 4174 5392
 > 16 0 23 4094 topology 4246 5392
-> 15 0 23 4094 topology 4100 5393
+> 15 0 23 4094 topology 4178 5393
 > 16 0 23 4094 topology 4246 5393
-> 15 0 23 4094 topology 4219 5394
+> 15 0 23 4094 topology 4177 5394
 > 16 0 23 4094 topology 4246 5394
-> 15 0 24 4094 topology 4116 5395
-> 16 0 24 4094 topology 4117 5395
-> 15 0 23 4094 topology 4141 5396
+> 15 0 23 4094 topology 4181 5395
+> 16 0 23 4094 topology 4246 5395
+> 15 0 23 4094 topology 4180 5396
 > 16 0 23 4094 topology 4246 5396
-> 15 0 24 4094 topology 4143 5397
-> 16 0 24 4094 topology 4144 5397
-> 15 0 23 4094 topology 4201 5398
+> 15 0 23 4094 topology 4100 5397
+> 16 0 23 4094 topology 4246 5397
+> 15 0 23 4094 topology 4099 5398
 > 16 0 23 4094 topology 4246 5398
-> 15 0 24 4094 topology 4176 5399
-> 16 0 24 4094 topology 4177 5399
-> 15 0 24 4094 topology 4209 5400
-> 16 0 24 4094 topology 4210 5400
-> 15 0 24 4094 topology 4128 5401
-> 16 0 24 4094 topology 4130 5401
-> 15 0 24 4094 topology 4215 5402
-> 16 0 24 4094 topology 4217 5402
-> 15 0 23 4094 topology 4108 5403
+> 15 0 23 4094 topology 4184 5399
+> 16 0 23 4094 topology 4246 5399
+> 15 0 23 4094 topology 4183 5400
+> 16 0 23 4094 topology 4246 5400
+> 15 0 23 4094 topology 4187 5401
+> 16 0 23 4094 topology 4246 5401
+> 15 0 23 4094 topology 4186 5402
+> 16 0 23 4094 topology 4246 5402
+> 15 0 23 4094 topology 4190 5403
 > 16 0 23 4094 topology 4246 5403
-> 15 0 23 4094 topology 4184 5404
+> 15 0 23 4094 topology 4189 5404
 > 16 0 23 4094 topology 4246 5404
-> 15 0 23 4094 topology 4136 5405
+> 15 0 23 4094 topology 4193 5405
 > 16 0 23 4094 topology 4246 5405
-> 15 0 24 4094 topology 4194 5406
-> 16 0 24 4094 topology 4196 5406
-> 15 0 23 4094 topology 4220 5407
+> 15 0 23 4094 topology 4192 5406
+> 16 0 23 4094 topology 4246 5406
+> 15 0 23 4094 topology 4196 5407
 > 16 0 23 4094 topology 4246 5407
-> 15 0 23 4094 topology 4172 5408
+> 15 0 23 4094 topology 4195 5408
 > 16 0 23 4094 topology 4246 5408
-> 15 0 24 4094 topology 4173 5409
-> 16 0 24 4094 topology 4175 5409
-> 15 0 24 4094 topology 4182 5410
-> 16 0 24 4094 topology 4183 5410
-> 15 0 23 4094 topology 4208 5411
+> 15 0 23 4094 topology 4199 5409
+> 16 0 23 4094 topology 4246 5409
+> 15 0 23 4094 topology 4198 5410
+> 16 0 23 4094 topology 4246 5410
+> 15 0 23 4094 topology 4202 5411
 > 16 0 23 4094 topology 4246 5411
-> 15 0 24 4094 topology 4215 5412
-> 16 0 24 4094 topology 4216 5412
-> 15 0 23 4094 topology 4126 5413
+> 15 0 23 4094 topology 4201 5412
+> 16 0 23 4094 topology 4246 5412
+> 15 0 23 4094 topology 4205 5413
 > 16 0 23 4094 topology 4246 5413
-> 15 0 23 4094 topology 4186 5414
+> 15 0 23 4094 topology 4204 5414
 > 16 0 23 4094 topology 4246 5414
-> 15 0 24 4094 topology 4239 5415
-> 16 0 24 4094 topology 4241 5415
-> 15 0 24 4094 topology 4140 5416
-> 16 0 24 4094 topology 4141 5416
-> 15 0 23 4094 topology 4168 5417
+> 15 0 23 4094 topology 4208 5415
+> 16 0 23 4094 topology 4246 5415
+> 15 0 23 4094 topology 4207 5416
+> 16 0 23 4094 topology 4246 5416
+> 15 0 23 4094 topology 4211 5417
 > 16 0 23 4094 topology 4246 5417
-> 15 0 24 4094 topology 4173 5418
-> 16 0 24 4094 topology 4174 5418
-> 15 0 23 4094 topology 4228 5419
+> 15 0 23 4094 topology 4210 5418
+> 16 0 23 4094 topology 4246 5418
+> 15 0 23 4094 topology 4103 5419
 > 16 0 23 4094 topology 4246 5419
-> 15 0 23 4094 topology 4115 5420
+> 15 0 23 4094 topology 4102 5420
 > 16 0 23 4094 topology 4246 5420
-> 15 0 23 4094 topology 4150 5421
+> 15 0 23 4094 topology 4214 5421
 > 16 0 23 4094 topology 4246 5421
-> 15 0 23 4094 topology 4210 5422
+> 15 0 23 4094 topology 4213 5422
 > 16 0 23 4094 topology 4246 5422
-> 15 0 24 4094 topology 4206 5423
-> 16 0 24 4094 topology 4207 5423
-> 15 0 24 4094 topology 4152 5424
-> 16 0 24 4094 topology 4154 5424
-> 15 0 24 4094 topology 4239 5425
-> 16 0 24 4094 topology 4240 5425
-> 15 0 24 4094 topology 4131 5426
-> 16 0 24 4094 topology 4133 5426
-> 15 0 23 4094 topology 4127 5427
+> 15 0 23 4094 topology 4217 5423
+> 16 0 23 4094 topology 4246 5423
+> 15 0 23 4094 topology 4216 5424
+> 16 0 23 4094 topology 4246 5424
+> 15 0 23 4094 topology 4220 5425
+> 16 0 23 4094 topology 4246 5425
+> 15 0 23 4094 topology 4219 5426
+> 16 0 23 4094 topology 4246 5426
+> 15 0 23 4094 topology 4223 5427
 > 16 0 23 4094 topology 4246 5427
-> 15 0 24 4094 topology 4218 5428
-> 16 0 24 4094 topology 4220 5428
-> 15 0 23 4094 topology 4117 5429
+> 15 0 23 4094 topology 4222 5428
+> 16 0 23 4094 topology 4246 5428
+> 15 0 23 4094 topology 4226 5429
 > 16 0 23 4094 topology 4246 5429
-> 15 0 23 4094 topology 4163 5430
+> 15 0 23 4094 topology 4225 5430
 > 16 0 23 4094 topology 4246 5430
-> 15 0 24 4094 topology 4197 5431
-> 16 0 24 4094 topology 4199 5431
-> 15 0 23 4094 topology 4199 5432
+> 15 0 23 4094 topology 4229 5431
+> 16 0 23 4094 topology 4246 5431
+> 15 0 23 4094 topology 4228 5432
 > 16 0 23 4094 topology 4246 5432
-> 15 0 24 4094 topology 4101 5433
-> 16 0 24 4094 topology 4102 5433
-> 15 0 23 4094 topology 4151 5434
+> 15 0 23 4094 topology 4232 5433
+> 16 0 23 4094 topology 4246 5433
+> 15 0 23 4094 topology 4231 5434
 > 16 0 23 4094 topology 4246 5434
-> 15 0 24 4094 topology 4176 5435
-> 16 0 24 4094 topology 4178 5435
-> 15 0 23 4094 topology 4235 5436
+> 15 0 23 4094 topology 4235 5435
+> 16 0 23 4094 topology 4246 5435
+> 15 0 23 4094 topology 4234 5436
 > 16 0 23 4094 topology 4246 5436
-> 15 0 24 4094 topology 4212 5437
-> 16 0 24 4094 topology 4213 5437
-> 15 0 23 4094 topology 4153 5438
+> 15 0 23 4094 topology 4238 5437
+> 16 0 23 4094 topology 4246 5437
+> 15 0 23 4094 topology 4237 5438
 > 16 0 23 4094 topology 4246 5438
-> 15 0 24 4094 topology 4137 5439
-> 16 0 24 4094 topology 4138 5439
-> 15 0 23 4094 topology 4213 5440
+> 15 0 23 4094 topology 4241 5439
+> 16 0 23 4094 topology 4246 5439
+> 15 0 23 4094 topology 4240 5440
 > 16 0 23 4094 topology 4246 5440
-> 15 0 24 4094 topology 4113 5441
-> 16 0 24 4094 topology 4114 5441
-> 15 0 23 4094 topology 4135 5442
+> 15 0 23 4094 topology 4106 5441
+> 16 0 23 4094 topology 4246 5441
+> 15 0 23 4094 topology 4105 5442
 > 16 0 23 4094 topology 4246 5442
-> 15 0 23 4094 topology 4106 5443
+> 15 0 23 4094 topology 4244 5443
 > 16 0 23 4094 topology 4246 5443
-> 15 0 24 4094 topology 4170 5444
-> 16 0 24 4094 topology 4171 5444
-> 15 0 23 4094 topology 4195 5445
+> 15 0 23 4094 topology 4243 5444
+> 16 0 23 4094 topology 4246 5444
+> 15 0 23 4094 topology 4109 5445
 > 16 0 23 4094 topology 4246 5445
-> 15 0 23 4094 topology 4177 5446
+> 15 0 23 4094 topology 4108 5446
 > 16 0 23 4094 topology 4246 5446
-> 15 0 24 4094 topology 4203 5447
-> 16 0 24 4094 topology 4204 5447
-> 15 0 24 4094 topology 4095 5448
-> 16 0 24 4094 topology 4097 5448
-> 15 0 23 4094 topology 4237 5449
+> 15 0 23 4094 topology 4112 5447
+> 16 0 23 4094 topology 4246 5447
+> 15 0 23 4094 topology 4111 5448
+> 16 0 23 4094 topology 4246 5448
+> 15 0 23 4094 topology 4115 5449
 > 16 0 23 4094 topology 4246 5449
-> 15 0 24 4094 topology 4098 5450
-> 16 0 24 4094 topology 4100 5450
-> 15 0 24 4094 topology 4236 5451
-> 16 0 24 4094 topology 4237 5451
-> 15 0 24 4094 topology 4101 5452
-> 16 0 24 4094 topology 4103 5452
-> 15 0 24 4094 topology 4155 5453
-> 16 0 24 4094 topology 4157 5453
-> 15 0 24 4094 topology 4104 5454
-> 16 0 24 4094 topology 4106 5454
-> 15 0 23 4094 topology 4102 5455
-> 16 0 23 4094 topology 4246 5455
-> 15 0 24 4094 topology 4107 5456
-> 16 0 24 4094 topology 4109 5456
-> 15 0 24 4094 topology 4134 5457
-> 16 0 24 4094 topology 4136 5457
-> 15 0 24 4094 topology 4242 5458
-> 16 0 24 4094 topology 4244 5458
-> 15 0 23 4094 topology 4154 5459
-> 16 0 23 4094 topology 4246 5459
-> 15 0 24 4094 topology 4110 5460
-> 16 0 24 4094 topology 4112 5460
-> 15 0 24 4094 topology 4221 5461
-> 16 0 24 4094 topology 4223 5461
-> 15 0 23 4094 topology 4190 5462
-> 16 0 23 4094 topology 4246 5462
-> 15 0 24 4094 topology 4113 5463
-> 16 0 24 4094 topology 4115 5463
-> 15 0 23 4094 topology 4142 5464
-> 16 0 23 4094 topology 4246 5464
-> 15 0 24 4094 topology 4116 5465
-> 16 0 24 4094 topology 4118 5465
-> 15 0 23 4094 topology 4226 5466
-> 16 0 23 4094 topology 4246 5466
-> 15 0 24 4094 topology 4200 5467
-> 16 0 24 4094 topology 4202 5467
-> 15 0 24 4094 topology 4119 5468
-> 16 0 24 4094 topology 4121 5468
-> 15 0 23 4094 topology 4178 5469
-> 16 0 23 4094 topology 4246 5469
-> 15 0 24 4094 topology 4179 5470
-> 16 0 24 4094 topology 4181 5470
-> 15 0 24 4094 topology 4134 5471
-> 16 0 24 4094 topology 4135 5471
-> 15 0 24 4094 topology 4242 5472
-> 16 0 24 4094 topology 4243 5472
-> 15 0 23 4094 topology 4097 5473
-> 16 0 23 4094 topology 4246 5473
-> 15 0 24 4094 topology 4167 5474
-> 16 0 24 4094 topology 4168 5474
-> 15 0 23 4094 topology 4162 5475
-> 16 0 23 4094 topology 4246 5475
-> 15 0 23 4094 topology 4222 5476
-> 16 0 23 4094 topology 4246 5476
-> 15 0 23 4094 topology 4144 5477
-> 16 0 23 4094 topology 4246 5477
-> 15 0 24 4094 topology 4200 5478
-> 16 0 24 4094 topology 4201 5478
-> 15 0 23 4094 topology 4204 5479
-> 16 0 23 4094 topology 4246 5479
-> 15 0 23 4094 topology 4121 5480
-> 16 0 23 4094 topology 4246 5480
-> 15 0 24 4094 topology 4233 5481
-> 16 0 24 4094 topology 4234 5481
-> 15 0 24 4094 topology 4158 5482
-> 16 0 24 4094 topology 4160 5482
-> 15 0 24 4094 topology 4137 5483
-> 16 0 24 4094 topology 4139 5483
-> 15 0 23 4094 topology 4111 5484
-> 16 0 23 4094 topology 4246 5484
-> 15 0 23 4094 topology 4133 5485
-> 16 0 23 4094 topology 4246 5485
-> 15 0 23 4094 topology 4217 5486
-> 16 0 23 4094 topology 4246 5486
-> 15 0 24 4094 topology 4224 5487
-> 16 0 24 4094 topology 4226 5487
-> 15 0 23 4094 topology 4169 5488
-> 16 0 23 4094 topology 4246 5488
-> 15 0 24 4094 topology 4098 5489
-> 16 0 24 4094 topology 4099 5489
-> 15 0 23 4094 topology 4205 5490
-> 16 0 23 4094 topology 4246 5490
-> 15 0 24 4094 topology 4203 5491
-> 16 0 24 4094 topology 4205 5491
-> 15 0 24 4094 topology 4131 5492
-> 16 0 24 4094 topology 4132 5492
-> 15 0 23 4094 topology 4241 5493
-> 16 0 23 4094 topology 4246 5493
-> 15 0 24 4094 topology 4164 5494
-> 16 0 24 4094 topology 4165 5494
-> 15 0 23 4094 topology 4129 5495
-> 16 0 23 4094 topology 4246 5495
-> 15 0 24 4094 topology 4110 5496
-> 16 0 24 4094 topology 4111 5496
-> 15 0 23 4094 topology 4189 5497
-> 16 0 23 4094 topology 4246 5497
-> 15 0 24 4094 topology 4197 5498
-> 16 0 24 4094 topology 4198 5498
-> 15 0 23 4094 topology 4171 5499
-> 16 0 23 4094 topology 4246 5499
-> 15 0 23 4094 topology 4112 5500
-> 16 0 23 4094 topology 4246 5500
-> 15 0 23 4094 topology 4231 5501
-> 16 0 23 4094 topology 4246 5501
-> 15 0 24 4094 topology 4230 5502
-> 16 0 24 4094 topology 4231 5502
-> 15 0 24 4094 topology 4182 5503
-> 16 0 24 4094 topology 4184 5503
-> 15 0 23 4094 topology 4096 5504
-> 16 0 23 4094 topology 4246 5504
-> 15 0 24 4094 topology 4161 5505
-> 16 0 24 4094 topology 4163 5505
-> 15 0 23 4094 topology 4124 5506
-> 16 0 23 4094 topology 4246 5506
-> 15 0 23 4094 topology 4160 5507
-> 16 0 23 4094 topology 4246 5507
-> 15 0 24 4094 topology 4140 5508
-> 16 0 24 4094 topology 4142 5508
-> 15 0 23 4094 topology 4244 5509
-> 16 0 23 4094 topology 4246 5509
-> 15 0 23 4094 topology 4120 5510
-> 16 0 23 4094 topology 4246 5510
-> 15 0 23 4094 topology 4196 5511
-> 16 0 23 4094 topology 4246 5511
-> 15 0 24 4094 topology 4227 5512
-> 16 0 24 4094 topology 4229 5512
-> 15 0 23 4094 topology 4148 5513
-> 16 0 23 4094 topology 4246 5513
-> 15 0 23 4094 topology 4232 5514
-> 16 0 23 4094 topology 4246 5514
-> 15 0 24 4094 topology 4128 5515
-> 16 0 24 4094 topology 4129 5515
-> 15 0 24 4094 topology 4206 5516
-> 16 0 24 4094 topology 4208 5516
-> 15 0 24 4094 topology 4161 5517
-> 16 0 24 4094 topology 4162 5517
-> 15 0 23 4094 topology 4156 5518
-> 16 0 23 4094 topology 4246 5518
-> 15 0 23 4094 topology 4216 5519
-> 16 0 23 4094 topology 4246 5519
-> 15 0 24 4094 topology 4194 5520
-> 16 0 24 4094 topology 4195 5520
-> 15 0 23 4094 topology 4138 5521
-> 16 0 23 4094 topology 4246 5521
-> 15 0 23 4094 topology 4103 5522
-> 16 0 23 4094 topology 4246 5522
-> 15 0 23 4094 topology 4198 5523
-> 16 0 23 4094 topology 4246 5523
-> 15 0 24 4094 topology 4227 5524
-> 16 0 24 4094 topology 4228 5524
-> 15 0 23 4094 topology 4180 5525
-> 16 0 23 4094 topology 4246 5525
-> 15 0 23 4094 topology 4240 5526
-> 16 0 23 4094 topology 4246 5526
-> 15 0 24 4094 topology 4185 5527
-> 16 0 24 4094 topology 4187 5527
-> 15 0 23 4094 topology 4105 5528
-> 16 0 23 4094 topology 4246 5528
-> 15 0 24 4094 topology 4164 5529
-> 16 0 24 4094 topology 4166 5529
-> 15 0 23 4094 topology 4187 5530
-> 16 0 23 4094 topology 4246 5530
-> 15 0 23 4094 topology 4139 5531
-> 16 0 23 4094 topology 4246 5531
-> 15 0 24 4094 topology 4095 5532
-> 16 0 24 4094 topology 4096 5532
-> 15 0 23 4094 topology 4223 5533
-> 16 0 23 4094 topology 4246 5533
-> 15 0 24 4094 topology 4143 5534
-> 16 0 24 4094 topology 4145 5534
-> 15 0 24 4094 topology 4125 5535
-> 16 0 24 4094 topology 4126 5535
-> 15 0 23 4094 topology 4175 5536
-> 16 0 23 4094 topology 4246 5536
-> 15 0 24 4094 topology 4230 5537
-> 16 0 24 4094 topology 4232 5537
-> 15 0 23 4094 topology 4211 5538
-> 16 0 23 4094 topology 4246 5538
-> 15 0 24 4094 topology 4158 5539
-> 16 0 24 4094 topology 4159 5539
-> 15 0 23 4094 topology 4123 5540
-> 16 0 23 4094 topology 4246 5540
-> 15 0 24 4094 topology 4107 5541
-> 16 0 24 4094 topology 4108 5541
-> 15 0 24 4094 topology 4209 5542
-> 16 0 24 4094 topology 4211 5542
-> 15 0 24 4094 topology 4191 5543
-> 16 0 24 4094 topology 4192 5543
-> 15 0 23 4094 topology 4183 5544
-> 16 0 23 4094 topology 4246 5544
-> 15 0 23 4094 topology 4243 5545
-> 16 0 23 4094 topology 4246 5545
-> 15 0 23 4094 topology 4165 5546
-> 16 0 23 4094 topology 4246 5546
-> 15 0 24 4094 topology 4224 5547
-> 16 0 24 4094 topology 4225 5547
-> 15 0 23 4094 topology 4225 5548
-> 16 0 23 4094 topology 4246 5548
-> 15 0 23 4094 topology 4147 5549
-> 16 0 23 4094 topology 4246 5549
-> 15 0 24 4094 topology 4119 5550
-> 16 0 24 4094 topology 4120 5550
-> 15 0 23 4094 topology 4207 5551
-> 16 0 23 4094 topology 4246 5551
-> 15 0 24 4094 topology 4149 5552
-> 16 0 24 4094 topology 4150 5552
-> 15 0 23 4094 topology 4118 5553
-> 16 0 23 4094 topology 4246 5553
-> 15 0 24 4094 topology 4122 5554
-> 16 0 24 4094 topology 4124 5554
-> 15 0 24 4094 topology 4188 5555
-> 16 0 24 4094 topology 4190 5555
-> 15 0 23 4248 topology 4260 5556
+> 15 0 23 4094 topology 4114 5450
+> 16 0 23 4094 topology 4246 5450
+> 15 0 23 4094 topology 4118 5451
+> 16 0 23 4094 topology 4246 5451
+> 15 0 23 4094 topology 4117 5452
+> 16 0 23 4094 topology 4246 5452
+> 15 0 23 4094 topology 4121 5453
+> 16 0 23 4094 topology 4246 5453
+> 15 0 23 4094 topology 4120 5454
+> 16 0 23 4094 topology 4246 5454
+> 15 0 24 4094 topology 4245 5455
+> 16 0 24 4094 topology 4246 5455
+> 15 0 25 4094 topology 4122 5456
+> 16 0 25 4094 topology 4124 5456
+> 15 0 25 4094 topology 4122 5457
+> 16 0 25 4094 topology 4123 5457
+> 15 0 25 4094 topology 4125 5458
+> 16 0 25 4094 topology 4127 5458
+> 15 0 25 4094 topology 4125 5459
+> 16 0 25 4094 topology 4126 5459
+> 15 0 25 4094 topology 4128 5460
+> 16 0 25 4094 topology 4130 5460
+> 15 0 25 4094 topology 4128 5461
+> 16 0 25 4094 topology 4129 5461
+> 15 0 25 4094 topology 4131 5462
+> 16 0 25 4094 topology 4133 5462
+> 15 0 25 4094 topology 4131 5463
+> 16 0 25 4094 topology 4132 5463
+> 15 0 25 4094 topology 4134 5464
+> 16 0 25 4094 topology 4136 5464
+> 15 0 25 4094 topology 4134 5465
+> 16 0 25 4094 topology 4135 5465
+> 15 0 25 4094 topology 4137 5466
+> 16 0 25 4094 topology 4139 5466
+> 15 0 25 4094 topology 4137 5467
+> 16 0 25 4094 topology 4138 5467
+> 15 0 25 4094 topology 4140 5468
+> 16 0 25 4094 topology 4142 5468
+> 15 0 25 4094 topology 4140 5469
+> 16 0 25 4094 topology 4141 5469
+> 15 0 25 4094 topology 4143 5470
+> 16 0 25 4094 topology 4145 5470
+> 15 0 25 4094 topology 4143 5471
+> 16 0 25 4094 topology 4144 5471
+> 15 0 25 4094 topology 4146 5472
+> 16 0 25 4094 topology 4148 5472
+> 15 0 25 4094 topology 4146 5473
+> 16 0 25 4094 topology 4147 5473
+> 15 0 25 4094 topology 4149 5474
+> 16 0 25 4094 topology 4151 5474
+> 15 0 25 4094 topology 4149 5475
+> 16 0 25 4094 topology 4150 5475
+> 15 0 25 4094 topology 4095 5476
+> 16 0 25 4094 topology 4097 5476
+> 15 0 25 4094 topology 4095 5477
+> 16 0 25 4094 topology 4096 5477
+> 15 0 25 4094 topology 4152 5478
+> 16 0 25 4094 topology 4154 5478
+> 15 0 25 4094 topology 4152 5479
+> 16 0 25 4094 topology 4153 5479
+> 15 0 25 4094 topology 4155 5480
+> 16 0 25 4094 topology 4157 5480
+> 15 0 25 4094 topology 4155 5481
+> 16 0 25 4094 topology 4156 5481
+> 15 0 25 4094 topology 4158 5482
+> 16 0 25 4094 topology 4160 5482
+> 15 0 25 4094 topology 4158 5483
+> 16 0 25 4094 topology 4159 5483
+> 15 0 25 4094 topology 4161 5484
+> 16 0 25 4094 topology 4163 5484
+> 15 0 25 4094 topology 4161 5485
+> 16 0 25 4094 topology 4162 5485
+> 15 0 25 4094 topology 4164 5486
+> 16 0 25 4094 topology 4166 5486
+> 15 0 25 4094 topology 4164 5487
+> 16 0 25 4094 topology 4165 5487
+> 15 0 25 4094 topology 4167 5488
+> 16 0 25 4094 topology 4169 5488
+> 15 0 25 4094 topology 4167 5489
+> 16 0 25 4094 topology 4168 5489
+> 15 0 25 4094 topology 4170 5490
+> 16 0 25 4094 topology 4172 5490
+> 15 0 25 4094 topology 4170 5491
+> 16 0 25 4094 topology 4171 5491
+> 15 0 25 4094 topology 4173 5492
+> 16 0 25 4094 topology 4175 5492
+> 15 0 25 4094 topology 4173 5493
+> 16 0 25 4094 topology 4174 5493
+> 15 0 25 4094 topology 4176 5494
+> 16 0 25 4094 topology 4178 5494
+> 15 0 25 4094 topology 4176 5495
+> 16 0 25 4094 topology 4177 5495
+> 15 0 25 4094 topology 4179 5496
+> 16 0 25 4094 topology 4181 5496
+> 15 0 25 4094 topology 4179 5497
+> 16 0 25 4094 topology 4180 5497
+> 15 0 25 4094 topology 4098 5498
+> 16 0 25 4094 topology 4100 5498
+> 15 0 25 4094 topology 4098 5499
+> 16 0 25 4094 topology 4099 5499
+> 15 0 25 4094 topology 4182 5500
+> 16 0 25 4094 topology 4184 5500
+> 15 0 25 4094 topology 4182 5501
+> 16 0 25 4094 topology 4183 5501
+> 15 0 25 4094 topology 4185 5502
+> 16 0 25 4094 topology 4187 5502
+> 15 0 25 4094 topology 4185 5503
+> 16 0 25 4094 topology 4186 5503
+> 15 0 25 4094 topology 4188 5504
+> 16 0 25 4094 topology 4190 5504
+> 15 0 25 4094 topology 4188 5505
+> 16 0 25 4094 topology 4189 5505
+> 15 0 25 4094 topology 4191 5506
+> 16 0 25 4094 topology 4193 5506
+> 15 0 25 4094 topology 4191 5507
+> 16 0 25 4094 topology 4192 5507
+> 15 0 25 4094 topology 4194 5508
+> 16 0 25 4094 topology 4196 5508
+> 15 0 25 4094 topology 4194 5509
+> 16 0 25 4094 topology 4195 5509
+> 15 0 25 4094 topology 4197 5510
+> 16 0 25 4094 topology 4199 5510
+> 15 0 25 4094 topology 4197 5511
+> 16 0 25 4094 topology 4198 5511
+> 15 0 25 4094 topology 4200 5512
+> 16 0 25 4094 topology 4202 5512
+> 15 0 25 4094 topology 4200 5513
+> 16 0 25 4094 topology 4201 5513
+> 15 0 25 4094 topology 4203 5514
+> 16 0 25 4094 topology 4205 5514
+> 15 0 25 4094 topology 4203 5515
+> 16 0 25 4094 topology 4204 5515
+> 15 0 25 4094 topology 4206 5516
+> 16 0 25 4094 topology 4208 5516
+> 15 0 25 4094 topology 4206 5517
+> 16 0 25 4094 topology 4207 5517
+> 15 0 25 4094 topology 4209 5518
+> 16 0 25 4094 topology 4211 5518
+> 15 0 25 4094 topology 4209 5519
+> 16 0 25 4094 topology 4210 5519
+> 15 0 25 4094 topology 4101 5520
+> 16 0 25 4094 topology 4103 5520
+> 15 0 25 4094 topology 4101 5521
+> 16 0 25 4094 topology 4102 5521
+> 15 0 25 4094 topology 4212 5522
+> 16 0 25 4094 topology 4214 5522
+> 15 0 25 4094 topology 4212 5523
+> 16 0 25 4094 topology 4213 5523
+> 15 0 25 4094 topology 4215 5524
+> 16 0 25 4094 topology 4217 5524
+> 15 0 25 4094 topology 4215 5525
+> 16 0 25 4094 topology 4216 5525
+> 15 0 25 4094 topology 4218 5526
+> 16 0 25 4094 topology 4220 5526
+> 15 0 25 4094 topology 4218 5527
+> 16 0 25 4094 topology 4219 5527
+> 15 0 25 4094 topology 4221 5528
+> 16 0 25 4094 topology 4223 5528
+> 15 0 25 4094 topology 4221 5529
+> 16 0 25 4094 topology 4222 5529
+> 15 0 25 4094 topology 4224 5530
+> 16 0 25 4094 topology 4226 5530
+> 15 0 25 4094 topology 4224 5531
+> 16 0 25 4094 topology 4225 5531
+> 15 0 25 4094 topology 4227 5532
+> 16 0 25 4094 topology 4229 5532
+> 15 0 25 4094 topology 4227 5533
+> 16 0 25 4094 topology 4228 5533
+> 15 0 25 4094 topology 4230 5534
+> 16 0 25 4094 topology 4232 5534
+> 15 0 25 4094 topology 4230 5535
+> 16 0 25 4094 topology 4231 5535
+> 15 0 25 4094 topology 4233 5536
+> 16 0 25 4094 topology 4235 5536
+> 15 0 25 4094 topology 4233 5537
+> 16 0 25 4094 topology 4234 5537
+> 15 0 25 4094 topology 4236 5538
+> 16 0 25 4094 topology 4238 5538
+> 15 0 25 4094 topology 4236 5539
+> 16 0 25 4094 topology 4237 5539
+> 15 0 25 4094 topology 4239 5540
+> 16 0 25 4094 topology 4241 5540
+> 15 0 25 4094 topology 4239 5541
+> 16 0 25 4094 topology 4240 5541
+> 15 0 25 4094 topology 4104 5542
+> 16 0 25 4094 topology 4106 5542
+> 15 0 25 4094 topology 4104 5543
+> 16 0 25 4094 topology 4105 5543
+> 15 0 25 4094 topology 4242 5544
+> 16 0 25 4094 topology 4244 5544
+> 15 0 25 4094 topology 4242 5545
+> 16 0 25 4094 topology 4243 5545
+> 15 0 25 4094 topology 4107 5546
+> 16 0 25 4094 topology 4109 5546
+> 15 0 25 4094 topology 4107 5547
+> 16 0 25 4094 topology 4108 5547
+> 15 0 25 4094 topology 4110 5548
+> 16 0 25 4094 topology 4112 5548
+> 15 0 25 4094 topology 4110 5549
+> 16 0 25 4094 topology 4111 5549
+> 15 0 25 4094 topology 4113 5550
+> 16 0 25 4094 topology 4115 5550
+> 15 0 25 4094 topology 4113 5551
+> 16 0 25 4094 topology 4114 5551
+> 15 0 25 4094 topology 4116 5552
+> 16 0 25 4094 topology 4118 5552
+> 15 0 25 4094 topology 4116 5553
+> 16 0 25 4094 topology 4117 5553
+> 15 0 25 4094 topology 4119 5554
+> 16 0 25 4094 topology 4121 5554
+> 15 0 25 4094 topology 4119 5555
+> 16 0 25 4094 topology 4120 5555
+> 15 0 23 4248 topology 4278 5556
 > 16 0 23 4248 topology 4385 5556
-> 15 0 23 4248 topology 4295 5557
+> 15 0 23 4248 topology 4277 5557
 > 16 0 23 4248 topology 4385 5557
-> 15 0 24 4248 topology 4297 5558
-> 16 0 24 4248 topology 4298 5558
-> 15 0 24 4248 topology 4351 5559
-> 16 0 24 4248 topology 4352 5559
-> 15 0 23 4248 topology 4325 5560
+> 15 0 23 4248 topology 4281 5558
+> 16 0 23 4248 topology 4385 5558
+> 15 0 23 4248 topology 4280 5559
+> 16 0 23 4248 topology 4385 5559
+> 15 0 23 4248 topology 4284 5560
 > 16 0 23 4248 topology 4385 5560
-> 15 0 24 4248 topology 4300 5561
-> 16 0 24 4248 topology 4301 5561
-> 15 0 24 4248 topology 4354 5562
-> 16 0 24 4248 topology 4355 5562
-> 15 0 23 4248 topology 4355 5563
+> 15 0 23 4248 topology 4283 5561
+> 16 0 23 4248 topology 4385 5561
+> 15 0 23 4248 topology 4287 5562
+> 16 0 23 4248 topology 4385 5562
+> 15 0 23 4248 topology 4286 5563
 > 16 0 23 4248 topology 4385 5563
-> 15 0 23 4248 topology 4272 5564
+> 15 0 23 4248 topology 4290 5564
 > 16 0 23 4248 topology 4385 5564
-> 15 0 24 4248 topology 4303 5565
-> 16 0 24 4248 topology 4304 5565
-> 15 0 24 4248 topology 4357 5566
-> 16 0 24 4248 topology 4358 5566
-> 15 0 24 4248 topology 4276 5567
-> 16 0 24 4248 topology 4278 5567
-> 15 0 24 4248 topology 4360 5568
-> 16 0 24 4248 topology 4361 5568
-> 15 0 24 4248 topology 4252 5569
-> 16 0 24 4248 topology 4254 5569
-> 15 0 24 4248 topology 4306 5570
-> 16 0 24 4248 topology 4308 5570
-> 15 0 24 4248 topology 4363 5571
-> 16 0 24 4248 topology 4364 5571
-> 15 0 24 4248 topology 4282 5572
-> 16 0 24 4248 topology 4284 5572
-> 15 0 24 4248 topology 4336 5573
-> 16 0 24 4248 topology 4338 5573
-> 15 0 24 4248 topology 4312 5574
-> 16 0 24 4248 topology 4314 5574
-> 15 0 24 4248 topology 4366 5575
-> 16 0 24 4248 topology 4368 5575
-> 15 0 23 4248 topology 4256 5576
+> 15 0 23 4248 topology 4289 5565
+> 16 0 23 4248 topology 4385 5565
+> 15 0 23 4248 topology 4293 5566
+> 16 0 23 4248 topology 4385 5566
+> 15 0 23 4248 topology 4292 5567
+> 16 0 23 4248 topology 4385 5567
+> 15 0 23 4248 topology 4296 5568
+> 16 0 23 4248 topology 4385 5568
+> 15 0 23 4248 topology 4295 5569
+> 16 0 23 4248 topology 4385 5569
+> 15 0 23 4248 topology 4299 5570
+> 16 0 23 4248 topology 4385 5570
+> 15 0 23 4248 topology 4298 5571
+> 16 0 23 4248 topology 4385 5571
+> 15 0 23 4248 topology 4302 5572
+> 16 0 23 4248 topology 4385 5572
+> 15 0 23 4248 topology 4301 5573
+> 16 0 23 4248 topology 4385 5573
+> 15 0 23 4248 topology 4305 5574
+> 16 0 23 4248 topology 4385 5574
+> 15 0 23 4248 topology 4304 5575
+> 16 0 23 4248 topology 4385 5575
+> 15 0 23 4248 topology 4251 5576
 > 16 0 23 4248 topology 4385 5576
-> 15 0 23 4248 topology 4278 5577
+> 15 0 23 4248 topology 4250 5577
 > 16 0 23 4248 topology 4385 5577
-> 15 0 24 4248 topology 4288 5578
-> 16 0 24 4248 topology 4290 5578
-> 15 0 24 4248 topology 4342 5579
-> 16 0 24 4248 topology 4344 5579
-> 15 0 24 4248 topology 4264 5580
-> 16 0 24 4248 topology 4266 5580
-> 15 0 24 4248 topology 4318 5581
-> 16 0 24 4248 topology 4320 5581
-> 15 0 23 4248 topology 4338 5582
+> 15 0 23 4248 topology 4308 5578
+> 16 0 23 4248 topology 4385 5578
+> 15 0 23 4248 topology 4307 5579
+> 16 0 23 4248 topology 4385 5579
+> 15 0 23 4248 topology 4311 5580
+> 16 0 23 4248 topology 4385 5580
+> 15 0 23 4248 topology 4310 5581
+> 16 0 23 4248 topology 4385 5581
+> 15 0 23 4248 topology 4314 5582
 > 16 0 23 4248 topology 4385 5582
-> 15 0 24 4248 topology 4372 5583
-> 16 0 24 4248 topology 4374 5583
-> 15 0 23 4248 topology 4268 5584
+> 15 0 23 4248 topology 4313 5583
+> 16 0 23 4248 topology 4385 5583
+> 15 0 23 4248 topology 4317 5584
 > 16 0 23 4248 topology 4385 5584
-> 15 0 23 4248 topology 4314 5585
+> 15 0 23 4248 topology 4316 5585
 > 16 0 23 4248 topology 4385 5585
-> 15 0 23 4248 topology 4290 5586
+> 15 0 23 4248 topology 4320 5586
 > 16 0 23 4248 topology 4385 5586
-> 15 0 24 4248 topology 4294 5587
-> 16 0 24 4248 topology 4296 5587
-> 15 0 24 4248 topology 4348 5588
-> 16 0 24 4248 topology 4350 5588
-> 15 0 23 4248 topology 4374 5589
+> 15 0 23 4248 topology 4319 5587
+> 16 0 23 4248 topology 4385 5587
+> 15 0 23 4248 topology 4323 5588
+> 16 0 23 4248 topology 4385 5588
+> 15 0 23 4248 topology 4322 5589
 > 16 0 23 4248 topology 4385 5589
-> 15 0 24 4248 topology 4324 5590
-> 16 0 24 4248 topology 4326 5590
-> 15 0 23 4248 topology 4350 5591
+> 15 0 23 4248 topology 4326 5590
+> 16 0 23 4248 topology 4385 5590
+> 15 0 23 4248 topology 4325 5591
 > 16 0 23 4248 topology 4385 5591
-> 15 0 24 4248 topology 4378 5592
-> 16 0 24 4248 topology 4380 5592
-> 15 0 24 4248 topology 4252 5593
-> 16 0 24 4248 topology 4253 5593
-> 15 0 23 4248 topology 4326 5594
+> 15 0 23 4248 topology 4329 5592
+> 16 0 23 4248 topology 4385 5592
+> 15 0 23 4248 topology 4328 5593
+> 16 0 23 4248 topology 4385 5593
+> 15 0 23 4248 topology 4332 5594
 > 16 0 23 4248 topology 4385 5594
-> 15 0 24 4248 topology 4300 5595
-> 16 0 24 4248 topology 4302 5595
-> 15 0 23 4248 topology 4302 5596
+> 15 0 23 4248 topology 4331 5595
+> 16 0 23 4248 topology 4385 5595
+> 15 0 23 4248 topology 4335 5596
 > 16 0 23 4248 topology 4385 5596
-> 15 0 24 4248 topology 4354 5597
-> 16 0 24 4248 topology 4356 5597
-> 15 0 24 4248 topology 4330 5598
-> 16 0 24 4248 topology 4332 5598
-> 15 0 23 4248 topology 4362 5599
+> 15 0 23 4248 topology 4334 5597
+> 16 0 23 4248 topology 4385 5597
+> 15 0 23 4248 topology 4254 5598
+> 16 0 23 4248 topology 4385 5598
+> 15 0 23 4248 topology 4253 5599
 > 16 0 23 4248 topology 4385 5599
-> 15 0 24 4248 topology 4360 5600
-> 16 0 24 4248 topology 4362 5600
-> 15 0 23 4248 topology 4280 5601
+> 15 0 23 4248 topology 4338 5600
+> 16 0 23 4248 topology 4385 5600
+> 15 0 23 4248 topology 4337 5601
 > 16 0 23 4248 topology 4385 5601
-> 15 0 24 4248 topology 4264 5602
-> 16 0 24 4248 topology 4265 5602
-> 15 0 23 4248 topology 4310 5603
+> 15 0 23 4248 topology 4341 5602
+> 16 0 23 4248 topology 4385 5602
+> 15 0 23 4248 topology 4340 5603
 > 16 0 23 4248 topology 4385 5603
-> 15 0 23 4248 topology 4251 5604
+> 15 0 23 4248 topology 4344 5604
 > 16 0 23 4248 topology 4385 5604
-> 15 0 23 4248 topology 4340 5605
+> 15 0 23 4248 topology 4343 5605
 > 16 0 23 4248 topology 4385 5605
-> 15 0 23 4248 topology 4370 5606
+> 15 0 23 4248 topology 4347 5606
 > 16 0 23 4248 topology 4385 5606
-> 15 0 23 4248 topology 4292 5607
+> 15 0 23 4248 topology 4346 5607
 > 16 0 23 4248 topology 4385 5607
-> 15 0 23 4248 topology 4322 5608
+> 15 0 23 4248 topology 4350 5608
 > 16 0 23 4248 topology 4385 5608
-> 15 0 23 4248 topology 4263 5609
+> 15 0 23 4248 topology 4349 5609
 > 16 0 23 4248 topology 4385 5609
-> 15 0 23 4248 topology 4352 5610
+> 15 0 23 4248 topology 4353 5610
 > 16 0 23 4248 topology 4385 5610
-> 15 0 23 4248 topology 4382 5611
+> 15 0 23 4248 topology 4352 5611
 > 16 0 23 4248 topology 4385 5611
-> 15 0 23 4248 topology 4304 5612
+> 15 0 23 4248 topology 4356 5612
 > 16 0 23 4248 topology 4385 5612
-> 15 0 23 4248 topology 4334 5613
+> 15 0 23 4248 topology 4355 5613
 > 16 0 23 4248 topology 4385 5613
-> 15 0 23 4248 topology 4275 5614
+> 15 0 23 4248 topology 4359 5614
 > 16 0 23 4248 topology 4385 5614
-> 15 0 23 4248 topology 4364 5615
+> 15 0 23 4248 topology 4358 5615
 > 16 0 23 4248 topology 4385 5615
-> 15 0 24 4248 topology 4255 5616
-> 16 0 24 4248 topology 4257 5616
-> 15 0 23 4248 topology 4253 5617
+> 15 0 23 4248 topology 4362 5616
+> 16 0 23 4248 topology 4385 5616
+> 15 0 23 4248 topology 4361 5617
 > 16 0 23 4248 topology 4385 5617
-> 15 0 23 4248 topology 4281 5618
+> 15 0 23 4248 topology 4365 5618
 > 16 0 23 4248 topology 4385 5618
-> 15 0 23 4248 topology 4265 5619
+> 15 0 23 4248 topology 4364 5619
 > 16 0 23 4248 topology 4385 5619
-> 15 0 23 4248 topology 4341 5620
+> 15 0 23 4248 topology 4257 5620
 > 16 0 23 4248 topology 4385 5620
-> 15 0 24 4248 topology 4267 5621
-> 16 0 24 4248 topology 4269 5621
-> 15 0 23 4248 topology 4317 5622
+> 15 0 23 4248 topology 4256 5621
+> 16 0 23 4248 topology 4385 5621
+> 15 0 23 4248 topology 4368 5622
 > 16 0 23 4248 topology 4385 5622
-> 15 0 24 4248 topology 4249 5623
-> 16 0 24 4248 topology 4250 5623
-> 15 0 23 4248 topology 4293 5624
+> 15 0 23 4248 topology 4367 5623
+> 16 0 23 4248 topology 4385 5623
+> 15 0 23 4248 topology 4371 5624
 > 16 0 23 4248 topology 4385 5624
-> 15 0 23 4248 topology 4377 5625
+> 15 0 23 4248 topology 4370 5625
 > 16 0 23 4248 topology 4385 5625
-> 15 0 24 4248 topology 4306 5626
-> 16 0 24 4248 topology 4307 5626
-> 15 0 23 4248 topology 4353 5627
+> 15 0 23 4248 topology 4374 5626
+> 16 0 23 4248 topology 4385 5626
+> 15 0 23 4248 topology 4373 5627
 > 16 0 23 4248 topology 4385 5627
-> 15 0 23 4248 topology 4329 5628
+> 15 0 23 4248 topology 4377 5628
 > 16 0 23 4248 topology 4385 5628
-> 15 0 23 4248 topology 4305 5629
+> 15 0 23 4248 topology 4376 5629
 > 16 0 23 4248 topology 4385 5629
-> 15 0 24 4248 topology 4309 5630
-> 16 0 24 4248 topology 4310 5630
-> 15 0 24 4248 topology 4312 5631
-> 16 0 24 4248 topology 4313 5631
-> 15 0 23 4248 topology 4365 5632
+> 15 0 23 4248 topology 4380 5630
+> 16 0 23 4248 topology 4385 5630
+> 15 0 23 4248 topology 4379 5631
+> 16 0 23 4248 topology 4385 5631
+> 15 0 23 4248 topology 4383 5632
 > 16 0 23 4248 topology 4385 5632
-> 15 0 24 4248 topology 4366 5633
-> 16 0 24 4248 topology 4367 5633
-> 15 0 24 4248 topology 4261 5634
-> 16 0 24 4248 topology 4262 5634
-> 15 0 23 4248 topology 4277 5635
+> 15 0 23 4248 topology 4382 5633
+> 16 0 23 4248 topology 4385 5633
+> 15 0 23 4248 topology 4260 5634
+> 16 0 23 4248 topology 4385 5634
+> 15 0 23 4248 topology 4259 5635
 > 16 0 23 4248 topology 4385 5635
-> 15 0 24 4248 topology 4315 5636
-> 16 0 24 4248 topology 4316 5636
-> 15 0 24 4248 topology 4369 5637
-> 16 0 24 4248 topology 4370 5637
-> 15 0 23 4248 topology 4307 5638
+> 15 0 23 4248 topology 4263 5636
+> 16 0 23 4248 topology 4385 5636
+> 15 0 23 4248 topology 4262 5637
+> 16 0 23 4248 topology 4385 5637
+> 15 0 23 4248 topology 4266 5638
 > 16 0 23 4248 topology 4385 5638
-> 15 0 24 4248 topology 4318 5639
-> 16 0 24 4248 topology 4319 5639
-> 15 0 23 4248 topology 4337 5640
+> 15 0 23 4248 topology 4265 5639
+> 16 0 23 4248 topology 4385 5639
+> 15 0 23 4248 topology 4269 5640
 > 16 0 23 4248 topology 4385 5640
-> 15 0 24 4248 topology 4372 5641
-> 16 0 24 4248 topology 4373 5641
-> 15 0 23 4248 topology 4367 5642
+> 15 0 23 4248 topology 4268 5641
+> 16 0 23 4248 topology 4385 5641
+> 15 0 23 4248 topology 4272 5642
 > 16 0 23 4248 topology 4385 5642
-> 15 0 23 4248 topology 4254 5643
+> 15 0 23 4248 topology 4271 5643
 > 16 0 23 4248 topology 4385 5643
-> 15 0 23 4248 topology 4289 5644
+> 15 0 23 4248 topology 4275 5644
 > 16 0 23 4248 topology 4385 5644
-> 15 0 24 4248 topology 4321 5645
-> 16 0 24 4248 topology 4322 5645
-> 15 0 24 4248 topology 4375 5646
-> 16 0 24 4248 topology 4376 5646
-> 15 0 23 4248 topology 4319 5647
-> 16 0 23 4248 topology 4385 5647
-> 15 0 24 4248 topology 4324 5648
-> 16 0 24 4248 topology 4325 5648
-> 15 0 23 4248 topology 4349 5649
-> 16 0 23 4248 topology 4385 5649
-> 15 0 24 4248 topology 4378 5650
-> 16 0 24 4248 topology 4379 5650
-> 15 0 23 4248 topology 4379 5651
-> 16 0 23 4248 topology 4385 5651
-> 15 0 23 4248 topology 4266 5652
-> 16 0 23 4248 topology 4385 5652
-> 15 0 24 4248 topology 4273 5653
-> 16 0 24 4248 topology 4274 5653
-> 15 0 23 4248 topology 4301 5654
-> 16 0 23 4248 topology 4385 5654
-> 15 0 24 4248 topology 4327 5655
-> 16 0 24 4248 topology 4328 5655
-> 15 0 24 4248 topology 4381 5656
-> 16 0 24 4248 topology 4382 5656
-> 15 0 23 4248 topology 4331 5657
-> 16 0 23 4248 topology 4385 5657
-> 15 0 24 4248 topology 4330 5658
-> 16 0 24 4248 topology 4331 5658
-> 15 0 23 4248 topology 4361 5659
-> 16 0 23 4248 topology 4385 5659
-> 15 0 24 4248 topology 4333 5660
-> 16 0 24 4248 topology 4334 5660
-> 15 0 24 4248 topology 4279 5661
-> 16 0 24 4248 topology 4281 5661
-> 15 0 24 4248 topology 4309 5662
-> 16 0 24 4248 topology 4311 5662
-> 15 0 23 4248 topology 4250 5663
-> 16 0 23 4248 topology 4385 5663
-> 15 0 24 4248 topology 4258 5664
-> 16 0 24 4248 topology 4260 5664
-> 15 0 24 4248 topology 4285 5665
-> 16 0 24 4248 topology 4287 5665
-> 15 0 24 4248 topology 4339 5666
-> 16 0 24 4248 topology 4341 5666
-> 15 0 24 4248 topology 4315 5667
-> 16 0 24 4248 topology 4317 5667
-> 15 0 24 4248 topology 4369 5668
-> 16 0 24 4248 topology 4371 5668
-> 15 0 23 4248 topology 4262 5669
-> 16 0 23 4248 topology 4385 5669
-> 15 0 23 4248 topology 4308 5670
-> 16 0 23 4248 topology 4385 5670
-> 15 0 23 4248 topology 4284 5671
-> 16 0 23 4248 topology 4385 5671
-> 15 0 24 4248 topology 4291 5672
-> 16 0 24 4248 topology 4293 5672
-> 15 0 24 4248 topology 4345 5673
-> 16 0 24 4248 topology 4347 5673
-> 15 0 23 4248 topology 4368 5674
-> 16 0 23 4248 topology 4385 5674
-> 15 0 24 4248 topology 4321 5675
-> 16 0 24 4248 topology 4323 5675
-> 15 0 23 4248 topology 4344 5676
-> 16 0 23 4248 topology 4385 5676
-> 15 0 24 4248 topology 4375 5677
-> 16 0 24 4248 topology 4377 5677
-> 15 0 23 4248 topology 4274 5678
-> 16 0 23 4248 topology 4385 5678
-> 15 0 23 4248 topology 4320 5679
-> 16 0 23 4248 topology 4385 5679
-> 15 0 24 4248 topology 4270 5680
-> 16 0 24 4248 topology 4272 5680
-> 15 0 23 4248 topology 4296 5681
-> 16 0 23 4248 topology 4385 5681
-> 15 0 24 4248 topology 4297 5682
-> 16 0 24 4248 topology 4299 5682
-> 15 0 24 4248 topology 4351 5683
-> 16 0 24 4248 topology 4353 5683
-> 15 0 23 4248 topology 4380 5684
-> 16 0 23 4248 topology 4385 5684
-> 15 0 24 4248 topology 4327 5685
-> 16 0 24 4248 topology 4329 5685
-> 15 0 23 4248 topology 4356 5686
-> 16 0 23 4248 topology 4385 5686
-> 15 0 24 4248 topology 4381 5687
-> 16 0 24 4248 topology 4383 5687
-> 15 0 23 4248 topology 4332 5688
-> 16 0 23 4248 topology 4385 5688
-> 15 0 24 4248 topology 4303 5689
-> 16 0 24 4248 topology 4305 5689
-> 15 0 24 4248 topology 4357 5690
-> 16 0 24 4248 topology 4359 5690
-> 15 0 24 4248 topology 4258 5691
-> 16 0 24 4248 topology 4259 5691
-> 15 0 24 4248 topology 4333 5692
-> 16 0 24 4248 topology 4335 5692
-> 15 0 24 4248 topology 4363 5693
-> 16 0 24 4248 topology 4365 5693
-> 15 0 23 4248 topology 4286 5694
-> 16 0 23 4248 topology 4385 5694
-> 15 0 23 4248 topology 4316 5695
-> 16 0 23 4248 topology 4385 5695
-> 15 0 23 4248 topology 4257 5696
-> 16 0 23 4248 topology 4385 5696
-> 15 0 23 4248 topology 4346 5697
-> 16 0 23 4248 topology 4385 5697
-> 15 0 24 4248 topology 4270 5698
-> 16 0 24 4248 topology 4271 5698
-> 15 0 23 4248 topology 4376 5699
-> 16 0 23 4248 topology 4385 5699
-> 15 0 23 4248 topology 4298 5700
-> 16 0 23 4248 topology 4385 5700
-> 15 0 23 4248 topology 4328 5701
-> 16 0 23 4248 topology 4385 5701
-> 15 0 23 4248 topology 4269 5702
-> 16 0 23 4248 topology 4385 5702
-> 15 0 23 4248 topology 4358 5703
-> 16 0 23 4248 topology 4385 5703
-> 15 0 24 4248 topology 4249 5704
-> 16 0 24 4248 topology 4251 5704
-> 15 0 25 4248 topology 4384 5705
-> 16 0 25 4248 topology 4385 5705
-> 15 0 23 4248 topology 4259 5706
-> 16 0 23 4248 topology 4385 5706
-> 15 0 24 4248 topology 4261 5707
-> 16 0 24 4248 topology 4263 5707
-> 15 0 23 4248 topology 4311 5708
-> 16 0 23 4248 topology 4385 5708
-> 15 0 23 4248 topology 4287 5709
-> 16 0 23 4248 topology 4385 5709
-> 15 0 23 4248 topology 4271 5710
-> 16 0 23 4248 topology 4385 5710
-> 15 0 23 4248 topology 4371 5711
-> 16 0 23 4248 topology 4385 5711
-> 15 0 24 4248 topology 4276 5712
-> 16 0 24 4248 topology 4277 5712
-> 15 0 23 4248 topology 4347 5713
-> 16 0 23 4248 topology 4385 5713
-> 15 0 23 4248 topology 4323 5714
-> 16 0 23 4248 topology 4385 5714
-> 15 0 24 4248 topology 4279 5715
-> 16 0 24 4248 topology 4280 5715
-> 15 0 23 4248 topology 4299 5716
-> 16 0 23 4248 topology 4385 5716
-> 15 0 24 4248 topology 4273 5717
-> 16 0 24 4248 topology 4275 5717
-> 15 0 23 4248 topology 4383 5718
-> 16 0 23 4248 topology 4385 5718
-> 15 0 24 4248 topology 4255 5719
-> 16 0 24 4248 topology 4256 5719
-> 15 0 24 4248 topology 4282 5720
-> 16 0 24 4248 topology 4283 5720
-> 15 0 24 4248 topology 4336 5721
-> 16 0 24 4248 topology 4337 5721
-> 15 0 23 4248 topology 4359 5722
-> 16 0 23 4248 topology 4385 5722
-> 15 0 23 4248 topology 4335 5723
-> 16 0 23 4248 topology 4385 5723
-> 15 0 24 4248 topology 4285 5724
-> 16 0 24 4248 topology 4286 5724
-> 15 0 24 4248 topology 4339 5725
-> 16 0 24 4248 topology 4340 5725
-> 15 0 24 4248 topology 4288 5726
-> 16 0 24 4248 topology 4289 5726
-> 15 0 24 4248 topology 4342 5727
-> 16 0 24 4248 topology 4343 5727
-> 15 0 23 4248 topology 4283 5728
-> 16 0 23 4248 topology 4385 5728
-> 15 0 24 4248 topology 4291 5729
-> 16 0 24 4248 topology 4292 5729
-> 15 0 24 4248 topology 4345 5730
-> 16 0 24 4248 topology 4346 5730
-> 15 0 23 4248 topology 4313 5731
-> 16 0 23 4248 topology 4385 5731
-> 15 0 24 4248 topology 4267 5732
-> 16 0 24 4248 topology 4268 5732
-> 15 0 24 4248 topology 4294 5733
-> 16 0 24 4248 topology 4295 5733
-> 15 0 23 4248 topology 4343 5734
-> 16 0 23 4248 topology 4385 5734
-> 15 0 24 4248 topology 4348 5735
-> 16 0 24 4248 topology 4349 5735
-> 15 0 23 4248 topology 4373 5736
-> 16 0 23 4248 topology 4385 5736
-> 15 0 27 3921 topology 4091 5737
-> 16 0 27 3921 topology 4093 5737
-> 15 0 21 3921 topology 4093 5738
-> 16 0 21 3921 topology 4386 5738
-> 15 0 26 3921 topology 4093 5739
+> 15 0 23 4248 topology 4274 5645
+> 16 0 23 4248 topology 4385 5645
+> 15 0 24 4248 topology 4384 5646
+> 16 0 24 4248 topology 4385 5646
+> 15 0 25 4248 topology 4276 5647
+> 16 0 25 4248 topology 4278 5647
+> 15 0 25 4248 topology 4276 5648
+> 16 0 25 4248 topology 4277 5648
+> 15 0 25 4248 topology 4279 5649
+> 16 0 25 4248 topology 4281 5649
+> 15 0 25 4248 topology 4279 5650
+> 16 0 25 4248 topology 4280 5650
+> 15 0 25 4248 topology 4282 5651
+> 16 0 25 4248 topology 4284 5651
+> 15 0 25 4248 topology 4282 5652
+> 16 0 25 4248 topology 4283 5652
+> 15 0 25 4248 topology 4285 5653
+> 16 0 25 4248 topology 4287 5653
+> 15 0 25 4248 topology 4285 5654
+> 16 0 25 4248 topology 4286 5654
+> 15 0 25 4248 topology 4288 5655
+> 16 0 25 4248 topology 4290 5655
+> 15 0 25 4248 topology 4288 5656
+> 16 0 25 4248 topology 4289 5656
+> 15 0 25 4248 topology 4291 5657
+> 16 0 25 4248 topology 4293 5657
+> 15 0 25 4248 topology 4291 5658
+> 16 0 25 4248 topology 4292 5658
+> 15 0 25 4248 topology 4294 5659
+> 16 0 25 4248 topology 4296 5659
+> 15 0 25 4248 topology 4294 5660
+> 16 0 25 4248 topology 4295 5660
+> 15 0 25 4248 topology 4297 5661
+> 16 0 25 4248 topology 4299 5661
+> 15 0 25 4248 topology 4297 5662
+> 16 0 25 4248 topology 4298 5662
+> 15 0 25 4248 topology 4300 5663
+> 16 0 25 4248 topology 4302 5663
+> 15 0 25 4248 topology 4300 5664
+> 16 0 25 4248 topology 4301 5664
+> 15 0 25 4248 topology 4303 5665
+> 16 0 25 4248 topology 4305 5665
+> 15 0 25 4248 topology 4303 5666
+> 16 0 25 4248 topology 4304 5666
+> 15 0 25 4248 topology 4249 5667
+> 16 0 25 4248 topology 4251 5667
+> 15 0 25 4248 topology 4249 5668
+> 16 0 25 4248 topology 4250 5668
+> 15 0 25 4248 topology 4306 5669
+> 16 0 25 4248 topology 4308 5669
+> 15 0 25 4248 topology 4306 5670
+> 16 0 25 4248 topology 4307 5670
+> 15 0 25 4248 topology 4309 5671
+> 16 0 25 4248 topology 4311 5671
+> 15 0 25 4248 topology 4309 5672
+> 16 0 25 4248 topology 4310 5672
+> 15 0 25 4248 topology 4312 5673
+> 16 0 25 4248 topology 4314 5673
+> 15 0 25 4248 topology 4312 5674
+> 16 0 25 4248 topology 4313 5674
+> 15 0 25 4248 topology 4315 5675
+> 16 0 25 4248 topology 4317 5675
+> 15 0 25 4248 topology 4315 5676
+> 16 0 25 4248 topology 4316 5676
+> 15 0 25 4248 topology 4318 5677
+> 16 0 25 4248 topology 4320 5677
+> 15 0 25 4248 topology 4318 5678
+> 16 0 25 4248 topology 4319 5678
+> 15 0 25 4248 topology 4321 5679
+> 16 0 25 4248 topology 4323 5679
+> 15 0 25 4248 topology 4321 5680
+> 16 0 25 4248 topology 4322 5680
+> 15 0 25 4248 topology 4324 5681
+> 16 0 25 4248 topology 4326 5681
+> 15 0 25 4248 topology 4324 5682
+> 16 0 25 4248 topology 4325 5682
+> 15 0 25 4248 topology 4327 5683
+> 16 0 25 4248 topology 4329 5683
+> 15 0 25 4248 topology 4327 5684
+> 16 0 25 4248 topology 4328 5684
+> 15 0 25 4248 topology 4330 5685
+> 16 0 25 4248 topology 4332 5685
+> 15 0 25 4248 topology 4330 5686
+> 16 0 25 4248 topology 4331 5686
+> 15 0 25 4248 topology 4333 5687
+> 16 0 25 4248 topology 4335 5687
+> 15 0 25 4248 topology 4333 5688
+> 16 0 25 4248 topology 4334 5688
+> 15 0 25 4248 topology 4252 5689
+> 16 0 25 4248 topology 4254 5689
+> 15 0 25 4248 topology 4252 5690
+> 16 0 25 4248 topology 4253 5690
+> 15 0 25 4248 topology 4336 5691
+> 16 0 25 4248 topology 4338 5691
+> 15 0 25 4248 topology 4336 5692
+> 16 0 25 4248 topology 4337 5692
+> 15 0 25 4248 topology 4339 5693
+> 16 0 25 4248 topology 4341 5693
+> 15 0 25 4248 topology 4339 5694
+> 16 0 25 4248 topology 4340 5694
+> 15 0 25 4248 topology 4342 5695
+> 16 0 25 4248 topology 4344 5695
+> 15 0 25 4248 topology 4342 5696
+> 16 0 25 4248 topology 4343 5696
+> 15 0 25 4248 topology 4345 5697
+> 16 0 25 4248 topology 4347 5697
+> 15 0 25 4248 topology 4345 5698
+> 16 0 25 4248 topology 4346 5698
+> 15 0 25 4248 topology 4348 5699
+> 16 0 25 4248 topology 4350 5699
+> 15 0 25 4248 topology 4348 5700
+> 16 0 25 4248 topology 4349 5700
+> 15 0 25 4248 topology 4351 5701
+> 16 0 25 4248 topology 4353 5701
+> 15 0 25 4248 topology 4351 5702
+> 16 0 25 4248 topology 4352 5702
+> 15 0 25 4248 topology 4354 5703
+> 16 0 25 4248 topology 4356 5703
+> 15 0 25 4248 topology 4354 5704
+> 16 0 25 4248 topology 4355 5704
+> 15 0 25 4248 topology 4357 5705
+> 16 0 25 4248 topology 4359 5705
+> 15 0 25 4248 topology 4357 5706
+> 16 0 25 4248 topology 4358 5706
+> 15 0 25 4248 topology 4360 5707
+> 16 0 25 4248 topology 4362 5707
+> 15 0 25 4248 topology 4360 5708
+> 16 0 25 4248 topology 4361 5708
+> 15 0 25 4248 topology 4363 5709
+> 16 0 25 4248 topology 4365 5709
+> 15 0 25 4248 topology 4363 5710
+> 16 0 25 4248 topology 4364 5710
+> 15 0 25 4248 topology 4255 5711
+> 16 0 25 4248 topology 4257 5711
+> 15 0 25 4248 topology 4255 5712
+> 16 0 25 4248 topology 4256 5712
+> 15 0 25 4248 topology 4366 5713
+> 16 0 25 4248 topology 4368 5713
+> 15 0 25 4248 topology 4366 5714
+> 16 0 25 4248 topology 4367 5714
+> 15 0 25 4248 topology 4369 5715
+> 16 0 25 4248 topology 4371 5715
+> 15 0 25 4248 topology 4369 5716
+> 16 0 25 4248 topology 4370 5716
+> 15 0 25 4248 topology 4372 5717
+> 16 0 25 4248 topology 4374 5717
+> 15 0 25 4248 topology 4372 5718
+> 16 0 25 4248 topology 4373 5718
+> 15 0 25 4248 topology 4375 5719
+> 16 0 25 4248 topology 4377 5719
+> 15 0 25 4248 topology 4375 5720
+> 16 0 25 4248 topology 4376 5720
+> 15 0 25 4248 topology 4378 5721
+> 16 0 25 4248 topology 4380 5721
+> 15 0 25 4248 topology 4378 5722
+> 16 0 25 4248 topology 4379 5722
+> 15 0 25 4248 topology 4381 5723
+> 16 0 25 4248 topology 4383 5723
+> 15 0 25 4248 topology 4381 5724
+> 16 0 25 4248 topology 4382 5724
+> 15 0 25 4248 topology 4258 5725
+> 16 0 25 4248 topology 4260 5725
+> 15 0 25 4248 topology 4258 5726
+> 16 0 25 4248 topology 4259 5726
+> 15 0 25 4248 topology 4261 5727
+> 16 0 25 4248 topology 4263 5727
+> 15 0 25 4248 topology 4261 5728
+> 16 0 25 4248 topology 4262 5728
+> 15 0 25 4248 topology 4264 5729
+> 16 0 25 4248 topology 4266 5729
+> 15 0 25 4248 topology 4264 5730
+> 16 0 25 4248 topology 4265 5730
+> 15 0 25 4248 topology 4267 5731
+> 16 0 25 4248 topology 4269 5731
+> 15 0 25 4248 topology 4267 5732
+> 16 0 25 4248 topology 4268 5732
+> 15 0 25 4248 topology 4270 5733
+> 16 0 25 4248 topology 4272 5733
+> 15 0 25 4248 topology 4270 5734
+> 16 0 25 4248 topology 4271 5734
+> 15 0 25 4248 topology 4273 5735
+> 16 0 25 4248 topology 4275 5735
+> 15 0 25 4248 topology 4273 5736
+> 16 0 25 4248 topology 4274 5736
+> 15 0 26 3921 topology 4093 5737
+> 16 0 26 3921 topology 4388 5737
+> 15 0 26 3921 topology 4247 5738
+> 16 0 26 3921 topology 4388 5738
+> 15 0 26 3921 topology 4386 5739
 > 16 0 26 3921 topology 4388 5739
-> 15 0 26 3921 topology 4386 5740
-> 16 0 26 3921 topology 4388 5740
-> 15 0 21 3921 topology 4093 5741
-> 16 0 21 3921 topology 4247 5741
-> 15 0 26 3921 topology 4247 5742
-> 16 0 26 3921 topology 4388 5742
-> 15 0 26 3921 topology 4247 5743
-> 16 0 26 3921 topology 4245 5743
-> 15 0 26 3921 topology 4386 5744
-> 16 0 26 3921 topology 4384 5744
-> 15 0 21 3921 topology 4247 5745
-> 16 0 21 3921 topology 4386 5745
-> 15 0 23 4391 topology 4508 5746
+> 15 0 27 3921 topology 4091 5740
+> 16 0 27 3921 topology 4093 5740
+> 15 0 20 3921 topology 4093 5741
+> 16 0 20 3921 topology 4247 5741
+> 15 0 20 3921 topology 4093 5742
+> 16 0 20 3921 topology 4386 5742
+> 15 0 20 3921 topology 4247 5743
+> 16 0 20 3921 topology 4386 5743
+> 15 0 26 3921 topology 4247 5744
+> 16 0 26 3921 topology 4245 5744
+> 15 0 26 3921 topology 4386 5745
+> 16 0 26 3921 topology 4384 5745
+> 15 0 23 4391 topology 4421 5746
 > 16 0 23 4391 topology 4633 5746
-> 15 0 24 4391 topology 4536 5747
-> 16 0 24 4391 topology 4538 5747
-> 15 0 23 4391 topology 4592 5748
+> 15 0 23 4391 topology 4420 5747
+> 16 0 23 4391 topology 4633 5747
+> 15 0 23 4391 topology 4424 5748
 > 16 0 23 4391 topology 4633 5748
-> 15 0 23 4391 topology 4450 5749
+> 15 0 23 4391 topology 4423 5749
 > 16 0 23 4391 topology 4633 5749
-> 15 0 23 4391 topology 4628 5750
+> 15 0 23 4391 topology 4427 5750
 > 16 0 23 4391 topology 4633 5750
-> 15 0 23 4391 topology 4510 5751
+> 15 0 23 4391 topology 4426 5751
 > 16 0 23 4391 topology 4633 5751
-> 15 0 23 4391 topology 4432 5752
+> 15 0 23 4391 topology 4430 5752
 > 16 0 23 4391 topology 4633 5752
-> 15 0 23 4391 topology 4570 5753
+> 15 0 23 4391 topology 4429 5753
 > 16 0 23 4391 topology 4633 5753
-> 15 0 23 4391 topology 4492 5754
+> 15 0 23 4391 topology 4433 5754
 > 16 0 23 4391 topology 4633 5754
-> 15 0 23 4391 topology 4630 5755
+> 15 0 23 4391 topology 4432 5755
 > 16 0 23 4391 topology 4633 5755
-> 15 0 23 4391 topology 4409 5756
+> 15 0 23 4391 topology 4436 5756
 > 16 0 23 4391 topology 4633 5756
-> 15 0 23 4391 topology 4552 5757
+> 15 0 23 4391 topology 4435 5757
 > 16 0 23 4391 topology 4633 5757
-> 15 0 23 4391 topology 4474 5758
+> 15 0 23 4391 topology 4439 5758
 > 16 0 23 4391 topology 4633 5758
-> 15 0 23 4391 topology 4612 5759
+> 15 0 23 4391 topology 4438 5759
 > 16 0 23 4391 topology 4633 5759
-> 15 0 23 4391 topology 4534 5760
+> 15 0 23 4391 topology 4442 5760
 > 16 0 23 4391 topology 4633 5760
-> 15 0 23 4391 topology 4594 5761
+> 15 0 23 4391 topology 4441 5761
 > 16 0 23 4391 topology 4633 5761
-> 15 0 24 4391 topology 4404 5762
-> 16 0 24 4391 topology 4406 5762
-> 15 0 23 4391 topology 4405 5763
+> 15 0 23 4391 topology 4445 5762
+> 16 0 23 4391 topology 4633 5762
+> 15 0 23 4391 topology 4444 5763
 > 16 0 23 4391 topology 4633 5763
-> 15 0 23 4391 topology 4427 5764
+> 15 0 23 4391 topology 4448 5764
 > 16 0 23 4391 topology 4633 5764
-> 15 0 23 4391 topology 4511 5765
+> 15 0 23 4391 topology 4447 5765
 > 16 0 23 4391 topology 4633 5765
-> 15 0 24 4391 topology 4425 5766
-> 16 0 24 4391 topology 4426 5766
-> 15 0 23 4391 topology 4463 5767
+> 15 0 23 4391 topology 4394 5766
+> 16 0 23 4391 topology 4633 5766
+> 15 0 23 4391 topology 4393 5767
 > 16 0 23 4391 topology 4633 5767
-> 15 0 23 4391 topology 4547 5768
+> 15 0 23 4391 topology 4451 5768
 > 16 0 23 4391 topology 4633 5768
-> 15 0 24 4391 topology 4455 5769
-> 16 0 24 4391 topology 4456 5769
-> 15 0 23 4391 topology 4631 5770
+> 15 0 23 4391 topology 4450 5769
+> 16 0 23 4391 topology 4633 5769
+> 15 0 23 4391 topology 4454 5770
 > 16 0 23 4391 topology 4633 5770
-> 15 0 23 4391 topology 4499 5771
+> 15 0 23 4391 topology 4453 5771
 > 16 0 23 4391 topology 4633 5771
-> 15 0 24 4391 topology 4485 5772
-> 16 0 24 4391 topology 4486 5772
-> 15 0 23 4391 topology 4583 5773
+> 15 0 23 4391 topology 4457 5772
+> 16 0 23 4391 topology 4633 5772
+> 15 0 23 4391 topology 4456 5773
 > 16 0 23 4391 topology 4633 5773
-> 15 0 24 4391 topology 4515 5774
-> 16 0 24 4391 topology 4516 5774
-> 15 0 23 4391 topology 4535 5775
+> 15 0 23 4391 topology 4460 5774
+> 16 0 23 4391 topology 4633 5774
+> 15 0 23 4391 topology 4459 5775
 > 16 0 23 4391 topology 4633 5775
-> 15 0 23 4391 topology 4619 5776
+> 15 0 23 4391 topology 4463 5776
 > 16 0 23 4391 topology 4633 5776
-> 15 0 24 4391 topology 4410 5777
-> 16 0 24 4391 topology 4411 5777
-> 15 0 24 4391 topology 4437 5778
-> 16 0 24 4391 topology 4438 5778
-> 15 0 24 4391 topology 4545 5779
-> 16 0 24 4391 topology 4546 5779
-> 15 0 24 4391 topology 4467 5780
-> 16 0 24 4391 topology 4468 5780
-> 15 0 24 4391 topology 4575 5781
-> 16 0 24 4391 topology 4576 5781
-> 15 0 23 4391 topology 4459 5782
+> 15 0 23 4391 topology 4462 5777
+> 16 0 23 4391 topology 4633 5777
+> 15 0 23 4391 topology 4466 5778
+> 16 0 23 4391 topology 4633 5778
+> 15 0 23 4391 topology 4465 5779
+> 16 0 23 4391 topology 4633 5779
+> 15 0 23 4391 topology 4469 5780
+> 16 0 23 4391 topology 4633 5780
+> 15 0 23 4391 topology 4468 5781
+> 16 0 23 4391 topology 4633 5781
+> 15 0 23 4391 topology 4472 5782
 > 16 0 23 4391 topology 4633 5782
-> 15 0 24 4391 topology 4497 5783
-> 16 0 24 4391 topology 4498 5783
-> 15 0 24 4391 topology 4605 5784
-> 16 0 24 4391 topology 4606 5784
-> 15 0 23 4391 topology 4400 5785
+> 15 0 23 4391 topology 4471 5783
+> 16 0 23 4391 topology 4633 5783
+> 15 0 23 4391 topology 4475 5784
+> 16 0 23 4391 topology 4633 5784
+> 15 0 23 4391 topology 4474 5785
 > 16 0 23 4391 topology 4633 5785
-> 15 0 23 4391 topology 4519 5786
+> 15 0 23 4391 topology 4478 5786
 > 16 0 23 4391 topology 4633 5786
-> 15 0 24 4391 topology 4527 5787
-> 16 0 24 4391 topology 4528 5787
-> 15 0 24 4391 topology 4419 5788
-> 16 0 24 4391 topology 4421 5788
-> 15 0 23 4391 topology 4441 5789
+> 15 0 23 4391 topology 4477 5787
+> 16 0 23 4391 topology 4633 5787
+> 15 0 23 4391 topology 4397 5788
+> 16 0 23 4391 topology 4633 5788
+> 15 0 23 4391 topology 4396 5789
 > 16 0 23 4391 topology 4633 5789
-> 15 0 24 4391 topology 4557 5790
-> 16 0 24 4391 topology 4558 5790
-> 15 0 23 4391 topology 4579 5791
+> 15 0 23 4391 topology 4481 5790
+> 16 0 23 4391 topology 4633 5790
+> 15 0 23 4391 topology 4480 5791
 > 16 0 23 4391 topology 4633 5791
-> 15 0 24 4391 topology 4422 5792
-> 16 0 24 4391 topology 4424 5792
-> 15 0 23 4391 topology 4501 5793
+> 15 0 23 4391 topology 4484 5792
+> 16 0 23 4391 topology 4633 5792
+> 15 0 23 4391 topology 4483 5793
 > 16 0 23 4391 topology 4633 5793
-> 15 0 24 4391 topology 4587 5794
-> 16 0 24 4391 topology 4588 5794
-> 15 0 24 4391 topology 4425 5795
-> 16 0 24 4391 topology 4427 5795
-> 15 0 23 4391 topology 4561 5796
+> 15 0 23 4391 topology 4487 5794
+> 16 0 23 4391 topology 4633 5794
+> 15 0 23 4391 topology 4486 5795
+> 16 0 23 4391 topology 4633 5795
+> 15 0 23 4391 topology 4490 5796
 > 16 0 23 4391 topology 4633 5796
-> 15 0 24 4391 topology 4617 5797
-> 16 0 24 4391 topology 4618 5797
-> 15 0 24 4391 topology 4401 5798
-> 16 0 24 4391 topology 4403 5798
-> 15 0 24 4391 topology 4428 5799
-> 16 0 24 4391 topology 4430 5799
-> 15 0 23 4391 topology 4621 5800
+> 15 0 23 4391 topology 4489 5797
+> 16 0 23 4391 topology 4633 5797
+> 15 0 23 4391 topology 4493 5798
+> 16 0 23 4391 topology 4633 5798
+> 15 0 23 4391 topology 4492 5799
+> 16 0 23 4391 topology 4633 5799
+> 15 0 23 4391 topology 4496 5800
 > 16 0 23 4391 topology 4633 5800
-> 15 0 24 4391 topology 4431 5801
-> 16 0 24 4391 topology 4433 5801
-> 15 0 24 4391 topology 4539 5802
-> 16 0 24 4391 topology 4541 5802
-> 15 0 24 4391 topology 4434 5803
-> 16 0 24 4391 topology 4436 5803
-> 15 0 24 4391 topology 4542 5804
-> 16 0 24 4391 topology 4544 5804
-> 15 0 24 4391 topology 4437 5805
-> 16 0 24 4391 topology 4439 5805
-> 15 0 24 4391 topology 4545 5806
-> 16 0 24 4391 topology 4547 5806
-> 15 0 24 4391 topology 4440 5807
-> 16 0 24 4391 topology 4442 5807
-> 15 0 23 4391 topology 4454 5808
+> 15 0 23 4391 topology 4495 5801
+> 16 0 23 4391 topology 4633 5801
+> 15 0 23 4391 topology 4499 5802
+> 16 0 23 4391 topology 4633 5802
+> 15 0 23 4391 topology 4498 5803
+> 16 0 23 4391 topology 4633 5803
+> 15 0 23 4391 topology 4502 5804
+> 16 0 23 4391 topology 4633 5804
+> 15 0 23 4391 topology 4501 5805
+> 16 0 23 4391 topology 4633 5805
+> 15 0 23 4391 topology 4505 5806
+> 16 0 23 4391 topology 4633 5806
+> 15 0 23 4391 topology 4504 5807
+> 16 0 23 4391 topology 4633 5807
+> 15 0 23 4391 topology 4508 5808
 > 16 0 23 4391 topology 4633 5808
-> 15 0 24 4391 topology 4548 5809
-> 16 0 24 4391 topology 4550 5809
-> 15 0 23 4391 topology 4414 5810
+> 15 0 23 4391 topology 4507 5809
+> 16 0 23 4391 topology 4633 5809
+> 15 0 23 4391 topology 4400 5810
 > 16 0 23 4391 topology 4633 5810
-> 15 0 24 4391 topology 4443 5811
-> 16 0 24 4391 topology 4445 5811
-> 15 0 24 4391 topology 4551 5812
-> 16 0 24 4391 topology 4553 5812
-> 15 0 23 4391 topology 4490 5813
+> 15 0 23 4391 topology 4399 5811
+> 16 0 23 4391 topology 4633 5811
+> 15 0 23 4391 topology 4511 5812
+> 16 0 23 4391 topology 4633 5812
+> 15 0 23 4391 topology 4510 5813
 > 16 0 23 4391 topology 4633 5813
-> 15 0 24 4391 topology 4446 5814
-> 16 0 24 4391 topology 4448 5814
-> 15 0 24 4391 topology 4554 5815
-> 16 0 24 4391 topology 4556 5815
-> 15 0 23 4391 topology 4574 5816
+> 15 0 23 4391 topology 4514 5814
+> 16 0 23 4391 topology 4633 5814
+> 15 0 23 4391 topology 4513 5815
+> 16 0 23 4391 topology 4633 5815
+> 15 0 23 4391 topology 4517 5816
 > 16 0 23 4391 topology 4633 5816
-> 15 0 24 4391 topology 4401 5817
-> 16 0 24 4391 topology 4402 5817
-> 15 0 23 4391 topology 4442 5818
+> 15 0 23 4391 topology 4516 5817
+> 16 0 23 4391 topology 4633 5817
+> 15 0 23 4391 topology 4520 5818
 > 16 0 23 4391 topology 4633 5818
-> 15 0 23 4391 topology 4526 5819
+> 15 0 23 4391 topology 4519 5819
 > 16 0 23 4391 topology 4633 5819
-> 15 0 24 4391 topology 4557 5820
-> 16 0 24 4391 topology 4559 5820
-> 15 0 23 4391 topology 4610 5821
+> 15 0 23 4391 topology 4523 5820
+> 16 0 23 4391 topology 4633 5820
+> 15 0 23 4391 topology 4522 5821
 > 16 0 23 4391 topology 4633 5821
-> 15 0 23 4391 topology 4478 5822
+> 15 0 23 4391 topology 4526 5822
 > 16 0 23 4391 topology 4633 5822
-> 15 0 24 4391 topology 4560 5823
-> 16 0 24 4391 topology 4562 5823
-> 15 0 23 4391 topology 4562 5824
+> 15 0 23 4391 topology 4525 5823
+> 16 0 23 4391 topology 4633 5823
+> 15 0 23 4391 topology 4529 5824
 > 16 0 23 4391 topology 4633 5824
-> 15 0 24 4391 topology 4563 5825
-> 16 0 24 4391 topology 4565 5825
-> 15 0 24 4391 topology 4566 5826
-> 16 0 24 4391 topology 4568 5826
-> 15 0 23 4391 topology 4598 5827
+> 15 0 23 4391 topology 4528 5825
+> 16 0 23 4391 topology 4633 5825
+> 15 0 23 4391 topology 4532 5826
+> 16 0 23 4391 topology 4633 5826
+> 15 0 23 4391 topology 4531 5827
 > 16 0 23 4391 topology 4633 5827
-> 15 0 23 4391 topology 4426 5828
+> 15 0 23 4391 topology 4535 5828
 > 16 0 23 4391 topology 4633 5828
-> 15 0 23 4391 topology 4486 5829
+> 15 0 23 4391 topology 4534 5829
 > 16 0 23 4391 topology 4633 5829
-> 15 0 23 4391 topology 4546 5830
+> 15 0 23 4391 topology 4538 5830
 > 16 0 23 4391 topology 4633 5830
-> 15 0 23 4391 topology 4468 5831
+> 15 0 23 4391 topology 4537 5831
 > 16 0 23 4391 topology 4633 5831
-> 15 0 23 4391 topology 4606 5832
+> 15 0 23 4391 topology 4403 5832
 > 16 0 23 4391 topology 4633 5832
-> 15 0 23 4391 topology 4528 5833
+> 15 0 23 4391 topology 4402 5833
 > 16 0 23 4391 topology 4633 5833
-> 15 0 23 4391 topology 4415 5834
+> 15 0 23 4391 topology 4541 5834
 > 16 0 23 4391 topology 4633 5834
-> 15 0 24 4391 topology 4398 5835
-> 16 0 24 4391 topology 4400 5835
-> 15 0 23 4391 topology 4588 5836
+> 15 0 23 4391 topology 4540 5835
+> 16 0 23 4391 topology 4633 5835
+> 15 0 23 4391 topology 4544 5836
 > 16 0 23 4391 topology 4633 5836
-> 15 0 23 4391 topology 4399 5837
+> 15 0 23 4391 topology 4543 5837
 > 16 0 23 4391 topology 4633 5837
-> 15 0 24 4391 topology 4392 5838
-> 16 0 24 4391 topology 4393 5838
-> 15 0 23 4391 topology 4481 5839
+> 15 0 23 4391 topology 4547 5838
+> 16 0 23 4391 topology 4633 5838
+> 15 0 23 4391 topology 4546 5839
 > 16 0 23 4391 topology 4633 5839
-> 15 0 24 4391 topology 4422 5840
-> 16 0 24 4391 topology 4423 5840
-> 15 0 23 4391 topology 4433 5841
+> 15 0 23 4391 topology 4550 5840
+> 16 0 23 4391 topology 4633 5840
+> 15 0 23 4391 topology 4549 5841
 > 16 0 23 4391 topology 4633 5841
-> 15 0 24 4391 topology 4452 5842
-> 16 0 24 4391 topology 4453 5842
-> 15 0 23 4391 topology 4517 5843
+> 15 0 23 4391 topology 4553 5842
+> 16 0 23 4391 topology 4633 5842
+> 15 0 23 4391 topology 4552 5843
 > 16 0 23 4391 topology 4633 5843
-> 15 0 23 4391 topology 4601 5844
+> 15 0 23 4391 topology 4556 5844
 > 16 0 23 4391 topology 4633 5844
-> 15 0 23 4391 topology 4469 5845
+> 15 0 23 4391 topology 4555 5845
 > 16 0 23 4391 topology 4633 5845
-> 15 0 24 4391 topology 4482 5846
-> 16 0 24 4391 topology 4483 5846
-> 15 0 23 4391 topology 4553 5847
+> 15 0 23 4391 topology 4559 5846
+> 16 0 23 4391 topology 4633 5846
+> 15 0 23 4391 topology 4558 5847
 > 16 0 23 4391 topology 4633 5847
-> 15 0 24 4391 topology 4512 5848
-> 16 0 24 4391 topology 4513 5848
-> 15 0 23 4391 topology 4505 5849
+> 15 0 23 4391 topology 4562 5848
+> 16 0 23 4391 topology 4633 5848
+> 15 0 23 4391 topology 4561 5849
 > 16 0 23 4391 topology 4633 5849
-> 15 0 24 4391 topology 4434 5850
-> 16 0 24 4391 topology 4435 5850
-> 15 0 24 4391 topology 4542 5851
-> 16 0 24 4391 topology 4543 5851
-> 15 0 23 4391 topology 4589 5852
+> 15 0 23 4391 topology 4565 5850
+> 16 0 23 4391 topology 4633 5850
+> 15 0 23 4391 topology 4564 5851
+> 16 0 23 4391 topology 4633 5851
+> 15 0 23 4391 topology 4568 5852
 > 16 0 23 4391 topology 4633 5852
-> 15 0 24 4391 topology 4464 5853
-> 16 0 24 4391 topology 4465 5853
-> 15 0 24 4391 topology 4572 5854
-> 16 0 24 4391 topology 4573 5854
-> 15 0 23 4391 topology 4625 5855
+> 15 0 23 4391 topology 4567 5853
+> 16 0 23 4391 topology 4633 5853
+> 15 0 23 4391 topology 4406 5854
+> 16 0 23 4391 topology 4633 5854
+> 15 0 23 4391 topology 4405 5855
 > 16 0 23 4391 topology 4633 5855
-> 15 0 23 4391 topology 4453 5856
+> 15 0 23 4391 topology 4571 5856
 > 16 0 23 4391 topology 4633 5856
-> 15 0 24 4391 topology 4494 5857
-> 16 0 24 4391 topology 4495 5857
-> 15 0 24 4391 topology 4602 5858
-> 16 0 24 4391 topology 4603 5858
-> 15 0 24 4391 topology 4416 5859
-> 16 0 24 4391 topology 4417 5859
-> 15 0 23 4391 topology 4513 5860
+> 15 0 23 4391 topology 4570 5857
+> 16 0 23 4391 topology 4633 5857
+> 15 0 23 4391 topology 4574 5858
+> 16 0 23 4391 topology 4633 5858
+> 15 0 23 4391 topology 4573 5859
+> 16 0 23 4391 topology 4633 5859
+> 15 0 23 4391 topology 4577 5860
 > 16 0 23 4391 topology 4633 5860
-> 15 0 24 4391 topology 4524 5861
-> 16 0 24 4391 topology 4525 5861
-> 15 0 23 4391 topology 4435 5862
+> 15 0 23 4391 topology 4576 5861
+> 16 0 23 4391 topology 4633 5861
+> 15 0 23 4391 topology 4580 5862
 > 16 0 23 4391 topology 4633 5862
-> 15 0 24 4391 topology 4446 5863
-> 16 0 24 4391 topology 4447 5863
-> 15 0 24 4391 topology 4554 5864
-> 16 0 24 4391 topology 4555 5864
-> 15 0 23 4391 topology 4573 5865
+> 15 0 23 4391 topology 4579 5863
+> 16 0 23 4391 topology 4633 5863
+> 15 0 23 4391 topology 4583 5864
+> 16 0 23 4391 topology 4633 5864
+> 15 0 23 4391 topology 4582 5865
 > 16 0 23 4391 topology 4633 5865
-> 15 0 23 4391 topology 4406 5866
+> 15 0 23 4391 topology 4586 5866
 > 16 0 23 4391 topology 4633 5866
-> 15 0 23 4391 topology 4495 5867
+> 15 0 23 4391 topology 4585 5867
 > 16 0 23 4391 topology 4633 5867
-> 15 0 24 4391 topology 4476 5868
-> 16 0 24 4391 topology 4477 5868
-> 15 0 24 4391 topology 4584 5869
-> 16 0 24 4391 topology 4585 5869
-> 15 0 24 4391 topology 4395 5870
-> 16 0 24 4391 topology 4397 5870
-> 15 0 24 4391 topology 4449 5871
-> 16 0 24 4391 topology 4451 5871
-> 15 0 23 4391 topology 4555 5872
+> 15 0 23 4391 topology 4589 5868
+> 16 0 23 4391 topology 4633 5868
+> 15 0 23 4391 topology 4588 5869
+> 16 0 23 4391 topology 4633 5869
+> 15 0 23 4391 topology 4592 5870
+> 16 0 23 4391 topology 4633 5870
+> 15 0 23 4391 topology 4591 5871
+> 16 0 23 4391 topology 4633 5871
+> 15 0 23 4391 topology 4595 5872
 > 16 0 23 4391 topology 4633 5872
-> 15 0 23 4391 topology 4477 5873
+> 15 0 23 4391 topology 4594 5873
 > 16 0 23 4391 topology 4633 5873
-> 15 0 24 4391 topology 4506 5874
-> 16 0 24 4391 topology 4507 5874
-> 15 0 24 4391 topology 4614 5875
-> 16 0 24 4391 topology 4615 5875
-> 15 0 24 4391 topology 4452 5876
-> 16 0 24 4391 topology 4454 5876
-> 15 0 23 4391 topology 4615 5877
+> 15 0 23 4391 topology 4598 5874
+> 16 0 23 4391 topology 4633 5874
+> 15 0 23 4391 topology 4597 5875
+> 16 0 23 4391 topology 4633 5875
+> 15 0 23 4391 topology 4409 5876
+> 16 0 23 4391 topology 4633 5876
+> 15 0 23 4391 topology 4408 5877
 > 16 0 23 4391 topology 4633 5877
-> 15 0 24 4391 topology 4536 5878
-> 16 0 24 4391 topology 4537 5878
-> 15 0 23 4391 topology 4537 5879
+> 15 0 23 4391 topology 4601 5878
+> 16 0 23 4391 topology 4633 5878
+> 15 0 23 4391 topology 4600 5879
 > 16 0 23 4391 topology 4633 5879
-> 15 0 24 4391 topology 4455 5880
-> 16 0 24 4391 topology 4457 5880
-> 15 0 24 4391 topology 4566 5881
-> 16 0 24 4391 topology 4567 5881
-> 15 0 23 4391 topology 4597 5882
+> 15 0 23 4391 topology 4604 5880
+> 16 0 23 4391 topology 4633 5880
+> 15 0 23 4391 topology 4603 5881
+> 16 0 23 4391 topology 4633 5881
+> 15 0 23 4391 topology 4607 5882
 > 16 0 23 4391 topology 4633 5882
-> 15 0 24 4391 topology 4458 5883
-> 16 0 24 4391 topology 4460 5883
-> 15 0 24 4391 topology 4596 5884
-> 16 0 24 4391 topology 4597 5884
-> 15 0 24 4391 topology 4461 5885
-> 16 0 24 4391 topology 4463 5885
-> 15 0 24 4391 topology 4569 5886
-> 16 0 24 4391 topology 4571 5886
-> 15 0 24 4391 topology 4626 5887
-> 16 0 24 4391 topology 4627 5887
-> 15 0 24 4391 topology 4464 5888
-> 16 0 24 4391 topology 4466 5888
-> 15 0 24 4391 topology 4572 5889
-> 16 0 24 4391 topology 4574 5889
-> 15 0 23 4391 topology 4424 5890
+> 15 0 23 4391 topology 4606 5883
+> 16 0 23 4391 topology 4633 5883
+> 15 0 23 4391 topology 4610 5884
+> 16 0 23 4391 topology 4633 5884
+> 15 0 23 4391 topology 4609 5885
+> 16 0 23 4391 topology 4633 5885
+> 15 0 23 4391 topology 4613 5886
+> 16 0 23 4391 topology 4633 5886
+> 15 0 23 4391 topology 4612 5887
+> 16 0 23 4391 topology 4633 5887
+> 15 0 23 4391 topology 4616 5888
+> 16 0 23 4391 topology 4633 5888
+> 15 0 23 4391 topology 4615 5889
+> 16 0 23 4391 topology 4633 5889
+> 15 0 23 4391 topology 4619 5890
 > 16 0 23 4391 topology 4633 5890
-> 15 0 23 4391 topology 4408 5891
+> 15 0 23 4391 topology 4618 5891
 > 16 0 23 4391 topology 4633 5891
-> 15 0 24 4391 topology 4467 5892
-> 16 0 24 4391 topology 4469 5892
-> 15 0 24 4391 topology 4575 5893
-> 16 0 24 4391 topology 4577 5893
-> 15 0 23 4391 topology 4460 5894
+> 15 0 23 4391 topology 4622 5892
+> 16 0 23 4391 topology 4633 5892
+> 15 0 23 4391 topology 4621 5893
+> 16 0 23 4391 topology 4633 5893
+> 15 0 23 4391 topology 4625 5894
 > 16 0 23 4391 topology 4633 5894
-> 15 0 24 4391 topology 4470 5895
-> 16 0 24 4391 topology 4472 5895
-> 15 0 24 4391 topology 4578 5896
-> 16 0 24 4391 topology 4580 5896
-> 15 0 23 4391 topology 4544 5897
+> 15 0 23 4391 topology 4624 5895
+> 16 0 23 4391 topology 4633 5895
+> 15 0 23 4391 topology 4628 5896
+> 16 0 23 4391 topology 4633 5896
+> 15 0 23 4391 topology 4627 5897
 > 16 0 23 4391 topology 4633 5897
-> 15 0 24 4391 topology 4473 5898
-> 16 0 24 4391 topology 4475 5898
-> 15 0 24 4391 topology 4581 5899
-> 16 0 24 4391 topology 4583 5899
-> 15 0 23 4391 topology 4496 5900
+> 15 0 23 4391 topology 4412 5898
+> 16 0 23 4391 topology 4633 5898
+> 15 0 23 4391 topology 4411 5899
+> 16 0 23 4391 topology 4633 5899
+> 15 0 23 4391 topology 4631 5900
 > 16 0 23 4391 topology 4633 5900
-> 15 0 24 4391 topology 4476 5901
-> 16 0 24 4391 topology 4478 5901
-> 15 0 23 4391 topology 4580 5902
+> 15 0 23 4391 topology 4630 5901
+> 16 0 23 4391 topology 4633 5901
+> 15 0 23 4391 topology 4415 5902
 > 16 0 23 4391 topology 4633 5902
-> 15 0 24 4391 topology 4584 5903
-> 16 0 24 4391 topology 4586 5903
-> 15 0 23 4391 topology 4448 5904
+> 15 0 23 4391 topology 4414 5903
+> 16 0 23 4391 topology 4633 5903
+> 15 0 23 4391 topology 4418 5904
 > 16 0 23 4391 topology 4633 5904
-> 15 0 23 4391 topology 4532 5905
+> 15 0 23 4391 topology 4417 5905
 > 16 0 23 4391 topology 4633 5905
-> 15 0 24 4391 topology 4587 5906
-> 16 0 24 4391 topology 4589 5906
-> 15 0 24 4391 topology 4407 5907
-> 16 0 24 4391 topology 4408 5907
-> 15 0 23 4391 topology 4616 5908
-> 16 0 23 4391 topology 4633 5908
-> 15 0 24 4391 topology 4590 5909
-> 16 0 24 4391 topology 4592 5909
-> 15 0 23 4391 topology 4420 5910
-> 16 0 23 4391 topology 4633 5910
-> 15 0 23 4391 topology 4568 5911
-> 16 0 23 4391 topology 4633 5911
-> 15 0 24 4391 topology 4593 5912
-> 16 0 24 4391 topology 4595 5912
-> 15 0 23 4391 topology 4480 5913
-> 16 0 23 4391 topology 4633 5913
-> 15 0 24 4391 topology 4596 5914
-> 16 0 24 4391 topology 4598 5914
-> 15 0 23 4391 topology 4540 5915
-> 16 0 23 4391 topology 4633 5915
-> 15 0 23 4391 topology 4397 5916
-> 16 0 23 4391 topology 4633 5916
-> 15 0 23 4391 topology 4462 5917
-> 16 0 23 4391 topology 4633 5917
-> 15 0 23 4391 topology 4600 5918
-> 16 0 23 4391 topology 4633 5918
-> 15 0 23 4391 topology 4522 5919
-> 16 0 23 4391 topology 4633 5919
-> 15 0 24 4391 topology 4392 5920
-> 16 0 24 4391 topology 4394 5920
-> 15 0 23 4391 topology 4444 5921
-> 16 0 23 4391 topology 4633 5921
-> 15 0 23 4391 topology 4582 5922
-> 16 0 23 4391 topology 4633 5922
-> 15 0 23 4391 topology 4504 5923
-> 16 0 23 4391 topology 4633 5923
-> 15 0 23 4391 topology 4564 5924
-> 16 0 23 4391 topology 4633 5924
-> 15 0 23 4391 topology 4624 5925
-> 16 0 23 4391 topology 4633 5925
-> 15 0 23 4391 topology 4393 5926
-> 16 0 23 4391 topology 4633 5926
-> 15 0 23 4391 topology 4451 5927
-> 16 0 23 4391 topology 4633 5927
-> 15 0 24 4391 topology 4419 5928
-> 16 0 24 4391 topology 4420 5928
-> 15 0 24 4391 topology 4449 5929
-> 16 0 24 4391 topology 4450 5929
-> 15 0 23 4391 topology 4487 5930
-> 16 0 23 4391 topology 4633 5930
-> 15 0 24 4391 topology 4416 5931
-> 16 0 24 4391 topology 4418 5931
-> 15 0 24 4391 topology 4479 5932
-> 16 0 24 4391 topology 4480 5932
-> 15 0 23 4391 topology 4417 5933
-> 16 0 23 4391 topology 4633 5933
-> 15 0 24 4391 topology 4398 5934
-> 16 0 24 4391 topology 4399 5934
-> 15 0 23 4391 topology 4571 5935
-> 16 0 23 4391 topology 4633 5935
-> 15 0 23 4391 topology 4439 5936
-> 16 0 23 4391 topology 4633 5936
-> 15 0 23 4391 topology 4523 5937
-> 16 0 23 4391 topology 4633 5937
-> 15 0 24 4391 topology 4509 5938
-> 16 0 24 4391 topology 4510 5938
-> 15 0 23 4391 topology 4607 5939
-> 16 0 23 4391 topology 4633 5939
-> 15 0 24 4391 topology 4539 5940
-> 16 0 24 4391 topology 4540 5940
-> 15 0 23 4391 topology 4475 5941
-> 16 0 23 4391 topology 4633 5941
-> 15 0 24 4391 topology 4431 5942
-> 16 0 24 4391 topology 4432 5942
-> 15 0 23 4391 topology 4559 5943
-> 16 0 23 4391 topology 4633 5943
-> 15 0 24 4391 topology 4461 5944
-> 16 0 24 4391 topology 4462 5944
-> 15 0 24 4391 topology 4569 5945
-> 16 0 24 4391 topology 4570 5945
-> 15 0 24 4391 topology 4491 5946
-> 16 0 24 4391 topology 4492 5946
-> 15 0 23 4391 topology 4595 5947
-> 16 0 23 4391 topology 4633 5947
-> 15 0 24 4391 topology 4599 5948
-> 16 0 24 4391 topology 4600 5948
-> 15 0 24 4391 topology 4521 5949
-> 16 0 24 4391 topology 4522 5949
-> 15 0 24 4391 topology 4629 5950
-> 16 0 24 4391 topology 4630 5950
-> 15 0 23 4391 topology 4429 5951
-> 16 0 23 4391 topology 4633 5951
-> 15 0 24 4391 topology 4551 5952
-> 16 0 24 4391 topology 4552 5952
-> 15 0 24 4391 topology 4443 5953
-> 16 0 24 4391 topology 4444 5953
-> 15 0 23 4391 topology 4489 5954
-> 16 0 23 4391 topology 4633 5954
-> 15 0 24 4391 topology 4473 5955
-> 16 0 24 4391 topology 4474 5955
-> 15 0 24 4391 topology 4581 5956
-> 16 0 24 4391 topology 4582 5956
-> 15 0 23 4391 topology 4549 5957
-> 16 0 23 4391 topology 4633 5957
-> 15 0 24 4391 topology 4503 5958
-> 16 0 24 4391 topology 4504 5958
-> 15 0 23 4391 topology 4471 5959
-> 16 0 23 4391 topology 4633 5959
-> 15 0 24 4391 topology 4611 5960
-> 16 0 24 4391 topology 4612 5960
-> 15 0 23 4391 topology 4412 5961
-> 16 0 23 4391 topology 4633 5961
-> 15 0 23 4391 topology 4609 5962
-> 16 0 23 4391 topology 4633 5962
-> 15 0 24 4391 topology 4533 5963
-> 16 0 24 4391 topology 4534 5963
-> 15 0 23 4391 topology 4531 5964
-> 16 0 23 4391 topology 4633 5964
-> 15 0 24 4391 topology 4479 5965
-> 16 0 24 4391 topology 4481 5965
-> 15 0 24 4391 topology 4563 5966
-> 16 0 24 4391 topology 4564 5966
-> 15 0 23 4391 topology 4591 5967
-> 16 0 23 4391 topology 4633 5967
-> 15 0 24 4391 topology 4482 5968
-> 16 0 24 4391 topology 4484 5968
-> 15 0 24 4391 topology 4593 5969
-> 16 0 24 4391 topology 4594 5969
-> 15 0 24 4391 topology 4485 5970
-> 16 0 24 4391 topology 4487 5970
-> 15 0 24 4391 topology 4623 5971
-> 16 0 24 4391 topology 4624 5971
-> 15 0 24 4391 topology 4488 5972
-> 16 0 24 4391 topology 4490 5972
-> 15 0 25 4391 topology 4632 5973
-> 16 0 25 4391 topology 4633 5973
-> 15 0 24 4391 topology 4491 5974
-> 16 0 24 4391 topology 4493 5974
-> 15 0 23 4391 topology 4402 5975
-> 16 0 23 4391 topology 4633 5975
-> 15 0 24 4391 topology 4599 5976
-> 16 0 24 4391 topology 4601 5976
-> 15 0 24 4391 topology 4494 5977
-> 16 0 24 4391 topology 4496 5977
-> 15 0 24 4391 topology 4413 5978
-> 16 0 24 4391 topology 4415 5978
-> 15 0 24 4391 topology 4602 5979
-> 16 0 24 4391 topology 4604 5979
-> 15 0 23 4391 topology 4430 5980
-> 16 0 23 4391 topology 4633 5980
-> 15 0 23 4391 topology 4514 5981
-> 16 0 23 4391 topology 4633 5981
-> 15 0 24 4391 topology 4497 5982
-> 16 0 24 4391 topology 4499 5982
-> 15 0 24 4391 topology 4605 5983
-> 16 0 24 4391 topology 4607 5983
-> 15 0 24 4391 topology 4500 5984
-> 16 0 24 4391 topology 4502 5984
-> 15 0 23 4391 topology 4466 5985
-> 16 0 23 4391 topology 4633 5985
-> 15 0 24 4391 topology 4608 5986
-> 16 0 24 4391 topology 4610 5986
-> 15 0 23 4391 topology 4550 5987
-> 16 0 23 4391 topology 4633 5987
-> 15 0 24 4391 topology 4503 5988
-> 16 0 24 4391 topology 4505 5988
-> 15 0 24 4391 topology 4611 5989
-> 16 0 24 4391 topology 4613 5989
-> 15 0 23 4391 topology 4502 5990
-> 16 0 23 4391 topology 4633 5990
-> 15 0 24 4391 topology 4506 5991
-> 16 0 24 4391 topology 4508 5991
-> 15 0 23 4391 topology 4586 5992
-> 16 0 23 4391 topology 4633 5992
-> 15 0 24 4391 topology 4614 5993
-> 16 0 24 4391 topology 4616 5993
-> 15 0 23 4391 topology 4538 5994
-> 16 0 23 4391 topology 4633 5994
-> 15 0 24 4391 topology 4617 5995
-> 16 0 24 4391 topology 4619 5995
-> 15 0 23 4391 topology 4622 5996
-> 16 0 23 4391 topology 4633 5996
-> 15 0 24 4391 topology 4620 5997
-> 16 0 24 4391 topology 4622 5997
-> 15 0 24 4391 topology 4413 5998
-> 16 0 24 4391 topology 4414 5998
-> 15 0 23 4391 topology 4456 5999
-> 16 0 23 4391 topology 4633 5999
-> 15 0 24 4391 topology 4623 6000
-> 16 0 24 4391 topology 4625 6000
-> 15 0 23 4391 topology 4516 6001
-> 16 0 23 4391 topology 4633 6001
-> 15 0 24 4391 topology 4626 6002
-> 16 0 24 4391 topology 4628 6002
-> 15 0 23 4391 topology 4438 6003
-> 16 0 23 4391 topology 4633 6003
-> 15 0 23 4391 topology 4403 6004
-> 16 0 23 4391 topology 4633 6004
-> 15 0 23 4391 topology 4576 6005
-> 16 0 23 4391 topology 4633 6005
-> 15 0 23 4391 topology 4498 6006
-> 16 0 23 4391 topology 4633 6006
-> 15 0 23 4391 topology 4558 6007
-> 16 0 23 4391 topology 4633 6007
-> 15 0 23 4391 topology 4618 6008
-> 16 0 23 4391 topology 4633 6008
-> 15 0 23 4391 topology 4421 6009
-> 16 0 23 4391 topology 4633 6009
-> 15 0 24 4391 topology 4410 6010
-> 16 0 24 4391 topology 4412 6010
-> 15 0 23 4391 topology 4457 6011
-> 16 0 23 4391 topology 4633 6011
-> 15 0 23 4391 topology 4411 6012
-> 16 0 23 4391 topology 4633 6012
-> 15 0 23 4391 topology 4541 6013
-> 16 0 23 4391 topology 4633 6013
-> 15 0 23 4391 topology 4493 6014
-> 16 0 23 4391 topology 4633 6014
-> 15 0 24 4391 topology 4428 6015
-> 16 0 24 4391 topology 4429 6015
-> 15 0 23 4391 topology 4577 6016
-> 16 0 23 4391 topology 4633 6016
-> 15 0 23 4391 topology 4445 6017
-> 16 0 23 4391 topology 4633 6017
-> 15 0 23 4391 topology 4529 6018
-> 16 0 23 4391 topology 4633 6018
-> 15 0 24 4391 topology 4458 6019
-> 16 0 24 4391 topology 4459 6019
-> 15 0 24 4391 topology 4404 6020
-> 16 0 24 4391 topology 4405 6020
-> 15 0 23 4391 topology 4613 6021
-> 16 0 23 4391 topology 4633 6021
-> 15 0 24 4391 topology 4488 6022
-> 16 0 24 4391 topology 4489 6022
-> 15 0 23 4391 topology 4565 6023
-> 16 0 23 4391 topology 4633 6023
-> 15 0 24 4391 topology 4518 6024
-> 16 0 24 4391 topology 4519 6024
-> 15 0 23 4391 topology 4423 6025
-> 16 0 23 4391 topology 4633 6025
-> 15 0 24 4391 topology 4548 6026
-> 16 0 24 4391 topology 4549 6026
-> 15 0 24 4391 topology 4440 6027
-> 16 0 24 4391 topology 4441 6027
-> 15 0 23 4391 topology 4483 6028
-> 16 0 23 4391 topology 4633 6028
-> 15 0 23 4391 topology 4394 6029
-> 16 0 23 4391 topology 4633 6029
-> 15 0 24 4391 topology 4470 6030
-> 16 0 24 4391 topology 4471 6030
-> 15 0 24 4391 topology 4578 6031
-> 16 0 24 4391 topology 4579 6031
-> 15 0 23 4391 topology 4543 6032
-> 16 0 23 4391 topology 4633 6032
-> 15 0 24 4391 topology 4500 6033
-> 16 0 24 4391 topology 4501 6033
-> 15 0 23 4391 topology 4465 6034
-> 16 0 23 4391 topology 4633 6034
-> 15 0 24 4391 topology 4608 6035
-> 16 0 24 4391 topology 4609 6035
-> 15 0 23 4391 topology 4603 6036
-> 16 0 23 4391 topology 4633 6036
-> 15 0 24 4391 topology 4530 6037
-> 16 0 24 4391 topology 4531 6037
-> 15 0 23 4391 topology 4525 6038
-> 16 0 23 4391 topology 4633 6038
-> 15 0 23 4391 topology 4447 6039
-> 16 0 23 4391 topology 4633 6039
-> 15 0 24 4391 topology 4560 6040
-> 16 0 24 4391 topology 4561 6040
-> 15 0 23 4391 topology 4585 6041
-> 16 0 23 4391 topology 4633 6041
-> 15 0 23 4391 topology 4507 6042
-> 16 0 23 4391 topology 4633 6042
-> 15 0 23 4391 topology 4418 6043
-> 16 0 23 4391 topology 4633 6043
-> 15 0 24 4391 topology 4590 6044
-> 16 0 24 4391 topology 4591 6044
-> 15 0 24 4391 topology 4509 6045
-> 16 0 24 4391 topology 4511 6045
-> 15 0 23 4391 topology 4567 6046
-> 16 0 23 4391 topology 4633 6046
-> 15 0 24 4391 topology 4620 6047
-> 16 0 24 4391 topology 4621 6047
-> 15 0 24 4391 topology 4512 6048
-> 16 0 24 4391 topology 4514 6048
-> 15 0 23 4391 topology 4627 6049
-> 16 0 23 4391 topology 4633 6049
-> 15 0 24 4391 topology 4515 6050
-> 16 0 24 4391 topology 4517 6050
-> 15 0 24 4391 topology 4407 6051
-> 16 0 24 4391 topology 4409 6051
-> 15 0 23 4391 topology 4396 6052
-> 16 0 23 4391 topology 4633 6052
-> 15 0 24 4391 topology 4518 6053
-> 16 0 24 4391 topology 4520 6053
-> 15 0 24 4391 topology 4521 6054
-> 16 0 24 4391 topology 4523 6054
-> 15 0 24 4391 topology 4629 6055
-> 16 0 24 4391 topology 4631 6055
-> 15 0 23 4391 topology 4484 6056
-> 16 0 23 4391 topology 4633 6056
-> 15 0 24 4391 topology 4395 6057
-> 16 0 24 4391 topology 4396 6057
-> 15 0 24 4391 topology 4524 6058
-> 16 0 24 4391 topology 4526 6058
-> 15 0 23 4391 topology 4436 6059
-> 16 0 23 4391 topology 4633 6059
-> 15 0 24 4391 topology 4527 6060
-> 16 0 24 4391 topology 4529 6060
-> 15 0 23 4391 topology 4520 6061
-> 16 0 23 4391 topology 4633 6061
-> 15 0 23 4391 topology 4604 6062
-> 16 0 23 4391 topology 4633 6062
-> 15 0 24 4391 topology 4530 6063
-> 16 0 24 4391 topology 4532 6063
-> 15 0 23 4391 topology 4472 6064
-> 16 0 23 4391 topology 4633 6064
-> 15 0 23 4391 topology 4556 6065
-> 16 0 23 4391 topology 4633 6065
-> 15 0 24 4391 topology 4533 6066
-> 16 0 24 4391 topology 4535 6066
-> 15 0 24 4635 topology 4669 6067
-> 16 0 24 4635 topology 4670 6067
-> 15 0 23 4635 topology 4680 6068
+> 15 0 24 4391 topology 4632 5906
+> 16 0 24 4391 topology 4633 5906
+> 15 0 25 4391 topology 4419 5907
+> 16 0 25 4391 topology 4421 5907
+> 15 0 25 4391 topology 4419 5908
+> 16 0 25 4391 topology 4420 5908
+> 15 0 25 4391 topology 4422 5909
+> 16 0 25 4391 topology 4424 5909
+> 15 0 25 4391 topology 4422 5910
+> 16 0 25 4391 topology 4423 5910
+> 15 0 25 4391 topology 4425 5911
+> 16 0 25 4391 topology 4427 5911
+> 15 0 25 4391 topology 4425 5912
+> 16 0 25 4391 topology 4426 5912
+> 15 0 25 4391 topology 4428 5913
+> 16 0 25 4391 topology 4430 5913
+> 15 0 25 4391 topology 4428 5914
+> 16 0 25 4391 topology 4429 5914
+> 15 0 25 4391 topology 4431 5915
+> 16 0 25 4391 topology 4433 5915
+> 15 0 25 4391 topology 4431 5916
+> 16 0 25 4391 topology 4432 5916
+> 15 0 25 4391 topology 4434 5917
+> 16 0 25 4391 topology 4436 5917
+> 15 0 25 4391 topology 4434 5918
+> 16 0 25 4391 topology 4435 5918
+> 15 0 25 4391 topology 4437 5919
+> 16 0 25 4391 topology 4439 5919
+> 15 0 25 4391 topology 4437 5920
+> 16 0 25 4391 topology 4438 5920
+> 15 0 25 4391 topology 4440 5921
+> 16 0 25 4391 topology 4442 5921
+> 15 0 25 4391 topology 4440 5922
+> 16 0 25 4391 topology 4441 5922
+> 15 0 25 4391 topology 4443 5923
+> 16 0 25 4391 topology 4445 5923
+> 15 0 25 4391 topology 4443 5924
+> 16 0 25 4391 topology 4444 5924
+> 15 0 25 4391 topology 4446 5925
+> 16 0 25 4391 topology 4448 5925
+> 15 0 25 4391 topology 4446 5926
+> 16 0 25 4391 topology 4447 5926
+> 15 0 25 4391 topology 4392 5927
+> 16 0 25 4391 topology 4394 5927
+> 15 0 25 4391 topology 4392 5928
+> 16 0 25 4391 topology 4393 5928
+> 15 0 25 4391 topology 4449 5929
+> 16 0 25 4391 topology 4451 5929
+> 15 0 25 4391 topology 4449 5930
+> 16 0 25 4391 topology 4450 5930
+> 15 0 25 4391 topology 4452 5931
+> 16 0 25 4391 topology 4454 5931
+> 15 0 25 4391 topology 4452 5932
+> 16 0 25 4391 topology 4453 5932
+> 15 0 25 4391 topology 4455 5933
+> 16 0 25 4391 topology 4457 5933
+> 15 0 25 4391 topology 4455 5934
+> 16 0 25 4391 topology 4456 5934
+> 15 0 25 4391 topology 4458 5935
+> 16 0 25 4391 topology 4460 5935
+> 15 0 25 4391 topology 4458 5936
+> 16 0 25 4391 topology 4459 5936
+> 15 0 25 4391 topology 4461 5937
+> 16 0 25 4391 topology 4463 5937
+> 15 0 25 4391 topology 4461 5938
+> 16 0 25 4391 topology 4462 5938
+> 15 0 25 4391 topology 4464 5939
+> 16 0 25 4391 topology 4466 5939
+> 15 0 25 4391 topology 4464 5940
+> 16 0 25 4391 topology 4465 5940
+> 15 0 25 4391 topology 4467 5941
+> 16 0 25 4391 topology 4469 5941
+> 15 0 25 4391 topology 4467 5942
+> 16 0 25 4391 topology 4468 5942
+> 15 0 25 4391 topology 4470 5943
+> 16 0 25 4391 topology 4472 5943
+> 15 0 25 4391 topology 4470 5944
+> 16 0 25 4391 topology 4471 5944
+> 15 0 25 4391 topology 4473 5945
+> 16 0 25 4391 topology 4475 5945
+> 15 0 25 4391 topology 4473 5946
+> 16 0 25 4391 topology 4474 5946
+> 15 0 25 4391 topology 4476 5947
+> 16 0 25 4391 topology 4478 5947
+> 15 0 25 4391 topology 4476 5948
+> 16 0 25 4391 topology 4477 5948
+> 15 0 25 4391 topology 4395 5949
+> 16 0 25 4391 topology 4397 5949
+> 15 0 25 4391 topology 4395 5950
+> 16 0 25 4391 topology 4396 5950
+> 15 0 25 4391 topology 4479 5951
+> 16 0 25 4391 topology 4481 5951
+> 15 0 25 4391 topology 4479 5952
+> 16 0 25 4391 topology 4480 5952
+> 15 0 25 4391 topology 4482 5953
+> 16 0 25 4391 topology 4484 5953
+> 15 0 25 4391 topology 4482 5954
+> 16 0 25 4391 topology 4483 5954
+> 15 0 25 4391 topology 4485 5955
+> 16 0 25 4391 topology 4487 5955
+> 15 0 25 4391 topology 4485 5956
+> 16 0 25 4391 topology 4486 5956
+> 15 0 25 4391 topology 4488 5957
+> 16 0 25 4391 topology 4490 5957
+> 15 0 25 4391 topology 4488 5958
+> 16 0 25 4391 topology 4489 5958
+> 15 0 25 4391 topology 4491 5959
+> 16 0 25 4391 topology 4493 5959
+> 15 0 25 4391 topology 4491 5960
+> 16 0 25 4391 topology 4492 5960
+> 15 0 25 4391 topology 4494 5961
+> 16 0 25 4391 topology 4496 5961
+> 15 0 25 4391 topology 4494 5962
+> 16 0 25 4391 topology 4495 5962
+> 15 0 25 4391 topology 4497 5963
+> 16 0 25 4391 topology 4499 5963
+> 15 0 25 4391 topology 4497 5964
+> 16 0 25 4391 topology 4498 5964
+> 15 0 25 4391 topology 4500 5965
+> 16 0 25 4391 topology 4502 5965
+> 15 0 25 4391 topology 4500 5966
+> 16 0 25 4391 topology 4501 5966
+> 15 0 25 4391 topology 4503 5967
+> 16 0 25 4391 topology 4505 5967
+> 15 0 25 4391 topology 4503 5968
+> 16 0 25 4391 topology 4504 5968
+> 15 0 25 4391 topology 4506 5969
+> 16 0 25 4391 topology 4508 5969
+> 15 0 25 4391 topology 4506 5970
+> 16 0 25 4391 topology 4507 5970
+> 15 0 25 4391 topology 4398 5971
+> 16 0 25 4391 topology 4400 5971
+> 15 0 25 4391 topology 4398 5972
+> 16 0 25 4391 topology 4399 5972
+> 15 0 25 4391 topology 4509 5973
+> 16 0 25 4391 topology 4511 5973
+> 15 0 25 4391 topology 4509 5974
+> 16 0 25 4391 topology 4510 5974
+> 15 0 25 4391 topology 4512 5975
+> 16 0 25 4391 topology 4514 5975
+> 15 0 25 4391 topology 4512 5976
+> 16 0 25 4391 topology 4513 5976
+> 15 0 25 4391 topology 4515 5977
+> 16 0 25 4391 topology 4517 5977
+> 15 0 25 4391 topology 4515 5978
+> 16 0 25 4391 topology 4516 5978
+> 15 0 25 4391 topology 4518 5979
+> 16 0 25 4391 topology 4520 5979
+> 15 0 25 4391 topology 4518 5980
+> 16 0 25 4391 topology 4519 5980
+> 15 0 25 4391 topology 4521 5981
+> 16 0 25 4391 topology 4523 5981
+> 15 0 25 4391 topology 4521 5982
+> 16 0 25 4391 topology 4522 5982
+> 15 0 25 4391 topology 4524 5983
+> 16 0 25 4391 topology 4526 5983
+> 15 0 25 4391 topology 4524 5984
+> 16 0 25 4391 topology 4525 5984
+> 15 0 25 4391 topology 4527 5985
+> 16 0 25 4391 topology 4529 5985
+> 15 0 25 4391 topology 4527 5986
+> 16 0 25 4391 topology 4528 5986
+> 15 0 25 4391 topology 4530 5987
+> 16 0 25 4391 topology 4532 5987
+> 15 0 25 4391 topology 4530 5988
+> 16 0 25 4391 topology 4531 5988
+> 15 0 25 4391 topology 4533 5989
+> 16 0 25 4391 topology 4535 5989
+> 15 0 25 4391 topology 4533 5990
+> 16 0 25 4391 topology 4534 5990
+> 15 0 25 4391 topology 4536 5991
+> 16 0 25 4391 topology 4538 5991
+> 15 0 25 4391 topology 4536 5992
+> 16 0 25 4391 topology 4537 5992
+> 15 0 25 4391 topology 4401 5993
+> 16 0 25 4391 topology 4403 5993
+> 15 0 25 4391 topology 4401 5994
+> 16 0 25 4391 topology 4402 5994
+> 15 0 25 4391 topology 4539 5995
+> 16 0 25 4391 topology 4541 5995
+> 15 0 25 4391 topology 4539 5996
+> 16 0 25 4391 topology 4540 5996
+> 15 0 25 4391 topology 4542 5997
+> 16 0 25 4391 topology 4544 5997
+> 15 0 25 4391 topology 4542 5998
+> 16 0 25 4391 topology 4543 5998
+> 15 0 25 4391 topology 4545 5999
+> 16 0 25 4391 topology 4547 5999
+> 15 0 25 4391 topology 4545 6000
+> 16 0 25 4391 topology 4546 6000
+> 15 0 25 4391 topology 4548 6001
+> 16 0 25 4391 topology 4550 6001
+> 15 0 25 4391 topology 4548 6002
+> 16 0 25 4391 topology 4549 6002
+> 15 0 25 4391 topology 4551 6003
+> 16 0 25 4391 topology 4553 6003
+> 15 0 25 4391 topology 4551 6004
+> 16 0 25 4391 topology 4552 6004
+> 15 0 25 4391 topology 4554 6005
+> 16 0 25 4391 topology 4556 6005
+> 15 0 25 4391 topology 4554 6006
+> 16 0 25 4391 topology 4555 6006
+> 15 0 25 4391 topology 4557 6007
+> 16 0 25 4391 topology 4559 6007
+> 15 0 25 4391 topology 4557 6008
+> 16 0 25 4391 topology 4558 6008
+> 15 0 25 4391 topology 4560 6009
+> 16 0 25 4391 topology 4562 6009
+> 15 0 25 4391 topology 4560 6010
+> 16 0 25 4391 topology 4561 6010
+> 15 0 25 4391 topology 4563 6011
+> 16 0 25 4391 topology 4565 6011
+> 15 0 25 4391 topology 4563 6012
+> 16 0 25 4391 topology 4564 6012
+> 15 0 25 4391 topology 4566 6013
+> 16 0 25 4391 topology 4568 6013
+> 15 0 25 4391 topology 4566 6014
+> 16 0 25 4391 topology 4567 6014
+> 15 0 25 4391 topology 4404 6015
+> 16 0 25 4391 topology 4406 6015
+> 15 0 25 4391 topology 4404 6016
+> 16 0 25 4391 topology 4405 6016
+> 15 0 25 4391 topology 4569 6017
+> 16 0 25 4391 topology 4571 6017
+> 15 0 25 4391 topology 4569 6018
+> 16 0 25 4391 topology 4570 6018
+> 15 0 25 4391 topology 4572 6019
+> 16 0 25 4391 topology 4574 6019
+> 15 0 25 4391 topology 4572 6020
+> 16 0 25 4391 topology 4573 6020
+> 15 0 25 4391 topology 4575 6021
+> 16 0 25 4391 topology 4577 6021
+> 15 0 25 4391 topology 4575 6022
+> 16 0 25 4391 topology 4576 6022
+> 15 0 25 4391 topology 4578 6023
+> 16 0 25 4391 topology 4580 6023
+> 15 0 25 4391 topology 4578 6024
+> 16 0 25 4391 topology 4579 6024
+> 15 0 25 4391 topology 4581 6025
+> 16 0 25 4391 topology 4583 6025
+> 15 0 25 4391 topology 4581 6026
+> 16 0 25 4391 topology 4582 6026
+> 15 0 25 4391 topology 4584 6027
+> 16 0 25 4391 topology 4586 6027
+> 15 0 25 4391 topology 4584 6028
+> 16 0 25 4391 topology 4585 6028
+> 15 0 25 4391 topology 4587 6029
+> 16 0 25 4391 topology 4589 6029
+> 15 0 25 4391 topology 4587 6030
+> 16 0 25 4391 topology 4588 6030
+> 15 0 25 4391 topology 4590 6031
+> 16 0 25 4391 topology 4592 6031
+> 15 0 25 4391 topology 4590 6032
+> 16 0 25 4391 topology 4591 6032
+> 15 0 25 4391 topology 4593 6033
+> 16 0 25 4391 topology 4595 6033
+> 15 0 25 4391 topology 4593 6034
+> 16 0 25 4391 topology 4594 6034
+> 15 0 25 4391 topology 4596 6035
+> 16 0 25 4391 topology 4598 6035
+> 15 0 25 4391 topology 4596 6036
+> 16 0 25 4391 topology 4597 6036
+> 15 0 25 4391 topology 4407 6037
+> 16 0 25 4391 topology 4409 6037
+> 15 0 25 4391 topology 4407 6038
+> 16 0 25 4391 topology 4408 6038
+> 15 0 25 4391 topology 4599 6039
+> 16 0 25 4391 topology 4601 6039
+> 15 0 25 4391 topology 4599 6040
+> 16 0 25 4391 topology 4600 6040
+> 15 0 25 4391 topology 4602 6041
+> 16 0 25 4391 topology 4604 6041
+> 15 0 25 4391 topology 4602 6042
+> 16 0 25 4391 topology 4603 6042
+> 15 0 25 4391 topology 4605 6043
+> 16 0 25 4391 topology 4607 6043
+> 15 0 25 4391 topology 4605 6044
+> 16 0 25 4391 topology 4606 6044
+> 15 0 25 4391 topology 4608 6045
+> 16 0 25 4391 topology 4610 6045
+> 15 0 25 4391 topology 4608 6046
+> 16 0 25 4391 topology 4609 6046
+> 15 0 25 4391 topology 4611 6047
+> 16 0 25 4391 topology 4613 6047
+> 15 0 25 4391 topology 4611 6048
+> 16 0 25 4391 topology 4612 6048
+> 15 0 25 4391 topology 4614 6049
+> 16 0 25 4391 topology 4616 6049
+> 15 0 25 4391 topology 4614 6050
+> 16 0 25 4391 topology 4615 6050
+> 15 0 25 4391 topology 4617 6051
+> 16 0 25 4391 topology 4619 6051
+> 15 0 25 4391 topology 4617 6052
+> 16 0 25 4391 topology 4618 6052
+> 15 0 25 4391 topology 4620 6053
+> 16 0 25 4391 topology 4622 6053
+> 15 0 25 4391 topology 4620 6054
+> 16 0 25 4391 topology 4621 6054
+> 15 0 25 4391 topology 4623 6055
+> 16 0 25 4391 topology 4625 6055
+> 15 0 25 4391 topology 4623 6056
+> 16 0 25 4391 topology 4624 6056
+> 15 0 25 4391 topology 4626 6057
+> 16 0 25 4391 topology 4628 6057
+> 15 0 25 4391 topology 4626 6058
+> 16 0 25 4391 topology 4627 6058
+> 15 0 25 4391 topology 4410 6059
+> 16 0 25 4391 topology 4412 6059
+> 15 0 25 4391 topology 4410 6060
+> 16 0 25 4391 topology 4411 6060
+> 15 0 25 4391 topology 4629 6061
+> 16 0 25 4391 topology 4631 6061
+> 15 0 25 4391 topology 4629 6062
+> 16 0 25 4391 topology 4630 6062
+> 15 0 25 4391 topology 4413 6063
+> 16 0 25 4391 topology 4415 6063
+> 15 0 25 4391 topology 4413 6064
+> 16 0 25 4391 topology 4414 6064
+> 15 0 25 4391 topology 4416 6065
+> 16 0 25 4391 topology 4418 6065
+> 15 0 25 4391 topology 4416 6066
+> 16 0 25 4391 topology 4417 6066
+> 15 0 23 4635 topology 4665 6067
+> 16 0 23 4635 topology 4793 6067
+> 15 0 23 4635 topology 4664 6068
 > 16 0 23 4635 topology 4793 6068
-> 15 0 23 4635 topology 4764 6069
+> 15 0 23 4635 topology 4668 6069
 > 16 0 23 4635 topology 4793 6069
-> 15 0 24 4635 topology 4672 6070
-> 16 0 24 4635 topology 4673 6070
-> 15 0 23 4635 topology 4716 6071
+> 15 0 23 4635 topology 4667 6070
+> 16 0 23 4635 topology 4793 6070
+> 15 0 23 4635 topology 4671 6071
 > 16 0 23 4635 topology 4793 6071
-> 15 0 24 4635 topology 4675 6072
-> 16 0 24 4635 topology 4676 6072
-> 15 0 24 4635 topology 4783 6073
-> 16 0 24 4635 topology 4784 6073
-> 15 0 24 4635 topology 4651 6074
-> 16 0 24 4635 topology 4652 6074
-> 15 0 24 4635 topology 4678 6075
-> 16 0 24 4635 topology 4679 6075
-> 15 0 23 4635 topology 4752 6076
+> 15 0 23 4635 topology 4670 6072
+> 16 0 23 4635 topology 4793 6072
+> 15 0 23 4635 topology 4674 6073
+> 16 0 23 4635 topology 4793 6073
+> 15 0 23 4635 topology 4673 6074
+> 16 0 23 4635 topology 4793 6074
+> 15 0 23 4635 topology 4677 6075
+> 16 0 23 4635 topology 4793 6075
+> 15 0 23 4635 topology 4676 6076
 > 16 0 23 4635 topology 4793 6076
-> 15 0 24 4635 topology 4786 6077
-> 16 0 24 4635 topology 4787 6077
-> 15 0 23 4635 topology 4664 6078
+> 15 0 23 4635 topology 4680 6077
+> 16 0 23 4635 topology 4793 6077
+> 15 0 23 4635 topology 4679 6078
 > 16 0 23 4635 topology 4793 6078
-> 15 0 24 4635 topology 4681 6079
-> 16 0 24 4635 topology 4682 6079
-> 15 0 24 4635 topology 4789 6080
-> 16 0 24 4635 topology 4790 6080
-> 15 0 24 4635 topology 4684 6081
-> 16 0 24 4635 topology 4685 6081
-> 15 0 23 4635 topology 4724 6082
+> 15 0 23 4635 topology 4683 6079
+> 16 0 23 4635 topology 4793 6079
+> 15 0 23 4635 topology 4682 6080
+> 16 0 23 4635 topology 4793 6080
+> 15 0 23 4635 topology 4686 6081
+> 16 0 23 4635 topology 4793 6081
+> 15 0 23 4635 topology 4685 6082
 > 16 0 23 4635 topology 4793 6082
-> 15 0 24 4635 topology 4687 6083
-> 16 0 24 4635 topology 4688 6083
-> 15 0 23 4635 topology 4784 6084
+> 15 0 23 4635 topology 4689 6083
+> 16 0 23 4635 topology 4793 6083
+> 15 0 23 4635 topology 4688 6084
 > 16 0 23 4635 topology 4793 6084
-> 15 0 23 4635 topology 4706 6085
+> 15 0 23 4635 topology 4692 6085
 > 16 0 23 4635 topology 4793 6085
-> 15 0 23 4635 topology 4647 6086
+> 15 0 23 4635 topology 4691 6086
 > 16 0 23 4635 topology 4793 6086
-> 15 0 24 4635 topology 4690 6087
-> 16 0 24 4635 topology 4691 6087
-> 15 0 24 4635 topology 4663 6088
-> 16 0 24 4635 topology 4665 6088
-> 15 0 23 4635 topology 4766 6089
+> 15 0 23 4635 topology 4638 6087
+> 16 0 23 4635 topology 4793 6087
+> 15 0 23 4635 topology 4637 6088
+> 16 0 23 4635 topology 4793 6088
+> 15 0 23 4635 topology 4695 6089
 > 16 0 23 4635 topology 4793 6089
-> 15 0 23 4635 topology 4688 6090
+> 15 0 23 4635 topology 4694 6090
 > 16 0 23 4635 topology 4793 6090
-> 15 0 23 4635 topology 4748 6091
+> 15 0 23 4635 topology 4698 6091
 > 16 0 23 4635 topology 4793 6091
-> 15 0 24 4635 topology 4723 6092
-> 16 0 24 4635 topology 4725 6092
-> 15 0 24 4635 topology 4699 6093
-> 16 0 24 4635 topology 4701 6093
-> 15 0 24 4635 topology 4675 6094
-> 16 0 24 4635 topology 4677 6094
-> 15 0 24 4635 topology 4783 6095
-> 16 0 24 4635 topology 4785 6095
-> 15 0 24 4635 topology 4759 6096
-> 16 0 24 4635 topology 4761 6096
-> 15 0 23 4635 topology 4643 6097
+> 15 0 23 4635 topology 4697 6092
+> 16 0 23 4635 topology 4793 6092
+> 15 0 23 4635 topology 4701 6093
+> 16 0 23 4635 topology 4793 6093
+> 15 0 23 4635 topology 4700 6094
+> 16 0 23 4635 topology 4793 6094
+> 15 0 23 4635 topology 4704 6095
+> 16 0 23 4635 topology 4793 6095
+> 15 0 23 4635 topology 4703 6096
+> 16 0 23 4635 topology 4793 6096
+> 15 0 23 4635 topology 4707 6097
 > 16 0 23 4635 topology 4793 6097
-> 15 0 24 4635 topology 4654 6098
-> 16 0 24 4635 topology 4656 6098
-> 15 0 24 4635 topology 4735 6099
-> 16 0 24 4635 topology 4737 6099
-> 15 0 23 4635 topology 4671 6100
+> 15 0 23 4635 topology 4706 6098
+> 16 0 23 4635 topology 4793 6098
+> 15 0 23 4635 topology 4710 6099
+> 16 0 23 4635 topology 4793 6099
+> 15 0 23 4635 topology 4709 6100
 > 16 0 23 4635 topology 4793 6100
-> 15 0 24 4635 topology 4711 6101
-> 16 0 24 4635 topology 4713 6101
-> 15 0 23 4635 topology 4755 6102
+> 15 0 23 4635 topology 4713 6101
+> 16 0 23 4635 topology 4793 6101
+> 15 0 23 4635 topology 4712 6102
 > 16 0 23 4635 topology 4793 6102
-> 15 0 24 4635 topology 4687 6103
-> 16 0 24 4635 topology 4689 6103
-> 15 0 23 4635 topology 4707 6104
+> 15 0 23 4635 topology 4716 6103
+> 16 0 23 4635 topology 4793 6103
+> 15 0 23 4635 topology 4715 6104
 > 16 0 23 4635 topology 4793 6104
-> 15 0 24 4635 topology 4771 6105
-> 16 0 24 4635 topology 4773 6105
-> 15 0 23 4635 topology 4791 6106
+> 15 0 23 4635 topology 4719 6105
+> 16 0 23 4635 topology 4793 6105
+> 15 0 23 4635 topology 4718 6106
 > 16 0 23 4635 topology 4793 6106
-> 15 0 23 4635 topology 4743 6107
+> 15 0 23 4635 topology 4722 6107
 > 16 0 23 4635 topology 4793 6107
-> 15 0 24 4635 topology 4747 6108
-> 16 0 24 4635 topology 4749 6108
-> 15 0 24 4635 topology 4648 6109
-> 16 0 24 4635 topology 4649 6109
-> 15 0 23 4635 topology 4779 6110
+> 15 0 23 4635 topology 4721 6108
+> 16 0 23 4635 topology 4793 6108
+> 15 0 23 4635 topology 4641 6109
+> 16 0 23 4635 topology 4793 6109
+> 15 0 23 4635 topology 4640 6110
 > 16 0 23 4635 topology 4793 6110
-> 15 0 23 4635 topology 4638 6111
+> 15 0 23 4635 topology 4725 6111
 > 16 0 23 4635 topology 4793 6111
-> 15 0 23 4635 topology 4673 6112
+> 15 0 23 4635 topology 4724 6112
 > 16 0 23 4635 topology 4793 6112
-> 15 0 23 4635 topology 4733 6113
+> 15 0 23 4635 topology 4728 6113
 > 16 0 23 4635 topology 4793 6113
-> 15 0 23 4635 topology 4715 6114
+> 15 0 23 4635 topology 4727 6114
 > 16 0 23 4635 topology 4793 6114
-> 15 0 23 4635 topology 4775 6115
+> 15 0 23 4635 topology 4731 6115
 > 16 0 23 4635 topology 4793 6115
-> 15 0 23 4635 topology 4662 6116
+> 15 0 23 4635 topology 4730 6116
 > 16 0 23 4635 topology 4793 6116
-> 15 0 23 4635 topology 4652 6117
+> 15 0 23 4635 topology 4734 6117
 > 16 0 23 4635 topology 4793 6117
-> 15 0 24 4635 topology 4657 6118
-> 16 0 24 4635 topology 4659 6118
-> 15 0 23 4635 topology 4698 6119
+> 15 0 23 4635 topology 4733 6118
+> 16 0 23 4635 topology 4793 6118
+> 15 0 23 4635 topology 4737 6119
 > 16 0 23 4635 topology 4793 6119
-> 15 0 24 4635 topology 4693 6120
-> 16 0 24 4635 topology 4694 6120
-> 15 0 24 4635 topology 4696 6121
-> 16 0 24 4635 topology 4697 6121
-> 15 0 23 4635 topology 4734 6122
+> 15 0 23 4635 topology 4736 6120
+> 16 0 23 4635 topology 4793 6120
+> 15 0 23 4635 topology 4740 6121
+> 16 0 23 4635 topology 4793 6121
+> 15 0 23 4635 topology 4739 6122
 > 16 0 23 4635 topology 4793 6122
-> 15 0 24 4635 topology 4645 6123
-> 16 0 24 4635 topology 4646 6123
-> 15 0 23 4635 topology 4686 6124
+> 15 0 23 4635 topology 4743 6123
+> 16 0 23 4635 topology 4793 6123
+> 15 0 23 4635 topology 4742 6124
 > 16 0 23 4635 topology 4793 6124
-> 15 0 24 4635 topology 4699 6125
-> 16 0 24 4635 topology 4700 6125
-> 15 0 23 4635 topology 4770 6126
+> 15 0 23 4635 topology 4746 6125
+> 16 0 23 4635 topology 4793 6125
+> 15 0 23 4635 topology 4745 6126
 > 16 0 23 4635 topology 4793 6126
-> 15 0 24 4635 topology 4702 6127
-> 16 0 24 4635 topology 4703 6127
-> 15 0 23 4635 topology 4722 6128
+> 15 0 23 4635 topology 4749 6127
+> 16 0 23 4635 topology 4793 6127
+> 15 0 23 4635 topology 4748 6128
 > 16 0 23 4635 topology 4793 6128
-> 15 0 24 4635 topology 4705 6129
-> 16 0 24 4635 topology 4706 6129
-> 15 0 24 4635 topology 4708 6130
-> 16 0 24 4635 topology 4709 6130
-> 15 0 24 4635 topology 4711 6131
-> 16 0 24 4635 topology 4712 6131
-> 15 0 23 4635 topology 4700 6132
+> 15 0 23 4635 topology 4752 6129
+> 16 0 23 4635 topology 4793 6129
+> 15 0 23 4635 topology 4751 6130
+> 16 0 23 4635 topology 4793 6130
+> 15 0 23 4635 topology 4644 6131
+> 16 0 23 4635 topology 4793 6131
+> 15 0 23 4635 topology 4643 6132
 > 16 0 23 4635 topology 4793 6132
-> 15 0 24 4635 topology 4714 6133
-> 16 0 24 4635 topology 4715 6133
-> 15 0 23 4635 topology 4760 6134
+> 15 0 23 4635 topology 4755 6133
+> 16 0 23 4635 topology 4793 6133
+> 15 0 23 4635 topology 4754 6134
 > 16 0 23 4635 topology 4793 6134
-> 15 0 23 4635 topology 4682 6135
+> 15 0 23 4635 topology 4758 6135
 > 16 0 23 4635 topology 4793 6135
-> 15 0 24 4635 topology 4717 6136
-> 16 0 24 4635 topology 4718 6136
-> 15 0 24 4635 topology 4636 6137
-> 16 0 24 4635 topology 4638 6137
-> 15 0 23 4635 topology 4653 6138
+> 15 0 23 4635 topology 4757 6136
+> 16 0 23 4635 topology 4793 6136
+> 15 0 23 4635 topology 4761 6137
+> 16 0 23 4635 topology 4793 6137
+> 15 0 23 4635 topology 4760 6138
 > 16 0 23 4635 topology 4793 6138
-> 15 0 24 4635 topology 4720 6139
-> 16 0 24 4635 topology 4721 6139
-> 15 0 23 4635 topology 4742 6140
+> 15 0 23 4635 topology 4764 6139
+> 16 0 23 4635 topology 4793 6139
+> 15 0 23 4635 topology 4763 6140
 > 16 0 23 4635 topology 4793 6140
-> 15 0 24 4635 topology 4666 6141
-> 16 0 24 4635 topology 4668 6141
-> 15 0 24 4635 topology 4726 6142
-> 16 0 24 4635 topology 4728 6142
-> 15 0 24 4635 topology 4702 6143
-> 16 0 24 4635 topology 4704 6143
-> 15 0 23 4635 topology 4637 6144
+> 15 0 23 4635 topology 4767 6141
+> 16 0 23 4635 topology 4793 6141
+> 15 0 23 4635 topology 4766 6142
+> 16 0 23 4635 topology 4793 6142
+> 15 0 23 4635 topology 4770 6143
+> 16 0 23 4635 topology 4793 6143
+> 15 0 23 4635 topology 4769 6144
 > 16 0 23 4635 topology 4793 6144
-> 15 0 24 4635 topology 4678 6145
-> 16 0 24 4635 topology 4680 6145
-> 15 0 24 4635 topology 4786 6146
-> 16 0 24 4635 topology 4788 6146
-> 15 0 24 4635 topology 4762 6147
-> 16 0 24 4635 topology 4764 6147
-> 15 0 23 4635 topology 4725 6148
+> 15 0 23 4635 topology 4773 6145
+> 16 0 23 4635 topology 4793 6145
+> 15 0 23 4635 topology 4772 6146
+> 16 0 23 4635 topology 4793 6146
+> 15 0 23 4635 topology 4776 6147
+> 16 0 23 4635 topology 4793 6147
+> 15 0 23 4635 topology 4775 6148
 > 16 0 23 4635 topology 4793 6148
-> 15 0 24 4635 topology 4738 6149
-> 16 0 24 4635 topology 4740 6149
-> 15 0 24 4635 topology 4660 6150
-> 16 0 24 4635 topology 4662 6150
-> 15 0 23 4635 topology 4677 6151
+> 15 0 23 4635 topology 4779 6149
+> 16 0 23 4635 topology 4793 6149
+> 15 0 23 4635 topology 4778 6150
+> 16 0 23 4635 topology 4793 6150
+> 15 0 23 4635 topology 4782 6151
 > 16 0 23 4635 topology 4793 6151
-> 15 0 24 4635 topology 4714 6152
-> 16 0 24 4635 topology 4716 6152
-> 15 0 24 4635 topology 4642 6153
-> 16 0 24 4635 topology 4643 6153
-> 15 0 23 4635 topology 4661 6154
+> 15 0 23 4635 topology 4781 6152
+> 16 0 23 4635 topology 4793 6152
+> 15 0 23 4635 topology 4647 6153
+> 16 0 23 4635 topology 4793 6153
+> 15 0 23 4635 topology 4646 6154
 > 16 0 23 4635 topology 4793 6154
-> 15 0 23 4635 topology 4761 6155
+> 15 0 23 4635 topology 4785 6155
 > 16 0 23 4635 topology 4793 6155
-> 15 0 24 4635 topology 4690 6156
-> 16 0 24 4635 topology 4692 6156
-> 15 0 23 4635 topology 4713 6157
+> 15 0 23 4635 topology 4784 6156
+> 16 0 23 4635 topology 4793 6156
+> 15 0 23 4635 topology 4788 6157
 > 16 0 23 4635 topology 4793 6157
-> 15 0 24 4635 topology 4774 6158
-> 16 0 24 4635 topology 4776 6158
-> 15 0 23 4635 topology 4749 6159
+> 15 0 23 4635 topology 4787 6158
+> 16 0 23 4635 topology 4793 6158
+> 15 0 23 4635 topology 4791 6159
 > 16 0 23 4635 topology 4793 6159
-> 15 0 24 4635 topology 4750 6160
-> 16 0 24 4635 topology 4752 6160
-> 15 0 23 4635 topology 4667 6161
+> 15 0 23 4635 topology 4790 6160
+> 16 0 23 4635 topology 4793 6160
+> 15 0 23 4635 topology 4650 6161
 > 16 0 23 4635 topology 4793 6161
-> 15 0 23 4635 topology 4727 6162
+> 15 0 23 4635 topology 4649 6162
 > 16 0 23 4635 topology 4793 6162
-> 15 0 23 4635 topology 4644 6163
+> 15 0 23 4635 topology 4653 6163
 > 16 0 23 4635 topology 4793 6163
-> 15 0 23 4635 topology 4787 6164
+> 15 0 23 4635 topology 4652 6164
 > 16 0 23 4635 topology 4793 6164
-> 15 0 23 4635 topology 4709 6165
+> 15 0 23 4635 topology 4656 6165
 > 16 0 23 4635 topology 4793 6165
-> 15 0 23 4635 topology 4769 6166
+> 15 0 23 4635 topology 4655 6166
 > 16 0 23 4635 topology 4793 6166
-> 15 0 24 4635 topology 4639 6167
-> 16 0 24 4635 topology 4641 6167
-> 15 0 23 4635 topology 4691 6168
+> 15 0 23 4635 topology 4659 6167
+> 16 0 23 4635 topology 4793 6167
+> 15 0 23 4635 topology 4658 6168
 > 16 0 23 4635 topology 4793 6168
-> 15 0 23 4635 topology 4751 6169
+> 15 0 23 4635 topology 4662 6169
 > 16 0 23 4635 topology 4793 6169
-> 15 0 23 4635 topology 4646 6170
+> 15 0 23 4635 topology 4661 6170
 > 16 0 23 4635 topology 4793 6170
-> 15 0 23 4635 topology 4668 6171
-> 16 0 23 4635 topology 4793 6171
-> 15 0 25 4635 topology 4792 6172
-> 16 0 25 4635 topology 4793 6172
-> 15 0 24 4635 topology 4639 6173
-> 16 0 24 4635 topology 4640 6173
-> 15 0 23 4635 topology 4704 6174
-> 16 0 23 4635 topology 4793 6174
-> 15 0 24 4635 topology 4723 6175
-> 16 0 24 4635 topology 4724 6175
-> 15 0 23 4635 topology 4788 6176
-> 16 0 23 4635 topology 4793 6176
-> 15 0 23 4635 topology 4740 6177
-> 16 0 23 4635 topology 4793 6177
-> 15 0 24 4635 topology 4726 6178
-> 16 0 24 4635 topology 4727 6178
-> 15 0 24 4635 topology 4729 6179
-> 16 0 24 4635 topology 4730 6179
-> 15 0 23 4635 topology 4692 6180
-> 16 0 23 4635 topology 4793 6180
-> 15 0 23 4635 topology 4776 6181
-> 16 0 23 4635 topology 4793 6181
-> 15 0 24 4635 topology 4732 6182
-> 16 0 24 4635 topology 4733 6182
-> 15 0 24 4635 topology 4735 6183
-> 16 0 24 4635 topology 4736 6183
-> 15 0 23 4635 topology 4694 6184
-> 16 0 23 4635 topology 4793 6184
-> 15 0 24 4635 topology 4738 6185
-> 16 0 24 4635 topology 4739 6185
-> 15 0 23 4635 topology 4754 6186
-> 16 0 23 4635 topology 4793 6186
-> 15 0 24 4635 topology 4741 6187
-> 16 0 24 4635 topology 4742 6187
-> 15 0 23 4635 topology 4676 6188
-> 16 0 23 4635 topology 4793 6188
-> 15 0 24 4635 topology 4744 6189
-> 16 0 24 4635 topology 4745 6189
-> 15 0 23 4635 topology 4736 6190
-> 16 0 23 4635 topology 4793 6190
-> 15 0 24 4635 topology 4747 6191
-> 16 0 24 4635 topology 4748 6191
-> 15 0 23 4635 topology 4718 6192
-> 16 0 23 4635 topology 4793 6192
-> 15 0 24 4635 topology 4693 6193
-> 16 0 24 4635 topology 4695 6193
-> 15 0 24 4635 topology 4750 6194
-> 16 0 24 4635 topology 4751 6194
-> 15 0 23 4635 topology 4659 6195
-> 16 0 23 4635 topology 4793 6195
-> 15 0 23 4635 topology 4778 6196
-> 16 0 23 4635 topology 4793 6196
-> 15 0 24 4635 topology 4669 6197
-> 16 0 24 4635 topology 4671 6197
-> 15 0 24 4635 topology 4642 6198
-> 16 0 24 4635 topology 4644 6198
-> 15 0 24 4635 topology 4753 6199
-> 16 0 24 4635 topology 4755 6199
-> 15 0 24 4635 topology 4729 6200
-> 16 0 24 4635 topology 4731 6200
-> 15 0 24 4635 topology 4705 6201
-> 16 0 24 4635 topology 4707 6201
-> 15 0 24 4635 topology 4681 6202
-> 16 0 24 4635 topology 4683 6202
-> 15 0 24 4635 topology 4789 6203
-> 16 0 24 4635 topology 4791 6203
-> 15 0 23 4635 topology 4695 6204
-> 16 0 23 4635 topology 4793 6204
-> 15 0 24 4635 topology 4636 6205
-> 16 0 24 4635 topology 4637 6205
-> 15 0 24 4635 topology 4765 6206
-> 16 0 24 4635 topology 4767 6206
-> 15 0 23 4635 topology 4655 6207
-> 16 0 23 4635 topology 4793 6207
-> 15 0 24 4635 topology 4741 6208
-> 16 0 24 4635 topology 4743 6208
-> 15 0 23 4635 topology 4731 6209
-> 16 0 23 4635 topology 4793 6209
-> 15 0 24 4635 topology 4717 6210
-> 16 0 24 4635 topology 4719 6210
-> 15 0 23 4635 topology 4683 6211
-> 16 0 23 4635 topology 4793 6211
-> 15 0 23 4635 topology 4767 6212
-> 16 0 23 4635 topology 4793 6212
-> 15 0 23 4635 topology 4719 6213
-> 16 0 23 4635 topology 4793 6213
-> 15 0 24 4635 topology 4777 6214
-> 16 0 24 4635 topology 4779 6214
-> 15 0 23 4635 topology 4703 6215
-> 16 0 23 4635 topology 4793 6215
-> 15 0 24 4635 topology 4660 6216
-> 16 0 24 4635 topology 4661 6216
-> 15 0 23 4635 topology 4763 6217
-> 16 0 23 4635 topology 4793 6217
-> 15 0 23 4635 topology 4685 6218
-> 16 0 23 4635 topology 4793 6218
-> 15 0 23 4635 topology 4650 6219
-> 16 0 23 4635 topology 4793 6219
-> 15 0 23 4635 topology 4745 6220
-> 16 0 23 4635 topology 4793 6220
-> 15 0 24 4635 topology 4645 6221
-> 16 0 24 4635 topology 4647 6221
-> 15 0 23 4635 topology 4640 6222
-> 16 0 23 4635 topology 4793 6222
-> 15 0 23 4635 topology 4674 6223
-> 16 0 23 4635 topology 4793 6223
-> 15 0 23 4635 topology 4758 6224
-> 16 0 23 4635 topology 4793 6224
-> 15 0 23 4635 topology 4710 6225
-> 16 0 23 4635 topology 4793 6225
-> 15 0 24 4635 topology 4753 6226
-> 16 0 24 4635 topology 4754 6226
-> 15 0 24 4635 topology 4756 6227
-> 16 0 24 4635 topology 4757 6227
-> 15 0 23 4635 topology 4746 6228
-> 16 0 23 4635 topology 4793 6228
-> 15 0 24 4635 topology 4759 6229
-> 16 0 24 4635 topology 4760 6229
-> 15 0 23 4635 topology 4782 6230
-> 16 0 23 4635 topology 4793 6230
-> 15 0 24 4635 topology 4762 6231
-> 16 0 24 4635 topology 4763 6231
-> 15 0 24 4635 topology 4765 6232
-> 16 0 24 4635 topology 4766 6232
-> 15 0 23 4635 topology 4670 6233
-> 16 0 23 4635 topology 4793 6233
-> 15 0 24 4635 topology 4657 6234
-> 16 0 24 4635 topology 4658 6234
-> 15 0 24 4635 topology 4768 6235
-> 16 0 24 4635 topology 4769 6235
-> 15 0 23 4635 topology 4730 6236
-> 16 0 23 4635 topology 4793 6236
-> 15 0 23 4635 topology 4641 6237
-> 16 0 23 4635 topology 4793 6237
-> 15 0 24 4635 topology 4771 6238
-> 16 0 24 4635 topology 4772 6238
-> 15 0 23 4635 topology 4790 6239
-> 16 0 23 4635 topology 4793 6239
-> 15 0 23 4635 topology 4712 6240
-> 16 0 23 4635 topology 4793 6240
-> 15 0 24 4635 topology 4774 6241
-> 16 0 24 4635 topology 4775 6241
-> 15 0 23 4635 topology 4772 6242
-> 16 0 23 4635 topology 4793 6242
-> 15 0 24 4635 topology 4777 6243
-> 16 0 24 4635 topology 4778 6243
-> 15 0 24 4635 topology 4696 6244
-> 16 0 24 4635 topology 4698 6244
-> 15 0 24 4635 topology 4780 6245
-> 16 0 24 4635 topology 4781 6245
-> 15 0 24 4635 topology 4672 6246
-> 16 0 24 4635 topology 4674 6246
-> 15 0 24 4635 topology 4756 6247
-> 16 0 24 4635 topology 4758 6247
-> 15 0 24 4635 topology 4648 6248
-> 16 0 24 4635 topology 4650 6248
-> 15 0 24 4635 topology 4732 6249
-> 16 0 24 4635 topology 4734 6249
-> 15 0 24 4635 topology 4708 6250
-> 16 0 24 4635 topology 4710 6250
-> 15 0 23 4635 topology 4665 6251
-> 16 0 23 4635 topology 4793 6251
-> 15 0 23 4635 topology 4649 6252
-> 16 0 23 4635 topology 4793 6252
-> 15 0 24 4635 topology 4684 6253
-> 16 0 24 4635 topology 4686 6253
-> 15 0 23 4635 topology 4701 6254
-> 16 0 23 4635 topology 4793 6254
-> 15 0 24 4635 topology 4768 6255
-> 16 0 24 4635 topology 4770 6255
-> 15 0 23 4635 topology 4785 6256
-> 16 0 23 4635 topology 4793 6256
-> 15 0 24 4635 topology 4744 6257
-> 16 0 24 4635 topology 4746 6257
-> 15 0 23 4635 topology 4737 6258
-> 16 0 23 4635 topology 4793 6258
-> 15 0 24 4635 topology 4720 6259
-> 16 0 24 4635 topology 4722 6259
-> 15 0 23 4635 topology 4689 6260
-> 16 0 23 4635 topology 4793 6260
-> 15 0 23 4635 topology 4773 6261
-> 16 0 23 4635 topology 4793 6261
-> 15 0 24 4635 topology 4780 6262
-> 16 0 24 4635 topology 4782 6262
-> 15 0 24 4635 topology 4654 6263
-> 16 0 24 4635 topology 4655 6263
-> 15 0 23 4635 topology 4697 6264
-> 16 0 23 4635 topology 4793 6264
-> 15 0 23 4635 topology 4757 6265
-> 16 0 23 4635 topology 4793 6265
-> 15 0 23 4635 topology 4679 6266
-> 16 0 23 4635 topology 4793 6266
-> 15 0 23 4635 topology 4739 6267
-> 16 0 23 4635 topology 4793 6267
-> 15 0 23 4635 topology 4656 6268
-> 16 0 23 4635 topology 4793 6268
-> 15 0 23 4635 topology 4721 6269
-> 16 0 23 4635 topology 4793 6269
-> 15 0 23 4635 topology 4781 6270
-> 16 0 23 4635 topology 4793 6270
-> 15 0 24 4635 topology 4651 6271
-> 16 0 24 4635 topology 4653 6271
-> 15 0 24 4635 topology 4663 6272
-> 16 0 24 4635 topology 4664 6272
-> 15 0 23 4635 topology 4728 6273
-> 16 0 23 4635 topology 4793 6273
-> 15 0 24 4635 topology 4666 6274
-> 16 0 24 4635 topology 4667 6274
-> 15 0 23 4635 topology 4658 6275
-> 16 0 23 4635 topology 4793 6275
-> 15 0 26 4390 topology 4794 6276
+> 15 0 24 4635 topology 4792 6171
+> 16 0 24 4635 topology 4793 6171
+> 15 0 25 4635 topology 4663 6172
+> 16 0 25 4635 topology 4665 6172
+> 15 0 25 4635 topology 4663 6173
+> 16 0 25 4635 topology 4664 6173
+> 15 0 25 4635 topology 4666 6174
+> 16 0 25 4635 topology 4668 6174
+> 15 0 25 4635 topology 4666 6175
+> 16 0 25 4635 topology 4667 6175
+> 15 0 25 4635 topology 4669 6176
+> 16 0 25 4635 topology 4671 6176
+> 15 0 25 4635 topology 4669 6177
+> 16 0 25 4635 topology 4670 6177
+> 15 0 25 4635 topology 4672 6178
+> 16 0 25 4635 topology 4674 6178
+> 15 0 25 4635 topology 4672 6179
+> 16 0 25 4635 topology 4673 6179
+> 15 0 25 4635 topology 4675 6180
+> 16 0 25 4635 topology 4677 6180
+> 15 0 25 4635 topology 4675 6181
+> 16 0 25 4635 topology 4676 6181
+> 15 0 25 4635 topology 4678 6182
+> 16 0 25 4635 topology 4680 6182
+> 15 0 25 4635 topology 4678 6183
+> 16 0 25 4635 topology 4679 6183
+> 15 0 25 4635 topology 4681 6184
+> 16 0 25 4635 topology 4683 6184
+> 15 0 25 4635 topology 4681 6185
+> 16 0 25 4635 topology 4682 6185
+> 15 0 25 4635 topology 4684 6186
+> 16 0 25 4635 topology 4686 6186
+> 15 0 25 4635 topology 4684 6187
+> 16 0 25 4635 topology 4685 6187
+> 15 0 25 4635 topology 4687 6188
+> 16 0 25 4635 topology 4689 6188
+> 15 0 25 4635 topology 4687 6189
+> 16 0 25 4635 topology 4688 6189
+> 15 0 25 4635 topology 4690 6190
+> 16 0 25 4635 topology 4692 6190
+> 15 0 25 4635 topology 4690 6191
+> 16 0 25 4635 topology 4691 6191
+> 15 0 25 4635 topology 4636 6192
+> 16 0 25 4635 topology 4638 6192
+> 15 0 25 4635 topology 4636 6193
+> 16 0 25 4635 topology 4637 6193
+> 15 0 25 4635 topology 4693 6194
+> 16 0 25 4635 topology 4695 6194
+> 15 0 25 4635 topology 4693 6195
+> 16 0 25 4635 topology 4694 6195
+> 15 0 25 4635 topology 4696 6196
+> 16 0 25 4635 topology 4698 6196
+> 15 0 25 4635 topology 4696 6197
+> 16 0 25 4635 topology 4697 6197
+> 15 0 25 4635 topology 4699 6198
+> 16 0 25 4635 topology 4701 6198
+> 15 0 25 4635 topology 4699 6199
+> 16 0 25 4635 topology 4700 6199
+> 15 0 25 4635 topology 4702 6200
+> 16 0 25 4635 topology 4704 6200
+> 15 0 25 4635 topology 4702 6201
+> 16 0 25 4635 topology 4703 6201
+> 15 0 25 4635 topology 4705 6202
+> 16 0 25 4635 topology 4707 6202
+> 15 0 25 4635 topology 4705 6203
+> 16 0 25 4635 topology 4706 6203
+> 15 0 25 4635 topology 4708 6204
+> 16 0 25 4635 topology 4710 6204
+> 15 0 25 4635 topology 4708 6205
+> 16 0 25 4635 topology 4709 6205
+> 15 0 25 4635 topology 4711 6206
+> 16 0 25 4635 topology 4713 6206
+> 15 0 25 4635 topology 4711 6207
+> 16 0 25 4635 topology 4712 6207
+> 15 0 25 4635 topology 4714 6208
+> 16 0 25 4635 topology 4716 6208
+> 15 0 25 4635 topology 4714 6209
+> 16 0 25 4635 topology 4715 6209
+> 15 0 25 4635 topology 4717 6210
+> 16 0 25 4635 topology 4719 6210
+> 15 0 25 4635 topology 4717 6211
+> 16 0 25 4635 topology 4718 6211
+> 15 0 25 4635 topology 4720 6212
+> 16 0 25 4635 topology 4722 6212
+> 15 0 25 4635 topology 4720 6213
+> 16 0 25 4635 topology 4721 6213
+> 15 0 25 4635 topology 4639 6214
+> 16 0 25 4635 topology 4641 6214
+> 15 0 25 4635 topology 4639 6215
+> 16 0 25 4635 topology 4640 6215
+> 15 0 25 4635 topology 4723 6216
+> 16 0 25 4635 topology 4725 6216
+> 15 0 25 4635 topology 4723 6217
+> 16 0 25 4635 topology 4724 6217
+> 15 0 25 4635 topology 4726 6218
+> 16 0 25 4635 topology 4728 6218
+> 15 0 25 4635 topology 4726 6219
+> 16 0 25 4635 topology 4727 6219
+> 15 0 25 4635 topology 4729 6220
+> 16 0 25 4635 topology 4731 6220
+> 15 0 25 4635 topology 4729 6221
+> 16 0 25 4635 topology 4730 6221
+> 15 0 25 4635 topology 4732 6222
+> 16 0 25 4635 topology 4734 6222
+> 15 0 25 4635 topology 4732 6223
+> 16 0 25 4635 topology 4733 6223
+> 15 0 25 4635 topology 4735 6224
+> 16 0 25 4635 topology 4737 6224
+> 15 0 25 4635 topology 4735 6225
+> 16 0 25 4635 topology 4736 6225
+> 15 0 25 4635 topology 4738 6226
+> 16 0 25 4635 topology 4740 6226
+> 15 0 25 4635 topology 4738 6227
+> 16 0 25 4635 topology 4739 6227
+> 15 0 25 4635 topology 4741 6228
+> 16 0 25 4635 topology 4743 6228
+> 15 0 25 4635 topology 4741 6229
+> 16 0 25 4635 topology 4742 6229
+> 15 0 25 4635 topology 4744 6230
+> 16 0 25 4635 topology 4746 6230
+> 15 0 25 4635 topology 4744 6231
+> 16 0 25 4635 topology 4745 6231
+> 15 0 25 4635 topology 4747 6232
+> 16 0 25 4635 topology 4749 6232
+> 15 0 25 4635 topology 4747 6233
+> 16 0 25 4635 topology 4748 6233
+> 15 0 25 4635 topology 4750 6234
+> 16 0 25 4635 topology 4752 6234
+> 15 0 25 4635 topology 4750 6235
+> 16 0 25 4635 topology 4751 6235
+> 15 0 25 4635 topology 4642 6236
+> 16 0 25 4635 topology 4644 6236
+> 15 0 25 4635 topology 4642 6237
+> 16 0 25 4635 topology 4643 6237
+> 15 0 25 4635 topology 4753 6238
+> 16 0 25 4635 topology 4755 6238
+> 15 0 25 4635 topology 4753 6239
+> 16 0 25 4635 topology 4754 6239
+> 15 0 25 4635 topology 4756 6240
+> 16 0 25 4635 topology 4758 6240
+> 15 0 25 4635 topology 4756 6241
+> 16 0 25 4635 topology 4757 6241
+> 15 0 25 4635 topology 4759 6242
+> 16 0 25 4635 topology 4761 6242
+> 15 0 25 4635 topology 4759 6243
+> 16 0 25 4635 topology 4760 6243
+> 15 0 25 4635 topology 4762 6244
+> 16 0 25 4635 topology 4764 6244
+> 15 0 25 4635 topology 4762 6245
+> 16 0 25 4635 topology 4763 6245
+> 15 0 25 4635 topology 4765 6246
+> 16 0 25 4635 topology 4767 6246
+> 15 0 25 4635 topology 4765 6247
+> 16 0 25 4635 topology 4766 6247
+> 15 0 25 4635 topology 4768 6248
+> 16 0 25 4635 topology 4770 6248
+> 15 0 25 4635 topology 4768 6249
+> 16 0 25 4635 topology 4769 6249
+> 15 0 25 4635 topology 4771 6250
+> 16 0 25 4635 topology 4773 6250
+> 15 0 25 4635 topology 4771 6251
+> 16 0 25 4635 topology 4772 6251
+> 15 0 25 4635 topology 4774 6252
+> 16 0 25 4635 topology 4776 6252
+> 15 0 25 4635 topology 4774 6253
+> 16 0 25 4635 topology 4775 6253
+> 15 0 25 4635 topology 4777 6254
+> 16 0 25 4635 topology 4779 6254
+> 15 0 25 4635 topology 4777 6255
+> 16 0 25 4635 topology 4778 6255
+> 15 0 25 4635 topology 4780 6256
+> 16 0 25 4635 topology 4782 6256
+> 15 0 25 4635 topology 4780 6257
+> 16 0 25 4635 topology 4781 6257
+> 15 0 25 4635 topology 4645 6258
+> 16 0 25 4635 topology 4647 6258
+> 15 0 25 4635 topology 4645 6259
+> 16 0 25 4635 topology 4646 6259
+> 15 0 25 4635 topology 4783 6260
+> 16 0 25 4635 topology 4785 6260
+> 15 0 25 4635 topology 4783 6261
+> 16 0 25 4635 topology 4784 6261
+> 15 0 25 4635 topology 4786 6262
+> 16 0 25 4635 topology 4788 6262
+> 15 0 25 4635 topology 4786 6263
+> 16 0 25 4635 topology 4787 6263
+> 15 0 25 4635 topology 4789 6264
+> 16 0 25 4635 topology 4791 6264
+> 15 0 25 4635 topology 4789 6265
+> 16 0 25 4635 topology 4790 6265
+> 15 0 25 4635 topology 4648 6266
+> 16 0 25 4635 topology 4650 6266
+> 15 0 25 4635 topology 4648 6267
+> 16 0 25 4635 topology 4649 6267
+> 15 0 25 4635 topology 4651 6268
+> 16 0 25 4635 topology 4653 6268
+> 15 0 25 4635 topology 4651 6269
+> 16 0 25 4635 topology 4652 6269
+> 15 0 25 4635 topology 4654 6270
+> 16 0 25 4635 topology 4656 6270
+> 15 0 25 4635 topology 4654 6271
+> 16 0 25 4635 topology 4655 6271
+> 15 0 25 4635 topology 4657 6272
+> 16 0 25 4635 topology 4659 6272
+> 15 0 25 4635 topology 4657 6273
+> 16 0 25 4635 topology 4658 6273
+> 15 0 25 4635 topology 4660 6274
+> 16 0 25 4635 topology 4662 6274
+> 15 0 25 4635 topology 4660 6275
+> 16 0 25 4635 topology 4661 6275
+> 15 0 26 4390 topology 4634 6276
 > 16 0 26 4390 topology 4796 6276
-> 15 0 21 4390 topology 4634 6277
-> 16 0 21 4390 topology 4794 6277
+> 15 0 26 4390 topology 4794 6277
+> 16 0 26 4390 topology 4796 6277
 > 15 0 27 4390 topology 4632 6278
 > 16 0 27 4390 topology 4634 6278
-> 15 0 26 4390 topology 4794 6279
-> 16 0 26 4390 topology 4792 6279
-> 15 0 26 4390 topology 4634 6280
-> 16 0 26 4390 topology 4796 6280
-> 15 0 26 21 topology 498 6281
-> 16 0 26 21 topology 497 6281
-> 15 0 35 0 topology 17 6282
-> 16 0 35 0 topology 1605 6282
-> 15 0 26 4390 topology 4797 6283
-> 16 0 26 4390 topology 4796 6283
-> 15 0 26 1189 topology 1605 6284
-> 16 0 26 1189 topology 1604 6284
-> 15 0 36 0 topology 11 6285
-> 16 0 36 0 topology 4389 6285
-> 15 0 36 0 topology 4 6286
-> 16 0 36 0 topology 2348 6286
-> 15 0 35 0 topology 498 6287
-> 16 0 35 0 topology 16 6287
-> 15 0 36 0 topology 5 6288
-> 16 0 36 0 topology 3920 6288
-> 15 0 35 0 topology 3414 6289
-> 16 0 35 0 topology 14 6289
-> 15 0 26 499 topology 868 6290
-> 16 0 26 499 topology 867 6290
-> 15 0 35 0 topology 16 6291
-> 16 0 35 0 topology 1605 6291
-> 15 0 35 0 topology 12 6292
-> 16 0 35 0 topology 3414 6292
-> 15 0 26 869 topology 1188 6293
-> 16 0 26 869 topology 1187 6293
-> 15 0 35 0 topology 15 6294
-> 16 0 35 0 topology 1605 6294
-> 15 0 36 0 topology 7 6295
-> 16 0 36 0 topology 498 6295
-> 15 0 35 0 topology 14 6296
-> 16 0 35 0 topology 3920 6296
-> 15 0 35 0 topology 17 6297
-> 16 0 35 0 topology 868 6297
-> 15 0 35 0 topology 20 6298
-> 16 0 35 0 topology 4797 6298
-> 15 0 36 0 topology 10 6299
-> 16 0 36 0 topology 4797 6299
-> 15 0 35 0 topology 12 6300
-> 16 0 35 0 topology 1188 6300
+> 15 0 20 4390 topology 4634 6279
+> 16 0 20 4390 topology 4794 6279
+> 15 0 26 4390 topology 4794 6280
+> 16 0 26 4390 topology 4792 6280
+> 15 0 35 0 topology 498 6281
+> 16 0 35 0 topology 16 6281
+> 15 0 35 0 topology 1605 6282
+> 16 0 35 0 topology 18 6282
+> 15 0 35 0 topology 3414 6283
+> 16 0 35 0 topology 14 6283
+> 15 0 26 21 topology 498 6284
+> 16 0 26 21 topology 497 6284
+> 15 0 26 499 topology 868 6285
+> 16 0 26 499 topology 867 6285
+> 15 0 26 869 topology 1188 6286
+> 16 0 26 869 topology 1187 6286
+> 15 0 26 1189 topology 1605 6287
+> 16 0 26 1189 topology 1604 6287
+> 15 0 26 1606 topology 2348 6288
+> 16 0 26 1606 topology 2347 6288
+> 15 0 26 2349 topology 3414 6289
+> 16 0 26 2349 topology 3413 6289
+> 15 0 26 3415 topology 3920 6290
+> 16 0 26 3415 topology 3919 6290
+> 15 0 26 3921 topology 4389 6291
+> 16 0 26 3921 topology 4388 6291
+> 15 0 26 4390 topology 4797 6292
+> 16 0 26 4390 topology 4796 6292
+> 15 0 36 0 topology 7 6293
+> 16 0 36 0 topology 498 6293
+> 15 0 35 0 topology 17 6294
+> 16 0 35 0 topology 868 6294
+> 15 0 36 0 topology 8 6295
+> 16 0 36 0 topology 868 6295
+> 15 0 35 0 topology 12 6296
+> 16 0 35 0 topology 1188 6296
+> 15 0 36 0 topology 2 6297
+> 16 0 36 0 topology 1188 6297
+> 15 0 35 0 topology 16 6298
+> 16 0 35 0 topology 1605 6298
+> 15 0 35 0 topology 17 6299
+> 16 0 35 0 topology 1605 6299
+> 15 0 35 0 topology 15 6300
+> 16 0 35 0 topology 1605 6300
 > 15 0 36 0 topology 6 6301
 > 16 0 36 0 topology 1605 6301
-> 15 0 26 3921 topology 4389 6302
-> 16 0 26 3921 topology 4388 6302
-> 15 0 35 0 topology 19 6303
-> 16 0 35 0 topology 4389 6303
-> 15 0 35 0 topology 13 6304
+> 15 0 35 0 topology 13 6302
+> 16 0 35 0 topology 2348 6302
+> 15 0 36 0 topology 4 6303
+> 16 0 36 0 topology 2348 6303
+> 15 0 35 0 topology 12 6304
 > 16 0 35 0 topology 3414 6304
-> 15 0 26 1606 topology 2348 6305
-> 16 0 26 1606 topology 2347 6305
-> 15 0 26 3415 topology 3920 6306
-> 16 0 26 3415 topology 3919 6306
-> 15 0 26 2349 topology 3414 6307
-> 16 0 26 2349 topology 3413 6307
-> 15 0 36 0 topology 8 6308
-> 16 0 36 0 topology 868 6308
-> 15 0 35 0 topology 1605 6309
-> 16 0 35 0 topology 18 6309
-> 15 0 36 0 topology 2 6310
-> 16 0 36 0 topology 1188 6310
-> 15 0 36 0 topology 3 6311
-> 16 0 36 0 topology 3414 6311
-> 15 0 35 0 topology 15 6312
-> 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
+> 15 0 35 0 topology 15 6305
+> 16 0 35 0 topology 3414 6305
+> 15 0 35 0 topology 13 6306
+> 16 0 35 0 topology 3414 6306
+> 15 0 36 0 topology 3 6307
+> 16 0 36 0 topology 3414 6307
+> 15 0 35 0 topology 14 6308
+> 16 0 35 0 topology 3920 6308
+> 15 0 36 0 topology 5 6309
+> 16 0 36 0 topology 3920 6309
+> 15 0 35 0 topology 19 6310
+> 16 0 35 0 topology 4389 6310
+> 15 0 36 0 topology 11 6311
+> 16 0 36 0 topology 4389 6311
+> 15 0 35 0 topology 20 6312
+> 16 0 35 0 topology 4797 6312
+> 15 0 36 0 topology 10 6313
+> 16 0 36 0 topology 4797 6313
+> 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..b80073f 100644 (file)
@@ -161,98 +161,98 @@ $ tail -n +3 procmig.trace
 > 4 12 0 11 11 0-LINK11-LINK11
 > 4 13 0 1 11 0-HOST1-LINK11
 > 4 14 0 11 1 0-LINK11-HOST1
-> 15 0 12 0 topology 19 0
-> 16 0 12 0 topology 20 0
-> 15 0 12 0 topology 15 1
-> 16 0 12 0 topology 9 1
-> 15 0 12 0 topology 27 2
-> 16 0 12 0 topology 18 2
-> 15 0 13 0 topology 5 3
-> 16 0 13 0 topology 24 3
+> 15 0 12 0 topology 12 0
+> 16 0 12 0 topology 16 0
+> 15 0 12 0 topology 9 1
+> 16 0 12 0 topology 16 1
+> 15 0 12 0 topology 16 2
+> 16 0 12 0 topology 14 2
+> 15 0 12 0 topology 21 3
+> 16 0 12 0 topology 19 3
 > 15 0 12 0 topology 8 4
-> 16 0 12 0 topology 10 4
-> 15 0 12 0 topology 21 5
-> 16 0 12 0 topology 22 5
-> 15 0 13 0 topology 1 6
-> 16 0 13 0 topology 9 6
-> 15 0 12 0 topology 23 7
-> 16 0 12 0 topology 24 7
-> 15 0 13 0 topology 1 8
-> 16 0 13 0 topology 15 8
-> 15 0 13 0 topology 1 9
-> 16 0 13 0 topology 11 9
-> 15 0 12 0 topology 26 10
-> 16 0 12 0 topology 27 10
-> 15 0 13 0 topology 5 11
-> 16 0 13 0 topology 18 11
-> 15 0 14 0 topology 11 12
-> 16 0 14 0 topology 2 12
-> 15 0 12 0 topology 28 13
-> 16 0 12 0 topology 29 13
-> 15 0 12 0 topology 12 14
-> 16 0 12 0 topology 16 14
-> 15 0 12 0 topology 9 15
-> 16 0 12 0 topology 16 15
-> 15 0 12 0 topology 14 16
-> 16 0 12 0 topology 13 16
-> 15 0 12 0 topology 29 17
-> 16 0 12 0 topology 11 17
-> 15 0 13 0 topology 3 18
-> 16 0 13 0 topology 30 18
-> 15 0 12 0 topology 11 19
-> 16 0 12 0 topology 15 19
+> 16 0 12 0 topology 19 4
+> 15 0 12 0 topology 19 5
+> 16 0 12 0 topology 20 5
+> 15 0 12 0 topology 8 6
+> 16 0 12 0 topology 20 6
+> 15 0 12 0 topology 27 7
+> 16 0 12 0 topology 18 7
+> 15 0 13 0 topology 5 8
+> 16 0 13 0 topology 18 8
+> 15 0 13 0 topology 4 9
+> 16 0 13 0 topology 18 9
+> 15 0 13 0 topology 2 10
+> 16 0 13 0 topology 18 10
+> 15 0 12 0 topology 16 11
+> 16 0 12 0 topology 21 11
+> 15 0 12 0 topology 21 12
+> 16 0 12 0 topology 22 12
+> 15 0 12 0 topology 9 13
+> 16 0 12 0 topology 12 13
+> 15 0 12 0 topology 15 14
+> 16 0 12 0 topology 9 14
+> 15 0 13 0 topology 1 15
+> 16 0 13 0 topology 9 15
+> 15 0 12 0 topology 20 16
+> 16 0 12 0 topology 23 16
+> 15 0 12 0 topology 23 17
+> 16 0 12 0 topology 24 17
+> 15 0 13 0 topology 5 18
+> 16 0 13 0 topology 24 18
+> 15 0 13 0 topology 4 19
+> 16 0 13 0 topology 24 19
 > 15 0 13 0 topology 2 20
 > 16 0 13 0 topology 24 20
-> 15 0 14 0 topology 18 21
-> 16 0 14 0 topology 6 21
-> 15 0 14 0 topology 10 22
-> 16 0 14 0 topology 5 22
-> 15 0 12 0 topology 8 23
-> 16 0 12 0 topology 19 23
-> 15 0 12 0 topology 12 24
-> 16 0 12 0 topology 25 24
-> 15 0 13 0 topology 4 25
-> 16 0 13 0 topology 24 25
-> 15 0 12 0 topology 16 26
-> 16 0 12 0 topology 14 26
-> 15 0 14 0 topology 17 27
-> 16 0 14 0 topology 4 27
-> 15 0 12 0 topology 12 28
-> 16 0 12 0 topology 17 28
-> 15 0 12 0 topology 9 29
-> 16 0 12 0 topology 17 29
-> 15 0 12 0 topology 21 30
-> 16 0 12 0 topology 19 30
-> 15 0 12 0 topology 22 31
-> 16 0 12 0 topology 25 31
-> 15 0 14 0 topology 24 32
-> 16 0 14 0 topology 7 32
-> 15 0 13 0 topology 3 33
-> 16 0 13 0 topology 28 33
-> 15 0 12 0 topology 25 34
-> 16 0 12 0 topology 26 34
-> 15 0 12 0 topology 8 35
-> 16 0 12 0 topology 20 35
-> 15 0 14 0 topology 13 36
-> 16 0 14 0 topology 3 36
-> 15 0 13 0 topology 2 37
-> 16 0 13 0 topology 18 37
-> 15 0 12 0 topology 9 38
-> 16 0 12 0 topology 12 38
-> 15 0 12 0 topology 14 39
-> 16 0 12 0 topology 8 39
-> 15 0 12 0 topology 20 40
-> 16 0 12 0 topology 23 40
-> 15 0 13 0 topology 4 41
-> 16 0 13 0 topology 18 41
-> 15 0 12 0 topology 13 42
-> 16 0 12 0 topology 8 42
-> 15 0 12 0 topology 11 43
-> 16 0 12 0 topology 8 43
-> 15 0 12 0 topology 16 44
-> 16 0 12 0 topology 21 44
-> 15 0 12 0 topology 30 45
-> 16 0 12 0 topology 28 45
+> 15 0 12 0 topology 11 21
+> 16 0 12 0 topology 15 21
+> 15 0 13 0 topology 1 22
+> 16 0 13 0 topology 15 22
+> 15 0 12 0 topology 12 23
+> 16 0 12 0 topology 17 23
+> 15 0 12 0 topology 9 24
+> 16 0 12 0 topology 17 24
+> 15 0 12 0 topology 22 25
+> 16 0 12 0 topology 25 25
+> 15 0 12 0 topology 12 26
+> 16 0 12 0 topology 25 26
+> 15 0 12 0 topology 25 27
+> 16 0 12 0 topology 26 27
+> 15 0 12 0 topology 26 28
+> 16 0 12 0 topology 27 28
+> 15 0 12 0 topology 14 29
+> 16 0 12 0 topology 8 29
+> 15 0 12 0 topology 13 30
+> 16 0 12 0 topology 8 30
+> 15 0 12 0 topology 11 31
+> 16 0 12 0 topology 8 31
+> 15 0 12 0 topology 8 32
+> 16 0 12 0 topology 10 32
+> 15 0 12 0 topology 30 33
+> 16 0 12 0 topology 28 33
+> 15 0 13 0 topology 3 34
+> 16 0 13 0 topology 28 34
+> 15 0 12 0 topology 28 35
+> 16 0 12 0 topology 29 35
+> 15 0 13 0 topology 3 36
+> 16 0 13 0 topology 30 36
+> 15 0 12 0 topology 14 37
+> 16 0 12 0 topology 13 37
+> 15 0 12 0 topology 29 38
+> 16 0 12 0 topology 11 38
+> 15 0 13 0 topology 1 39
+> 16 0 13 0 topology 11 39
+> 15 0 14 0 topology 24 40
+> 16 0 14 0 topology 7 40
+> 15 0 14 0 topology 10 41
+> 16 0 14 0 topology 5 41
+> 15 0 14 0 topology 13 42
+> 16 0 14 0 topology 3 42
+> 15 0 14 0 topology 17 43
+> 16 0 14 0 topology 4 43
+> 15 0 14 0 topology 18 44
+> 16 0 14 0 topology 6 44
+> 15 0 14 0 topology 11 45
+> 16 0 14 0 topology 2 45
 > 6 0 32 2 3 "emigrant-1"
 > 6 0 33 2 1 "policeman-2"
 > 12 0 3 32 5
@@ -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'
@@ -615,100 +615,100 @@ $ tail -n +3 procmig.trace
 > 8 0 15 30 0.035083
 > 8 0 14 31 498000000.000000
 > 8 0 15 31 0.000015
-> 15 0 17 0 topology 19 0
-> 16 0 17 0 topology 20 0
-> 15 0 17 0 topology 15 1
-> 16 0 17 0 topology 9 1
-> 15 0 17 0 topology 27 2
-> 16 0 17 0 topology 18 2
-> 15 0 18 0 topology 5 3
-> 16 0 18 0 topology 24 3
+> 15 0 17 0 topology 12 0
+> 16 0 17 0 topology 16 0
+> 15 0 17 0 topology 9 1
+> 16 0 17 0 topology 16 1
+> 15 0 17 0 topology 16 2
+> 16 0 17 0 topology 14 2
+> 15 0 17 0 topology 21 3
+> 16 0 17 0 topology 19 3
 > 15 0 17 0 topology 8 4
-> 16 0 17 0 topology 10 4
-> 15 0 17 0 topology 21 5
-> 16 0 17 0 topology 22 5
-> 15 0 18 0 topology 1 6
-> 16 0 18 0 topology 9 6
-> 15 0 17 0 topology 23 7
-> 16 0 17 0 topology 24 7
-> 15 0 18 0 topology 1 8
-> 16 0 18 0 topology 15 8
-> 15 0 18 0 topology 1 9
-> 16 0 18 0 topology 11 9
-> 15 0 17 0 topology 26 10
-> 16 0 17 0 topology 27 10
-> 15 0 18 0 topology 5 11
-> 16 0 18 0 topology 18 11
-> 15 0 19 0 topology 11 12
-> 16 0 19 0 topology 2 12
-> 15 0 17 0 topology 28 13
-> 16 0 17 0 topology 29 13
-> 15 0 17 0 topology 12 14
-> 16 0 17 0 topology 16 14
-> 15 0 17 0 topology 9 15
-> 16 0 17 0 topology 16 15
-> 15 0 17 0 topology 14 16
-> 16 0 17 0 topology 13 16
-> 15 0 17 0 topology 29 17
-> 16 0 17 0 topology 11 17
-> 15 0 18 0 topology 3 18
-> 16 0 18 0 topology 30 18
-> 15 0 17 0 topology 11 19
-> 16 0 17 0 topology 15 19
+> 16 0 17 0 topology 19 4
+> 15 0 17 0 topology 19 5
+> 16 0 17 0 topology 20 5
+> 15 0 17 0 topology 8 6
+> 16 0 17 0 topology 20 6
+> 15 0 17 0 topology 27 7
+> 16 0 17 0 topology 18 7
+> 15 0 18 0 topology 5 8
+> 16 0 18 0 topology 18 8
+> 15 0 18 0 topology 4 9
+> 16 0 18 0 topology 18 9
+> 15 0 18 0 topology 2 10
+> 16 0 18 0 topology 18 10
+> 15 0 17 0 topology 16 11
+> 16 0 17 0 topology 21 11
+> 15 0 17 0 topology 21 12
+> 16 0 17 0 topology 22 12
+> 15 0 17 0 topology 9 13
+> 16 0 17 0 topology 12 13
+> 15 0 17 0 topology 15 14
+> 16 0 17 0 topology 9 14
+> 15 0 18 0 topology 1 15
+> 16 0 18 0 topology 9 15
+> 15 0 17 0 topology 20 16
+> 16 0 17 0 topology 23 16
+> 15 0 17 0 topology 23 17
+> 16 0 17 0 topology 24 17
+> 15 0 18 0 topology 5 18
+> 16 0 18 0 topology 24 18
+> 15 0 18 0 topology 4 19
+> 16 0 18 0 topology 24 19
 > 15 0 18 0 topology 2 20
 > 16 0 18 0 topology 24 20
-> 15 0 19 0 topology 18 21
-> 16 0 19 0 topology 6 21
-> 15 0 19 0 topology 10 22
-> 16 0 19 0 topology 5 22
-> 15 0 17 0 topology 8 23
-> 16 0 17 0 topology 19 23
-> 15 0 17 0 topology 12 24
-> 16 0 17 0 topology 25 24
-> 15 0 18 0 topology 4 25
-> 16 0 18 0 topology 24 25
-> 15 0 17 0 topology 16 26
-> 16 0 17 0 topology 14 26
-> 15 0 19 0 topology 17 27
-> 16 0 19 0 topology 4 27
-> 15 0 17 0 topology 12 28
-> 16 0 17 0 topology 17 28
-> 15 0 17 0 topology 9 29
-> 16 0 17 0 topology 17 29
-> 15 0 17 0 topology 21 30
-> 16 0 17 0 topology 19 30
-> 15 0 17 0 topology 22 31
-> 16 0 17 0 topology 25 31
-> 15 0 19 0 topology 24 32
-> 16 0 19 0 topology 7 32
-> 15 0 18 0 topology 3 33
-> 16 0 18 0 topology 28 33
-> 15 0 17 0 topology 25 34
-> 16 0 17 0 topology 26 34
-> 15 0 17 0 topology 8 35
-> 16 0 17 0 topology 20 35
-> 15 0 19 0 topology 13 36
-> 16 0 19 0 topology 3 36
-> 15 0 18 0 topology 2 37
-> 16 0 18 0 topology 18 37
-> 15 0 17 0 topology 9 38
-> 16 0 17 0 topology 12 38
-> 15 0 17 0 topology 14 39
-> 16 0 17 0 topology 8 39
-> 15 0 17 0 topology 20 40
-> 16 0 17 0 topology 23 40
-> 15 0 18 0 topology 4 41
-> 16 0 18 0 topology 18 41
-> 15 0 17 0 topology 13 42
-> 16 0 17 0 topology 8 42
-> 15 0 17 0 topology 11 43
-> 16 0 17 0 topology 8 43
-> 15 0 17 0 topology 16 44
-> 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"
+> 15 0 17 0 topology 11 21
+> 16 0 17 0 topology 15 21
+> 15 0 18 0 topology 1 22
+> 16 0 18 0 topology 15 22
+> 15 0 17 0 topology 12 23
+> 16 0 17 0 topology 17 23
+> 15 0 17 0 topology 9 24
+> 16 0 17 0 topology 17 24
+> 15 0 17 0 topology 22 25
+> 16 0 17 0 topology 25 25
+> 15 0 17 0 topology 12 26
+> 16 0 17 0 topology 25 26
+> 15 0 17 0 topology 25 27
+> 16 0 17 0 topology 26 27
+> 15 0 17 0 topology 26 28
+> 16 0 17 0 topology 27 28
+> 15 0 17 0 topology 14 29
+> 16 0 17 0 topology 8 29
+> 15 0 17 0 topology 13 30
+> 16 0 17 0 topology 8 30
+> 15 0 17 0 topology 11 31
+> 16 0 17 0 topology 8 31
+> 15 0 17 0 topology 8 32
+> 16 0 17 0 topology 10 32
+> 15 0 17 0 topology 30 33
+> 16 0 17 0 topology 28 33
+> 15 0 18 0 topology 3 34
+> 16 0 18 0 topology 28 34
+> 15 0 17 0 topology 28 35
+> 16 0 17 0 topology 29 35
+> 15 0 18 0 topology 3 36
+> 16 0 18 0 topology 30 36
+> 15 0 17 0 topology 14 37
+> 16 0 17 0 topology 13 37
+> 15 0 17 0 topology 29 38
+> 16 0 17 0 topology 11 38
+> 15 0 18 0 topology 1 39
+> 16 0 18 0 topology 11 39
+> 15 0 19 0 topology 24 40
+> 16 0 19 0 topology 7 40
+> 15 0 19 0 topology 10 41
+> 16 0 19 0 topology 5 41
+> 15 0 19 0 topology 13 42
+> 16 0 19 0 topology 3 42
+> 15 0 19 0 topology 17 43
+> 16 0 19 0 topology 4 43
+> 15 0 19 0 topology 18 44
+> 16 0 19 0 topology 6 44
+> 15 0 19 0 topology 11 45
+> 16 0 19 0 topology 2 45
+> 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'
@@ -1217,100 +1217,100 @@ $ tail -n +3 procmig.trace
 > 8 0 15 30 0.035083
 > 8 0 14 31 498000000.000000
 > 8 0 15 31 0.000015
-> 15 0 17 0 topology 19 0
-> 16 0 17 0 topology 20 0
-> 15 0 17 0 topology 15 1
-> 16 0 17 0 topology 9 1
-> 15 0 17 0 topology 27 2
-> 16 0 17 0 topology 18 2
-> 15 0 18 0 topology 5 3
-> 16 0 18 0 topology 24 3
+> 15 0 17 0 topology 12 0
+> 16 0 17 0 topology 16 0
+> 15 0 17 0 topology 9 1
+> 16 0 17 0 topology 16 1
+> 15 0 17 0 topology 16 2
+> 16 0 17 0 topology 14 2
+> 15 0 17 0 topology 21 3
+> 16 0 17 0 topology 19 3
 > 15 0 17 0 topology 8 4
-> 16 0 17 0 topology 10 4
-> 15 0 17 0 topology 21 5
-> 16 0 17 0 topology 22 5
-> 15 0 18 0 topology 1 6
-> 16 0 18 0 topology 9 6
-> 15 0 17 0 topology 23 7
-> 16 0 17 0 topology 24 7
-> 15 0 18 0 topology 1 8
-> 16 0 18 0 topology 15 8
-> 15 0 18 0 topology 1 9
-> 16 0 18 0 topology 11 9
-> 15 0 17 0 topology 26 10
-> 16 0 17 0 topology 27 10
-> 15 0 18 0 topology 5 11
-> 16 0 18 0 topology 18 11
-> 15 0 19 0 topology 11 12
-> 16 0 19 0 topology 2 12
-> 15 0 17 0 topology 28 13
-> 16 0 17 0 topology 29 13
-> 15 0 17 0 topology 12 14
-> 16 0 17 0 topology 16 14
-> 15 0 17 0 topology 9 15
-> 16 0 17 0 topology 16 15
-> 15 0 17 0 topology 14 16
-> 16 0 17 0 topology 13 16
-> 15 0 17 0 topology 29 17
-> 16 0 17 0 topology 11 17
-> 15 0 18 0 topology 3 18
-> 16 0 18 0 topology 30 18
-> 15 0 17 0 topology 11 19
-> 16 0 17 0 topology 15 19
+> 16 0 17 0 topology 19 4
+> 15 0 17 0 topology 19 5
+> 16 0 17 0 topology 20 5
+> 15 0 17 0 topology 8 6
+> 16 0 17 0 topology 20 6
+> 15 0 17 0 topology 27 7
+> 16 0 17 0 topology 18 7
+> 15 0 18 0 topology 5 8
+> 16 0 18 0 topology 18 8
+> 15 0 18 0 topology 4 9
+> 16 0 18 0 topology 18 9
+> 15 0 18 0 topology 2 10
+> 16 0 18 0 topology 18 10
+> 15 0 17 0 topology 16 11
+> 16 0 17 0 topology 21 11
+> 15 0 17 0 topology 21 12
+> 16 0 17 0 topology 22 12
+> 15 0 17 0 topology 9 13
+> 16 0 17 0 topology 12 13
+> 15 0 17 0 topology 15 14
+> 16 0 17 0 topology 9 14
+> 15 0 18 0 topology 1 15
+> 16 0 18 0 topology 9 15
+> 15 0 17 0 topology 20 16
+> 16 0 17 0 topology 23 16
+> 15 0 17 0 topology 23 17
+> 16 0 17 0 topology 24 17
+> 15 0 18 0 topology 5 18
+> 16 0 18 0 topology 24 18
+> 15 0 18 0 topology 4 19
+> 16 0 18 0 topology 24 19
 > 15 0 18 0 topology 2 20
 > 16 0 18 0 topology 24 20
-> 15 0 19 0 topology 18 21
-> 16 0 19 0 topology 6 21
-> 15 0 19 0 topology 10 22
-> 16 0 19 0 topology 5 22
-> 15 0 17 0 topology 8 23
-> 16 0 17 0 topology 19 23
-> 15 0 17 0 topology 12 24
-> 16 0 17 0 topology 25 24
-> 15 0 18 0 topology 4 25
-> 16 0 18 0 topology 24 25
-> 15 0 17 0 topology 16 26
-> 16 0 17 0 topology 14 26
-> 15 0 19 0 topology 17 27
-> 16 0 19 0 topology 4 27
-> 15 0 17 0 topology 12 28
-> 16 0 17 0 topology 17 28
-> 15 0 17 0 topology 9 29
-> 16 0 17 0 topology 17 29
-> 15 0 17 0 topology 21 30
-> 16 0 17 0 topology 19 30
-> 15 0 17 0 topology 22 31
-> 16 0 17 0 topology 25 31
-> 15 0 19 0 topology 24 32
-> 16 0 19 0 topology 7 32
-> 15 0 18 0 topology 3 33
-> 16 0 18 0 topology 28 33
-> 15 0 17 0 topology 25 34
-> 16 0 17 0 topology 26 34
-> 15 0 17 0 topology 8 35
-> 16 0 17 0 topology 20 35
-> 15 0 19 0 topology 13 36
-> 16 0 19 0 topology 3 36
-> 15 0 18 0 topology 2 37
-> 16 0 18 0 topology 18 37
-> 15 0 17 0 topology 9 38
-> 16 0 17 0 topology 12 38
-> 15 0 17 0 topology 14 39
-> 16 0 17 0 topology 8 39
-> 15 0 17 0 topology 20 40
-> 16 0 17 0 topology 23 40
-> 15 0 18 0 topology 4 41
-> 16 0 18 0 topology 18 41
-> 15 0 17 0 topology 13 42
-> 16 0 17 0 topology 8 42
-> 15 0 17 0 topology 11 43
-> 16 0 17 0 topology 8 43
-> 15 0 17 0 topology 16 44
-> 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"
+> 15 0 17 0 topology 11 21
+> 16 0 17 0 topology 15 21
+> 15 0 18 0 topology 1 22
+> 16 0 18 0 topology 15 22
+> 15 0 17 0 topology 12 23
+> 16 0 17 0 topology 17 23
+> 15 0 17 0 topology 9 24
+> 16 0 17 0 topology 17 24
+> 15 0 17 0 topology 22 25
+> 16 0 17 0 topology 25 25
+> 15 0 17 0 topology 12 26
+> 16 0 17 0 topology 25 26
+> 15 0 17 0 topology 25 27
+> 16 0 17 0 topology 26 27
+> 15 0 17 0 topology 26 28
+> 16 0 17 0 topology 27 28
+> 15 0 17 0 topology 14 29
+> 16 0 17 0 topology 8 29
+> 15 0 17 0 topology 13 30
+> 16 0 17 0 topology 8 30
+> 15 0 17 0 topology 11 31
+> 16 0 17 0 topology 8 31
+> 15 0 17 0 topology 8 32
+> 16 0 17 0 topology 10 32
+> 15 0 17 0 topology 30 33
+> 16 0 17 0 topology 28 33
+> 15 0 18 0 topology 3 34
+> 16 0 18 0 topology 28 34
+> 15 0 17 0 topology 28 35
+> 16 0 17 0 topology 29 35
+> 15 0 18 0 topology 3 36
+> 16 0 18 0 topology 30 36
+> 15 0 17 0 topology 14 37
+> 16 0 17 0 topology 13 37
+> 15 0 17 0 topology 29 38
+> 16 0 17 0 topology 11 38
+> 15 0 18 0 topology 1 39
+> 16 0 18 0 topology 11 39
+> 15 0 19 0 topology 24 40
+> 16 0 19 0 topology 7 40
+> 15 0 19 0 topology 10 41
+> 16 0 19 0 topology 5 41
+> 15 0 19 0 topology 13 42
+> 16 0 19 0 topology 3 42
+> 15 0 19 0 topology 17 43
+> 16 0 19 0 topology 4 43
+> 15 0 19 0 topology 18 44
+> 16 0 19 0 topology 6 44
+> 15 0 19 0 topology 11 45
+> 16 0 19 0 topology 2 45
+> 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'
@@ -1808,131 +1808,131 @@ $ tail -n +3 simgrid.trace
 > 8 0 5 30 0.035083
 > 8 0 4 31 498000000.000000
 > 8 0 5 31 0.000015
-> 15 0 6 0 topology 19 0
-> 16 0 6 0 topology 20 0
-> 15 0 6 0 topology 15 1
-> 16 0 6 0 topology 9 1
-> 15 0 6 0 topology 27 2
-> 16 0 6 0 topology 18 2
-> 15 0 7 0 topology 5 3
-> 16 0 7 0 topology 24 3
+> 15 0 6 0 topology 12 0
+> 16 0 6 0 topology 16 0
+> 15 0 6 0 topology 9 1
+> 16 0 6 0 topology 16 1
+> 15 0 6 0 topology 16 2
+> 16 0 6 0 topology 14 2
+> 15 0 6 0 topology 21 3
+> 16 0 6 0 topology 19 3
 > 15 0 6 0 topology 8 4
-> 16 0 6 0 topology 10 4
-> 15 0 6 0 topology 21 5
-> 16 0 6 0 topology 22 5
-> 15 0 7 0 topology 1 6
-> 16 0 7 0 topology 9 6
-> 15 0 6 0 topology 23 7
-> 16 0 6 0 topology 24 7
-> 15 0 7 0 topology 1 8
-> 16 0 7 0 topology 15 8
-> 15 0 7 0 topology 1 9
-> 16 0 7 0 topology 11 9
-> 15 0 6 0 topology 26 10
-> 16 0 6 0 topology 27 10
-> 15 0 7 0 topology 5 11
-> 16 0 7 0 topology 18 11
-> 15 0 8 0 topology 11 12
-> 16 0 8 0 topology 2 12
-> 15 0 6 0 topology 28 13
-> 16 0 6 0 topology 29 13
-> 15 0 6 0 topology 12 14
-> 16 0 6 0 topology 16 14
-> 15 0 6 0 topology 9 15
-> 16 0 6 0 topology 16 15
-> 15 0 6 0 topology 14 16
-> 16 0 6 0 topology 13 16
-> 15 0 6 0 topology 29 17
-> 16 0 6 0 topology 11 17
-> 15 0 7 0 topology 3 18
-> 16 0 7 0 topology 30 18
-> 15 0 6 0 topology 11 19
-> 16 0 6 0 topology 15 19
+> 16 0 6 0 topology 19 4
+> 15 0 6 0 topology 19 5
+> 16 0 6 0 topology 20 5
+> 15 0 6 0 topology 8 6
+> 16 0 6 0 topology 20 6
+> 15 0 6 0 topology 27 7
+> 16 0 6 0 topology 18 7
+> 15 0 7 0 topology 5 8
+> 16 0 7 0 topology 18 8
+> 15 0 7 0 topology 4 9
+> 16 0 7 0 topology 18 9
+> 15 0 7 0 topology 2 10
+> 16 0 7 0 topology 18 10
+> 15 0 6 0 topology 16 11
+> 16 0 6 0 topology 21 11
+> 15 0 6 0 topology 21 12
+> 16 0 6 0 topology 22 12
+> 15 0 6 0 topology 9 13
+> 16 0 6 0 topology 12 13
+> 15 0 6 0 topology 15 14
+> 16 0 6 0 topology 9 14
+> 15 0 7 0 topology 1 15
+> 16 0 7 0 topology 9 15
+> 15 0 6 0 topology 20 16
+> 16 0 6 0 topology 23 16
+> 15 0 6 0 topology 23 17
+> 16 0 6 0 topology 24 17
+> 15 0 7 0 topology 5 18
+> 16 0 7 0 topology 24 18
+> 15 0 7 0 topology 4 19
+> 16 0 7 0 topology 24 19
 > 15 0 7 0 topology 2 20
 > 16 0 7 0 topology 24 20
-> 15 0 8 0 topology 18 21
-> 16 0 8 0 topology 6 21
-> 15 0 8 0 topology 10 22
-> 16 0 8 0 topology 5 22
-> 15 0 6 0 topology 8 23
-> 16 0 6 0 topology 19 23
-> 15 0 6 0 topology 12 24
-> 16 0 6 0 topology 25 24
-> 15 0 7 0 topology 4 25
-> 16 0 7 0 topology 24 25
-> 15 0 6 0 topology 16 26
-> 16 0 6 0 topology 14 26
-> 15 0 8 0 topology 17 27
-> 16 0 8 0 topology 4 27
-> 15 0 6 0 topology 12 28
-> 16 0 6 0 topology 17 28
-> 15 0 6 0 topology 9 29
-> 16 0 6 0 topology 17 29
-> 15 0 6 0 topology 21 30
-> 16 0 6 0 topology 19 30
-> 15 0 6 0 topology 22 31
-> 16 0 6 0 topology 25 31
-> 15 0 8 0 topology 24 32
-> 16 0 8 0 topology 7 32
-> 15 0 7 0 topology 3 33
-> 16 0 7 0 topology 28 33
-> 15 0 6 0 topology 25 34
-> 16 0 6 0 topology 26 34
-> 15 0 6 0 topology 8 35
-> 16 0 6 0 topology 20 35
-> 15 0 8 0 topology 13 36
-> 16 0 8 0 topology 3 36
-> 15 0 7 0 topology 2 37
-> 16 0 7 0 topology 18 37
-> 15 0 6 0 topology 9 38
-> 16 0 6 0 topology 12 38
-> 15 0 6 0 topology 14 39
-> 16 0 6 0 topology 8 39
-> 15 0 6 0 topology 20 40
-> 16 0 6 0 topology 23 40
-> 15 0 7 0 topology 4 41
-> 16 0 7 0 topology 18 41
-> 15 0 6 0 topology 13 42
-> 16 0 6 0 topology 8 42
-> 15 0 6 0 topology 11 43
-> 16 0 6 0 topology 8 43
-> 15 0 6 0 topology 16 44
-> 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
+> 15 0 6 0 topology 11 21
+> 16 0 6 0 topology 15 21
+> 15 0 7 0 topology 1 22
+> 16 0 7 0 topology 15 22
+> 15 0 6 0 topology 12 23
+> 16 0 6 0 topology 17 23
+> 15 0 6 0 topology 9 24
+> 16 0 6 0 topology 17 24
+> 15 0 6 0 topology 22 25
+> 16 0 6 0 topology 25 25
+> 15 0 6 0 topology 12 26
+> 16 0 6 0 topology 25 26
+> 15 0 6 0 topology 25 27
+> 16 0 6 0 topology 26 27
+> 15 0 6 0 topology 26 28
+> 16 0 6 0 topology 27 28
+> 15 0 6 0 topology 14 29
+> 16 0 6 0 topology 8 29
+> 15 0 6 0 topology 13 30
+> 16 0 6 0 topology 8 30
+> 15 0 6 0 topology 11 31
+> 16 0 6 0 topology 8 31
+> 15 0 6 0 topology 8 32
+> 16 0 6 0 topology 10 32
+> 15 0 6 0 topology 30 33
+> 16 0 6 0 topology 28 33
+> 15 0 7 0 topology 3 34
+> 16 0 7 0 topology 28 34
+> 15 0 6 0 topology 28 35
+> 16 0 6 0 topology 29 35
+> 15 0 7 0 topology 3 36
+> 16 0 7 0 topology 30 36
+> 15 0 6 0 topology 14 37
+> 16 0 6 0 topology 13 37
+> 15 0 6 0 topology 29 38
+> 16 0 6 0 topology 11 38
+> 15 0 7 0 topology 1 39
+> 16 0 7 0 topology 11 39
+> 15 0 8 0 topology 24 40
+> 16 0 8 0 topology 7 40
+> 15 0 8 0 topology 10 41
+> 16 0 8 0 topology 5 41
+> 15 0 8 0 topology 13 42
+> 16 0 8 0 topology 3 42
+> 15 0 8 0 topology 17 43
+> 16 0 8 0 topology 4 43
+> 15 0 8 0 topology 18 44
+> 16 0 8 0 topology 6 44
+> 15 0 8 0 topology 11 45
+> 16 0 8 0 topology 2 45
+> 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'
@@ -2143,98 +2143,98 @@ $ tail -n +3 simgrid.trace
 > 8 0 6 30 0.035083
 > 8 0 5 31 498000000.000000
 > 8 0 6 31 0.000015
-> 15 0 8 0 topology 19 0
-> 16 0 8 0 topology 20 0
-> 15 0 8 0 topology 15 1
-> 16 0 8 0 topology 9 1
-> 15 0 8 0 topology 27 2
-> 16 0 8 0 topology 18 2
-> 15 0 9 0 topology 5 3
-> 16 0 9 0 topology 24 3
+> 15 0 8 0 topology 12 0
+> 16 0 8 0 topology 16 0
+> 15 0 8 0 topology 9 1
+> 16 0 8 0 topology 16 1
+> 15 0 8 0 topology 16 2
+> 16 0 8 0 topology 14 2
+> 15 0 8 0 topology 21 3
+> 16 0 8 0 topology 19 3
 > 15 0 8 0 topology 8 4
-> 16 0 8 0 topology 10 4
-> 15 0 8 0 topology 21 5
-> 16 0 8 0 topology 22 5
-> 15 0 9 0 topology 1 6
-> 16 0 9 0 topology 9 6
-> 15 0 8 0 topology 23 7
-> 16 0 8 0 topology 24 7
-> 15 0 9 0 topology 1 8
-> 16 0 9 0 topology 15 8
-> 15 0 9 0 topology 1 9
-> 16 0 9 0 topology 11 9
-> 15 0 8 0 topology 26 10
-> 16 0 8 0 topology 27 10
-> 15 0 9 0 topology 5 11
-> 16 0 9 0 topology 18 11
-> 15 0 10 0 topology 11 12
-> 16 0 10 0 topology 2 12
-> 15 0 8 0 topology 28 13
-> 16 0 8 0 topology 29 13
-> 15 0 8 0 topology 12 14
-> 16 0 8 0 topology 16 14
-> 15 0 8 0 topology 9 15
-> 16 0 8 0 topology 16 15
-> 15 0 8 0 topology 14 16
-> 16 0 8 0 topology 13 16
-> 15 0 8 0 topology 29 17
-> 16 0 8 0 topology 11 17
-> 15 0 9 0 topology 3 18
-> 16 0 9 0 topology 30 18
-> 15 0 8 0 topology 11 19
-> 16 0 8 0 topology 15 19
+> 16 0 8 0 topology 19 4
+> 15 0 8 0 topology 19 5
+> 16 0 8 0 topology 20 5
+> 15 0 8 0 topology 8 6
+> 16 0 8 0 topology 20 6
+> 15 0 8 0 topology 27 7
+> 16 0 8 0 topology 18 7
+> 15 0 9 0 topology 5 8
+> 16 0 9 0 topology 18 8
+> 15 0 9 0 topology 4 9
+> 16 0 9 0 topology 18 9
+> 15 0 9 0 topology 2 10
+> 16 0 9 0 topology 18 10
+> 15 0 8 0 topology 16 11
+> 16 0 8 0 topology 21 11
+> 15 0 8 0 topology 21 12
+> 16 0 8 0 topology 22 12
+> 15 0 8 0 topology 9 13
+> 16 0 8 0 topology 12 13
+> 15 0 8 0 topology 15 14
+> 16 0 8 0 topology 9 14
+> 15 0 9 0 topology 1 15
+> 16 0 9 0 topology 9 15
+> 15 0 8 0 topology 20 16
+> 16 0 8 0 topology 23 16
+> 15 0 8 0 topology 23 17
+> 16 0 8 0 topology 24 17
+> 15 0 9 0 topology 5 18
+> 16 0 9 0 topology 24 18
+> 15 0 9 0 topology 4 19
+> 16 0 9 0 topology 24 19
 > 15 0 9 0 topology 2 20
 > 16 0 9 0 topology 24 20
-> 15 0 10 0 topology 18 21
-> 16 0 10 0 topology 6 21
-> 15 0 10 0 topology 10 22
-> 16 0 10 0 topology 5 22
-> 15 0 8 0 topology 8 23
-> 16 0 8 0 topology 19 23
-> 15 0 8 0 topology 12 24
-> 16 0 8 0 topology 25 24
-> 15 0 9 0 topology 4 25
-> 16 0 9 0 topology 24 25
-> 15 0 8 0 topology 16 26
-> 16 0 8 0 topology 14 26
-> 15 0 10 0 topology 17 27
-> 16 0 10 0 topology 4 27
-> 15 0 8 0 topology 12 28
-> 16 0 8 0 topology 17 28
-> 15 0 8 0 topology 9 29
-> 16 0 8 0 topology 17 29
-> 15 0 8 0 topology 21 30
-> 16 0 8 0 topology 19 30
-> 15 0 8 0 topology 22 31
-> 16 0 8 0 topology 25 31
-> 15 0 10 0 topology 24 32
-> 16 0 10 0 topology 7 32
-> 15 0 9 0 topology 3 33
-> 16 0 9 0 topology 28 33
-> 15 0 8 0 topology 25 34
-> 16 0 8 0 topology 26 34
-> 15 0 8 0 topology 8 35
-> 16 0 8 0 topology 20 35
-> 15 0 10 0 topology 13 36
-> 16 0 10 0 topology 3 36
-> 15 0 9 0 topology 2 37
-> 16 0 9 0 topology 18 37
-> 15 0 8 0 topology 9 38
-> 16 0 8 0 topology 12 38
-> 15 0 8 0 topology 14 39
-> 16 0 8 0 topology 8 39
-> 15 0 8 0 topology 20 40
-> 16 0 8 0 topology 23 40
-> 15 0 9 0 topology 4 41
-> 16 0 9 0 topology 18 41
-> 15 0 8 0 topology 13 42
-> 16 0 8 0 topology 8 42
-> 15 0 8 0 topology 11 43
-> 16 0 8 0 topology 8 43
-> 15 0 8 0 topology 16 44
-> 16 0 8 0 topology 21 44
-> 15 0 8 0 topology 30 45
-> 16 0 8 0 topology 28 45
+> 15 0 8 0 topology 11 21
+> 16 0 8 0 topology 15 21
+> 15 0 9 0 topology 1 22
+> 16 0 9 0 topology 15 22
+> 15 0 8 0 topology 12 23
+> 16 0 8 0 topology 17 23
+> 15 0 8 0 topology 9 24
+> 16 0 8 0 topology 17 24
+> 15 0 8 0 topology 22 25
+> 16 0 8 0 topology 25 25
+> 15 0 8 0 topology 12 26
+> 16 0 8 0 topology 25 26
+> 15 0 8 0 topology 25 27
+> 16 0 8 0 topology 26 27
+> 15 0 8 0 topology 26 28
+> 16 0 8 0 topology 27 28
+> 15 0 8 0 topology 14 29
+> 16 0 8 0 topology 8 29
+> 15 0 8 0 topology 13 30
+> 16 0 8 0 topology 8 30
+> 15 0 8 0 topology 11 31
+> 16 0 8 0 topology 8 31
+> 15 0 8 0 topology 8 32
+> 16 0 8 0 topology 10 32
+> 15 0 8 0 topology 30 33
+> 16 0 8 0 topology 28 33
+> 15 0 9 0 topology 3 34
+> 16 0 9 0 topology 28 34
+> 15 0 8 0 topology 28 35
+> 16 0 8 0 topology 29 35
+> 15 0 9 0 topology 3 36
+> 16 0 9 0 topology 30 36
+> 15 0 8 0 topology 14 37
+> 16 0 8 0 topology 13 37
+> 15 0 8 0 topology 29 38
+> 16 0 8 0 topology 11 38
+> 15 0 9 0 topology 1 39
+> 16 0 9 0 topology 11 39
+> 15 0 10 0 topology 24 40
+> 16 0 10 0 topology 7 40
+> 15 0 10 0 topology 10 41
+> 16 0 10 0 topology 5 41
+> 15 0 10 0 topology 13 42
+> 16 0 10 0 topology 3 42
+> 15 0 10 0 topology 17 43
+> 16 0 10 0 topology 4 43
+> 15 0 10 0 topology 18 44
+> 16 0 10 0 topology 6 44
+> 15 0 10 0 topology 11 45
+> 16 0 10 0 topology 2 45
 > 8 2.025708 7 15 0.000000
 > 9 2.025708 7 15 7536438.095238
 > 10 2.025708 7 15 7536438.095238
@@ -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'
@@ -2572,98 +2572,98 @@ $ tail -n +3 simgrid.trace
 > 4 12 0 11 11 0-LINK11-LINK11
 > 4 13 0 1 11 0-HOST1-LINK11
 > 4 14 0 11 1 0-LINK11-HOST1
-> 15 0 12 0 topology 19 0
-> 16 0 12 0 topology 20 0
-> 15 0 12 0 topology 15 1
-> 16 0 12 0 topology 9 1
-> 15 0 12 0 topology 27 2
-> 16 0 12 0 topology 18 2
-> 15 0 13 0 topology 5 3
-> 16 0 13 0 topology 24 3
+> 15 0 12 0 topology 12 0
+> 16 0 12 0 topology 16 0
+> 15 0 12 0 topology 9 1
+> 16 0 12 0 topology 16 1
+> 15 0 12 0 topology 16 2
+> 16 0 12 0 topology 14 2
+> 15 0 12 0 topology 21 3
+> 16 0 12 0 topology 19 3
 > 15 0 12 0 topology 8 4
-> 16 0 12 0 topology 10 4
-> 15 0 12 0 topology 21 5
-> 16 0 12 0 topology 22 5
-> 15 0 13 0 topology 1 6
-> 16 0 13 0 topology 9 6
-> 15 0 12 0 topology 23 7
-> 16 0 12 0 topology 24 7
-> 15 0 13 0 topology 1 8
-> 16 0 13 0 topology 15 8
-> 15 0 13 0 topology 1 9
-> 16 0 13 0 topology 11 9
-> 15 0 12 0 topology 26 10
-> 16 0 12 0 topology 27 10
-> 15 0 13 0 topology 5 11
-> 16 0 13 0 topology 18 11
-> 15 0 14 0 topology 11 12
-> 16 0 14 0 topology 2 12
-> 15 0 12 0 topology 28 13
-> 16 0 12 0 topology 29 13
-> 15 0 12 0 topology 12 14
-> 16 0 12 0 topology 16 14
-> 15 0 12 0 topology 9 15
-> 16 0 12 0 topology 16 15
-> 15 0 12 0 topology 14 16
-> 16 0 12 0 topology 13 16
-> 15 0 12 0 topology 29 17
-> 16 0 12 0 topology 11 17
-> 15 0 13 0 topology 3 18
-> 16 0 13 0 topology 30 18
-> 15 0 12 0 topology 11 19
-> 16 0 12 0 topology 15 19
+> 16 0 12 0 topology 19 4
+> 15 0 12 0 topology 19 5
+> 16 0 12 0 topology 20 5
+> 15 0 12 0 topology 8 6
+> 16 0 12 0 topology 20 6
+> 15 0 12 0 topology 27 7
+> 16 0 12 0 topology 18 7
+> 15 0 13 0 topology 5 8
+> 16 0 13 0 topology 18 8
+> 15 0 13 0 topology 4 9
+> 16 0 13 0 topology 18 9
+> 15 0 13 0 topology 2 10
+> 16 0 13 0 topology 18 10
+> 15 0 12 0 topology 16 11
+> 16 0 12 0 topology 21 11
+> 15 0 12 0 topology 21 12
+> 16 0 12 0 topology 22 12
+> 15 0 12 0 topology 9 13
+> 16 0 12 0 topology 12 13
+> 15 0 12 0 topology 15 14
+> 16 0 12 0 topology 9 14
+> 15 0 13 0 topology 1 15
+> 16 0 13 0 topology 9 15
+> 15 0 12 0 topology 20 16
+> 16 0 12 0 topology 23 16
+> 15 0 12 0 topology 23 17
+> 16 0 12 0 topology 24 17
+> 15 0 13 0 topology 5 18
+> 16 0 13 0 topology 24 18
+> 15 0 13 0 topology 4 19
+> 16 0 13 0 topology 24 19
 > 15 0 13 0 topology 2 20
 > 16 0 13 0 topology 24 20
-> 15 0 14 0 topology 18 21
-> 16 0 14 0 topology 6 21
-> 15 0 14 0 topology 10 22
-> 16 0 14 0 topology 5 22
-> 15 0 12 0 topology 8 23
-> 16 0 12 0 topology 19 23
-> 15 0 12 0 topology 12 24
-> 16 0 12 0 topology 25 24
-> 15 0 13 0 topology 4 25
-> 16 0 13 0 topology 24 25
-> 15 0 12 0 topology 16 26
-> 16 0 12 0 topology 14 26
-> 15 0 14 0 topology 17 27
-> 16 0 14 0 topology 4 27
-> 15 0 12 0 topology 12 28
-> 16 0 12 0 topology 17 28
-> 15 0 12 0 topology 9 29
-> 16 0 12 0 topology 17 29
-> 15 0 12 0 topology 21 30
-> 16 0 12 0 topology 19 30
-> 15 0 12 0 topology 22 31
-> 16 0 12 0 topology 25 31
-> 15 0 14 0 topology 24 32
-> 16 0 14 0 topology 7 32
-> 15 0 13 0 topology 3 33
-> 16 0 13 0 topology 28 33
-> 15 0 12 0 topology 25 34
-> 16 0 12 0 topology 26 34
-> 15 0 12 0 topology 8 35
-> 16 0 12 0 topology 20 35
-> 15 0 14 0 topology 13 36
-> 16 0 14 0 topology 3 36
-> 15 0 13 0 topology 2 37
-> 16 0 13 0 topology 18 37
-> 15 0 12 0 topology 9 38
-> 16 0 12 0 topology 12 38
-> 15 0 12 0 topology 14 39
-> 16 0 12 0 topology 8 39
-> 15 0 12 0 topology 20 40
-> 16 0 12 0 topology 23 40
-> 15 0 13 0 topology 4 41
-> 16 0 13 0 topology 18 41
-> 15 0 12 0 topology 13 42
-> 16 0 12 0 topology 8 42
-> 15 0 12 0 topology 11 43
-> 16 0 12 0 topology 8 43
-> 15 0 12 0 topology 16 44
-> 16 0 12 0 topology 21 44
-> 15 0 12 0 topology 30 45
-> 16 0 12 0 topology 28 45
+> 15 0 12 0 topology 11 21
+> 16 0 12 0 topology 15 21
+> 15 0 13 0 topology 1 22
+> 16 0 13 0 topology 15 22
+> 15 0 12 0 topology 12 23
+> 16 0 12 0 topology 17 23
+> 15 0 12 0 topology 9 24
+> 16 0 12 0 topology 17 24
+> 15 0 12 0 topology 22 25
+> 16 0 12 0 topology 25 25
+> 15 0 12 0 topology 12 26
+> 16 0 12 0 topology 25 26
+> 15 0 12 0 topology 25 27
+> 16 0 12 0 topology 26 27
+> 15 0 12 0 topology 26 28
+> 16 0 12 0 topology 27 28
+> 15 0 12 0 topology 14 29
+> 16 0 12 0 topology 8 29
+> 15 0 12 0 topology 13 30
+> 16 0 12 0 topology 8 30
+> 15 0 12 0 topology 11 31
+> 16 0 12 0 topology 8 31
+> 15 0 12 0 topology 8 32
+> 16 0 12 0 topology 10 32
+> 15 0 12 0 topology 30 33
+> 16 0 12 0 topology 28 33
+> 15 0 13 0 topology 3 34
+> 16 0 13 0 topology 28 34
+> 15 0 12 0 topology 28 35
+> 16 0 12 0 topology 29 35
+> 15 0 13 0 topology 3 36
+> 16 0 13 0 topology 30 36
+> 15 0 12 0 topology 14 37
+> 16 0 12 0 topology 13 37
+> 15 0 12 0 topology 29 38
+> 16 0 12 0 topology 11 38
+> 15 0 13 0 topology 1 39
+> 16 0 13 0 topology 11 39
+> 15 0 14 0 topology 24 40
+> 16 0 14 0 topology 7 40
+> 15 0 14 0 topology 10 41
+> 16 0 14 0 topology 5 41
+> 15 0 14 0 topology 13 42
+> 16 0 14 0 topology 3 42
+> 15 0 14 0 topology 17 43
+> 16 0 14 0 topology 4 43
+> 15 0 14 0 topology 18 44
+> 16 0 14 0 topology 6 44
+> 15 0 14 0 topology 11 45
+> 16 0 14 0 topology 2 45
 > 6 0 32 2 3 "emigrant-1"
 > 6 0 33 2 1 "policeman-2"
 > 12 0 3 32 5
@@ -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..33ba72b 100644 (file)
@@ -208,98 +208,98 @@ $ tail -n +3 simgrid.trace
 > 8 0 5 30 0.035083
 > 8 0 4 31 498000000.000000
 > 8 0 5 31 0.000015
-> 15 0 6 0 topology 19 0
-> 16 0 6 0 topology 20 0
-> 15 0 6 0 topology 15 1
-> 16 0 6 0 topology 9 1
-> 15 0 6 0 topology 27 2
-> 16 0 6 0 topology 18 2
-> 15 0 7 0 topology 5 3
-> 16 0 7 0 topology 24 3
+> 15 0 6 0 topology 12 0
+> 16 0 6 0 topology 16 0
+> 15 0 6 0 topology 9 1
+> 16 0 6 0 topology 16 1
+> 15 0 6 0 topology 16 2
+> 16 0 6 0 topology 14 2
+> 15 0 6 0 topology 21 3
+> 16 0 6 0 topology 19 3
 > 15 0 6 0 topology 8 4
-> 16 0 6 0 topology 10 4
-> 15 0 6 0 topology 21 5
-> 16 0 6 0 topology 22 5
-> 15 0 7 0 topology 1 6
-> 16 0 7 0 topology 9 6
-> 15 0 6 0 topology 23 7
-> 16 0 6 0 topology 24 7
-> 15 0 7 0 topology 1 8
-> 16 0 7 0 topology 15 8
-> 15 0 7 0 topology 1 9
-> 16 0 7 0 topology 11 9
-> 15 0 6 0 topology 26 10
-> 16 0 6 0 topology 27 10
-> 15 0 7 0 topology 5 11
-> 16 0 7 0 topology 18 11
-> 15 0 8 0 topology 11 12
-> 16 0 8 0 topology 2 12
-> 15 0 6 0 topology 28 13
-> 16 0 6 0 topology 29 13
-> 15 0 6 0 topology 12 14
-> 16 0 6 0 topology 16 14
-> 15 0 6 0 topology 9 15
-> 16 0 6 0 topology 16 15
-> 15 0 6 0 topology 14 16
-> 16 0 6 0 topology 13 16
-> 15 0 6 0 topology 29 17
-> 16 0 6 0 topology 11 17
-> 15 0 7 0 topology 3 18
-> 16 0 7 0 topology 30 18
-> 15 0 6 0 topology 11 19
-> 16 0 6 0 topology 15 19
+> 16 0 6 0 topology 19 4
+> 15 0 6 0 topology 19 5
+> 16 0 6 0 topology 20 5
+> 15 0 6 0 topology 8 6
+> 16 0 6 0 topology 20 6
+> 15 0 6 0 topology 27 7
+> 16 0 6 0 topology 18 7
+> 15 0 7 0 topology 5 8
+> 16 0 7 0 topology 18 8
+> 15 0 7 0 topology 4 9
+> 16 0 7 0 topology 18 9
+> 15 0 7 0 topology 2 10
+> 16 0 7 0 topology 18 10
+> 15 0 6 0 topology 16 11
+> 16 0 6 0 topology 21 11
+> 15 0 6 0 topology 21 12
+> 16 0 6 0 topology 22 12
+> 15 0 6 0 topology 9 13
+> 16 0 6 0 topology 12 13
+> 15 0 6 0 topology 15 14
+> 16 0 6 0 topology 9 14
+> 15 0 7 0 topology 1 15
+> 16 0 7 0 topology 9 15
+> 15 0 6 0 topology 20 16
+> 16 0 6 0 topology 23 16
+> 15 0 6 0 topology 23 17
+> 16 0 6 0 topology 24 17
+> 15 0 7 0 topology 5 18
+> 16 0 7 0 topology 24 18
+> 15 0 7 0 topology 4 19
+> 16 0 7 0 topology 24 19
 > 15 0 7 0 topology 2 20
 > 16 0 7 0 topology 24 20
-> 15 0 8 0 topology 18 21
-> 16 0 8 0 topology 6 21
-> 15 0 8 0 topology 10 22
-> 16 0 8 0 topology 5 22
-> 15 0 6 0 topology 8 23
-> 16 0 6 0 topology 19 23
-> 15 0 6 0 topology 12 24
-> 16 0 6 0 topology 25 24
-> 15 0 7 0 topology 4 25
-> 16 0 7 0 topology 24 25
-> 15 0 6 0 topology 16 26
-> 16 0 6 0 topology 14 26
-> 15 0 8 0 topology 17 27
-> 16 0 8 0 topology 4 27
-> 15 0 6 0 topology 12 28
-> 16 0 6 0 topology 17 28
-> 15 0 6 0 topology 9 29
-> 16 0 6 0 topology 17 29
-> 15 0 6 0 topology 21 30
-> 16 0 6 0 topology 19 30
-> 15 0 6 0 topology 22 31
-> 16 0 6 0 topology 25 31
-> 15 0 8 0 topology 24 32
-> 16 0 8 0 topology 7 32
-> 15 0 7 0 topology 3 33
-> 16 0 7 0 topology 28 33
-> 15 0 6 0 topology 25 34
-> 16 0 6 0 topology 26 34
-> 15 0 6 0 topology 8 35
-> 16 0 6 0 topology 20 35
-> 15 0 8 0 topology 13 36
-> 16 0 8 0 topology 3 36
-> 15 0 7 0 topology 2 37
-> 16 0 7 0 topology 18 37
-> 15 0 6 0 topology 9 38
-> 16 0 6 0 topology 12 38
-> 15 0 6 0 topology 14 39
-> 16 0 6 0 topology 8 39
-> 15 0 6 0 topology 20 40
-> 16 0 6 0 topology 23 40
-> 15 0 7 0 topology 4 41
-> 16 0 7 0 topology 18 41
-> 15 0 6 0 topology 13 42
-> 16 0 6 0 topology 8 42
-> 15 0 6 0 topology 11 43
-> 16 0 6 0 topology 8 43
-> 15 0 6 0 topology 16 44
-> 16 0 6 0 topology 21 44
-> 15 0 6 0 topology 30 45
-> 16 0 6 0 topology 28 45
+> 15 0 6 0 topology 11 21
+> 16 0 6 0 topology 15 21
+> 15 0 7 0 topology 1 22
+> 16 0 7 0 topology 15 22
+> 15 0 6 0 topology 12 23
+> 16 0 6 0 topology 17 23
+> 15 0 6 0 topology 9 24
+> 16 0 6 0 topology 17 24
+> 15 0 6 0 topology 22 25
+> 16 0 6 0 topology 25 25
+> 15 0 6 0 topology 12 26
+> 16 0 6 0 topology 25 26
+> 15 0 6 0 topology 25 27
+> 16 0 6 0 topology 26 27
+> 15 0 6 0 topology 26 28
+> 16 0 6 0 topology 27 28
+> 15 0 6 0 topology 14 29
+> 16 0 6 0 topology 8 29
+> 15 0 6 0 topology 13 30
+> 16 0 6 0 topology 8 30
+> 15 0 6 0 topology 11 31
+> 16 0 6 0 topology 8 31
+> 15 0 6 0 topology 8 32
+> 16 0 6 0 topology 10 32
+> 15 0 6 0 topology 30 33
+> 16 0 6 0 topology 28 33
+> 15 0 7 0 topology 3 34
+> 16 0 7 0 topology 28 34
+> 15 0 6 0 topology 28 35
+> 16 0 6 0 topology 29 35
+> 15 0 7 0 topology 3 36
+> 16 0 7 0 topology 30 36
+> 15 0 6 0 topology 14 37
+> 16 0 6 0 topology 13 37
+> 15 0 6 0 topology 29 38
+> 16 0 6 0 topology 11 38
+> 15 0 7 0 topology 1 39
+> 16 0 7 0 topology 11 39
+> 15 0 8 0 topology 24 40
+> 16 0 8 0 topology 7 40
+> 15 0 8 0 topology 10 41
+> 16 0 8 0 topology 5 41
+> 15 0 8 0 topology 13 42
+> 16 0 8 0 topology 3 42
+> 15 0 8 0 topology 17 43
+> 16 0 8 0 topology 4 43
+> 15 0 8 0 topology 18 44
+> 16 0 8 0 topology 6 44
+> 15 0 8 0 topology 11 45
+> 16 0 8 0 topology 2 45
 > 1 9 3 Link_Capacity "1 1 1"
 > 1 10 3 Link_Utilization "0.9 0.1 0.1"
 > 8 0 9 15 12.340000
@@ -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
index 38b306b..9f3fbdc 100644 (file)
@@ -5,9 +5,7 @@
     <prop id="tracing/uncategorized" value="yes"/>
     <prop id="tracing/buffer" value="yes"/>
     <prop id="tracing" value="yes"/>
-    <prop id="viva/categorized" value="trace-masterworker.cat.plist"/>
     <prop id="tracing/filename" value="trace-masterworker.trace"/>
-    <prop id="viva/uncategorized" value="trace-masterworker.uncat.plist"/>
     <prop id="tracing/categorized" value="yes"/>
   </config>
 
index 03ce9c7..7d9ace5 100644 (file)
       <prop id="watt_per_state" value="100.0:200.0, 93.0:170.0, 90.0:150.0" />
       <prop id="watt_off" value="10" />
     </host>
-
-    <link id="bus" bandwidth="100kBps" latency="0"/>
+    <link id="bus" bandwidth="100kBps" latency="0" sharing_policy="SHARED">
+<!--   REALISTIC VALUES                    <prop id="watt_range" value="10.3581:10.7479" /> -->
+<!--  IREALISTIC VALUES FOR THE TEST -->   <prop id="watt_range" value="1:3" /> 
+    </link>
     <route src="MyHost1" dst="MyHost2">
       <link_ctn id="bus"/>
     </route>
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 72a43da..5b88ee4 100644 (file)
@@ -1,37 +1,70 @@
-foreach (example actions-comm actions-storage actor-create actor-daemon actor-kill actor-migration actor-suspend 
-                 app-masterworker app-pingpong app-token-ring plugin-hostload io mutex )
-  add_executable       (s4u_${example}  ${example}/s4u_${example}.cpp)
-  target_link_libraries(s4u_${example}  simgrid)
-  set_target_properties(s4u_${example}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
+foreach (example actions-comm actions-storage 
+                 actor-create actor-daemon actor-execute actor-kill actor-lifetime actor-migration actor-suspend actor-priority
+                 app-masterworker app-pingpong app-token-ring
+                async-wait async-waitany async-waitall
+                energy-link
+                plugin-hostload io mutex)
+  add_executable       (s4u-${example}  ${example}/s4u-${example}.cpp)
+  target_link_libraries(s4u-${example}  simgrid)
+  set_target_properties(s4u-${example}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
 
-  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u_${example}.tesh)
-  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u_${example}.cpp)
+  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.tesh)
+  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.cpp)
 endforeach()
 
 # CHORD EXAMPLE
-add_executable       (s4u_dht-chord dht-chord/s4u_dht-chord.cpp dht-chord/node.cpp)
-target_link_libraries(s4u_dht-chord simgrid)
-set_target_properties(s4u_dht-chord PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-chord)
-foreach (file s4u_dht-chord node)
+add_executable       (s4u-dht-chord dht-chord/s4u-dht-chord.cpp dht-chord/node.cpp)
+target_link_libraries(s4u-dht-chord simgrid)
+set_target_properties(s4u-dht-chord PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-chord)
+foreach (file s4u-dht-chord node)
   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/${file}.cpp)
 endforeach()
-set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u_dht-chord.hpp)
+set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.hpp)
+
+add_executable       (s4u-bittorrent app-bittorrent/s4u-bittorrent.cpp app-bittorrent/s4u-peer.cpp
+                      app-bittorrent/s4u-tracker.cpp)
+target_link_libraries(s4u-bittorrent simgrid)
+set_target_properties(s4u-bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
+foreach (file s4u-bittorrent s4u-peer s4u-tracker)
+  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.cpp
+                                     ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.hpp)
+endforeach()
 
 set(examples_src  ${examples_src}                                                                          PARENT_SCOPE)
-set(tesh_files    ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u_dht-chord.tesh                 PARENT_SCOPE)
-set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u_actions-comm_split_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u_actions-comm_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/s4u_actions-storage_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u_actor-create_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/s4u_app-masterworker_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u_dht-chord_d.xml                PARENT_SCOPE)
-set(txt_files     ${txt_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u_actions-comm_split_p0.txt
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u_actions-comm_split_p1.txt
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u_actions-comm.txt
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/s4u_actions-storage.txt
+set(tesh_files    ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actor-priority/s4u-actor-priority.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/s4u-async-waitany.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/s4u-async-waitall.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actor-execute/s4u-actor-execute.tesh       
+                  PARENT_SCOPE)
+set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm-split_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/s4u-actions-storage_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-actor-create_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actor-priority/s4u-actor-priority_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/s4u-app-masterworker_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/s4u-async-waitany_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/s4u-async-waitall_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime_d.xml
+                 PARENT_SCOPE)
+set(txt_files     ${txt_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm-split-p0.txt
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm-split-p1.txt
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm.txt
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/s4u-actions-storage.txt
                                   ${CMAKE_CURRENT_SOURCE_DIR}/README.doc                                   PARENT_SCOPE)
 
-foreach(example actions-comm actions-storage actor-create actor-daemon actor-kill actor-migration actor-suspend 
-                 app-masterworker app-pingpong app-token-ring dht-chord plugin-hostload io mutex )
-  ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example} s4u_${example}.tesh)
+foreach(example actions-comm actions-storage 
+                actor-create actor-daemon actor-execute actor-kill actor-lifetime actor-migration actor-suspend
+                app-bittorrent app-masterworker app-pingpong app-token-ring 
+               async-wait async-waitall async-waitany actor-priority
+               dht-chord 
+               energy-link
+               plugin-hostload io mutex)
+  ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example} s4u-${example}.tesh)
 endforeach()
index c875b41..78254fb 100644 (file)
@@ -1,9 +1,9 @@
 S4U (Simgrid for you) is the next interface of SimGrid, expected to be released with SimGrid 4.0.
 
-Even if it's in a very preliminary state so far, you are welcome to
-try it and report any interface glitches that you see. Be however
-warned that the interface will be modified until its final release. 
-You will have to adapt your code on the way.
+Even if it is not completely rock stable yet, it may well already fit
+your needs. You are welcome to try it and report any interface
+glitches that you see. Be however warned that the interface may change
+until its final release.  You will have to adapt your code on the way.
 
 This file follows the Doxygen syntax to be included in the
 documentation, but it should remain readable directly.
@@ -14,56 +14,96 @@ documentation, but it should remain readable directly.
  @brief Find the S4U example fitting your needs in the archive.
 
   - @ref s4u_ex_basics
+  - @ref s4u_ex_async
   - @ref s4u_ex_actors
   - @ref s4u_ex_synchro
   - @ref s4u_ex_actions
 
 @section s4u_ex_basics Basics of SimGrid simulation
 
-  - <b>Creating actors:</b> @ref examples/s4u/actor-create/s4u_actor-create.cpp and 
-    @ref examples/s4u/actor-create/s4u_actor-create_d.xml \n
+  - <b>Creating actors:</b> @ref examples/s4u/actor-create/s4u-actor-create.cpp and 
+    @ref examples/s4u/actor-create/s4u-actor-create_d.xml \n
     Shows how to start your actors to populate your simulation.
 
-  - <b>Ping Pong</b>: @ref examples/s4u/app-pingpong/s4u_app-pingpong.c\n
-   It's hard to think of a simpler example: it is just sending one message back and forth.
-   The tesh file laying in the directory show how to start the simulator binary, highlighting how to pass options to 
-   the simulators (as detailed in Section \ref options). 
+  - <b>Ping Pong</b>: @ref examples/s4u/app-pingpong/s4u-app-pingpong.cpp\n
+    This simple example just sends one message back and forth.
+    The tesh file laying in the directory show how to start the simulator binary, highlighting how to pass options to 
+    the simulators (as detailed in Section \ref options). 
 
-  - <b>Token ring:</b> @ref examples/s4u/app-token-ring/s4u_app-token-ring.cpp \n
+  - <b>Token ring:</b> @ref examples/s4u/app-token-ring/s4u-app-token-ring.cpp \n
     Shows how to implement a classical communication pattern, where a token is exchanged along a ring to reach every
     participant.
 
-  - <b>Master Workers:</b> @ref examples/s4u/app-masterworker/s4u_app-masterworker.cpp \n
+  - <b>Master Workers:</b> @ref examples/s4u/app-masterworker/s4u-app-masterworker.cpp \n
     Another good old example, where one Master process has a bunch of task to dispatch to a set of several Worker 
     processes. 
+    
+@section s4u_ex_async Asynchronous communications
+
+ - <b>Basic asynchronous communications</b>. 
+   @ref examples/s4u/async-wait/s4u-async-wait.cpp \n
+   Illustrates how to have non-blocking communications, that are
+   communications running in the background leaving the process free
+   to do something else during their completion. The main functions
+   involved are @ref simgrid::s4u::Comm::put_async and 
+   @ref simgrid::s4u::Comm::wait().
+
+ - <b>Waiting for all communications in a set</b>.
+   @ref examples/s4u/async-waitall/s4u-async-waitall.cpp\n
+   The @ref simgrid::s4u::Comm::wait_all() function is useful when you want to block
+   until all activities in a given set have completed.
+
+ - <b>Waiting for the first completed communication in a set</b>.
+   @ref examples/s4u/async-waitany/s4u-async-waitany.cpp\n
+   The @ref simgrid::s4u::Comm::wait_any() function is useful when you want to block
+   until one activity of the set completes, no matter which terminates
+   first.    
 
 @section s4u_ex_actors Acting on Actors
 
   - <b>Creating actors</b>. 
-    @ref examples/s4u/actor-create/s4u_actor-create.cpp \n
+    @ref examples/s4u/actor-create/s4u-actor-create.cpp \n
     Most actors are started from the deployment XML file, but they exist other methods.
 
+  - <b>Actors using CPU time</b>.
+    @ref examples/s4u/actor-execute/s4u-actor-execute.cpp \n
+    The computations done in your program are not reported to the
+    simulated world, unless you explicitely request the simulator to pause
+    the actor until a given amount of flops gets computed on its simulated
+    host.
+
   - <b>Daemonize actors</b>
-    @ref examples/s4u/actor-daemon/s4u_actor-daemon.cpp \n
+    @ref examples/s4u/actor-daemon/s4u-actor-daemon.cpp \n
     Some actors may be intended to simulate daemons that run in background. This example show how to transform a regular
     actor into a daemon that will be automatically killed once the simulation is over. 
 
   - <b>Suspend and Resume actors</b>.
-    @ref examples/s4u/actor-suspend/s4u_actor-suspend.cpp \n
+    @ref examples/s4u/actor-suspend/s4u-actor-suspend.cpp \n
     Actors can be suspended and resumed during their executions
     thanks to the @ref suspend and @ref resume methods.
 
+    - <b>Priority actors</b>.
+    @ref examples/s4u/actor-priority/s4u-actor-priority.cpp \n
+    Actors can be launched according their priorities thanks to the @ref
+     execution method.
+
   - <b>Kill actors</b>.
-    @ref examples/s4u/actor-kill/s4u_actor-kill.cpp \n
+    @ref examples/s4u/actor-kill/s4u-actor-kill.cpp \n
     Actors can forcefully stop other actors with the @ref kill method.
 
+  - <b>Controling the actor life cycle from the XML</b>.
+    @ref examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp 
+    @ref examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml 
+    \n
+    You can specify a start time and a kill time in the deployment file.
+
   - <b>Migrating Actors</b>.
-    @ref examples/s4u/actor-migration/s4u_actor-migration.cpp \n
+    @ref examples/s4u/actor-migration/s4u-actor-migration.cpp \n
     Actors can move or be moved from a host to another with the @ref migrate method.
 
 @section s4u_ex_synchro Inter-Actor Synchronization 
 
- - <b>Mutex: </b> @ref examples/s4u/mutex/s4u_mutex.cpp \n
+ - <b>Mutex: </b> @ref examples/s4u/mutex/s4u-mutex.cpp \n
    Shows how to use simgrid::s4u::Mutex synchronization objects.
 
 @section s4u_ex_actions Following Workload Traces
@@ -85,30 +125,33 @@ with, but the second is more efficient on very large traces. Check
 also the tesh files in the example directories for details.
 
   - <b>Communication replay</b>.
-    @ref examples/s4u/actions-comm/s4u_actions-comm.cpp \n
+    @ref examples/s4u/actions-comm/s4u-actions-comm.cpp \n
     Presents a set of event handlers reproducing classical communication
     primitives (asynchronous send/receive at the moment).
 
   - <b>I/O replay</b>.
-    @ref examples/s4u/actions-storage/s4u_actions-storage.cpp \n
+    @ref examples/s4u/actions-storage/s4u-actions-storage.cpp \n
     Presents a set of event handlers reproducing classical I/O
     primitives (open, read, close).
 
 */
 
 /**
-@example examples/s4u/actions-comm/s4u_actions-comm.cpp
-@example examples/s4u/actions-storage/s4u_actions-storage.cpp
-@example examples/s4u/actor-create/s4u_actor-create.cpp
-@example examples/s4u/actor-create/s4u_actor-create_d.xml
-@example examples/s4u/actor-daemon/s4u_actor-daemon.cpp
-@example examples/s4u/actor-kill/s4u_actor-kill.cpp
-@example examples/s4u/actor-migration/s4u_actor-migration.cpp
-@example examples/s4u/actor-suspend/s4u_actor-suspend.cpp
-@example examples/s4u/app-token-ring/s4u_app-token-ring.cpp
-@example examples/s4u/app-masterworker/s4u_app-masterworker.cpp
-@example examples/s4u/app-pingpong/s4u_app-pingpong.cpp
-
-@example examples/s4u/mutex/s4u_mutex.cpp
+@example examples/s4u/actions-comm/s4u-actions-comm.cpp
+@example examples/s4u/actions-storage/s4u-actions-storage.cpp
+@example examples/s4u/actor-create/s4u-actor-create.cpp
+@example examples/s4u/actor-create/s4u-actor-create_d.xml
+@example examples/s4u/actor-daemon/s4u-actor-daemon.cpp
+@example examples/s4u/actor-execute/s4u-actor-execute.cpp
+@example examples/s4u/actor-kill/s4u-actor-kill.cpp
+@example examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp 
+@example examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml 
+@example examples/s4u/actor-migration/s4u-actor-migration.cpp
+@example examples/s4u/actor-suspend/s4u-actor-suspend.cpp
+@example examples/s4u/app-token-ring/s4u-app-token-ring.cpp
+@example examples/s4u/app-masterworker/s4u-app-masterworker.cpp
+@example examples/s4u/app-pingpong/s4u-app-pingpong.cpp
+
+@example examples/s4u/mutex/s4u-mutex.cpp
 
 */
\ No newline at end of file
@@ -3,12 +3,12 @@
 <platform version="4.1">
 <!-- Example file of how to use trace replay, with actions split in separate files, one per actor.
      Launch it like this:
-         ./actions-comm ../../platforms/platform.xml actions-comm_split_d.xml  -->
+         ./actions-comm ../../platforms/platform.xml actions-comm-split_d.xml  -->
 
   <actor host="Tremblay" function="p0">
-    <argument value="s4u_actions-comm_split_p0.txt"/>
+    <argument value="s4u-actions-comm-split-p0.txt"/>
   </actor>
   <actor host="Ruby"     function="p1">
-    <argument value="s4u_actions-comm_split_p1.txt"/>
+    <argument value="s4u-actions-comm-split-p1.txt"/>
   </actor>
 </platform>
@@ -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);
   }
@@ -85,7 +85,7 @@ public:
 
 int main(int argc, char *argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
 
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file [action_files]\n"
                        "\t# if all actions are in the same file\n"
@@ -94,11 +94,11 @@ int main(int argc, char *argv[])
                        "\tExample: %s msg_platform.xml msg_deployment.xml ",
              argv[0], argv[0], argv[0]);
 
-  e->loadPlatform(argv[1]);
-  e->registerDefault(&simgrid::xbt::replay_runner);
-  e->registerFunction<Replayer>("p0");
-  e->registerFunction<Replayer>("p1");
-  e->loadDeployment(argv[2]);
+  e.loadPlatform(argv[1]);
+  e.registerDefault(&simgrid::xbt::replay_runner);
+  e.registerFunction<Replayer>("p0");
+  e.registerFunction<Replayer>("p1");
+  e.loadDeployment(argv[2]);
 
   /*   Action registration */
   xbt_replay_action_register("compute", Replayer::compute);
@@ -109,15 +109,14 @@ int main(int argc, char *argv[])
     simgrid::xbt::action_fs = new std::ifstream(argv[3], std::ifstream::in);
   }
 
-  e->run();
+  e.run();
 
   if (argv[3]) {
     delete simgrid::xbt::action_fs;
     simgrid::xbt::action_fs = nullptr;
   }
 
-  XBT_INFO("Simulation time %g", e->getClock());
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }
@@ -1,12 +1,12 @@
 ! output sort 19
-$ ${bindir:=.}/s4u_actions-comm --log=actions.thres=verbose ${srcdir:=.}/small_platform_fatpipe.xml s4u_actions-comm_split_d.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actions-comm --log=actions.thres=verbose ${srcdir:=.}/small_platform_fatpipe.xml s4u-actions-comm-split_d.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [ 20.703314] (p0@Tremblay) p0 recv p1 20.703314
 > [ 20.703314] (p1@Ruby) p1 send p0 1e10 20.703314
 > [ 30.897513] (p0@Tremblay) p0 compute 1e9 10.194200
 > [ 30.897513] (p1@Ruby) p1 compute 1e9 10.194200
 > [ 30.897513] (maestro@) Simulation time 30.8975
 
-$ ${bindir:=.}/s4u_actions-comm --log=actions.thres=verbose ${srcdir:=.}/small_platform_fatpipe.xml s4u_actions-comm_d.xml s4u_actions-comm.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actions-comm --log=actions.thres=verbose ${srcdir:=.}/small_platform_fatpipe.xml s4u-actions-comm_d.xml s4u-actions-comm.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [ 20.703314] (p0@Tremblay) p0 recv p1 20.703314
 > [ 20.703314] (p1@Ruby) p1 send p0 1e10 20.703314
 > [ 30.897513] (p0@Tremblay) p0 compute 1e9 10.194200
@@ -29,7 +29,7 @@ static void log_action(const char* const* action, double date)
   }
 }
 
-static simgrid::s4u::File* get_file_descriptor(const char* file_name)
+static simgrid::s4u::File* get_file_descriptor(std::string file_name)
 {
   std::string full_name = simgrid::s4u::this_actor::getName() + ":" + file_name;
 
@@ -60,11 +60,11 @@ public:
   /* My actions */
   static void open(const char* const* action)
   {
-    const char* file_name = action[2];
+    std::string file_name = action[2];
     double clock          = simgrid::s4u::Engine::getClock();
     std::string full_name = simgrid::s4u::this_actor::getName() + ":" + file_name;
 
-    ACT_DEBUG("Entering Open: %s (filename: %s)", NAME, file_name);
+    ACT_DEBUG("Entering Open: %s (filename: %s)", NAME, file_name.c_str());
     simgrid::s4u::File* file = new simgrid::s4u::File(file_name, NULL);
 
     opened_files.insert({full_name, file});
@@ -74,7 +74,7 @@ public:
 
   static void read(const char* const* action)
   {
-    const char* file_name = action[2];
+    std::string file_name = action[2];
     sg_size_t size        = std::stoul(action[3]);
     double clock          = simgrid::s4u::Engine::getClock();
 
@@ -88,12 +88,12 @@ public:
 
   static void close(const char* const* action)
   {
-    const char* file_name = action[2];
+    std::string file_name = action[2];
     double clock          = simgrid::s4u::Engine::getClock();
 
     simgrid::s4u::File* file = get_file_descriptor(file_name);
 
-    ACT_DEBUG("Entering Close: %s (filename: %s)", NAME, file_name);
+    ACT_DEBUG("Entering Close: %s (filename: %s)", NAME, file_name.c_str());
     delete file;
 
     log_action(action, simgrid::s4u::Engine::getClock() - clock);
@@ -102,7 +102,8 @@ public:
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
+  sg_storage_file_system_init();
 
   xbt_assert(argc > 3, "Usage: %s platform_file deployment_file [action_files]\n"
                        "\texample: %s platform.xml deployment.xml actions # if all actions are in the same file\n"
@@ -110,10 +111,10 @@ int main(int argc, char* argv[])
                        "\texample: %s platform.xml deployment.xml",
              argv[0], argv[0], argv[0]);
 
-  e->loadPlatform(argv[1]);
-  e->registerDefault(&simgrid::xbt::replay_runner);
-  e->registerFunction<Replayer>("p0");
-  e->loadDeployment(argv[2]);
+  e.loadPlatform(argv[1]);
+  e.registerDefault(&simgrid::xbt::replay_runner);
+  e.registerFunction<Replayer>("p0");
+  e.loadDeployment(argv[2]);
 
   /*   Action registration */
   xbt_replay_action_register("open", Replayer::open);
@@ -124,15 +125,14 @@ int main(int argc, char* argv[])
     simgrid::xbt::action_fs = new std::ifstream(argv[3], std::ifstream::in);
   }
 
-  e->run();
+  e.run();
 
   if (argv[3]) {
     delete simgrid::xbt::action_fs;
     simgrid::xbt::action_fs = nullptr;
   }
 
-  XBT_INFO("Simulation time %g", e->getClock());
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }
@@ -1,5 +1,5 @@
 ! output sort 19
-$ ${bindir:=.}/s4u_actions-storage --log=storage_actions.thres=verbose ${srcdir:=.}/storage/storage.xml s4u_actions-storage_d.xml s4u_actions-storage.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actions-storage --log=storage_actions.thres=verbose ${srcdir:=.}/storage/storage.xml s4u-actions-storage_d.xml s4u-actions-storage.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (p0@denise) p0 open /home/lib/libsimgrid.so.3.6.2 0.000000
 > [  0.063552] (p0@denise) p0 read /home/lib/libsimgrid.so.3.6.2 12710497 0.063552
 > [  0.063552] (p0@denise) p0 close /home/lib/libsimgrid.so.3.6.2 0.000000
@@ -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. */
@@ -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.");
   }
 };
@@ -87,10 +88,10 @@ public:
 int main(int argc, char** argv)
 {
   /* When your program starts, you have to first start a new simulation engine, as follows */
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
 
   /* Then you should load a platform file, describing your simulated platform */
-  e->loadPlatform("../../platforms/small_platform.xml");
+  e.loadPlatform("../../platforms/small_platform.xml");
 
   /* And now you have to ask SimGrid to actually start your actors.
    *
@@ -100,21 +101,19 @@ int main(int argc, char** argv)
   simgrid::s4u::Actor::createActor("sender1", simgrid::s4u::Host::by_name("Tremblay"), Sender());
 
   /* The second way is to first register your function, and then retrieve it */
-  e->registerFunction<Sender>("sender"); // The sender is passed as a template parameter here
+  e.registerFunction<Sender>("sender");  // The sender is passed as a template parameter here
   std::vector<std::string> args;         // Here we declare the parameter that the actor will get
   args.push_back("GloubiBoulga");        // Add a parameter to the set (we could have done it in the first approach too)
 
   simgrid::s4u::Actor::createActor("sender2", simgrid::s4u::Host::by_name("Jupiter"), "sender", args);
 
   /* The third way to start your actors is to use a deployment file. */
-  e->registerFunction<Receiver>("receiver");   // You first have to register the actor as with the second approach
-  e->loadDeployment("s4u_actor-create_d.xml"); // And then, you load the deployment file
+  e.registerFunction<Receiver>("receiver");   // You first have to register the actor as with the second approach
+  e.loadDeployment("s4u-actor-create_d.xml"); // And then, you load the deployment file
 
   /* Once every actors are started in the engine, the simulation can start */
-  e->run();
+  e.run();
 
   /* Once the simulation is done, the program is ended */
-  delete e;
-
   return 0;
 }
@@ -1,6 +1,6 @@
 #! ./tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_actor-create
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-create
 > [Tremblay:sender1:(1) 0.000000] [s4u_actor_create/INFO] Hello s4u, I have something to send
 > [Jupiter:sender2:(2) 0.000000] [s4u_actor_create/INFO] Hello s4u, I have something to send
 > [Fafard:receiver:(3) 0.000000] [s4u_actor_create/INFO] Hello s4u, I'm ready to get any message you'd want on mb42
@@ -31,14 +31,12 @@ static void my_daemon()
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
 
-  e->loadPlatform(argv[1]);
+  e.loadPlatform(argv[1]);
   simgrid::s4u::Actor::createActor("worker", simgrid::s4u::Host::by_name("Boivin"), worker);
   simgrid::s4u::Actor::createActor("daemon", simgrid::s4u::Host::by_name("Tremblay"), my_daemon);
 
-  e->run();
-
-  delete e;
+  e.run();
   return 0;
 }
@@ -2,7 +2,7 @@
 
 p Testing the process daemonization feature
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_actor-daemon ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-daemon ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (worker@Boivin) Let's do some work (for 10 sec on Boivin).
 > [  0.000000] (daemon@Tremblay) Hello from the infinite loop
 > [  3.000000] (daemon@Tremblay) Hello from the infinite loop
diff --git a/examples/s4u/actor-execute/s4u-actor-execute.cpp b/examples/s4u/actor-execute/s4u-actor-execute.cpp
new file mode 100644 (file)
index 0000000..9fc417d
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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/s4u.hpp"
+
+static int executor(std::vector<std::string> /*args*/)
+{
+  /* this_actor::execute() tells SimGrid to pause the calling actor
+   * until its host has computed the amount of flops passed as a parameter */
+  simgrid::s4u::this_actor::execute(100);
+
+  /* This simple example does not do anything beyond that */
+  return 0;
+}
+
+int main(int argc, char *argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  std::vector<std::string> args;
+  xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+
+  e.loadPlatform(argv[1]);
+
+  simgrid::s4u::Actor::createActor("executor", simgrid::s4u::Host::by_name("Tremblay"), executor, args);
+
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/actor-execute/s4u-actor-execute.tesh b/examples/s4u/actor-execute/s4u-actor-execute.tesh
new file mode 100644 (file)
index 0000000..e4575eb
--- /dev/null
@@ -0,0 +1,4 @@
+#! ./tesh
+
+p Start remote processes 
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-execute$EXEEXT ${srcdir:=.}/small_platform.xml 
similarity index 60%
rename from examples/s4u/actor-kill/s4u_actor-kill.cpp
rename to examples/s4u/actor-kill/s4u-actor-kill.cpp
index e6a77aa..fe726b4 100644 (file)
@@ -7,8 +7,15 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor_kill, "Messages specific for this s4u example");
 
+static int on_exit(void*, void*)
+{
+  XBT_INFO("I have been killed!");
+  return 0;
+}
+
 static void victim()
 {
+  simgrid::s4u::this_actor::onExit(on_exit, nullptr);
   XBT_INFO("Hello!");
   XBT_INFO("Suspending myself");
   simgrid::s4u::this_actor::suspend(); /* - Start by suspending itself */
@@ -24,11 +31,16 @@ static void killer()
       simgrid::s4u::Actor::createActor("victim", simgrid::s4u::Host::by_name("Fafard"), victim);
   simgrid::s4u::this_actor::sleep_for(10); /* - Wait for 10 seconds */
 
-  XBT_INFO("Resume process"); /* - Resume it from its suspended state */
+  XBT_INFO("Resume the victim"); /* - Resume it from its suspended state */
   poor_victim->resume();
+  simgrid::s4u::this_actor::sleep_for(2);
 
-  XBT_INFO("Kill process"); /* - and then kill it */
+  XBT_INFO("Kill the victim"); /* - and then kill it */
   poor_victim->kill();
+  simgrid::s4u::this_actor::sleep_for(1);
+
+  XBT_INFO("Killing everybody but myself");
+  simgrid::s4u::Actor::killAll();
 
   XBT_INFO("OK, goodbye now. I commit a suicide.");
   simgrid::s4u::this_actor::kill();
@@ -38,17 +50,20 @@ static void killer()
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
-  e->loadPlatform(argv[1]); /* - Load the platform description */
+  e.loadPlatform(argv[1]); /* - Load the platform description */
   /* - Create and deploy killer process, that will create the victim process  */
   simgrid::s4u::Actor::createActor("killer", simgrid::s4u::Host::by_name("Tremblay"), killer);
+  simgrid::s4u::Actor::createActor("Alice", simgrid::s4u::Host::by_name("Jupiter"), victim);
+  simgrid::s4u::Actor::createActor("Bob", simgrid::s4u::Host::by_name("Ginette"), victim);
+  simgrid::s4u::Actor::createActor("Carol", simgrid::s4u::Host::by_name("Bourassa"), victim);
+  simgrid::s4u::Actor::createActor("Dave", simgrid::s4u::Host::by_name("Boivin"), victim);
 
-  e->run(); /* - Run the simulation */
+  e.run(); /* - Run the simulation */
 
-  XBT_INFO("Simulation time %g", e->getClock());
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }
diff --git a/examples/s4u/actor-kill/s4u-actor-kill.tesh b/examples/s4u/actor-kill/s4u-actor-kill.tesh
new file mode 100644 (file)
index 0000000..0f68771
--- /dev/null
@@ -0,0 +1,25 @@
+#! ./tesh
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-kill ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+> [  0.000000] (killer@Tremblay) Hello!
+> [  0.000000] (Alice@Jupiter) Hello!
+> [  0.000000] (Alice@Jupiter) Suspending myself
+> [  0.000000] (Bob@Ginette) Hello!
+> [  0.000000] (Bob@Ginette) Suspending myself
+> [  0.000000] (Carol@Bourassa) Hello!
+> [  0.000000] (Carol@Bourassa) Suspending myself
+> [  0.000000] (Dave@Boivin) Hello!
+> [  0.000000] (Dave@Boivin) Suspending myself
+> [  0.000000] (victim@Fafard) Hello!
+> [  0.000000] (victim@Fafard) Suspending myself
+> [ 10.000000] (killer@Tremblay) Resume the victim
+> [ 10.000000] (victim@Fafard) OK, OK. Let's work
+> [ 12.000000] (killer@Tremblay) Kill the victim
+> [ 12.000000] (victim@Fafard) I have been killed!
+> [ 13.000000] (killer@Tremblay) Killing everybody but myself
+> [ 13.000000] (Alice@Jupiter) I have been killed!
+> [ 13.000000] (Bob@Ginette) I have been killed!
+> [ 13.000000] (Carol@Bourassa) I have been killed!
+> [ 13.000000] (Dave@Boivin) I have been killed!
+> [ 13.000000] (killer@Tremblay) OK, goodbye now. I commit a suicide.
+> [ 13.000000] (maestro@) Simulation time 13
diff --git a/examples/s4u/actor-kill/s4u_actor-kill.tesh b/examples/s4u/actor-kill/s4u_actor-kill.tesh
deleted file mode 100644 (file)
index 1492f44..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#! ./tesh
-
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_actor-kill ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
-> [  0.000000] (killer@Tremblay) Hello!
-> [  0.000000] (victim@Fafard) Hello!
-> [  0.000000] (victim@Fafard) Suspending myself
-> [ 10.000000] (killer@Tremblay) Resume process
-> [ 10.000000] (killer@Tremblay) Kill process
-> [ 10.000000] (killer@Tremblay) OK, goodbye now. I commit a suicide.
-> [ 10.000000] (maestro@) Simulation time 10
diff --git a/examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp b/examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
new file mode 100644 (file)
index 0000000..8f2b4ec
--- /dev/null
@@ -0,0 +1,46 @@
+/* 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 "simgrid/s4u.hpp"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific for this s4u example");
+
+/* Executed on process termination, to display a message helping to understand the output */
+static int my_onexit(void*, void*)
+{
+  XBT_INFO("Exiting now (done sleeping or got killed).");
+  return 0;
+}
+
+/* Just sleep until termination */
+class sleeper {
+
+public:
+  explicit sleeper(std::vector<std::string> /*args*/)
+  {
+    XBT_INFO("Hello! I go to sleep.");
+    simgrid::s4u::this_actor::onExit(my_onexit, NULL);
+
+    simgrid::s4u::this_actor::sleep_for(10);
+  }
+  void operator()() { XBT_INFO("Done sleeping."); }
+};
+
+int main(int argc, char* argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+                       "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+             argv[0], argv[0]);
+
+  e.loadPlatform(argv[1]); /* - Load the platform description */
+  e.registerFunction<sleeper>("sleeper");
+  e.loadDeployment(argv[2]); /* - Deploy the sleeper processes with explicit start/kill times */
+
+  e.run(); /* - Run the simulation */
+
+  return 0;
+}
diff --git a/examples/s4u/actor-lifetime/s4u-actor-lifetime.tesh b/examples/s4u/actor-lifetime/s4u-actor-lifetime.tesh
new file mode 100644 (file)
index 0000000..9b525ce
--- /dev/null
@@ -0,0 +1,14 @@
+#! ./tesh
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-lifetime ${srcdir:=.}/cluster.xml ${srcdir:=.}/../s4u/actor-lifetime/s4u-actor-lifetime_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:sleeper@node-0.acme.org) Hello! I go to sleep.
+> [  0.000000] (2:sleeper@node-1.acme.org) Hello! I go to sleep.
+> [  2.000000] (3:sleeper@node-0.acme.org) Hello! I go to sleep.
+> [  3.000000] (2:sleeper@node-1.acme.org) Exiting now (done sleeping or got killed).
+> [  4.000000] (4:sleeper@node-2.acme.org) Hello! I go to sleep.
+> [  7.000000] (4:sleeper@node-2.acme.org) Exiting now (done sleeping or got killed).
+> [ 10.000000] (1:sleeper@node-0.acme.org) Done sleeping.
+> [ 10.000000] (1:sleeper@node-0.acme.org) Exiting now (done sleeping or got killed).
+> [ 12.000000] (3:sleeper@node-0.acme.org) Done sleeping.
+> [ 12.000000] (3:sleeper@node-0.acme.org) Exiting now (done sleeping or got killed).
+
diff --git a/examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml b/examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml
new file mode 100644 (file)
index 0000000..c69e987
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+
+<!-- This shows how to use the start_time and kill_time attributes of <actors> -->
+
+<platform version="4.1">
+  <actor host="node-0.acme.org" function="sleeper"                              />
+  <actor host="node-0.acme.org" function="sleeper" start_time="2"               />
+  <actor host="node-1.acme.org" function="sleeper"                kill_time="3" />
+  <actor host="node-2.acme.org" function="sleeper" start_time="4" kill_time="7" />
+</platform>
@@ -58,9 +58,9 @@ static void policeman()
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
-  e->loadPlatform(argv[1]); /* - Load the platform description */
+  e.loadPlatform(argv[1]); /* - Load the platform description */
 
   /* - Create and deploy the emigrant and policeman processes */
   simgrid::s4u::Actor::createActor("emigrant", simgrid::s4u::Host::by_name("Jacquelin"), emigrant);
@@ -68,10 +68,9 @@ int main(int argc, char* argv[])
 
   checkpoint     = simgrid::s4u::Mutex::createMutex(); /* - Initiate the mutex and conditions */
   identification = simgrid::s4u::ConditionVariable::createConditionVariable();
-  e->run();
+  e.run();
 
-  XBT_INFO("Simulation time %g", e->getClock());
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }
@@ -3,7 +3,7 @@
 p Testing the migration feature of MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_actor-migration ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-migration ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (emigrant@Jacquelin) I'll look for a new job on another machine ('Boivin') where the grass is greener.
 > [  0.000000] (emigrant@Boivin) Yeah, found something to do
 > [  0.000000] (policeman@Boivin) Wait at the checkpoint.
diff --git a/examples/s4u/actor-priority/s4u-actor-priority.cpp b/examples/s4u/actor-priority/s4u-actor-priority.cpp
new file mode 100644 (file)
index 0000000..1564f7e
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/s4u.hpp"
+#include <cstdlib>
+#include <iostream>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
+
+class test {
+  double computation_amount;
+  double priority;
+
+public:
+  explicit test(std::vector<std::string> args)
+{
+  computation_amount = std::stod(args[1]);
+  priority = std::stod(args[2]);
+}
+void operator()()
+{
+  XBT_INFO("Hello! Running an actor of size %g with priority %g", computation_amount, priority);
+  simgrid::s4u::this_actor::execute(computation_amount, priority);
+
+  XBT_INFO("Goodbye now!");
+}
+};
+
+int main(int argc, char *argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+             "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+  
+  e.registerFunction<test>("test");
+
+  e.loadPlatform(argv[1]);
+  e.loadDeployment(argv[2]);
+
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/actor-priority/s4u-actor-priority.tesh b/examples/s4u/actor-priority/s4u-actor-priority.tesh
new file mode 100644 (file)
index 0000000..82916b3
--- /dev/null
@@ -0,0 +1,8 @@
+#! ./tesh
+
+! output sort 19
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-priority$EXEEXT ${srcdir:=.}/small_platform.xml  ${srcdir:=.}/../s4u/actor-priority/s4u-actor-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:test@Fafard) Hello! Running an actor of size 7.6296e+07 with priority 1
+> [  0.000000] (2:test@Fafard) Hello! Running an actor of size 7.6296e+07 with priority 2
+> [  1.500000] (2:test@Fafard) Goodbye now!
+> [  2.000000] (1:test@Fafard) Goodbye now!
diff --git a/examples/s4u/actor-priority/s4u-actor-priority_d.xml b/examples/s4u/actor-priority/s4u-actor-priority_d.xml
new file mode 100644 (file)
index 0000000..5d15f2b
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+  <actor host="Fafard" function="test">
+    <argument value="76296000"/>
+    <argument value="1.0"/>
+  </actor>
+  <actor host="Fafard" function="test">
+    <argument value="76296000"/>
+    <argument value="2.0"/>
+  </actor>
+</platform>
@@ -66,16 +66,15 @@ static void dream_master()
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
-  e->loadPlatform(argv[1]); /* - Load the platform description */
+  e.loadPlatform(argv[1]); /* - Load the platform description */
   std::vector<simgrid::s4u::Host*> list;
-  e->getHostList(&list);
+  e.getHostList(&list);
   simgrid::s4u::Actor::createActor("dream_master", list.front(), dream_master);
 
-  e->run(); /* - Run the simulation */
+  e.run(); /* - Run the simulation */
 
-  delete e;
   return 0;
 }
@@ -3,7 +3,7 @@
 p Testing the suspend/resume feature of MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_actor-suspend ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-suspend ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (dream_master@Boivin) Let's create a lazy guy.
 > [  0.000000] (Lazy@Boivin) Nobody's watching me ? Let's go to sleep.
 > [  0.000000] (dream_master@Boivin) Let's wait a little bit...
diff --git a/examples/s4u/app-bittorrent/s4u-app-bittorrent.tesh b/examples/s4u/app-bittorrent/s4u-app-bittorrent.tesh
new file mode 100644 (file)
index 0000000..cd07097
--- /dev/null
@@ -0,0 +1,23 @@
+#! ./tesh
+
+p Testing the Bittorrent implementation with MSG
+
+! timeout 10
+! output sort 19
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-bittorrent ${srcdir:=.}/cluster.xml ${srcdir:=.}/../s4u/app-bittorrent/s4u-app-bittorrent_d.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
+> [    0.000000] (1:tracker@node-0.acme.org) Tracker launched.
+> [    0.000000] (2:peer@node-1.acme.org) Hi, I'm joining the network with id 2
+> [    0.000000] (3:peer@node-2.acme.org) Hi, I'm joining the network with id 3
+> [    0.000000] (4:peer@node-3.acme.org) Hi, I'm joining the network with id 4
+> [    0.000000] (5:peer@node-4.acme.org) Hi, I'm joining the network with id 5
+> [    0.000000] (6:peer@node-5.acme.org) Hi, I'm joining the network with id 6
+> [    0.000000] (7:peer@node-6.acme.org) Hi, I'm joining the network with id 7
+> [    0.000000] (8:peer@node-7.acme.org) Hi, I'm joining the network with id 8
+> [ 3000.000000] (1:tracker@node-0.acme.org) Tracker is leaving
+> [ 5000.007806] (2:peer@node-1.acme.org) Here is my current status: 1111111111
+> [ 5000.007806] (3:peer@node-2.acme.org) Here is my current status: 1111111111
+> [ 5000.007806] (4:peer@node-3.acme.org) Here is my current status: 1111111111
+> [ 5000.007806] (5:peer@node-4.acme.org) Here is my current status: 1111111111
+> [ 5000.007806] (6:peer@node-5.acme.org) Here is my current status: 1111111111
+> [ 5000.007806] (7:peer@node-6.acme.org) Here is my current status: 1111111111
+> [ 5000.007806] (8:peer@node-7.acme.org) Here is my current status: 1111111111
diff --git a/examples/s4u/app-bittorrent/s4u-bittorrent.cpp b/examples/s4u/app-bittorrent/s4u-bittorrent.cpp
new file mode 100644 (file)
index 0000000..38709b0
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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 "s4u-bittorrent.hpp"
+#include "s4u-peer.hpp"
+#include "s4u-tracker.hpp"
+
+simgrid::xbt::Extension<simgrid::s4u::Host, HostBittorrent> HostBittorrent::EXTENSION_ID;
+
+int main(int argc, char* argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+
+  /* Check the arguments */
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file", argv[0]);
+
+  e.loadPlatform(argv[1]);
+
+  HostBittorrent::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostBittorrent>();
+
+  std::vector<simgrid::s4u::Host*> list;
+  simgrid::s4u::Engine::getInstance()->getHostList(&list);
+  for (auto const& host : list)
+    host->extension_set(new HostBittorrent(host));
+
+  e.registerFunction<Tracker>("tracker");
+  e.registerFunction<Peer>("peer");
+  e.loadDeployment(argv[2]);
+
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/app-bittorrent/s4u-bittorrent.hpp b/examples/s4u/app-bittorrent/s4u-bittorrent.hpp
new file mode 100644 (file)
index 0000000..61e64bd
--- /dev/null
@@ -0,0 +1,104 @@
+/* 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
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef BITTORRENT_BITTORRENT_HPP_
+#define BITTORRENT_BITTORRENT_HPP_
+
+#include <simgrid/s4u.hpp>
+#include <xbt/RngStream.h>
+
+#define MAILBOX_SIZE 40
+#define TRACKER_MAILBOX "tracker_mailbox"
+/** Max number of peers sent by the tracker to clients */
+#define MAXIMUM_PEERS 50
+/** Interval of time where the peer should send a request to the tracker */
+#define TRACKER_QUERY_INTERVAL 1000
+/** Communication size for a task to the tracker */
+#define TRACKER_COMM_SIZE 1
+#define GET_PEERS_TIMEOUT 10000
+#define TIMEOUT_MESSAGE 10
+#define TRACKER_RECEIVE_TIMEOUT 10
+/** Number of peers that can be unchocked at a given time */
+#define MAX_UNCHOKED_PEERS 4
+/** Interval between each update of the choked peers */
+#define UPDATE_CHOKED_INTERVAL 30
+/** Number of pieces the peer asks for simultaneously */
+#define MAX_PIECES 1
+
+/** Message sizes
+ * Sizes based on report by A. Legout et al, Understanding BitTorrent: An Experimental Perspective
+ * http://hal.inria.fr/inria-00000156/en
+ */
+#define MESSAGE_HANDSHAKE_SIZE 68
+#define MESSAGE_CHOKE_SIZE 5
+#define MESSAGE_UNCHOKE_SIZE 5
+#define MESSAGE_INTERESTED_SIZE 5
+#define MESSAGE_NOTINTERESTED_SIZE 5
+#define MESSAGE_HAVE_SIZE 9
+#define MESSAGE_BITFIELD_SIZE 5
+#define MESSAGE_REQUEST_SIZE 17
+#define MESSAGE_PIECE_SIZE 13
+#define MESSAGE_CANCEL_SIZE 17
+
+/** Types of messages exchanged between two peers. */
+enum e_message_type {
+  MESSAGE_HANDSHAKE,
+  MESSAGE_CHOKE,
+  MESSAGE_UNCHOKE,
+  MESSAGE_INTERESTED,
+  MESSAGE_NOTINTERESTED,
+  MESSAGE_HAVE,
+  MESSAGE_BITFIELD,
+  MESSAGE_REQUEST,
+  MESSAGE_PIECE,
+  MESSAGE_CANCEL
+};
+
+class Message {
+public:
+  e_message_type type;
+  int peer_id;
+  simgrid::s4u::MailboxPtr return_mailbox;
+  unsigned int bitfield = 0U;
+  int piece             = 0;
+  int block_index       = 0;
+  int block_length      = 0;
+  Message(e_message_type type, int peer_id, simgrid::s4u::MailboxPtr return_mailbox)
+      : type(type), peer_id(peer_id), return_mailbox(return_mailbox){};
+  Message(e_message_type type, int peer_id, unsigned int bitfield, simgrid::s4u::MailboxPtr return_mailbox)
+      : type(type), peer_id(peer_id), return_mailbox(return_mailbox), bitfield(bitfield){};
+  Message(e_message_type type, int peer_id, simgrid::s4u::MailboxPtr return_mailbox, int piece, int block_index,
+          int block_length)
+      : type(type)
+      , peer_id(peer_id)
+      , return_mailbox(return_mailbox)
+      , piece(piece)
+      , block_index(block_index)
+      , block_length(block_length){};
+  Message(e_message_type type, int peer_id, simgrid::s4u::MailboxPtr return_mailbox, int piece)
+      : type(type), peer_id(peer_id), return_mailbox(return_mailbox), piece(piece){};
+  ~Message() = default;
+};
+
+class HostBittorrent {
+  RngStream stream_;
+  simgrid::s4u::Host* host = nullptr;
+
+public:
+  static simgrid::xbt::Extension<simgrid::s4u::Host, HostBittorrent> EXTENSION_ID;
+
+  explicit HostBittorrent(simgrid::s4u::Host* ptr) : host(ptr)
+  {
+    std::string descr = std::string("RngSream<") + host->getCname() + ">";
+    stream_           = RngStream_CreateStream(descr.c_str());
+  }
+
+  ~HostBittorrent() { RngStream_DeleteStream(&stream_); };
+
+  RngStream getStream() { return stream_; };
+};
+
+#endif /* BITTORRENT_BITTORRENT_HPP_ */
diff --git a/examples/s4u/app-bittorrent/s4u-peer.cpp b/examples/s4u/app-bittorrent/s4u-peer.cpp
new file mode 100644 (file)
index 0000000..8f9bc79
--- /dev/null
@@ -0,0 +1,677 @@
+/* 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 <algorithm>
+#include <climits>
+#include <xbt/ex.hpp>
+
+#include "s4u-peer.hpp"
+#include "s4u-tracker.hpp"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_bt_peer, "Messages specific for the peers");
+
+/*
+ * User parameters for transferred file data. For the test, the default values are :
+ * File size: 10 pieces * 5 blocks/piece * 16384 bytes/block = 819200 bytes
+ */
+#define FILE_PIECES 10UL
+#define PIECES_BLOCKS 5UL
+#define BLOCK_SIZE 16384
+
+/** Number of blocks asked by each request */
+#define BLOCKS_REQUESTED 2UL
+
+#define ENABLE_END_GAME_MODE 1
+#define SLEEP_DURATION 1
+#define BITS_TO_BYTES(x) (((x) / 8 + (x) % 8) ? 1 : 0)
+
+Peer::Peer(std::vector<std::string> args)
+{
+  // Check arguments
+  xbt_assert(args.size() == 3 || args.size() == 4, "Wrong number of arguments");
+  try {
+    id       = std::stoi(args[1]);
+    mailbox_ = simgrid::s4u::Mailbox::byName(std::to_string(id));
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid ID:") + args[1].c_str());
+  }
+
+  try {
+    deadline = std::stod(args[2]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid deadline:") + args[2].c_str());
+  }
+  xbt_assert(deadline > 0, "Wrong deadline supplied");
+
+  stream = simgrid::s4u::this_actor::getHost()->extension<HostBittorrent>()->getStream();
+
+  if (args.size() == 4 && args[3] == "1") {
+    bitfield_       = (1U << FILE_PIECES) - 1U;
+    bitfield_blocks = (1ULL << (FILE_PIECES * PIECES_BLOCKS)) - 1ULL;
+  }
+  pieces_count = new short[FILE_PIECES]{0};
+
+  XBT_INFO("Hi, I'm joining the network with id %d", id);
+}
+
+Peer::~Peer()
+{
+  for (auto const& peer : connected_peers)
+    delete peer.second;
+  delete[] pieces_count;
+}
+
+/** Peer main function */
+void Peer::operator()()
+{
+  // Getting peer data from the tracker.
+  if (getPeersFromTracker()) {
+    XBT_DEBUG("Got %zu peers from the tracker. Current status is: %s", connected_peers.size(), getStatus().c_str());
+    begin_receive_time = simgrid::s4u::Engine::getClock();
+    mailbox_->setReceiver(simgrid::s4u::Actor::self());
+    if (hasFinished()) {
+      sendHandshakeToAllPeers();
+    } else {
+      leech();
+    }
+    seed();
+  } else {
+    XBT_INFO("Couldn't contact the tracker.");
+  }
+
+  XBT_INFO("Here is my current status: %s", getStatus().c_str());
+}
+
+bool Peer::getPeersFromTracker()
+{
+  simgrid::s4u::MailboxPtr tracker_mailbox = simgrid::s4u::Mailbox::byName(TRACKER_MAILBOX);
+  // Build the task to send to the tracker
+  TrackerQuery* peer_request = new TrackerQuery(id, mailbox_);
+  try {
+    XBT_DEBUG("Sending a peer request to the tracker.");
+    tracker_mailbox->put(peer_request, TRACKER_COMM_SIZE, GET_PEERS_TIMEOUT);
+  } catch (xbt_ex& e) {
+    if (e.category == timeout_error) {
+      XBT_DEBUG("Timeout expired when requesting peers to tracker");
+      delete peer_request;
+      return false;
+    }
+  }
+
+  try {
+    TrackerAnswer* answer = static_cast<TrackerAnswer*>(mailbox_->get(GET_PEERS_TIMEOUT));
+    // Add the peers the tracker gave us to our peer list.
+    for (auto const& peer_id : *answer->getPeers())
+      if (id != peer_id)
+        connected_peers[peer_id] = new Connection(peer_id);
+    delete answer;
+  } catch (xbt_ex& e) {
+    if (e.category == timeout_error) {
+      XBT_DEBUG("Timeout expired when requesting peers to tracker");
+      return false;
+    }
+  }
+  return true;
+}
+
+void Peer::sendHandshakeToAllPeers()
+{
+  for (auto const& kv : connected_peers) {
+    Connection* remote_peer = kv.second;
+    Message* handshake      = new Message(MESSAGE_HANDSHAKE, id, mailbox_);
+    remote_peer->mailbox_->put_init(handshake, MESSAGE_HANDSHAKE_SIZE)->detach();
+    XBT_DEBUG("Sending a HANDSHAKE to %d", remote_peer->id);
+  }
+}
+
+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->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->getCname());
+  mailbox
+      ->put_init(new Message(MESSAGE_BITFIELD, id, bitfield_, mailbox_),
+                 MESSAGE_BITFIELD_SIZE + BITS_TO_BYTES(FILE_PIECES))
+      ->detach();
+}
+
+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->getCname());
+  mailbox->put_init(new Message(MESSAGE_PIECE, id, mailbox_, piece, block_index, block_length), BLOCK_SIZE)->detach();
+}
+
+void Peer::sendHaveToAllPeers(unsigned int piece)
+{
+  XBT_DEBUG("Sending HAVE message to all my peers");
+  for (auto const& kv : connected_peers) {
+    Connection* remote_peer = kv.second;
+    remote_peer->mailbox_->put_init(new Message(MESSAGE_HAVE, id, mailbox_, piece), MESSAGE_HAVE_SIZE)->detach();
+  }
+}
+
+void Peer::sendRequestTo(Connection* remote_peer, unsigned int piece)
+{
+  remote_peer->current_piece = piece;
+  xbt_assert(remote_peer->hasPiece(piece));
+  int block_index = getFirstMissingBlockFrom(piece);
+  if (block_index != -1) {
+    int block_length = std::min(BLOCKS_REQUESTED, PIECES_BLOCKS - 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)
+        ->detach();
+  }
+}
+
+std::string Peer::getStatus()
+{
+  std::string res = std::string("");
+  for (int i = FILE_PIECES - 1; i >= 0; i--)
+    res = std::string((bitfield_ & (1U << i)) ? "1" : "0") + res;
+  return res;
+}
+
+bool Peer::hasFinished()
+{
+  return bitfield_ == (1U << FILE_PIECES) - 1U;
+}
+
+/** Indicates if the remote peer has a piece not stored by the local peer */
+bool Peer::isInterestedBy(Connection* remote_peer)
+{
+  return remote_peer->bitfield & (bitfield_ ^ ((1 << FILE_PIECES) - 1));
+}
+
+bool Peer::isInterestedByFree(Connection* remote_peer)
+{
+  for (unsigned int i = 0; i < FILE_PIECES; i++)
+    if (hasNotPiece(i) && remote_peer->hasPiece(i) && isNotDownloadingPiece(i))
+      return true;
+  return false;
+}
+
+void Peer::updatePiecesCountFromBitfield(unsigned int bitfield)
+{
+  for (unsigned int i = 0; i < FILE_PIECES; i++)
+    if (bitfield & (1U << i))
+      pieces_count[i]++;
+}
+
+unsigned int Peer::countPieces(unsigned int bitfield)
+{
+  unsigned int count = 0U;
+  unsigned int n     = bitfield;
+  while (n) {
+    count += n & 1U;
+    n >>= 1U;
+  }
+  return count;
+}
+
+int Peer::nbInterestedPeers()
+{
+  int nb = 0;
+  for (auto const& kv : connected_peers)
+    if (kv.second->interested)
+      nb++;
+  return nb;
+}
+
+void Peer::leech()
+{
+  double next_choked_update = simgrid::s4u::Engine::getClock() + UPDATE_CHOKED_INTERVAL;
+  XBT_DEBUG("Start downloading.");
+
+  /* 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_->getCname());
+
+  void* data = nullptr;
+  while (simgrid::s4u::Engine::getClock() < deadline && countPieces(bitfield_) < FILE_PIECES) {
+    if (comm_received == nullptr) {
+      comm_received = mailbox_->get_async(&data);
+    }
+    if (comm_received->test()) {
+      message = static_cast<Message*>(data);
+      handleMessage();
+      delete message;
+      comm_received = nullptr;
+    } else {
+      // We don't execute the choke algorithm if we don't already have a piece
+      if (simgrid::s4u::Engine::getClock() >= next_choked_update && countPieces(bitfield_) > 0) {
+        updateChokedPeers();
+        next_choked_update += UPDATE_CHOKED_INTERVAL;
+      } else {
+        simgrid::s4u::this_actor::sleep_for(SLEEP_DURATION);
+      }
+    }
+  }
+  if (hasFinished())
+    XBT_DEBUG("%d becomes a seeder", id);
+}
+
+void Peer::seed()
+{
+  double next_choked_update = simgrid::s4u::Engine::getClock() + UPDATE_CHOKED_INTERVAL;
+  XBT_DEBUG("Start seeding.");
+  // start the main seed loop
+  void* data = nullptr;
+  while (simgrid::s4u::Engine::getClock() < deadline) {
+    if (comm_received == nullptr) {
+      comm_received = mailbox_->get_async(&data);
+    }
+    if (comm_received->test()) {
+      message = static_cast<Message*>(data);
+      handleMessage();
+      delete message;
+      comm_received = nullptr;
+    } else {
+      if (simgrid::s4u::Engine::getClock() >= next_choked_update) {
+        updateChokedPeers();
+        // TODO: Change the choked peer algorithm when seeding.
+        next_choked_update += UPDATE_CHOKED_INTERVAL;
+      } else {
+        simgrid::s4u::this_actor::sleep_for(SLEEP_DURATION);
+      }
+    }
+  }
+}
+
+void Peer::updateActivePeersSet(Connection* remote_peer)
+{
+  if (remote_peer->interested && not remote_peer->choked_upload)
+    active_peers.insert(remote_peer);
+  else
+    active_peers.erase(remote_peer);
+}
+
+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->getCname());
+
+  auto known_peer         = connected_peers.find(message->peer_id);
+  Connection* remote_peer = (known_peer == connected_peers.end()) ? nullptr : known_peer->second;
+  xbt_assert(remote_peer != nullptr || message->type == MESSAGE_HANDSHAKE,
+             "The impossible did happened: A not-in-our-list peer sent us a message.");
+
+  switch (message->type) {
+    case MESSAGE_HANDSHAKE:
+      // Check if the peer is in our connection list.
+      if (remote_peer == nullptr) {
+        XBT_DEBUG("This peer %d was unknown, answer to its handshake", message->peer_id);
+        connected_peers[message->peer_id] = new Connection(message->peer_id);
+        sendMessage(message->return_mailbox, MESSAGE_HANDSHAKE, MESSAGE_HANDSHAKE_SIZE);
+      }
+      // Send our bitfield to the peer
+      sendBitfield(message->return_mailbox);
+      break;
+    case MESSAGE_BITFIELD:
+      // Update the pieces list
+      updatePiecesCountFromBitfield(message->bitfield);
+      // Store the bitfield
+      remote_peer->bitfield = message->bitfield;
+      xbt_assert(not remote_peer->am_interested, "Should not be interested at first");
+      if (isInterestedBy(remote_peer)) {
+        remote_peer->am_interested = true;
+        sendMessage(message->return_mailbox, MESSAGE_INTERESTED, MESSAGE_INTERESTED_SIZE);
+      }
+      break;
+    case MESSAGE_INTERESTED:
+      // Update the interested state of the peer.
+      remote_peer->interested = true;
+      updateActivePeersSet(remote_peer);
+      break;
+    case MESSAGE_NOTINTERESTED:
+      remote_peer->interested = false;
+      updateActivePeersSet(remote_peer);
+      break;
+    case MESSAGE_UNCHOKE:
+      xbt_assert(remote_peer->choked_download);
+      remote_peer->choked_download = false;
+      // Send requests to the peer, since it has unchoked us
+      if (remote_peer->am_interested)
+        requestNewPieceTo(remote_peer);
+      break;
+    case MESSAGE_CHOKE:
+      xbt_assert(not remote_peer->choked_download);
+      remote_peer->choked_download = true;
+      if (remote_peer->current_piece != -1)
+        removeCurrentPiece(remote_peer, remote_peer->current_piece);
+      break;
+    case MESSAGE_HAVE:
+      XBT_DEBUG("\t for piece %d", message->piece);
+      xbt_assert((message->piece >= 0 && static_cast<unsigned int>(message->piece) < FILE_PIECES),
+                 "Wrong HAVE message received");
+      remote_peer->bitfield = remote_peer->bitfield | (1U << static_cast<unsigned int>(message->piece));
+      pieces_count[message->piece]++;
+      // If the piece is in our pieces, we tell the peer that we are interested.
+      if (not remote_peer->am_interested && hasNotPiece(message->piece)) {
+        remote_peer->am_interested = true;
+        sendMessage(message->return_mailbox, MESSAGE_INTERESTED, MESSAGE_INTERESTED_SIZE);
+        if (not remote_peer->choked_download)
+          requestNewPieceTo(remote_peer);
+      }
+      break;
+    case MESSAGE_REQUEST:
+      xbt_assert(remote_peer->interested);
+      xbt_assert((message->piece >= 0 && static_cast<unsigned int>(message->piece) < FILE_PIECES),
+                 "Wrong HAVE message received");
+      if (not remote_peer->choked_upload) {
+        XBT_DEBUG("\t for piece %d (%d,%d)", message->piece, message->block_index,
+                  message->block_index + message->block_length);
+        if (not hasNotPiece(message->piece)) {
+          sendPiece(message->return_mailbox, message->piece, message->block_index, message->block_length);
+        }
+      } else {
+        XBT_DEBUG("\t for piece %d but he is choked.", message->peer_id);
+      }
+      break;
+    case MESSAGE_PIECE:
+      XBT_DEBUG(" \t for piece %d (%d,%d)", message->piece, message->block_index,
+                message->block_index + message->block_length);
+      xbt_assert(not remote_peer->choked_download);
+      xbt_assert(remote_peer->am_interested || ENABLE_END_GAME_MODE,
+                 "Can't received a piece if I'm not interested without end-game mode!"
+                 "piece (%d) bitfield (%u) remote bitfield (%u)",
+                 message->piece, bitfield_, remote_peer->bitfield);
+      xbt_assert(not remote_peer->choked_download, "Can't received a piece if I'm choked !");
+      xbt_assert((message->piece >= 0 && static_cast<unsigned int>(message->piece) < FILE_PIECES),
+                 "Wrong piece received");
+      // TODO: Execute a computation.
+      if (hasNotPiece(static_cast<unsigned int>(message->piece))) {
+        updateBitfieldBlocks(message->piece, message->block_index, message->block_length);
+        if (hasCompletedPiece(static_cast<unsigned int>(message->piece))) {
+          // Removing the piece from our piece list
+          removeCurrentPiece(remote_peer, message->piece);
+          // Setting the fact that we have the piece
+          bitfield_ = bitfield_ | (1U << static_cast<unsigned int>(message->piece));
+          XBT_DEBUG("My status is now %s", getStatus().c_str());
+          // Sending the information to all the peers we are connected to
+          sendHaveToAllPeers(message->piece);
+          // sending UNINTERESTED to peers that do not have what we want.
+          updateInterestedAfterReceive();
+        } else {                                      // piece not completed
+          sendRequestTo(remote_peer, message->piece); // ask for the next block
+        }
+      } else {
+        XBT_DEBUG("However, we already have it");
+        xbt_assert(ENABLE_END_GAME_MODE, "Should not happen because we don't use end game mode !");
+        requestNewPieceTo(remote_peer);
+      }
+      break;
+    case MESSAGE_CANCEL:
+      break;
+    default:
+      THROW_IMPOSSIBLE;
+  }
+  // Update the peer speed.
+  if (remote_peer) {
+    remote_peer->addSpeedValue(1.0 / (simgrid::s4u::Engine::getClock() - begin_receive_time));
+  }
+  begin_receive_time = simgrid::s4u::Engine::getClock();
+}
+
+/** Selects the appropriate piece to download and requests it to the remote_peer */
+void Peer::requestNewPieceTo(Connection* remote_peer)
+{
+  int piece = selectPieceToDownload(remote_peer);
+  if (piece != -1) {
+    current_pieces |= (1U << (unsigned int)piece);
+    sendRequestTo(remote_peer, piece);
+  }
+}
+
+void Peer::removeCurrentPiece(Connection* remote_peer, unsigned int current_piece)
+{
+  current_pieces &= ~(1U << current_piece);
+  remote_peer->current_piece = -1;
+}
+
+/** @brief Return the piece to be downloaded
+ * There are two cases (as described in "Bittorrent Architecture Protocol", Ryan Toole :
+ * If a piece is partially downloaded, this piece will be selected prioritarily
+ * If the peer has strictly less than 4 pieces, he chooses a piece at random.
+ * If the peer has more than pieces, he downloads the pieces that are the less replicated (rarest policy).
+ * If all pieces have been downloaded or requested, we select a random requested piece (endgame mode).
+ * @param remote_peer: information about the connection
+ * @return the piece to download if possible. -1 otherwise
+ */
+int Peer::selectPieceToDownload(Connection* remote_peer)
+{
+  int piece = partiallyDownloadedPiece(remote_peer);
+  // strict priority policy
+  if (piece != -1)
+    return piece;
+
+  // end game mode
+  if (countPieces(current_pieces) >= (FILE_PIECES - countPieces(bitfield_)) && isInterestedBy(remote_peer)) {
+#if ENABLE_END_GAME_MODE == 0
+    return -1;
+#endif
+    int nb_interesting_pieces = 0;
+    // compute the number of interesting pieces
+    for (unsigned int i = 0; i < FILE_PIECES; i++)
+      if (hasNotPiece(i) && remote_peer->hasPiece(i))
+        nb_interesting_pieces++;
+
+    xbt_assert(nb_interesting_pieces != 0);
+    // get a random interesting piece
+    int random_piece_index = RngStream_RandInt(stream, 0, nb_interesting_pieces - 1);
+    int current_index      = 0;
+    for (unsigned int i = 0; i < FILE_PIECES; i++) {
+      if (hasNotPiece(i) && remote_peer->hasPiece(i)) {
+        if (random_piece_index == current_index) {
+          piece = i;
+          break;
+        }
+        current_index++;
+      }
+    }
+    xbt_assert(piece != -1);
+    return piece;
+  }
+  // Random first policy
+  if (countPieces(bitfield_) < 4 && isInterestedByFree(remote_peer)) {
+    int nb_interesting_pieces = 0;
+    // compute the number of interesting pieces
+    for (unsigned int i = 0; i < FILE_PIECES; i++)
+      if (hasNotPiece(i) && remote_peer->hasPiece(i) && isNotDownloadingPiece(i))
+        nb_interesting_pieces++;
+    xbt_assert(nb_interesting_pieces != 0);
+    // get a random interesting piece
+    int random_piece_index = RngStream_RandInt(stream, 0, nb_interesting_pieces - 1);
+    int current_index      = 0;
+    for (unsigned int i = 0; i < FILE_PIECES; i++) {
+      if (hasNotPiece(i) && remote_peer->hasPiece(i) && isNotDownloadingPiece(i)) {
+        if (random_piece_index == current_index) {
+          piece = i;
+          break;
+        }
+        current_index++;
+      }
+    }
+    xbt_assert(piece != -1);
+    return piece;
+  } else { // Rarest first policy
+    short min         = SHRT_MAX;
+    int nb_min_pieces = 0;
+    int current_index = 0;
+    // compute the smallest number of copies of available pieces
+    for (unsigned int i = 0; i < FILE_PIECES; i++) {
+      if (pieces_count[i] < min && hasNotPiece(i) && remote_peer->hasPiece(i) && isNotDownloadingPiece(i))
+        min = pieces_count[i];
+    }
+
+    xbt_assert(min != SHRT_MAX || not isInterestedByFree(remote_peer));
+    // compute the number of rarest pieces
+    for (unsigned int i = 0; i < FILE_PIECES; i++)
+      if (pieces_count[i] == min && hasNotPiece(i) && remote_peer->hasPiece(i) && isNotDownloadingPiece(i))
+        nb_min_pieces++;
+
+    xbt_assert(nb_min_pieces != 0 || not isInterestedByFree(remote_peer));
+    // get a random rarest piece
+    int random_rarest_index = RngStream_RandInt(stream, 0, nb_min_pieces - 1);
+    for (unsigned int i = 0; i < FILE_PIECES; i++)
+      if (pieces_count[i] == min && hasNotPiece(i) && remote_peer->hasPiece(i) && isNotDownloadingPiece(i)) {
+        if (random_rarest_index == current_index) {
+          piece = i;
+          break;
+        }
+        current_index++;
+      }
+
+    xbt_assert(piece != -1 || not isInterestedByFree(remote_peer));
+    return piece;
+  }
+}
+
+void Peer::updateChokedPeers()
+{
+  if (nbInterestedPeers() == 0)
+    return;
+  XBT_DEBUG("(%d) update_choked peers %zu active peers", id, active_peers.size());
+  // update the current round
+  round_                  = (round_ + 1) % 3;
+  Connection* chosen_peer = nullptr;
+  // select first active peer and remove it from the set
+  Connection* choked_peer;
+  if (active_peers.empty()) {
+    choked_peer = nullptr;
+  } else {
+    choked_peer = *active_peers.begin();
+    active_peers.erase(choked_peer);
+  }
+
+  /**If we are currently seeding, we unchoke the peer which has been unchoked the last time.*/
+  if (hasFinished()) {
+    Connection* remote_peer;
+    double unchoke_time = simgrid::s4u::Engine::getClock() + 1;
+    for (auto const& kv : connected_peers) {
+      remote_peer = kv.second;
+      if (remote_peer->last_unchoke < unchoke_time && remote_peer->interested && remote_peer->choked_upload) {
+        unchoke_time = remote_peer->last_unchoke;
+        chosen_peer  = remote_peer;
+      }
+    }
+  } else {
+    // Random optimistic unchoking
+    if (round_ == 0) {
+      int j = 0;
+      do {
+        // We choose a random peer to unchoke.
+        std::unordered_map<int, Connection*>::iterator chosen_peer_it = connected_peers.begin();
+        std::advance(chosen_peer_it, RngStream_RandInt(stream, 0, connected_peers.size() - 1));
+        chosen_peer = chosen_peer_it->second;
+        if (chosen_peer == nullptr)
+          THROWF(unknown_error, 0, "A peer should have be selected at this point");
+        else if (not chosen_peer->interested || not chosen_peer->choked_upload)
+          chosen_peer = nullptr;
+        else
+          XBT_DEBUG("Nothing to do, keep going");
+        j++;
+      } while (chosen_peer == nullptr && j < MAXIMUM_PEERS);
+    } else {
+      // Use the "fastest download" policy.
+      double fastest_speed = 0.0;
+      for (auto const& kv : connected_peers) {
+        Connection* remote_peer = kv.second;
+        if (remote_peer->peer_speed > fastest_speed && remote_peer->choked_upload && remote_peer->interested) {
+          chosen_peer   = remote_peer;
+          fastest_speed = remote_peer->peer_speed;
+        }
+      }
+    }
+  }
+
+  if (chosen_peer != nullptr)
+    XBT_DEBUG("(%d) update_choked peers unchoked (%d) ; int (%d) ; choked (%d) ", id, chosen_peer->id,
+              chosen_peer->interested, chosen_peer->choked_upload);
+
+  if (choked_peer != chosen_peer) {
+    if (choked_peer != nullptr) {
+      xbt_assert(not choked_peer->choked_upload, "Tries to choked a choked peer");
+      choked_peer->choked_upload = true;
+      updateActivePeersSet(choked_peer);
+      XBT_DEBUG("(%d) Sending a CHOKE to %d", id, choked_peer->id);
+      sendMessage(choked_peer->mailbox_, MESSAGE_CHOKE, MESSAGE_CHOKE_SIZE);
+    }
+    if (chosen_peer != nullptr) {
+      xbt_assert((chosen_peer->choked_upload), "Tries to unchoked an unchoked peer");
+      chosen_peer->choked_upload = false;
+      active_peers.insert(chosen_peer);
+      chosen_peer->last_unchoke = simgrid::s4u::Engine::getClock();
+      XBT_DEBUG("(%d) Sending a UNCHOKE to %d", id, chosen_peer->id);
+      updateActivePeersSet(chosen_peer);
+      sendMessage(chosen_peer->mailbox_, MESSAGE_UNCHOKE, MESSAGE_UNCHOKE_SIZE);
+    }
+  }
+}
+
+/** @brief Update "interested" state of peers: send "not interested" to peers that don't have any more pieces we want.*/
+void Peer::updateInterestedAfterReceive()
+{
+  for (auto const& kv : connected_peers) {
+    Connection* remote_peer = kv.second;
+    if (remote_peer->am_interested) {
+      bool interested = false;
+      // Check if the peer still has a piece we want.
+      for (unsigned int i = 0; i < FILE_PIECES; i++)
+        if (hasNotPiece(i) && remote_peer->hasPiece(i)) {
+          interested = true;
+          break;
+        }
+
+      if (not interested) { // no more piece to download from connection
+        remote_peer->am_interested = false;
+        sendMessage(remote_peer->mailbox_, MESSAGE_NOTINTERESTED, MESSAGE_NOTINTERESTED_SIZE);
+      }
+    }
+  }
+}
+
+void Peer::updateBitfieldBlocks(int piece, int block_index, int block_length)
+{
+  xbt_assert((piece >= 0 && static_cast<unsigned int>(piece) <= FILE_PIECES), "Wrong piece.");
+  xbt_assert((block_index >= 0 && static_cast<unsigned int>(block_index) <= PIECES_BLOCKS), "Wrong block : %d.",
+             block_index);
+  for (int i = block_index; i < (block_index + block_length); i++)
+    bitfield_blocks |= (1ULL << static_cast<unsigned int>(piece * PIECES_BLOCKS + i));
+}
+
+bool Peer::hasCompletedPiece(unsigned int piece)
+{
+  for (unsigned int i = 0; i < PIECES_BLOCKS; i++)
+    if (not(bitfield_blocks & 1ULL << (piece * PIECES_BLOCKS + i)))
+      return false;
+  return true;
+}
+
+int Peer::getFirstMissingBlockFrom(int piece)
+{
+  for (unsigned int i = 0; i < PIECES_BLOCKS; i++)
+    if (not(bitfield_blocks & 1ULL << (piece * PIECES_BLOCKS + i)))
+      return i;
+  return -1;
+}
+
+/** Returns a piece that is partially downloaded and stored by the remote peer if any -1 otherwise. */
+int Peer::partiallyDownloadedPiece(Connection* remote_peer)
+{
+  for (unsigned int i = 0; i < FILE_PIECES; i++)
+    if (hasNotPiece(i) && remote_peer->hasPiece(i) && isNotDownloadingPiece(i) && getFirstMissingBlockFrom(i) > 0)
+      return i;
+  return -1;
+}
diff --git a/examples/s4u/app-bittorrent/s4u-peer.hpp b/examples/s4u/app-bittorrent/s4u-peer.hpp
new file mode 100644 (file)
index 0000000..9d1e195
--- /dev/null
@@ -0,0 +1,91 @@
+/* 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. */
+
+#ifndef BITTORRENT_PEER_HPP
+#define BITTORRENT_PEER_HPP
+#include "s4u-bittorrent.hpp"
+#include <set>
+#include <unordered_map>
+
+class Connection {
+public:
+  int id; // Peer id
+  simgrid::s4u::MailboxPtr mailbox_;
+  unsigned int bitfield = 0U; // Fields
+  //  int messages_count;
+  double peer_speed    = 0;
+  double last_unchoke  = 0;
+  int current_piece    = -1;
+  bool am_interested   = false; // Indicates if we are interested in something the peer has
+  bool interested      = false; // Indicates if the peer is interested in one of our pieces
+  bool choked_upload   = true;  // Indicates if the peer is choked for the current peer
+  bool choked_download = true;  // Indicates if the peer has choked the current peer
+
+  explicit Connection(int id) : id(id), mailbox_(simgrid::s4u::Mailbox::byName(std::to_string(id))){};
+  ~Connection() = default;
+  void addSpeedValue(double speed) { peer_speed = peer_speed * 0.6 + speed * 0.4; }
+  bool hasPiece(unsigned int piece) { return bitfield & 1U << piece; }
+};
+
+class Peer {
+  int id;
+  double deadline;
+  RngStream stream;
+  simgrid::s4u::MailboxPtr mailbox_;
+  std::unordered_map<int, Connection*> connected_peers;
+  std::set<Connection*> active_peers; // active peers list
+
+  unsigned int bitfield_             = 0;       // list of pieces the peer has.
+  unsigned long long bitfield_blocks = 0;       // list of blocks the peer has.
+  short* pieces_count                = nullptr; // number of peers that have each piece.
+  unsigned int current_pieces        = 0;       // current pieces the peer is downloading
+  double begin_receive_time = 0; // time when the receiving communication has begun, useful for calculating host speed.
+  int round_                = 0; // current round for the chocking algorithm.
+
+  simgrid::s4u::CommPtr comm_received = nullptr; // current comm
+  Message* message                    = nullptr; // current message being received
+public:
+  explicit Peer(std::vector<std::string> args);
+  Peer(const Peer&) = delete;
+  ~Peer();
+  void operator()();
+
+  std::string getStatus();
+  bool hasFinished();
+  int nbInterestedPeers();
+  bool isInterestedBy(Connection* remote_peer);
+  bool isInterestedByFree(Connection* remote_peer);
+  void updateActivePeersSet(Connection* remote_peer);
+  void updateInterestedAfterReceive();
+  void updateChokedPeers();
+
+  bool hasNotPiece(unsigned int piece) { return not(bitfield_ & 1U << piece); }
+  bool hasCompletedPiece(unsigned int piece);
+  unsigned int countPieces(unsigned int bitfield);
+  /** Check that a piece is not currently being download by the peer. */
+  bool isNotDownloadingPiece(unsigned int piece) { return not(current_pieces & 1U << piece); }
+  int partiallyDownloadedPiece(Connection* remote_peer);
+  void updatePiecesCountFromBitfield(unsigned int bitfield);
+  void removeCurrentPiece(Connection* remote_peer, unsigned int current_piece);
+  void updateBitfieldBlocks(int piece, int block_index, int block_length);
+  int getFirstMissingBlockFrom(int piece);
+  int selectPieceToDownload(Connection* remote_peer);
+  void requestNewPieceTo(Connection* remote_peer);
+
+  bool getPeersFromTracker();
+  void sendMessage(simgrid::s4u::MailboxPtr mailbox, e_message_type type, uint64_t size);
+  void sendBitfield(simgrid::s4u::MailboxPtr mailbox);
+  void sendPiece(simgrid::s4u::MailboxPtr mailbox, unsigned int piece, int block_index, int block_length);
+  void sendHandshakeToAllPeers();
+  void sendHaveToAllPeers(unsigned int piece);
+  void sendRequestTo(Connection* remote_peer, unsigned int piece);
+
+  void handleMessage();
+  void leech();
+  void seed();
+};
+
+#endif /* BITTORRENT_PEER_HPP */
diff --git a/examples/s4u/app-bittorrent/s4u-tracker.cpp b/examples/s4u/app-bittorrent/s4u-tracker.cpp
new file mode 100644 (file)
index 0000000..1296679
--- /dev/null
@@ -0,0 +1,71 @@
+/* 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 "s4u-tracker.hpp"
+#include <algorithm>
+#include <xbt/RngStream.h>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_bt_tracker, "Messages specific for the tracker");
+
+Tracker::Tracker(std::vector<std::string> args)
+{
+  // Checking arguments
+  xbt_assert(args.size() == 2, "Wrong number of arguments for the tracker.");
+  // Retrieving end time
+  try {
+    deadline = std::stod(args[1]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid deadline:") + args[1].c_str());
+  }
+  xbt_assert(deadline > 0, "Wrong deadline supplied");
+
+  stream = simgrid::s4u::this_actor::getHost()->extension<HostBittorrent>()->getStream();
+
+  mailbox = simgrid::s4u::Mailbox::byName(TRACKER_MAILBOX);
+
+  XBT_INFO("Tracker launched.");
+}
+
+void Tracker::operator()()
+{
+  simgrid::s4u::CommPtr comm = nullptr;
+  void* received;
+  while (simgrid::s4u::Engine::getClock() < deadline) {
+    if (comm == nullptr)
+      comm = mailbox->get_async(&received);
+    if (comm->test()) {
+      // Retrieve the data sent by the peer.
+      TrackerQuery* tq = static_cast<TrackerQuery*>(received);
+
+      // Add the peer to our peer list, if not already known.
+      if (known_peers.find(tq->getPeerId()) == known_peers.end()) {
+        known_peers.insert(tq->getPeerId());
+      }
+
+      // Sending back peers to the requesting peer
+      TrackerAnswer* ta = new TrackerAnswer(TRACKER_QUERY_INTERVAL);
+      std::set<int>::iterator next_peer;
+      int nb_known_peers = known_peers.size();
+      int max_tries      = std::min(MAXIMUM_PEERS, nb_known_peers);
+      int tried          = 0;
+      while (tried < max_tries) {
+        do {
+          next_peer = known_peers.begin();
+          std::advance(next_peer, RngStream_RandInt(stream, 0, nb_known_peers - 1));
+        } while (ta->getPeers()->find(*next_peer) != ta->getPeers()->end());
+        ta->addPeer(*next_peer);
+        tried++;
+      }
+      tq->getReturnMailbox()->put_init(ta, TRACKER_COMM_SIZE)->detach();
+
+      delete tq;
+      comm = nullptr;
+    } else {
+      simgrid::s4u::this_actor::sleep_for(1);
+    }
+  }
+  XBT_INFO("Tracker is leaving");
+}
diff --git a/examples/s4u/app-bittorrent/s4u-tracker.hpp b/examples/s4u/app-bittorrent/s4u-tracker.hpp
new file mode 100644 (file)
index 0000000..d167dc0
--- /dev/null
@@ -0,0 +1,46 @@
+/* Copyright (c) 2012-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. */
+
+#ifndef BITTORRENT_TRACKER_HPP_
+#define BITTORRENT_TRACKER_HPP_
+
+#include "s4u-bittorrent.hpp"
+#include <set>
+
+class TrackerQuery {
+  int peer_id; // peer id
+  simgrid::s4u::MailboxPtr return_mailbox;
+public:
+  explicit TrackerQuery(int peer_id, simgrid::s4u::MailboxPtr return_mailbox)
+      : peer_id(peer_id), return_mailbox(return_mailbox){};
+  ~TrackerQuery() = default;
+  int getPeerId() { return peer_id; }
+  simgrid::s4u::MailboxPtr getReturnMailbox() { return return_mailbox; }
+};
+
+class TrackerAnswer {
+  // int interval; // how often the peer should contact the tracker (unused for now)
+  std::set<int>* peers; // the peer list the peer has asked for.
+public:
+  explicit TrackerAnswer(int /*interval*/) /*: interval(interval)*/ { peers = new std::set<int>; }
+  TrackerAnswer(const TrackerAnswer&)                               = delete;
+  ~TrackerAnswer() { delete peers; };
+  void addPeer(int peer) { peers->insert(peer); }
+  std::set<int>* getPeers() { return peers; }
+};
+
+class Tracker {
+  double deadline;
+  RngStream stream;
+  simgrid::s4u::MailboxPtr mailbox;
+  std::set<int> known_peers;
+
+public:
+  explicit Tracker(std::vector<std::string> args);
+  void operator()();
+};
+
+#endif /* BITTORRENT_TRACKER_HPP */
@@ -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 "xbt/str.h"
 #include "xbt/sysdep.h"
 #include <simgrid/s4u.hpp>
 #include <string>
@@ -38,18 +37,17 @@ 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 task to the @ref worker */
-      char* payload = bprintf("%f", comp_size);
-      mailbox->put(payload, comm_size);
+      /* - Send the computation amount to the @ref worker */
+      mailbox->put(new double(comp_size), comm_size);
     }
 
     XBT_INFO("All tasks have been dispatched. Let's tell everybody the computation is over.");
     for (int i = 0; i < workers_count; i++) {
       /* - Eventually tell all the workers to stop by sending a "finalize" task */
       mailbox = simgrid::s4u::Mailbox::byName(std::string("worker-") + std::to_string(i % workers_count));
-      mailbox->put(xbt_strdup("finalize"), 0);
+      mailbox->put(new double(-1.0), 0);
     }
   }
 };
@@ -70,38 +68,35 @@ public:
   void operator()()
   {
     while (1) { /* The worker waits in an infinite loop for tasks sent by the \ref master */
-      char* res = static_cast<char*>(mailbox->get());
-      xbt_assert(res != nullptr, "MSG_task_get failed");
-
-      if (strcmp(res, "finalize") == 0) { /* - Exit if 'finalize' is received */
-        xbt_free(res);
+      double* task = static_cast<double*>(mailbox->get());
+      xbt_assert(task != nullptr, "mailbox->get() failed");
+      double comp_size = *task;
+      delete task;
+      if (comp_size < 0) { /* - Exit when -1.0 is received */
+        XBT_INFO("I'm done. See you!");
         break;
       }
       /*  - Otherwise, process the task */
-      double comp_size = std::stod(res);
-      xbt_free(res);
       simgrid::s4u::this_actor::execute(comp_size);
     }
-    XBT_INFO("I'm done. See you!");
   }
 };
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
                        "\tExample: %s msg_platform.xml msg_deployment.xml\n",
              argv[0], argv[0]);
 
-  e->loadPlatform(argv[1]);              /** - Load the platform description */
-  e->registerFunction<Master>("master");
-  e->registerFunction<Worker>("worker"); /** - Register the function to be executed by the processes */
-  e->loadDeployment(argv[2]);            /** - Deploy the application */
+  e.loadPlatform(argv[1]); /** - Load the platform description */
+  e.registerFunction<Master>("master");
+  e.registerFunction<Worker>("worker"); /** - Register the function to be executed by the processes */
+  e.loadDeployment(argv[2]);            /** - Deploy the application */
 
-  e->run(); /** - Run the simulation */
+  e.run(); /** - Run the simulation */
 
-  XBT_INFO("Simulation time %g", e->getClock());
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }
@@ -3,7 +3,7 @@
 p Testing a simple master/worker example application (mailbox version)
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_app-masterworker$EXEEXT ${srcdir:=.}/small_platform_with_routers.xml ${srcdir:=.}/../s4u/app-masterworker/s4u_app-masterworker_d.xml --cfg=network/crosstraffic:0 --trace "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-masterworker$EXEEXT ${srcdir:=.}/small_platform_with_routers.xml ${srcdir:=.}/../s4u/app-masterworker/s4u-app-masterworker_d.xml --cfg=network/crosstraffic:0 --trace "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (maestro@) Configuration change: Set 'network/crosstraffic' to '0'
 > [  0.000000] (master@Tremblay) Got 5 workers and 20 tasks to process
 > [  0.000000] (master@Tremblay) Sending "Task_0" (of 20) to mailbox "worker-0"
@@ -54,9 +54,9 @@ static void ponger(std::vector<std::string> args)
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
 
-  e->loadPlatform(argv[1]);
+  e.loadPlatform(argv[1]);
   std::vector<std::string> args;
   args.push_back("Jupiter");
   simgrid::s4u::Actor::createActor("pinger", simgrid::s4u::Host::by_name("Tremblay"), pinger, args);
@@ -66,10 +66,9 @@ int main(int argc, char* argv[])
 
   simgrid::s4u::Actor::createActor("ponger", simgrid::s4u::Host::by_name("Jupiter"), ponger, args);
 
-  e->run();
+  e.run();
 
-  XBT_INFO("Total simulation time: %.3f", e->getClock());
-  delete e;
+  XBT_INFO("Total simulation time: %.3f", e.getClock());
 
   return 0;
 }
@@ -2,7 +2,20 @@
 
 p Testing with default compound
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  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 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)
@@ -14,7 +27,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u_app-pingpong$EXEEXT ${srcdir:=.}/small_platfor
 
 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"
+$ $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"
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01'
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (1:pinger@Tremblay) Ping -> Jupiter
@@ -28,7 +41,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u_app-pingpong$EXEEXT ${srcdir:=.}/small_platfor
 
 p Testing the surf network Reno 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:Reno" --log=surf_lagrange.thres=critical "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Reno" --log=surf_lagrange.thres=critical "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0: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 'Reno'
@@ -41,9 +54,24 @@ $ $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"
+$ $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"
 > [  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 'Vegas'
@@ -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
@@ -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 "xbt/str.h"
 #include <simgrid/s4u.hpp>
 #include <algorithm>
 #include <string>
@@ -23,8 +22,12 @@ public:
 
   void operator()()
   {
-    rank = xbt_str_parse_int(simgrid::s4u::this_actor::getName().c_str(),
-                             "Any process of this example must have a numerical name, not %s");
+    try {
+      rank = std::stoi(simgrid::s4u::this_actor::getName());
+    } catch (std::invalid_argument& ia) {
+      throw std::invalid_argument(std::string("Processes of this example must have a numerical name, not ") +
+                                  ia.what());
+    }
     my_mailbox = simgrid::s4u::Mailbox::byName(std::to_string(rank));
     if (rank + 1 == simgrid::s4u::Engine::getInstance()->getHostCount())
       /* The last process, which sends the token back to rank 0 */
@@ -35,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);
     }
   }
@@ -51,22 +54,21 @@ public:
 
 int main(int argc, char** argv)
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc > 1, "Usage: %s platform.xml\n", argv[0]);
-  e->loadPlatform(argv[1]);
+  e.loadPlatform(argv[1]);
 
-  XBT_INFO("Number of hosts '%zu'", e->getHostCount());
+  XBT_INFO("Number of hosts '%zu'", e.getHostCount());
   int id = 0;
   std::vector<simgrid::s4u::Host*> list;
-  e->getHostList(&list);
-  for (auto host : list) {
+  e.getHostList(&list);
+  for (auto const& host : list) {
     /* - Give a unique rank to each host and create a @ref relay_runner process on each */
     simgrid::s4u::Actor::createActor((std::to_string(id)).c_str(), host, RelayRunner());
     id++;
   }
-  e->run();
-  XBT_INFO("Simulation time %g", e->getClock());
+  e.run();
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }
@@ -1,6 +1,6 @@
 #! ./tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_app-token-ring ${srcdir:=.}/routing_cluster.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-token-ring ${srcdir:=.}/routing_cluster.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (maestro@) Number of hosts '6'
 > [  0.000000] (0@host1) Host "0" send 'Token' to Host "1"
 > [  0.017354] (1@host2) Host "1" received "Token"
@@ -16,7 +16,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u_app-token-ring ${srcdir:=.}/routing_cluster.xm
 > [  0.131796] (0@host1) Host "0" received "Token"
 > [  0.131796] (maestro@) Simulation time 0.131796
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_app-token-ring ${srcdir:=.}/two_peers.xml "--log=root.fmt:[%12.6r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-token-ring ${srcdir:=.}/two_peers.xml "--log=root.fmt:[%12.6r]%e(%P@%h)%e%m%n"
 > [    0.000000] (maestro@) Number of hosts '2'
 > [    0.000000] (0@100030591) Host "0" send 'Token' to Host "1"
 > [    0.624423] (1@100036570) Host "1" received "Token"
@@ -24,7 +24,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u_app-token-ring ${srcdir:=.}/two_peers.xml "--l
 > [    1.248846] (0@100030591) Host "0" received "Token"
 > [    1.248846] (maestro@) Simulation time 1.24885
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_app-token-ring ${srcdir:=.}/meta_cluster.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-token-ring ${srcdir:=.}/meta_cluster.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (maestro@) Number of hosts '60'
 > [  0.000000] (0@host-1.cluster1) Host "0" send 'Token' to Host "1"
 > [  0.030364] (1@host-1.cluster2) Host "1" received "Token"
diff --git a/examples/s4u/async-wait/s4u-async-wait.cpp b/examples/s4u/async-wait/s4u-async-wait.cpp
new file mode 100644 (file)
index 0000000..f7b1968
--- /dev/null
@@ -0,0 +1,114 @@
+/* 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 example shows how to use simgrid::s4u::this_actor::wait() to wait for a given communication.
+ *
+ * As for the other asynchronous examples, the sender initiate all the messages it wants to send and
+ * pack the resulting simgrid::s4u::CommPtr objects in a vector. All messages thus occurs concurrently.
+ *
+ * The sender then loops until there is no ongoing communication.
+ */
+
+#include "simgrid/s4u.hpp"
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_wait, "Messages specific for this s4u example");
+
+class Sender {
+  long messages_count;  /* - number of tasks */
+  long receivers_count; /* - number of receivers */
+  double msg_size;      /* - communication cost in bytes */
+
+public:
+  explicit Sender(std::vector<std::string> args)
+  {
+    xbt_assert(args.size() == 4, "Expecting 3 parameters from the XML deployment file but got %zu", args.size());
+    messages_count  = std::stol(args[1]);
+    msg_size        = std::stod(args[2]);
+    receivers_count = std::stol(args[3]);
+  }
+  void operator()()
+  {
+    std::vector<simgrid::s4u::CommPtr> pending_comms;
+
+    /* Start dispatching all messages to receivers, in a round robin fashion */
+    for (int i = 0; i < messages_count; i++) {
+
+      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);
+      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(payload, msg_size);
+      /* Add this comm to the vector of all known comms */
+      pending_comms.push_back(comm);
+    }
+
+    /* Start sending messages to let the workers know that they should stop */
+    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);
+      std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
+
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, 0);
+      pending_comms.push_back(comm);
+      XBT_INFO("Send 'finalize' to 'receiver-%ld'", i % receivers_count);
+    }
+    XBT_INFO("Done dispatching all messages");
+
+    /* Now that all message exchanges were initiated, wait for their completion, in order of creation. */
+    while (not pending_comms.empty()) {
+      simgrid::s4u::CommPtr comm = pending_comms.back();
+      comm->wait();             // we could provide a timeout as a parameter
+      pending_comms.pop_back(); // remove it from the list
+    }
+
+    XBT_INFO("Goodbye now!");
+  }
+};
+
+/* Receiver actor expects 1 argument: its ID */
+class Receiver {
+  simgrid::s4u::MailboxPtr mbox;
+
+public:
+  explicit Receiver(std::vector<std::string> args)
+  {
+    xbt_assert(args.size() == 2, "Expecting one parameter from the XML deployment file but got %zu", args.size());
+    std::string mboxName = std::string("receiver-") + args[1];
+    mbox                 = simgrid::s4u::Mailbox::byName(mboxName);
+  }
+
+  void operator()()
+  {
+    XBT_INFO("Wait for my first message");
+    for (bool cont = true; cont;) {
+      std::string* received = static_cast<std::string*>(mbox->get());
+      XBT_INFO("I got a '%s'.", received->c_str());
+      cont = (*received != "finalize"); // If it's a finalize message, we're done
+      // Receiving the message was all we were supposed to do
+      delete received;
+    }
+  }
+};
+
+int main(int argc, char *argv[])
+{
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
+
+  simgrid::s4u::Engine e(&argc, argv);
+  e.registerFunction<Sender>("sender");
+  e.registerFunction<Receiver>("receiver");
+
+  e.loadPlatform(argv[1]);
+  e.loadDeployment(argv[2]);
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/async-wait/s4u-async-wait.tesh b/examples/s4u/async-wait/s4u-async-wait.tesh
new file mode 100644 (file)
index 0000000..26cf9f9
--- /dev/null
@@ -0,0 +1,16 @@
+#! ./tesh
+
+p Test1 Sleep_sender > Sleep_receiver
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-wait ${srcdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/../s4u/async-wait/s4u-async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
+> [  0.000000] (2:receiver@Ruby) Wait for my first message
+> [  0.000000] (1:sender@Tremblay) Send 'Message 1' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 2' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'finalize' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Done dispatching all messages
+> [  0.105458] (2:receiver@Ruby) I got a 'Message 0'.
+> [  0.210917] (2:receiver@Ruby) I got a 'Message 1'.
+> [  0.316375] (2:receiver@Ruby) I got a 'Message 2'.
+> [  0.318326] (2:receiver@Ruby) I got a 'finalize'.
+> [  0.318326] (1:sender@Tremblay) Goodbye now!
\ No newline at end of file
diff --git a/examples/s4u/async-wait/s4u-async-wait_d.xml b/examples/s4u/async-wait/s4u-async-wait_d.xml
new file mode 100644 (file)
index 0000000..e6f11cf
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+  <!-- The master actor (with some arguments) -->
+  <actor host="Tremblay" function="sender">
+    <argument value="3"/>       <!-- Number of tasks -->
+    <argument value="50000000"/>  <!-- Computation size of tasks -->
+    <argument value="1"/>         <!-- Number of receivers -->
+  </actor>
+  <!-- The receiver processes --> 
+  <actor host="Ruby" function="receiver">
+    <argument value="0"/> <!-- id -->
+  </actor>
+</platform>
\ No newline at end of file
diff --git a/examples/s4u/async-waitall/s4u-async-waitall.cpp b/examples/s4u/async-waitall/s4u-async-waitall.cpp
new file mode 100644 (file)
index 0000000..7e611d7
--- /dev/null
@@ -0,0 +1,110 @@
+/* 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 example shows how to block on the completion of a set of communications.
+ *
+ * As for the other asynchronous examples, the sender initiate all the messages it wants to send and
+ * pack the resulting simgrid::s4u::CommPtr objects in a vector. All messages thus occurs concurrently.
+ *
+ * The sender then blocks until all ongoing communication terminate, using simgrid::s4u::Comm::wait_all()
+ *
+ */
+
+#include "simgrid/s4u.hpp"
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_waitall, "Messages specific for this s4u example");
+
+class Sender {
+  long messages_count;  /* - number of tasks */
+  long receivers_count; /* - number of receivers */
+  double msg_size;      /* - communication cost in bytes */
+
+public:
+  explicit Sender(std::vector<std::string> args)
+  {
+    xbt_assert(args.size() == 4, "Expecting 3 parameters from the XML deployment file but got %zu", args.size());
+    messages_count  = std::stol(args[1]);
+    msg_size        = std::stod(args[2]);
+    receivers_count = std::stol(args[3]);
+  }
+  void operator()()
+  {
+    std::vector<simgrid::s4u::CommPtr> pending_comms;
+
+    /* Start dispatching all messages to receivers, in a round robin fashion */
+    for (int i = 0; i < messages_count; i++) {
+
+      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);
+      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(payload, msg_size);
+      /* Add this comm to the vector of all known comms */
+      pending_comms.push_back(comm);
+    }
+
+    /* Start sending messages to let the workers know that they should stop */
+    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);
+      std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
+
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, 0);
+      pending_comms.push_back(comm);
+      XBT_INFO("Send 'finalize' to 'receiver-%ld'", i % receivers_count);
+    }
+    XBT_INFO("Done dispatching all messages");
+
+    /* Now that all message exchanges were initiated, wait for their completion in one single call */
+    simgrid::s4u::Comm::wait_all(&pending_comms);
+
+    XBT_INFO("Goodbye now!");
+  }
+};
+
+/* Receiver actor expects 1 argument: its ID */
+class Receiver {
+  simgrid::s4u::MailboxPtr mbox;
+
+public:
+  explicit Receiver(std::vector<std::string> args)
+  {
+    xbt_assert(args.size() == 2, "Expecting one parameter from the XML deployment file but got %zu", args.size());
+    std::string mboxName = std::string("receiver-") + args[1];
+    mbox                 = simgrid::s4u::Mailbox::byName(mboxName);
+  }
+  void operator()()
+  {
+    XBT_INFO("Wait for my first message");
+    for (bool cont = true; cont;) {
+      std::string* received = static_cast<std::string*>(mbox->get());
+      XBT_INFO("I got a '%s'.", received->c_str());
+      cont = (*received != "finalize"); // If it's a finalize message, we're done
+      // Receiving the message was all we were supposed to do
+      delete received;
+    }
+  }
+};
+
+int main(int argc, char *argv[])
+{
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
+
+  simgrid::s4u::Engine e(&argc, argv);
+  e.registerFunction<Sender>("sender");
+  e.registerFunction<Receiver>("receiver");
+
+  e.loadPlatform(argv[1]);
+  e.loadDeployment(argv[2]);
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/async-waitall/s4u-async-waitall.tesh b/examples/s4u/async-waitall/s4u-async-waitall.tesh
new file mode 100644 (file)
index 0000000..0ae70d1
--- /dev/null
@@ -0,0 +1,21 @@
+#! ./tesh
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-waitall ${srcdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/../s4u/async-waitall/s4u-async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
+> [  0.000000] (2:receiver@Ruby) Wait for my first message
+> [  0.000000] (3:receiver@Perl) Wait for my first message
+> [  0.000000] (1:sender@Tremblay) Send 'Message 1' to 'receiver-1'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 2' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 3' to 'receiver-1'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 4' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'finalize' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'finalize' to 'receiver-1'
+> [  0.000000] (1:sender@Tremblay) Done dispatching all messages
+> [  0.004022] (2:receiver@Ruby) I got a 'Message 0'.
+> [  0.004022] (3:receiver@Perl) I got a 'Message 1'.
+> [  0.008043] (2:receiver@Ruby) I got a 'Message 2'.
+> [  0.008043] (3:receiver@Perl) I got a 'Message 3'.
+> [  0.009995] (3:receiver@Perl) I got a 'finalize'.
+> [  0.012065] (2:receiver@Ruby) I got a 'Message 4'.
+> [  0.014016] (2:receiver@Ruby) I got a 'finalize'.
+> [  0.014016] (1:sender@Tremblay) Goodbye now!
diff --git a/examples/s4u/async-waitall/s4u-async-waitall_d.xml b/examples/s4u/async-waitall/s4u-async-waitall_d.xml
new file mode 100644 (file)
index 0000000..122a030
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+  <!-- The master actor (with some arguments) -->
+  <actor host="Tremblay" function="sender">
+    <argument value="5"/>         <!-- Number of messages -->
+    <argument value="1000000"/>   <!-- Size of messages -->
+    <argument value="2"/>         <!-- Number of receivers -->
+  </actor>
+  <!-- The receiver processes. -->
+  <actor host="Ruby" function="receiver">
+    <argument value="0"/>
+  </actor>
+  <actor host="Perl" function="receiver">
+    <argument value="1"/>
+  </actor>
+</platform>
diff --git a/examples/s4u/async-waitany/s4u-async-waitany.cpp b/examples/s4u/async-waitany/s4u-async-waitany.cpp
new file mode 100644 (file)
index 0000000..eff5ae2
--- /dev/null
@@ -0,0 +1,126 @@
+/* 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 example shows how to use simgrid::s4u::this_actor::wait_any() to wait for the first occurring event.
+ *
+ * As for the other asynchronous examples, the sender initiate all the messages it wants to send and
+ * pack the resulting simgrid::s4u::CommPtr objects in a vector. All messages thus occurs concurrently.
+ *
+ * The sender then loops until there is no ongoing communication. Using wait_any() ensures that the sender
+ * will notice events as soon as they occur even if it does not follow the order of the container.
+ *
+ * Here, finalize messages will terminate earlier because their size is 0, so they travel faster than the
+ * other messages of this application.  As expected, the trace shows that the finalize of worker 1 is
+ * processed before 'Message 5' that is sent to worker 0.
+ *
+ */
+
+#include "simgrid/s4u.hpp"
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_waitall, "Messages specific for this msg example");
+
+class Sender {
+  long messages_count;  /* - number of tasks */
+  long receivers_count; /* - number of receivers */
+  double msg_size;      /* - communication cost in bytes */
+
+public:
+  explicit Sender(std::vector<std::string> args)
+  {
+    xbt_assert(args.size() == 4, "Expecting 3 parameters from the XML deployment file but got %zu", args.size());
+    messages_count  = std::stol(args[1]);
+    msg_size        = std::stod(args[2]);
+    receivers_count = std::stol(args[3]);
+  }
+  void operator()()
+  {
+    std::vector<simgrid::s4u::CommPtr> pending_comms;
+
+    /* Start dispatching all messages to receivers, in a round robin fashion */
+    for (int i = 0; i < messages_count; i++) {
+
+      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);
+      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(payload, msg_size);
+      /* Add this comm to the vector of all known comms */
+      pending_comms.push_back(comm);
+    }
+
+    /* Start sending messages to let the workers know that they should stop */
+    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);
+      std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
+
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, 0);
+      pending_comms.push_back(comm);
+      XBT_INFO("Send 'finalize' to 'receiver-%ld'", i % receivers_count);
+    }
+    XBT_INFO("Done dispatching all messages");
+
+    /* Now that all message exchanges were initiated, wait for their completion, in order of termination.
+     *
+     * This loop waits for first terminating message with wait_any() and remove it with erase(), until all comms are
+     * terminated
+     * Even in this simple example, the pending comms do not terminate in the exact same order of creation.
+     */
+    while (not pending_comms.empty()) {
+      int changed_pos = simgrid::s4u::Comm::wait_any(&pending_comms);
+      pending_comms.erase(pending_comms.begin() + changed_pos);
+      if (changed_pos != 0)
+        XBT_INFO("Remove the %dth pending comm: it terminated earlier than another comm that was initiated first.",
+                 changed_pos);
+    }
+
+    XBT_INFO("Goodbye now!");
+  }
+};
+
+/* Receiver actor expects 1 argument: its ID */
+class Receiver {
+  simgrid::s4u::MailboxPtr mbox;
+
+public:
+  explicit Receiver(std::vector<std::string> args)
+  {
+    xbt_assert(args.size() == 2, "Expecting one parameter from the XML deployment file but got %zu", args.size());
+    std::string mboxName = std::string("receiver-") + args[1];
+    mbox                 = simgrid::s4u::Mailbox::byName(mboxName);
+  }
+  void operator()()
+  {
+    XBT_INFO("Wait for my first message");
+    for (bool cont = true; cont;) {
+      std::string* received = static_cast<std::string*>(mbox->get());
+      XBT_INFO("I got a '%s'.", received->c_str());
+      cont = (*received != "finalize"); // If it's a finalize message, we're done
+      // Receiving the message was all we were supposed to do
+      delete received;
+    }
+  }
+};
+
+int main(int argc, char *argv[])
+{
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
+
+  simgrid::s4u::Engine e(&argc, argv);
+  e.registerFunction<Sender>("sender");
+  e.registerFunction<Receiver>("receiver");
+
+  e.loadPlatform(argv[1]);
+  e.loadDeployment(argv[2]);
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/async-waitany/s4u-async-waitany.tesh b/examples/s4u/async-waitany/s4u-async-waitany.tesh
new file mode 100644 (file)
index 0000000..1ec6a42
--- /dev/null
@@ -0,0 +1,27 @@
+#! ./tesh
+
+p Testing this_actor->wait_any()
+
+! output sort 19
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-waitany ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../s4u/async-waitany/s4u-async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
+> [  0.000000] (2:receiver@Fafard) Wait for my first message
+> [  0.000000] (3:receiver@Jupiter) Wait for my first message
+> [  0.000000] (1:sender@Tremblay) Send 'Message 1' to 'receiver-1'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 2' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 3' to 'receiver-1'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 4' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'Message 5' to 'receiver-1'
+> [  0.000000] (1:sender@Tremblay) Send 'finalize' to 'receiver-0'
+> [  0.000000] (1:sender@Tremblay) Send 'finalize' to 'receiver-1'
+> [  0.000000] (1:sender@Tremblay) Done dispatching all messages
+> [  0.158397] (2:receiver@Fafard) I got a 'Message 0'.
+> [  0.169155] (3:receiver@Jupiter) I got a 'Message 1'.
+> [  0.316794] (2:receiver@Fafard) I got a 'Message 2'.
+> [  0.338309] (3:receiver@Jupiter) I got a 'Message 3'.
+> [  0.475190] (2:receiver@Fafard) I got a 'Message 4'.
+> [  0.500898] (2:receiver@Fafard) I got a 'finalize'.
+> [  0.500898] (1:sender@Tremblay) Remove the 1th pending comm: it terminated earlier than another comm that was initiated first.
+> [  0.507464] (3:receiver@Jupiter) I got a 'Message 5'.
+> [  0.526478] (3:receiver@Jupiter) I got a 'finalize'.
+> [  0.526478] (1:sender@Tremblay) Goodbye now!
diff --git a/examples/s4u/async-waitany/s4u-async-waitany_d.xml b/examples/s4u/async-waitany/s4u-async-waitany_d.xml
new file mode 100644 (file)
index 0000000..4296dbb
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+  <!-- The master actor (with some arguments) -->
+  <actor host="Tremblay" function="sender">
+    <argument value="6"/>         <!-- Number of messages -->
+    <argument value="1000000"/>   <!-- Size of messages -->
+    <argument value="2"/>         <!-- Number of receivers -->
+  </actor>
+  <!-- The receiver processes -->
+  <actor host="Fafard" function="receiver">
+    <argument value="0"/>       <!-- My name -->
+  </actor>
+  <actor host="Jupiter" function="receiver">
+    <argument value="1"/>       <!-- My name -->
+  </actor>
+</platform>
index 184c1e3..4a73c0f 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (c) 2010-2016. The SimGrid Team. All rights reserved.          */
+/* 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 "s4u_dht-chord.hpp"
+#include "s4u-dht-chord.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(s4u_chord);
 
@@ -40,6 +40,11 @@ static int is_in_interval(int id, int start, int end)
   return i <= e;
 }
 
+void ChordMessage::destroy(void* message)
+{
+  delete static_cast<ChordMessage*>(message);
+}
+
 /* Initializes the current node as the first one of the system */
 Node::Node(std::vector<std::string> args)
 {
@@ -120,8 +125,8 @@ void Node::notifyAndQuit()
     }
   }
 
-  if (pred_id_ != -1) {
-    // send the SUCCESSOR_LEAVING to our predecessor (only if I have one)
+  if (pred_id_ != -1 && pred_id_ != id_) {
+    // send the SUCCESSOR_LEAVING to our predecessor (only if I have one that is not me)
     ChordMessage* succ_msg = new ChordMessage(SUCCESSOR_LEAVING);
     succ_msg->request_id   = fingers_[0];
     succ_msg->answer_to    = mailbox_;
@@ -230,19 +235,19 @@ 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 {
     comm->wait(timeout);
     XBT_DEBUG("Received the answer to my 'Predecessor Alive': my predecessor %d is alive", pred_id_);
+    delete static_cast<ChordMessage*>(data);
   } catch (xbt_ex& e) {
     if (e.category == timeout_error) {
       XBT_DEBUG("Failed to receive the answer to my 'Predecessor Alive' request");
       pred_id_ = -1;
     }
   }
-  delete message;
 }
 
 /* Asks its predecessor to a remote node
@@ -275,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 {
@@ -389,7 +394,7 @@ void Node::remoteNotify(int notify_id, int predecessor_candidate_id)
   // send a "Notify" request to notify_id
   XBT_DEBUG("Sending a 'Notify' request to %d", notify_id);
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::to_string(notify_id));
-  mailbox->put_init(message, 10)->detach();
+  mailbox->put_init(message, 10)->detach(ChordMessage::destroy);
 }
 
 /* This function is called periodically. It checks the immediate successor of the current node. */
@@ -398,13 +403,10 @@ void Node::stabilize()
   XBT_DEBUG("Stabilizing node");
 
   // get the predecessor of my immediate successor
-  int candidate_id;
+  int candidate_id = pred_id_;
   int successor_id = fingers_[0];
-  if (successor_id != id_) {
+  if (successor_id != id_)
     candidate_id = remoteGetPredecessor(successor_id);
-  } else {
-    candidate_id = pred_id_;
-  }
 
   // this node is a candidate to become my new successor
   if (candidate_id != -1 && is_in_interval(candidate_id, id_ + 1, successor_id - 1)) {
@@ -430,16 +432,16 @@ 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();
+      message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
     } else {
       // otherwise, forward the request to the closest preceding finger in my table
       int closest = closestPrecedingFinger(message->request_id);
       XBT_DEBUG("Forwarding the 'Find Successor' request for id %d to my closest preceding finger %d",
           message->request_id, closest);
       simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::to_string(closest));
-      mailbox->put_init(message, 10)->detach();
+      mailbox->put_init(message, 10)->detach(ChordMessage::destroy);
     }
     break;
 
@@ -448,8 +450,8 @@ 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->answer_to->put_init(message, 10)->detach();
+              message->issuer_host_name.c_str(), message->answer_to->getCname(), message->answer_id);
+    message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
     break;
 
   case NOTIFY:
@@ -486,8 +488,8 @@ 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->put_init(message, 10)->detach();
+              message->answer_to->getCname());
+    message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
     break;
 
   default:
similarity index 87%
rename from examples/s4u/dht-chord/s4u_dht-chord.cpp
rename to examples/s4u/dht-chord/s4u-dht-chord.cpp
index 1a9db78..5c819f1 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 "s4u_dht-chord.hpp"
+#include "s4u-dht-chord.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_chord, "Messages specific for this s4u example");
 simgrid::xbt::Extension<simgrid::s4u::Host, HostChord> HostChord::EXTENSION_ID;
@@ -30,7 +30,7 @@ static void chord_init()
 
   std::vector<simgrid::s4u::Host*> list;
   simgrid::s4u::Engine::getInstance()->getHostList(&list);
-  for (auto host : list)
+  for (auto const& host : list)
     host->extension_set(new HostChord(host));
 }
 
@@ -41,7 +41,7 @@ static void chord_exit()
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
                        "\tExample: %s ../msg_platform.xml chord.xml\n",
              argv[0], argv[0]);
@@ -63,19 +63,18 @@ int main(int argc, char* argv[])
     options++;
   }
 
-  e->loadPlatform(options[0]);
+  e.loadPlatform(options[0]);
 
   chord_init();
 
-  e->registerFunction<Node>("node");
-  e->loadDeployment(options[1]);
+  e.registerFunction<Node>("node");
+  e.loadDeployment(options[1]);
 
-  e->run();
+  e.run();
 
-  XBT_INFO("Simulated time: %g", e->getClock());
+  XBT_INFO("Simulated time: %g", e.getClock());
 
   chord_exit();
 
-  delete e;
   return 0;
 }
similarity index 95%
rename from examples/s4u/dht-chord/s4u_dht-chord.hpp
rename to examples/s4u/dht-chord/s4u-dht-chord.hpp
index 04f0c22..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:
@@ -69,6 +69,8 @@ public:
   }
 
   ~ChordMessage() = default;
+
+  static void destroy(void* message);
 };
 
 class Node {
@@ -85,6 +87,7 @@ class Node {
 
 public:
   explicit Node(std::vector<std::string> args);
+  Node(const Node&) = delete;
   ~Node();
   void join(int known_id);
   void leave();
@@ -159,8 +162,11 @@ public:
       }
       now = simgrid::s4u::Engine::getClock();
     }
-    if (data != nullptr) {
-      delete static_cast<ChordMessage*>(data);
+    if (comm_receive != nullptr) {
+      if (comm_receive->test())
+        delete static_cast<ChordMessage*>(data);
+      else
+        comm_receive->cancel();
     }
     // leave the ring
     leave();
similarity index 75%
rename from examples/s4u/dht-chord/s4u_dht-chord.tesh
rename to examples/s4u/dht-chord/s4u-dht-chord.tesh
index ebe7b47..3096c45 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the Chord implementation with MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_dht-chord$EXEEXT -nb_bits=3 ${srcdir:=.}/cluster.xml ${srcdir:=.}/../s4u/dht-chord/s4u_dht-chord_d.xml --log=s4u_chord.thres:verbose "--log=root.fmt:[%10.5r]%e(%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-dht-chord$EXEEXT -nb_bits=3 ${srcdir:=.}/cluster.xml ${srcdir:=.}/../s4u/dht-chord/s4u-dht-chord_d.xml --log=s4u_chord.thres:verbose "--log=root.fmt:[%10.5r]%e(%P@%h)%e%m%n"
 > [   0.00000] (node@node-0.acme.org) My finger table:
 > [   0.00000] (node@node-0.acme.org) Start | Succ
 > [   0.00000] (node@node-0.acme.org)    3  |  42
@@ -177,61 +177,61 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u_dht-chord$EXEEXT -nb_bits=3 ${srcdir:=.}/clust
 > [ 360.18115] (node@node-0.acme.org) Predecessor: 533744
 > [ 420.23459] (node@node-2.acme.org) Well Guys! I Think it's time for me to leave ;)
 > [ 425.22668] (node@node-0.acme.org) My new predecessor is 42
-> [ 475.23449] (node@node-0.acme.org) My new finger #0 is 42
-> [ 480.23439] (node@node-0.acme.org) My new predecessor is 16728096
-> [ 480.23439] (node@node-0.acme.org) My finger table:
-> [ 480.23439] (node@node-0.acme.org) Start | Succ
-> [ 480.23439] (node@node-0.acme.org)    3  |  42
-> [ 480.23439] (node@node-0.acme.org)    4  | 16509405
-> [ 480.23439] (node@node-0.acme.org)    6  | 533744
-> [ 480.23439] (node@node-0.acme.org) Predecessor: 16728096
-> [ 485.24209] (node@node-6.acme.org) My new finger #2 is 42
-> [ 485.24209] (node@node-6.acme.org) My finger table:
-> [ 485.24209] (node@node-6.acme.org) Start | Succ
-> [ 485.24209] (node@node-6.acme.org)    1  |  42
-> [ 485.24209] (node@node-6.acme.org)    2  |  42
-> [ 485.24209] (node@node-6.acme.org)    4  |  42
-> [ 485.24209] (node@node-6.acme.org) Predecessor: -1
-> [ 495.24970] (node@node-0.acme.org) My new finger #0 is 16728096
-> [ 575.26471] (node@node-6.acme.org) My new predecessor is 42
-> [ 575.26471] (node@node-6.acme.org) My finger table:
-> [ 575.26471] (node@node-6.acme.org) Start | Succ
-> [ 575.26471] (node@node-6.acme.org)    1  |  42
-> [ 575.26471] (node@node-6.acme.org)    2  |  42
-> [ 575.26471] (node@node-6.acme.org)    4  |  42
-> [ 575.26471] (node@node-6.acme.org) Predecessor: 42
-> [ 600.27202] (node@node-0.acme.org) My new finger #1 is 16728096
-> [ 600.27202] (node@node-0.acme.org) My finger table:
-> [ 600.27202] (node@node-0.acme.org) Start | Succ
-> [ 600.27202] (node@node-0.acme.org)    3  | 16728096
-> [ 600.27202] (node@node-0.acme.org)    4  | 16728096
-> [ 600.27202] (node@node-0.acme.org)    6  | 533744
-> [ 600.27202] (node@node-0.acme.org) Predecessor: 16728096
-> [ 720.36329] (node@node-0.acme.org) My new finger #2 is 16728096
-> [ 720.36329] (node@node-0.acme.org) My finger table:
-> [ 720.36329] (node@node-0.acme.org) Start | Succ
-> [ 720.36329] (node@node-0.acme.org)    3  | 16728096
-> [ 720.36329] (node@node-0.acme.org)    4  | 16728096
-> [ 720.36329] (node@node-0.acme.org)    6  | 16728096
-> [ 720.36329] (node@node-0.acme.org) Predecessor: 16728096
-> [ 855.46207] (node@node-6.acme.org) My new finger #2 is 16728096
-> [ 855.46207] (node@node-6.acme.org) My finger table:
-> [ 855.46207] (node@node-6.acme.org) Start | Succ
-> [ 855.46207] (node@node-6.acme.org)    1  |  42
-> [ 855.46207] (node@node-6.acme.org)    2  |  42
-> [ 855.46207] (node@node-6.acme.org)    4  | 16728096
-> [ 855.46207] (node@node-6.acme.org) Predecessor: 42
-> [ 860.46197] (node@node-6.acme.org) Well Guys! I Think it's time for me to leave ;)
-> [ 865.45406] (node@node-0.acme.org) My new predecessor is 42
-> [ 890.43115] (node@node-5.acme.org) Well Guys! I Think it's time for me to leave ;)
-> [ 915.45406] (node@node-0.acme.org) My new finger #0 is 42
-> [ 940.45356] (node@node-0.acme.org) My new finger #0 is 16509405
-> [ 990.45356] (node@node-0.acme.org) My new finger #1 is 16509405
-> [ 990.45356] (node@node-0.acme.org) My finger table:
-> [ 990.45356] (node@node-0.acme.org) Start | Succ
-> [ 990.45356] (node@node-0.acme.org)    3  | 16509405
-> [ 990.45356] (node@node-0.acme.org)    4  | 16509405
-> [ 990.45356] (node@node-0.acme.org)    6  | 16728096
-> [ 990.45356] (node@node-0.acme.org) Predecessor: 42
-> [1040.45356] (node@node-0.acme.org) Well Guys! I Think it's time for me to leave ;)
-> [1090.46137] (maestro@) Simulated time: 1090.46
+> [ 475.22668] (node@node-0.acme.org) My new finger #0 is 42
+> [ 480.22658] (node@node-0.acme.org) My new predecessor is 16728096
+> [ 480.22658] (node@node-0.acme.org) My finger table:
+> [ 480.22658] (node@node-0.acme.org) Start | Succ
+> [ 480.22658] (node@node-0.acme.org)    3  |  42
+> [ 480.22658] (node@node-0.acme.org)    4  | 16509405
+> [ 480.22658] (node@node-0.acme.org)    6  | 533744
+> [ 480.22658] (node@node-0.acme.org) Predecessor: 16728096
+> [ 485.23429] (node@node-6.acme.org) My new finger #2 is 42
+> [ 485.23429] (node@node-6.acme.org) My finger table:
+> [ 485.23429] (node@node-6.acme.org) Start | Succ
+> [ 485.23429] (node@node-6.acme.org)    1  |  42
+> [ 485.23429] (node@node-6.acme.org)    2  |  42
+> [ 485.23429] (node@node-6.acme.org)    4  |  42
+> [ 485.23429] (node@node-6.acme.org) Predecessor: -1
+> [ 495.24189] (node@node-0.acme.org) My new finger #0 is 16728096
+> [ 575.25691] (node@node-6.acme.org) My new predecessor is 42
+> [ 575.25691] (node@node-6.acme.org) My finger table:
+> [ 575.25691] (node@node-6.acme.org) Start | Succ
+> [ 575.25691] (node@node-6.acme.org)    1  |  42
+> [ 575.25691] (node@node-6.acme.org)    2  |  42
+> [ 575.25691] (node@node-6.acme.org)    4  |  42
+> [ 575.25691] (node@node-6.acme.org) Predecessor: 42
+> [ 600.26421] (node@node-0.acme.org) My new finger #1 is 16728096
+> [ 600.26421] (node@node-0.acme.org) My finger table:
+> [ 600.26421] (node@node-0.acme.org) Start | Succ
+> [ 600.26421] (node@node-0.acme.org)    3  | 16728096
+> [ 600.26421] (node@node-0.acme.org)    4  | 16728096
+> [ 600.26421] (node@node-0.acme.org)    6  | 533744
+> [ 600.26421] (node@node-0.acme.org) Predecessor: 16728096
+> [ 720.35548] (node@node-0.acme.org) My new finger #2 is 16728096
+> [ 720.35548] (node@node-0.acme.org) My finger table:
+> [ 720.35548] (node@node-0.acme.org) Start | Succ
+> [ 720.35548] (node@node-0.acme.org)    3  | 16728096
+> [ 720.35548] (node@node-0.acme.org)    4  | 16728096
+> [ 720.35548] (node@node-0.acme.org)    6  | 16728096
+> [ 720.35548] (node@node-0.acme.org) Predecessor: 16728096
+> [ 855.45426] (node@node-6.acme.org) My new finger #2 is 16728096
+> [ 855.45426] (node@node-6.acme.org) My finger table:
+> [ 855.45426] (node@node-6.acme.org) Start | Succ
+> [ 855.45426] (node@node-6.acme.org)    1  |  42
+> [ 855.45426] (node@node-6.acme.org)    2  |  42
+> [ 855.45426] (node@node-6.acme.org)    4  | 16728096
+> [ 855.45426] (node@node-6.acme.org) Predecessor: 42
+> [ 860.45416] (node@node-6.acme.org) Well Guys! I Think it's time for me to leave ;)
+> [ 865.44626] (node@node-0.acme.org) My new predecessor is 42
+> [ 890.42334] (node@node-5.acme.org) Well Guys! I Think it's time for me to leave ;)
+> [ 915.44626] (node@node-0.acme.org) My new finger #0 is 42
+> [ 940.44576] (node@node-0.acme.org) My new finger #0 is 16509405
+> [ 990.44576] (node@node-0.acme.org) My new finger #1 is 16509405
+> [ 990.44576] (node@node-0.acme.org) My finger table:
+> [ 990.44576] (node@node-0.acme.org) Start | Succ
+> [ 990.44576] (node@node-0.acme.org)    3  | 16509405
+> [ 990.44576] (node@node-0.acme.org)    4  | 16509405
+> [ 990.44576] (node@node-0.acme.org)    6  | 16728096
+> [ 990.44576] (node@node-0.acme.org) Predecessor: 42
+> [1040.44576] (node@node-0.acme.org) Well Guys! I Think it's time for me to leave ;)
+> [1090.44576] (maestro@) Simulated time: 1090.45
diff --git a/examples/s4u/energy-link/s4u-energy-link.cpp b/examples/s4u/energy-link/s4u-energy-link.cpp
new file mode 100644 (file)
index 0000000..94de986
--- /dev/null
@@ -0,0 +1,143 @@
+/* Copyright (c) 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/plugins/energy.h"
+#include "xbt/log.h"
+#include <simgrid/s4u.hpp>
+
+#include <random>
+
+/* Parameters of the random generation of the flow size */
+static const unsigned long int min_size = 1e6;
+static const unsigned long int max_size = 1e9;
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_app_energyconsumption, "Messages specific for this s4u example");
+
+static void sender(std::vector<std::string> args)
+{
+  xbt_assert(args.size() == 2, "The master function expects 2 arguments.");
+  int flow_amount  = std::stoi(args.at(0));
+  double comm_size = std::stod(args.at(1));
+  XBT_INFO("Send %.0f bytes, in %d flows", comm_size, flow_amount);
+
+  simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::string("message"));
+
+  simgrid::s4u::this_actor::sleep_for(10);
+
+  /* - Send the task to the @ref worker */
+  char* payload = bprintf("%f", comm_size);
+
+  if (flow_amount == 1) {
+    mailbox->put(payload, comm_size);
+  } else {
+    // Start all comms in parallel
+    std::vector<simgrid::s4u::CommPtr> comms;
+    for (int i = 0; i < flow_amount; i++)
+      comms.push_back(mailbox->put_async(const_cast<char*>("message"), comm_size));
+
+    // And now, wait for all comms. Manually since wait_all is not part of this_actor yet
+    for (int i = 0; i < flow_amount; i++) {
+      simgrid::s4u::CommPtr comm = comms.at(i);
+      comm->wait();
+    }
+    comms.clear();
+  }
+  XBT_INFO("sender done.");
+}
+
+static void receiver(std::vector<std::string> args)
+{
+  int flow_amount = std::stoi(args.at(0));
+
+  XBT_INFO("Receiving %d flows ...", flow_amount);
+
+  simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::string("message"));
+
+  if (flow_amount == 1) {
+    void* res = mailbox->get();
+    xbt_free(res);
+  } else {
+    void* ignored;
+
+    // Start all comms in parallel
+    std::vector<simgrid::s4u::CommPtr> comms;
+    for (int i = 0; i < flow_amount; i++)
+      comms.push_back(mailbox->get_async(&ignored));
+
+    // And now, wait for all comms. Manually since wait_all is not part of this_actor yet
+    for (int i = 0; i < flow_amount; i++)
+      comms.at(i)->wait();
+    comms.clear();
+  }
+  XBT_INFO("receiver done.");
+}
+
+int main(int argc, char* argv[])
+{
+
+  simgrid::s4u::Engine e(&argc, argv);
+
+  /* Check if we got --NS3 on the command line, and activate ecofen if so */
+  bool NS3 = false;
+  for (int i = 0; i < argc; i++) {
+    if (strcmp(argv[i], "--NS3") == 0)
+      NS3 = true;
+    if (NS3) // Found the --NS3 parameter previously; shift the rest of the line
+      argv[i] = argv[i + 1];
+  }
+  if (NS3) {
+    xbt_die("No Ecofen in this build");
+    //    XBT_INFO("Activating the Ecofen energy plugin");
+    //    ns3_link_energy_plugin_init();
+    //    xbt_cfg_set_parse("network/model:NS3");
+    //    argc -= 1; // We removed it from the parameters
+  } else {
+    XBT_INFO("Activating the SimGrid link energy plugin");
+    sg_link_energy_plugin_init();
+  }
+
+  xbt_assert(argc > 1, "\nUsage: %s platform_file [flowCount [datasize]] [--NS3]\n"
+                       "\tExample: %s s4uplatform.xml \n"
+                       "\tIf you add NS3 as last parameter, this will try to activate the ecofen plugin.\n"
+                       "\tWithout it, it will use the SimGrid link energy plugin.\n",
+             argv[0], argv[0]);
+  e.loadPlatform(argv[1]);
+
+  /* prepare to launch the actors */
+  std::vector<std::string> argSender;
+  std::vector<std::string> argReceiver;
+  if (argc > 2) {
+    argSender.push_back(argv[2]); // Take the amount of flows from the command line
+    argReceiver.push_back(argv[2]);
+  } else {
+    argSender.push_back("1"); // Default value
+    argReceiver.push_back("1");
+  }
+  if (argc > 3) {
+    if (strcmp(argv[3], "random") == 0) { // We're asked to get a random size
+      /* Initialize the random number generator */
+      std::random_device rd;
+      std::default_random_engine generator(rd());
+
+      /* Distribution on which to apply the generator */
+      std::uniform_int_distribution<unsigned long int> distribution(min_size, max_size);
+
+      char* size = bprintf("%lu", distribution(generator));
+      argSender.push_back(std::string(size));
+      xbt_free(size);
+    } else {                        // Not "random" ? Then it should be the size to use
+      argSender.push_back(argv[3]); // Take the datasize from the command line
+    }
+  } else { // No parameter at all? Then use the default value
+    argSender.push_back("25000");
+  }
+  simgrid::s4u::Actor::createActor("sender", simgrid::s4u::Host::by_name("MyHost1"), sender, argSender);
+  simgrid::s4u::Actor::createActor("receiver", simgrid::s4u::Host::by_name("MyHost2"), receiver, argReceiver);
+
+  /* And now, launch the simulation */
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/energy-link/s4u-energy-link.tesh b/examples/s4u/energy-link/s4u-energy-link.tesh
new file mode 100644 (file)
index 0000000..2622a4b
--- /dev/null
@@ -0,0 +1,28 @@
+#! ./tesh
+
+p Testing the mechanism for computing link energy consumption (using CM02 as a network model)
+
+$ ${bindir:=.}/s4u-energy-link$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=network/model:CM02 --cfg=network/crosstraffic:no
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/crosstraffic' to 'no'
+> [  0.000000] (0:maestro@) Activating the SimGrid link energy plugin
+> [  0.000000] (1:sender@MyHost1) Send 25000 bytes, in 1 flows
+> [  0.000000] (2:receiver@MyHost2) Receiving 1 flows ...
+> [ 10.250000] (2:receiver@MyHost2) receiver done.
+> [ 10.250000] (1:sender@MyHost1) sender done.
+> [ 10.250000] (0:maestro@) Link 'bus' total consumption: 10.750000
+> [ 10.250000] (0:maestro@) Total energy over all links: 10.750000
+
+p And now test with 500000 bytes
+
+$ ${bindir:=.}/s4u-energy-link$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml 1 50000000 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=network/model:CM02 --cfg=network/crosstraffic:no
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/crosstraffic' to 'no'
+> [  0.000000] (0:maestro@) Activating the SimGrid link energy plugin
+> [  0.000000] (1:sender@MyHost1) Send 50000000 bytes, in 1 flows
+> [  0.000000] (2:receiver@MyHost2) Receiving 1 flows ...
+> [510.000000] (2:receiver@MyHost2) receiver done.
+> [510.000000] (1:sender@MyHost1) sender done.
+> [510.000000] (0:maestro@) Link 'bus' total consumption: 1510.000000
+> [510.000000] (0:maestro@) Total energy over all links: 1510.000000
+
similarity index 64%
rename from examples/s4u/io/s4u_io.cpp
rename to examples/s4u/io/s4u-io.cpp
index 378f271..c783697 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"
@@ -15,8 +16,8 @@ public:
   {
     XBT_INFO("Storage info on %s:", simgrid::s4u::Host::current()->getCname());
 
-    for (const auto&kv : mounts) {
-      const char* mountpoint = kv.first.c_str();
+    for (auto const& kv : mounts) {
+      std::string mountpoint         = kv.first;
       simgrid::s4u::Storage* storage = kv.second;
 
       // Retrieve disk's information
@@ -24,8 +25,8 @@ 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, used_size, free_size,
-               size);
+      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", storage->getCname(), mountpoint.c_str(), used_size,
+               free_size, size);
     }
   }
 
@@ -36,11 +37,11 @@ public:
     show_info(mounts);
 
     // Open an non-existing file to create it
-    const char* filename = "/home/tmp/data.txt";
+    std::string filename     = "/home/tmp/data.txt";
     simgrid::s4u::File* file = new simgrid::s4u::File(filename, nullptr);
 
     sg_size_t write = file->write(200000);  // Write 200,000 bytes
-    XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename);
+    XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename.c_str());
 
     // check that sizes have changed
     show_info(mounts);
@@ -49,44 +50,46 @@ public:
     const sg_size_t file_size = file->size();
     file->seek(0);
     const sg_size_t read = file->read(file_size);
-    XBT_INFO("Read %llu bytes on %s", read, filename);
+    XBT_INFO("Read %llu bytes on %s", read, filename.c_str());
 
     // Now write 100,000 bytes in tmp/data.txt
     write = file->write(100000);  // Write 100,000 bytes
-    XBT_INFO("Write %llu bytes on %s", write, filename);
+    XBT_INFO("Write %llu bytes on %s", write, filename.c_str());
 
     simgrid::s4u::Storage* storage = simgrid::s4u::Storage::byName("Disk4");
 
     // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme
-    const char *newpath = "/home/tmp/simgrid.readme";
-    XBT_INFO("Move '%s' to '%s'", file->getPath(), newpath);
+    std::string newpath = "/home/tmp/simgrid.readme";
+    XBT_INFO("Move '%s' to '%s'", file->getPath(), newpath.c_str());
     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", (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("    Uninitialized storage data: '%s'", (char*)storage->getUserdata());
+    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'", (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;
   }
 };
 
 int main(int argc, char **argv)
 {
-  simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
-  e->loadPlatform("../../platforms/storage/storage.xml");
+  simgrid::s4u::Engine e(&argc, argv);
+  sg_storage_file_system_init();
+  e.loadPlatform("../../platforms/storage/storage.xml");
   simgrid::s4u::Actor::createActor("host", simgrid::s4u::Host::by_name("denise"), MyHost());
-  e->run();
-  delete e;
+  e.run();
+
   return 0;
 }
similarity index 97%
rename from examples/s4u/io/s4u_io.tesh
rename to examples/s4u/io/s4u-io.tesh
index 4e21628..29188d7 100644 (file)
@@ -1,6 +1,6 @@
 #! ./tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_io
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-io
 > [denise:host:(1) 0.000000] [s4u_test/INFO] Storage info on denise:
 > [denise:host:(1) 0.000000] [s4u_test/INFO]     Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000.
 > [denise:host:(1) 0.000000] [s4u_test/INFO]     Disk4 (/home) Used: 13221994; Free: 536857690006; Total: 536870912000.
similarity index 93%
rename from examples/s4u/mutex/s4u_mutex.cpp
rename to examples/s4u/mutex/s4u-mutex.cpp
index 2f2afd9..b1e3523 100644 (file)
@@ -60,11 +60,10 @@ static void master()
 
 int main(int argc, char **argv)
 {
-  simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
-  e->loadPlatform("../../platforms/two_hosts.xml");
+  simgrid::s4u::Engine e(&argc, argv);
+  e.loadPlatform("../../platforms/two_hosts.xml");
   simgrid::s4u::Actor::createActor("main", simgrid::s4u::Host::by_name("Tremblay"), master);
-  e->run();
+  e.run();
 
-  delete e;
   return 0;
 }
similarity index 98%
rename from examples/s4u/mutex/s4u_mutex.tesh
rename to examples/s4u/mutex/s4u-mutex.tesh
index 8d64d17..42ef210 100644 (file)
@@ -1,6 +1,6 @@
 #! ./tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u_mutex
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-mutex
 > [Jupiter:worker:(2) 0.000000] [s4u_test/INFO] Hello s4u, I'm ready to compute after a lock_guard
 > [Jupiter:worker:(2) 0.000000] [s4u_test/INFO] I'm done, good bye
 > [Tremblay:worker:(3) 0.000000] [s4u_test/INFO] Hello s4u, I'm ready to compute after a regular lock
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2010, 2013-2015. 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. */
@@ -69,17 +68,16 @@ static void execute_load_test()
 int main(int argc, char* argv[])
 {
   sg_host_load_plugin_init();
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
 
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
-  e->loadPlatform(argv[1]);
+  e.loadPlatform(argv[1]);
 
   simgrid::s4u::Actor::createActor("load_test", simgrid::s4u::Host::by_name("MyHost1"), execute_load_test);
 
-  e->run();
+  e.run();
 
   XBT_INFO("Total simulation time: %.2f", simgrid::s4u::Engine::getClock());
 
-  delete e;
   return 0;
 }
@@ -2,7 +2,7 @@
 
 p This tests the HostLoad plugin (this allows the user to get the current load of a host and the computed flops)
 
-$ ${bindir:=.}/s4u_plugin-hostload$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-plugin-hostload$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:load_test@MyHost1) Initial peak speed: 1E+08 flop/s; number of flops computed so far: 0E+00 (should be 0)
 > [  0.000000] (1:load_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:load_test@MyHost1) Done sleeping 10.00s; peak speed: 1E+08 flop/s; number of flops computed so far: 0E+00 (nothing should have changed)
index 176bd08..7dfd2f0 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* 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
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
           sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index ef3d029..e268452 100644 (file)
@@ -1,13 +1,15 @@
 /* simple test trying to load a DAX file.                                   */
 
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* 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. */
 
 #include "simgrid/simdag.h"
-#include "xbt/file.h"
+
+#include <stdio.h>
+#include <string.h>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
 
@@ -79,9 +81,8 @@ int main(int argc, char **argv)
   XBT_INFO("------------------- Run the schedule ---------------------------");
   SD_simulate(-1);
   XBT_INFO("------------------- Produce the trace file---------------------------");
-  char * basename = xbt_basename(tracefilename);
-  XBT_INFO("Producing the trace of the run into %s", basename);
-  free(basename);
+  char* basename = strrchr(tracefilename, '/');
+  XBT_INFO("Producing the trace of the run into %s", basename ? basename + 1 : tracefilename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
@@ -101,7 +102,7 @@ int main(int argc, char **argv)
               sg_host_get_name(wsl[0]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index 3417134..8caeab7 100644 (file)
@@ -109,6 +109,8 @@ $ cat ${srcdir:=.}/daxload/smalldax.trace
 > [0.016600] node-1.acme.org compute 42000000000.000000 # 1@task1
 > [0.016600] node-10.acme.org compute 42000000000.000000 # 2@task2
 > [42.033200] node-11.acme.org compute 42000000000.000000 # 3@task1
+> [0.000000] node-0.acme.org send node-1.acme.org 1000000.000000 # root_i1_1@task1
+> [0.016600] node-1.acme.org recv node-0.acme.org 1000000.000000 # root_i1_1@task1
 > [0.000000] node-0.acme.org send node-10.acme.org 1000000.000000 # root_i2_2@task2
 > [0.016600] node-10.acme.org recv node-0.acme.org 1000000.000000 # root_i2_2@task2
 > [42.016600] node-1.acme.org send node-11.acme.org 1000000.000000 # 1@task1_o1_3@task1
@@ -117,8 +119,6 @@ $ cat ${srcdir:=.}/daxload/smalldax.trace
 > [42.033200] node-11.acme.org recv node-10.acme.org 1000000.000000 # 2@task2_o2_3@task1
 > [84.033200] node-11.acme.org send node-0.acme.org 4167312.000000 # 3@task1_o3_end
 > [84.067138] node-0.acme.org recv node-11.acme.org 4167312.000000 # 3@task1_o3_end
-> [0.000000] node-0.acme.org send node-1.acme.org 1000000.000000 # root_i1_1@task1
-> [0.016600] node-1.acme.org recv node-0.acme.org 1000000.000000 # root_i1_1@task1
 > [84.067138] node-0.acme.org compute 0.000000 # end
 
 $ cmake -E remove -f ${srcdir:=.}/dax.dot ${srcdir:=.}/daxload/smalldax.trace
index 697c10c..7e8d159 100644 (file)
@@ -29,30 +29,33 @@ int main(int argc, char **argv)
   const char *name1 = sg_host_get_name(h1);
   const char *name2 = sg_host_get_name(h2);
 
-  /* Get the property list of 'host1' */
+  /* Trying to set a new property */
+  sg_host_set_property_value(h1, "NewProp", "newValue");
+
+  /* Get the property list of 'host1'. This is only a copy of the internal data structure.*/
   XBT_INFO("Property list for host %s", name1);
   xbt_dict_t props = sg_host_get_properties(h1);
 
-  /* Trying to set a new property */
-  xbt_dict_set(props, "NewProp", strdup("newValue"), NULL);
 
   /* Print the properties of 'host1' */
-  xbt_dict_foreach(props, cursor, key, data) {
+  xbt_dict_foreach (props, cursor, key, data)
     XBT_INFO("\tProperty: %s has value: %s", key, data);
-  }
 
   /* Try to get a property that does not exist */
   value = sg_host_get_property_value(h1, noexist);
   XBT_INFO("\tProperty: %s has value: %s", noexist, value?value:"Undefined (NULL)");
 
+  xbt_dict_free(&props);
+
   /* Get the property list of 'host2' */
   XBT_INFO("Property list for host %s", name2);
   props = sg_host_get_properties(h2);
 
   /* Print the properties of 'host2' */
-  xbt_dict_foreach(props, cursor, key, data) {
+  xbt_dict_foreach (props, cursor, key, data)
     XBT_INFO("\tProperty: %s on host: %s", key, data);
-  }
+
+  xbt_dict_free(&props);
 
   /* Modify an existing property test. First check it exists */
   XBT_INFO("Modify an existing property");
@@ -62,7 +65,7 @@ int main(int argc, char **argv)
     XBT_INFO("\tProperty: %s is undefined", exist);
   else {
     XBT_INFO("\tProperty: %s old value: %s", exist, value);
-    xbt_dict_set(props, exist, strdup("250"), NULL);
+    sg_host_set_property_value(h2, exist, "250");
   }
 
   /* Test if we have changed the value */
index aa77528..f4f1355 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* 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
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
           sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index 5ba0bc0..affd7b6 100644 (file)
@@ -1,16 +1,16 @@
-/* Copyright (c) 2006-2015. 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/simdag.h"
 #include "simgrid/s4u.hpp"
+#include "simgrid/simdag.h"
 #include "xbt/ex.h"
-#include <xbt/ex.hpp>
 #include "xbt/log.h"
-#include <math.h>
+#include <cmath>
 #include <set>
+#include <xbt/ex.hpp>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test, "Logging specific to this SimDag example");
 
@@ -40,9 +40,9 @@ int main(int argc, char **argv)
   XBT_INFO("Route between %s and %s:", h1->getCname(), h2->getCname());
   std::vector<sg_link_t> route;
   double latency = 0;
-  h1->routeTo(h2, &route, &latency);
+  h1->routeTo(h2, route, &latency);
 
-  for (auto link : route)
+  for (auto const& link : route)
     XBT_INFO("   Link %s: latency = %f, bandwidth = %f", sg_link_name(link), sg_link_latency(link),
              sg_link_bandwidth(link));
 
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
   SD_task_schedule(taskD, 2, host_list, computation_amount, communication_amount, -1);
 
   std::set<SD_task_t> *changed_tasks = simgrid::sd::simulate(-1.0);
-  for (auto task: *changed_tasks){
+  for (auto const& task : *changed_tasks) {
     XBT_INFO("Task '%s' start time: %f, finish time: %f", SD_task_get_name(task),
           SD_task_get_start_time(task), SD_task_get_finish_time(task));
   }
index ace4e78..a83ddd9 100644 (file)
@@ -59,9 +59,9 @@ if(enable_smpi)
     ADD_TESH(smpi-mc-only-send-determinism --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/only_send_deterministic.tesh)
   endif()
 
-  ADD_TESH(smpi-tracing        --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace/trace.tesh)
-  ADD_TESH(smpi-tracing-simple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple/trace_simple.tesh)
-  ADD_TESH(smpi-tracing-call-location --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_call_location/trace_call_location.tesh)
+  ADD_TESH(smpi-tracing        --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace/trace.tesh)
+  ADD_TESH(smpi-tracing-simple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_simple ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple/trace_simple.tesh)
+  ADD_TESH(smpi-tracing-call-location --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_call_location ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_call_location/trace_call_location.tesh)
   ADD_TESH(smpi-replay         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/replay.tesh)
   ADD_TESH_FACTORIES(smpi-energy "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh)
 endif()
index 7dacc29..c98a0d3 100644 (file)
@@ -180,14 +180,14 @@ static DGraph *buildSH(const char cls){
   tmpS>>=1;
   }
   for(i=0;i<numSources;i++){
-  snprintf(nm,BLOCK_SIZE,"Source.%d",i);
-  nd=newNode(nm);
-  AttachNode(dg,nd);
+    snprintf(nm, BLOCK_SIZE, "Source.%u", i);
+    nd = newNode(nm);
+    AttachNode(dg, nd);
   }
   for(j=0;j<numOfLayers;j++){
     mask=0x00000001<<j;
     for(i=0;i<numSources;i++){
-      snprintf(nm,BLOCK_SIZE,"Comparator.%d",(i+j*firstLayerNode));
+      snprintf(nm, BLOCK_SIZE, "Comparator.%u", (i + j * firstLayerNode));
       nd=newNode(nm);
       AttachNode(dg,nd);
       ndoff=i&(~mask);
@@ -203,7 +203,7 @@ static DGraph *buildSH(const char cls){
   }
   mask=0x00000001<<numOfLayers;
   for(i=0;i<numSources;i++){
-    snprintf(nm,BLOCK_SIZE,"Sink.%d",i);
+    snprintf(nm, BLOCK_SIZE, "Sink.%u", i);
     nd=newNode(nm);
     AttachNode(dg,nd);
     ndoff=i&(~mask);
@@ -240,7 +240,6 @@ static DGraph *buildWH(const char cls){
     AttachNode(dg,nd);
   }
   totComparators=0;
-  numPrevLayerNodes=numLayerNodes;
   while(numLayerNodes>maxInDeg){
     numLayerNodes=numLayerNodes/maxInDeg;
     if(numLayerNodes*maxInDeg<numPrevLayerNodes)
@@ -452,7 +451,6 @@ static Arr* WindowFilter(Arr *a, Arr* b,int w){
     }
     if(rmsm1<rms0) k=-1;
     if(k==0){
-      j=i+fielddim;
       a->val[i]=weight*b->val[i];
       a->val[i+1]=weight*b->val[i+1];
       a->val[i+2]=weight*b->val[i+2];
@@ -668,7 +666,7 @@ int main(int argc,char **argv ){
     dg=buildBH(class);
   }else if(strncmp(argv[3],"WH",2)==0){
     dg=buildWH(class);
-  }else if(strncmp(argv[3],"SH",2)==0){
+  }else /* (strncmp(argv[3],"SH",2)==0) */ {
     dg=buildSH(class);
   }
 
@@ -677,7 +675,7 @@ int main(int argc,char **argv ){
     if(my_rank==0)
     fprintf(stderr,"Not enough timers. Node timeing is off. \n");
   }
-  if(dg->numNodes>comm_size){
+  if(dg->numNodes && dg->numNodes>comm_size){
     if(my_rank==0){
     fprintf(stderr,"**  The number of MPI processes should not be less than \n");
     fprintf(stderr,"**  the number of nodes in the graph\n");
index 24257dc..a7b8d50 100644 (file)
@@ -73,7 +73,6 @@ int main(int argc, char **argv) {
     fprintf(stdout," Number of random numbers generated: %s\n",size);
     fprintf(stdout," Number of active processes: %d\n",no_nodes);
   }
-  verified = FALSE;
 
   /* Compute the number of "batches" of random number pairs generated per processor. Adjust if the number of processors
    * does not evenly divide the total number  */
@@ -99,7 +98,6 @@ int main(int argc, char **argv) {
   for (i=0;i<2*nk;i++) {
     x[i] = -1e99;
   }
-  Mops = log(sqrt(abs(1)));
 
   /* Synchronize before placing time stamp */
   MPI_Barrier( MPI_COMM_WORLD );
@@ -147,12 +145,12 @@ int main(int argc, char **argv) {
     for (i=1;i<=100 && !stop;i++) {
       ik = kk / 2;
       if (2 * ik != kk)  {
-        t3 = randlc(&t1, &t2);
+        randlc(&t1, &t2);
       }
       if (ik==0)
         stop = TRUE;
       else {
-        t3 = randlc(&t2, &t2);
+        randlc(&t2, &t2);
         kk = ik;
       }
     }
index 7314dee..b681965 100644 (file)
@@ -124,7 +124,7 @@ static double  find_my_seed( int  kn,       /* my processor rank, 0<=kn<=num pro
                              double a )     /* Ran num gen mult, try 1220703125.00 */
 {
   long   i;
-  double t1,t2,t3,an;
+  double t1,t2,an;
   long   mq,nq,kk,ik;
 
   nq = nn / np;
@@ -145,13 +145,12 @@ static double  find_my_seed( int  kn,       /* my processor rank, 0<=kn<=num pro
   for( i=1; i<=100; i++ ){
     ik = kk / 2;
     if( 2 * ik !=  kk )
-      t3 = randlc( &t1, &t2 );
+      randlc( &t1, &t2 );
     if( ik == 0 )
       break;
-    t3 = randlc( &t2, &t2 );
+    randlc( &t2, &t2 );
     kk = ik;
   }
-  an=t3;//added to silence paranoid compilers
 
   return t1;
 }
index 317eecc..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
 /******************************************************************************/
 
 /* Run :
-  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send-is-detached-thresh:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */
+  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" \
+    ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml \
+    --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none \
+    --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send-is-detached-thresh:0 \
+    --cfg=contexts/stack-size:128 --cfg=model-check/visited:100000 --cfg=model-check/max-depth:100000 ./bugged1_liveness
+*/
 
 #include <stdio.h>
 #include <mpi.h>
@@ -21,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 03a4db5..a69af43 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_non_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications-determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_non_deterministic
 > [0.000000] [mc_global/INFO] Check communication determinism
 > [0.000000] [mc_comm_determinism/INFO] The communications pattern of the process 1 is different! (Different communication : 1)
 > [0.000000] [mc_comm_determinism/INFO] ****************************************************
index 8c9108c..34aca4c 100644 (file)
@@ -1,6 +1,6 @@
 /* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=smpi/send-is-detached-thresh:0 gdb\ --args\ ./send_deterministic */
 
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -33,15 +33,11 @@ int main(int argc, char **argv)
   }
 
   if (rank == 0) {
-    //printf("MPI_ISend / MPI_IRecv Test \n");
-
     for (int i = 0; i < size - 1; i++) {
       MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
-      //printf("Message received from %d\n", recv_buff);
     }
   }else{
     MPI_Send(&rank, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
-    //printf("Sent %d to rank 0\n", rank);
   }
 
   MPI_Finalize();
index 99ea34b..74ae1f2 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_only_send_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications-determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/host-speed:1e9 ./smpi_only_send_deterministic
 > [0.000000] [mc_comm_determinism/INFO] Check communication determinism
 > [0.000000] [mc_comm_determinism/INFO] ******************************************************
 > [0.000000] [mc_comm_determinism/INFO] **** Only-send-deterministic communication pattern ****
index 078385a..fb0e9f9 100644 (file)
@@ -28,9 +28,12 @@ int main(int argc, char *argv[]) {
   xbt_replay_action_register("blah", action_blah);
 
   /* The send action is an override, so we have to first save its previous value in a global */
-  previous_send = xbt_replay_action_get("send");
-  xbt_replay_action_register("send", overriding_send);
-
+  int rank;
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+  if (rank == 0) {
+    previous_send = xbt_replay_action_get("send");
+    xbt_replay_action_register("send", overriding_send);
+  }
   /* The regular run of the replayer */
   smpi_replay_main(&argc, &argv);
   return 0;
index 1f2c89f..5c702a0 100644 (file)
@@ -155,19 +155,16 @@ $ tail -n +3 ./simgrid.trace
 > 5 5 2 smpi_replay_run_init "0 1 0"
 > 6 0 2 1 0 "rank-1"
 > 6 0 3 1 0 "rank-2"
-> 12 0 2 1 4
 > 12 0 2 1 5
 > 13 0 2 1
-> 12 0 2 2 4
 > 12 0 2 2 5
 > 13 0 2 2
-> 12 0 2 3 4
 > 12 0 2 3 5
 > 13 0 2 3
 > 5 6 2 action_bcast "0 0.78 0.39"
 > 12 0 2 1 6
-> 12 0 2 3 6
 > 12 0 2 2 6
+> 12 0 2 3 6
 > 13 0 2 1
 > 12 0 2 1 4
 > 13 0.015036 2 2
index cf33945..bcd9d36 100644 (file)
@@ -3,7 +3,7 @@ if(enable_smpi)
 
   add_executable       (replay_multiple replay_multiple.c)
   target_link_libraries(replay_multiple simgrid)
-  ADD_TESH(smpi-replay-multiple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple --cd ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/replay_multiple.tesh)
+  ADD_TESH(smpi-replay-multiple --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR} --setenv bindir=${CMAKE_CURRENT_BINARY_DIR} --cd ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/replay_multiple.tesh)
 endif()
 
 set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/generate_multiple_deployment.sh
index 1288fcb..f267b72 100755 (executable)
@@ -146,15 +146,15 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
         HAVE_SEQ=$(which seq 2>/dev/null)
 
         if [ -n "${HAVE_SEQ}" ]; then
-            SEQ1=$( ${HAVE_SEQ} 0 $(( $NUMPROCSMINE - 1 )) )
+            SEQ1=$( ${HAVE_SEQ} 0 $(( NUMPROCSMINE - 1 )) )
         else
             cnt=0
-            while (( $cnt < $NUMPROCSMINE )) ; do
-            SEQ1="$SEQ1 $cnt"
-            cnt=$((cnt + 1));
+            while (( cnt < NUMPROCSMINE )) ; do
+                SEQ1="$SEQ1 $cnt"
+                cnt=$((cnt + 1))
             done
         fi
-        #NUMPROCS=$((${NUMPROCS}+${NUMPROCSMINE}));
+        #NUMPROCS=$(( NUMPROCS + NUMPROCSMINE ));
         for i in $SEQ1
 ##----------------------------------------------------------
 ##  generate application.xml with hostnames from hostfile:
@@ -166,7 +166,7 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
 ##---- generate <actor> tags------------------------------
         do
            if [ -n "${HOSTFILE}" ]; then
-               j=$(( $NUMPROCS % $NUMHOSTS +1))
+               j=$(( NUMPROCS % NUMHOSTS + 1))
             fi
             hostname=$(echo $hostnames|cut -d' ' -f$j)
             if [ -z "${hostname}" ]; then
@@ -178,11 +178,11 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
             echo "  <actor host=\"${host}\" function=\"${instance}\"> <!-- function name used only for logging -->" >> ${APPLICATIONTMP}
             echo "    <argument value=\"${instance}\"/> <!-- instance -->" >> ${APPLICATIONTMP}
             echo "    <argument value=\"${i}\"/> <!-- rank -->" >> ${APPLICATIONTMP}
-            echo "    <argument value=\"$(echo $hosttrace|cut -d' ' -f$(($i+1)))\"/>" >> ${APPLICATIONTMP}
+            echo "    <argument value=\"$(echo $hosttrace|cut -d' ' -f$((i+1)))\"/>" >> ${APPLICATIONTMP}
            
             echo "    <argument value=\"${sleeptime}\"/> <!-- delay -->" >> ${APPLICATIONTMP}
             echo "  </actor>" >> ${APPLICATIONTMP}
-            NUMPROCS=$(( $NUMPROCS +1))
+            NUMPROCS=$(( NUMPROCS + 1))
         done
         # return IFS back to newline for "for" loop
         IFS_OLD=$IFS
index a7cfeb5..ebb03f3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -7,6 +7,9 @@
 #include "simgrid/msg.h"
 #include "mpi.h"
 
+#include <stdio.h>
+#include <string.h>
+
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 static int smpi_replay(int argc, char *argv[]) {
@@ -29,10 +32,10 @@ int main(int argc, char *argv[]){
   FILE* fp = fopen(argv[1], "r");
   if (fp == NULL)
     xbt_die("Cannot open %s", argv[1]);
-  char *line = NULL;
-  size_t n   = 0;
+  char line[2048];
   const char* instance_id = NULL;
-  while (xbt_getline(&line, &n, fp) != -1 ){
+  while (fgets(line, sizeof line, fp)) {
+    xbt_assert(1 + strlen(line) < sizeof line, "input buffer too short (read: %s)", line);
     xbt_dynar_t elems = xbt_str_split_quoted_in_place(line);
     if(xbt_dynar_length(elems)<3){
       xbt_die ("Not enough elements in the line");
@@ -47,7 +50,6 @@ int main(int argc, char *argv[]){
 
     xbt_free(line_char);
   }
-  xbt_free(line);
 
   fclose(fp);
 
index a8816fd..d4ba9d2 100644 (file)
@@ -1,16 +1,14 @@
 p Test the replay with multiple instances 
 
 p first generate the deployment file
-$ ${srcdir:=.}/generate_multiple_deployment.sh -platform ${srcdir:=.}/../../platforms/small_platform_with_routers.xml -hostfile ${srcdir:=.}/../hostfile  ${srcdir:=.}/description_file ${srcdir:=.}/deployment.xml
+$ ${srcdir:=.}/generate_multiple_deployment.sh -platform ${srcdir:=.}/../../platforms/small_platform_with_routers.xml -hostfile ${srcdir:=.}/../hostfile  ${srcdir:=.}/description_file ${bindir:=.}/deployment.xml
 
 p This test needs maxmin/concurrency-limit=100 because it starts 64 hosts on 5 machines.
 ! timeout 120
-$ ./replay_multiple description_file ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${srcdir:=.}/deployment.xml --log=smpi.:info --cfg=maxmin/concurrency-limit:100
+$ ./replay_multiple description_file ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${bindir:=.}/deployment.xml --log=smpi.:info --cfg=maxmin/concurrency-limit:100
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/concurrency-limit' to '100'
 > [0.000000] [msg_test/INFO] Initializing instance 1 of size 32
 > [0.000000] [msg_test/INFO] Initializing instance 2 of size 32
 > [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation.  The timings will certainly not be accurate.  Use the option "--cfg=smpi/host-speed:<flops>" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information.
-> [Jupiter:2:(52) 1140688.493796] [smpi_replay/INFO] Simulation time 1124371.141124
-> [1140688.493796] [msg_test/INFO] Simulation time 1.14069e+06
-
-$ rm -f deployment.xml
+> [Jupiter:2:(62) 1140698.106357] [smpi_replay/INFO] Simulation time 1124380.753685
+> [1140698.106357] [msg_test/INFO] Simulation time 1.1407e+06
index 2578ace..07008d4 100644 (file)
@@ -3,6 +3,6 @@
 # Go for the first test
 
 p Test instrumentation of SMPI
-$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace/smpi_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 $ rm -f smpi_trace.trace
index 8d4be9c..bbffa88 100644 (file)
@@ -4,7 +4,7 @@
 
 p Test SMPI with call-location tracing. This means that the binary must have
 p already been compiled with the -trace-call-location switch.
-$ ../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/trace_call_location/smpi_trace_call_location --cfg=smpi/host-speed:-1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ./smpi_trace_call_location --cfg=smpi/host-speed:-1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 $ grep --quiet "12 0.* 2 1 5 .*trace_call_location\.c\" 14$" ./smpi_trace.trace 
 
index 1dddb4e..c6ce7bb 100644 (file)
@@ -3,22 +3,19 @@
 # Go for the first test
 
 p SMPI test
-$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 p Another SMPI test, with only -trace
-$ ../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 p Testing without trace parameters
-$ ../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 p Testing grouped tracing
-$ ../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
-p Testing generation of viva configuration files
-$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/simulate-computation:no -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
-> [0.003952] [instr_config/INFO] No categories declared, ignoring generation of viva graph configuration
 
 p Testing with parameters but without activating them with the safe switch (-trace)
-$ ../../smpi_script/bin/smpirun -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../../smpi_script/bin/smpirun -trace-resource -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_trace_simple --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
-$ rm -f smpi_trace.trace smpi_uncat.plist smpi_cat.plist
+$ rm -f smpi_trace.trace
\ No newline at end of file
diff --git a/include/msg/datatypes.h b/include/msg/datatypes.h
deleted file mode 100644 (file)
index 34c965a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/msg.h instead of msg/datatypes.h
-#include "simgrid/msg.h"
diff --git a/include/msg/msg.h b/include/msg/msg.h
deleted file mode 100644 (file)
index e86d89b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/msg.h instead of msg/msg.h
-#include "simgrid/msg.h"
diff --git a/include/simdag/datatypes.h b/include/simdag/datatypes.h
deleted file mode 100644 (file)
index 571d1aa..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/simdag.h instead of simdag/datatypes.h
-#include "simgrid/simdag.h"
diff --git a/include/simdag/simdag.h b/include/simdag/simdag.h
deleted file mode 100644 (file)
index 6306622..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/simdag.h instead of simdag/simdag.h
-#include "simgrid/simdag.h"
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 c3c0cbc..9a996b9 100644 (file)
@@ -55,7 +55,7 @@ namespace surf {
   class LinkImpl;
   class HostImpl;
   class StorageImpl;
-  class FileImpl;
+  class StorageType;
 }
 namespace trace_mgr {
   class trace;
@@ -79,7 +79,7 @@ typedef simgrid::kernel::context::Context* smx_context_t;
 typedef simgrid::simix::ActorImpl* smx_actor_t;
 typedef simgrid::simix::MutexImpl* smx_mutex_t;
 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
-typedef simgrid::surf::FileImpl* surf_file_t;
+typedef simgrid::surf::StorageImpl* surf_storage_t;
 
 #else
 
@@ -99,6 +99,7 @@ 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_storage* surf_storage_t;
 
 #endif
 
index 1c418b2..d839c96 100644 (file)
@@ -46,6 +46,7 @@ XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
 XBT_PUBLIC(void) sg_host_set_pstate(sg_host_t host,int pstate);
 XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host);
 XBT_PUBLIC(const char*) sg_host_get_property_value(sg_host_t host, const char* name);
+XBT_PUBLIC(void) sg_host_set_property_value(sg_host_t host, const char* name, const char* value);
 XBT_PUBLIC(void) sg_host_route(sg_host_t from, sg_host_t to, xbt_dynar_t links);
 XBT_PUBLIC(double) sg_host_route_latency(sg_host_t from, sg_host_t to);
 XBT_PUBLIC(double) sg_host_route_bandwidth(sg_host_t from, sg_host_t to);
index 43387f2..eb25b52 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
@@ -6,17 +6,14 @@
 
 #ifndef JEDULE_HPP_
 #define JEDULE_HPP_
-#include <stdio.h>
 #include "simgrid_config.h"
+#include <cstdio>
 
 #include "jedule_events.hpp"
 #include "jedule_platform.hpp"
 
 #if SIMGRID_HAVE_JEDULE
 
-XBT_ATTRIB_UNUSED static std::unordered_map <const char *, jed_container_t> host2_simgrid_parent_container;
-XBT_ATTRIB_UNUSED static std::unordered_map <std::string, jed_container_t> container_name2container;
-
 namespace simgrid {
 namespace jedule{
 
@@ -36,11 +33,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 777a9f4..a4db6ec 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
@@ -181,7 +181,7 @@ public:
     xbt_assert(this->value_);
     T* result = value_;
     value_ = nullptr;
-    return *value_;
+    return *result;
   }
 
 private:
@@ -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 345b584..b3284ad 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2004-2015. 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. */
@@ -17,6 +16,7 @@
 
 #ifdef __cplusplus
 #include "simgrid/simix.h"
+#include <map>
 namespace simgrid {
 namespace msg {
 class Comm;
@@ -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 */
@@ -169,47 +169,47 @@ XBT_PUBLIC(const char*) MSG_zone_get_property_value(msg_netzone_t as, const char
 XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
 XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
 
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_root() instead: v3.19 will remove MSG_environment_get_routing_root() completely.") msg_netzone_t
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_root() instead: v3.19 will turn this warning into an error.") static inline msg_netzone_t
     MSG_environment_get_routing_root()
 {
   return MSG_zone_get_root();
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_name() instead: v3.19 will remove MSG_environment_as_get_name() completely.") const
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_name() instead: v3.19 will turn this warning into an error.") static inline const
     char* MSG_environment_as_get_name(msg_netzone_t zone)
 {
   return MSG_zone_get_name(zone);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_by_name() instead: v3.19 will remove MSG_environment_as_get_by_name() completely.") msg_netzone_t
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_by_name() instead: v3.19 will turn this warning into an error.") static inline msg_netzone_t
     MSG_environment_as_get_by_name(const char* name)
 {
   return MSG_zone_get_by_name(name);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_sons() instead: v3.19 will remove MSG_environment_as_get_routing_sons() completely.") xbt_dict_t
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_sons() instead: v3.19 will turn this warning into an error.") static inline xbt_dict_t
     MSG_environment_as_get_routing_sons(msg_netzone_t zone)
 {
   xbt_dict_t res = xbt_dict_new_homogeneous(NULL);
   MSG_zone_get_sons(zone, res);
   return res;
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_property_value() instead: v3.19 will remove MSG_environment_as_get_property_value() completely.")
-    const char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name)
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_property_value() instead: v3.19 will turn this warning into an error.") static inline const
+    char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name)
 {
   return MSG_zone_get_property_value(zone, name);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
+XBT_ATTRIB_DEPRECATED_v319(
     "Use MSG_zone_set_property_value() instead: v3.19 will remove MSG_environment_as_set_property_value() "
-    "completely.") void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name, char* value)
+    "completely.") static inline void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name,
+                                                                            char* value)
 {
   MSG_zone_set_property_value(zone, name, value);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_hosts() instead: v3.19 will remove MSG_environment_as_get_hosts() completely.") xbt_dynar_t
-    MSG_environment_as_get_hosts(msg_netzone_t zone)
+XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_hosts() instead: v3.19 will remove MSG_environment_as_get_hosts() "
+                           "completely.") static inline xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t zone)
 {
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), NULL);
   MSG_zone_get_hosts(zone, res);
@@ -265,15 +265,13 @@ XBT_PUBLIC(void) MSG_host_get_process_list(msg_host_t h, xbt_dynar_t whereto);
 XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h);
 
-static inline double
-    XBT_ATTRIB_DEPRECATED_v319("Use MSG_host_get_speed(): v3.19 will drop MSG_get_host_speed() completely.")
-        MSG_get_host_speed(msg_host_t host)
+XBT_ATTRIB_DEPRECATED_v319("Use MSG_host_get_speed(): v3.19 will drop MSG_get_host_speed() "
+                           "completely.") static inline double MSG_get_host_speed(msg_host_t host)
 {
   return MSG_host_get_speed(host);
 }
-static inline double XBT_ATTRIB_DEPRECATED_v320(
-    "Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() completely.")
-    MSG_host_get_current_power_peak(msg_host_t host)
+XBT_ATTRIB_DEPRECATED_v320("Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() "
+                           "completely.") static inline double MSG_host_get_current_power_peak(msg_host_t host)
 {
   return MSG_host_get_speed(host);
 }
@@ -380,44 +378,41 @@ XBT_PUBLIC(void) MSG_task_set_bound(msg_task_t task, double bound);
 XBT_PUBLIC(msg_error_t) MSG_process_join(msg_process_t process, double timeout);
 XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec);
 
-XBT_PUBLIC(void) MSG_task_set_flops_amount(msg_task_t task,
-                                               double flops_amount);
-XBT_PUBLIC(double) MSG_task_get_flops_amount(msg_task_t task);
-XBT_PUBLIC(void) MSG_task_set_bytes_amount(msg_task_t task,
-                                        double bytes_amount);
+XBT_PUBLIC(void) MSG_task_set_flops_amount(msg_task_t task, double flops_amount);
+XBT_ATTRIB_DEPRECATED_v321("Use MSG_task_get_initial_flops_amount if you want to get initial amounts of flops, or "
+                           "Use MSG_task_get_remaining_work_ratio to get task progress (in order "
+                           "to compute progress in flops)") XBT_PUBLIC(double)
+    MSG_task_get_flops_amount(msg_task_t task);
+XBT_PUBLIC(double) MSG_task_get_initial_flops_amount(msg_task_t task);
+XBT_PUBLIC(double) MSG_task_get_remaining_work_ratio(msg_task_t task);
+XBT_PUBLIC(void) MSG_task_set_bytes_amount(msg_task_t task, double bytes_amount);
+
 
 XBT_PUBLIC(double) MSG_task_get_remaining_communication(msg_task_t task);
 XBT_PUBLIC(int) MSG_task_is_latency_bounded(msg_task_t task);
 XBT_PUBLIC(double) MSG_task_get_bytes_amount(msg_task_t task);
 
+XBT_PUBLIC(msg_error_t) MSG_task_receive_ext(msg_task_t* task, const char* alias, double timeout, msg_host_t host);
 
-XBT_PUBLIC(msg_error_t)
-    MSG_task_receive_ext(msg_task_t * task, const char *alias, double timeout,
-                     msg_host_t host);
-
-XBT_PUBLIC(msg_error_t)
-    MSG_task_receive_with_timeout(msg_task_t * task, const char *alias,
-                              double timeout);
+XBT_PUBLIC(msg_error_t) MSG_task_receive_with_timeout(msg_task_t* task, const char* alias, double timeout);
 
-XBT_PUBLIC(msg_error_t)
-    MSG_task_receive(msg_task_t * task, const char *alias);
+XBT_PUBLIC(msg_error_t) MSG_task_receive(msg_task_t* task, const char* alias);
 #define MSG_task_recv(t,a) MSG_task_receive(t,a)
 
-
-
 XBT_PUBLIC(msg_error_t)
-    MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, double timeout,
-                     msg_host_t host, double rate);
+MSG_task_receive_ext_bounded(msg_task_t* task, const char* alias, double timeout, msg_host_t host, double rate);
 
-XBT_PUBLIC(msg_error_t) MSG_task_receive_with_timeout_bounded(msg_task_t * task, const char *alias,  double timeout, double rate);
+XBT_PUBLIC(msg_error_t)
+MSG_task_receive_with_timeout_bounded(msg_task_t* task, const char* alias, double timeout, double rate);
 XBT_PUBLIC(msg_error_t) MSG_task_receive_bounded(msg_task_t * task, const char *alias,double rate);
 #define MSG_task_recv_bounded(t,a,r) MSG_task_receive_bounded(t,a,r)
 
 XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias);
 XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate);
-XBT_PUBLIC(msg_comm_t)
-MSG_task_isend_with_matching(msg_task_t task, const char* alias, int (*match_fun)(void*, void*, void*),
-                             void* match_data);
+XBT_ATTRIB_DEPRECATED_v320(
+    "This function will be removed from SimGrid v3.20. If you really need this function, please speak up quickly.")
+    XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(msg_task_t task, const char* alias,
+                                                        int (*match_fun)(void*, void*, void*), void* match_data);
 
 XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup);
 XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate);
@@ -460,7 +455,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);
@@ -475,7 +471,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);
@@ -520,24 +516,18 @@ XBT_PUBLIC(void) MSG_vm_resume(msg_vm_t vm);
 XBT_PUBLIC(msg_host_t) MSG_vm_get_pm(msg_vm_t vm);
 XBT_PUBLIC(void) MSG_vm_set_bound(msg_vm_t vm, double bound);
 
-
 #include "simgrid/instr.h"
 
 /* ****************************************************************************************** */
 /* Used only by the bindings -- unclean pimple, please ignore if you're not writing a binding */
 XBT_PUBLIC(smx_context_t) MSG_process_get_smx_ctx(msg_process_t process);
 
-
-/* Functions renamed in 3.14 */
-#define MSG_mailbox_get_head(m) MSG_mailbox_front(m)
-
-
 SG_END_DECL()
 
 #ifdef __cplusplus
 XBT_PUBLIC(msg_process_t)
 MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data, msg_host_t host,
-                                xbt_dict_t properties);
+                                std::map<std::string, std::string>* properties);
 #endif
 
 #endif
index a4d9be7..a5663c0 100644 (file)
@@ -1,5 +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. */
@@ -19,7 +18,10 @@ XBT_PUBLIC(double) sg_host_get_wattmin_at(sg_host_t host, int pstate);
 XBT_PUBLIC(double) sg_host_get_wattmax_at(sg_host_t host, int pstate);
 XBT_PUBLIC(double) sg_host_get_current_consumption(sg_host_t host);
 
-#define MSG_host_energy_plugin_init() sg_energy_plugin_init()
+XBT_PUBLIC(void) sg_link_energy_plugin_init();
+XBT_PUBLIC(double) sg_link_get_consumed_energy(sg_link_t link);
+
+#define MSG_host_energy_plugin_init() sg_host_energy_plugin_init()
 #define MSG_host_get_consumed_energy(host) sg_host_get_consumed_energy(host)
 #define MSG_host_get_wattmin_at(host,pstate) sg_host_get_wattmin_at(host,pstate)
 #define MSG_host_get_wattmax_at(host,pstate) sg_host_get_wattmax_at(host,pstate)
diff --git a/include/simgrid/plugins/file_system.h b/include/simgrid/plugins/file_system.h
new file mode 100644 (file)
index 0000000..bb22a1a
--- /dev/null
@@ -0,0 +1,21 @@
+/* Copyright (c) 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 SIMGRID_PLUGINS_FILE_SYSTEM_H_
+#define SIMGRID_PLUGINS_FILE_SYSTEM_H_
+
+#include <simgrid/forward.h>
+#include <xbt/base.h>
+
+SG_BEGIN_DECL()
+
+XBT_PUBLIC(void) sg_storage_file_system_init();
+
+#define MSG_storage_file_system_init() sg_storage_file_system_init()
+
+SG_END_DECL()
+
+#endif
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 99ede18..e9cdd87 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. */
@@ -109,17 +109,17 @@ namespace s4u {
  * <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
  * <platform version="4">
  *
- *   <!-- Start a process called 'master' on the host called 'Tremblay' -->
- *   <process host="Tremblay" function="master">
+ *   <!-- Start an actor called 'master' on the host called 'Tremblay' -->
+ *   <actor host="Tremblay" function="master">
  *      <!-- Here come the parameter that you want to feed to this instance of master -->
  *      <argument value="20"/>        <!-- argv[1] -->
  *      <argument value="50000000"/>  <!-- argv[2] -->
  *      <argument value="1000000"/>   <!-- argv[3] -->
  *      <argument value="5"/>         <!-- argv[4] -->
- *   </process>
+ *   </actor>
  *
- *   <!-- Start a process called 'worker' on the host called 'Jupiter' -->
- *   <process host="Jupiter" function="worker"/> <!-- Don't provide any parameter ->>
+ *   <!-- Start an actor called 'worker' on the host called 'Jupiter' -->
+ *   <actor host="Jupiter" function="worker"/> <!-- Don't provide any parameter ->>
  *
  * </platform>
  * @endcode
@@ -176,7 +176,7 @@ public:
   /** Create an actor using code
    *
    *  Using this constructor, move-only type can be used. The consequence is
-   *  that we cannot copy the value and restart the process in its initial
+   *  that we cannot copy the value and restart the actor in its initial
    *  state. In order to use auto-restart, an explicit `function` must be passed
    *  instead.
    */
@@ -194,13 +194,13 @@ public:
   static ActorPtr createActor(const char* name, s4u::Host* host, const char* function, std::vector<std::string> args);
 
   // ***** Methods *****
-  /** This actor will be automatically terminated when the last non-daemon process finishes **/
+  /** This actor will be automatically terminated when the last non-daemon actor 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
@@ -215,17 +215,17 @@ public:
   /** Suspend an actor by suspending the task on which it was waiting for the completion. */
   void suspend();
 
-  /** Resume a suspended process by resuming the task on which it was waiting for the completion. */
+  /** Resume a suspended actor by resuming the task on which it was waiting for the completion. */
   void resume();
 
-  /** Returns true if the process is suspended. */
+  /** Returns true if the actor is suspended. */
   int isSuspended();
 
   /** If set to true, the actor will automatically restart when its host reboots */
   void setAutoRestart(bool autorestart);
 
   /** Add a function to the list of "on_exit" functions for the current actor. The on_exit functions are the functions
-   * executed when your actor is killed. You should use them to free the data used by your process.
+   * executed when your actor is killed. You should use them to free the data used by your actor.
    */
   void onExit(int_f_pvoid_pvoid_t fun, void* data);
 
@@ -269,6 +269,7 @@ public:
   /** Retrieve the property value (or nullptr if not set) */
   const char* getProperty(const char* key);
   void setProperty(const char* key, const char* value);
+  Actor* restart();
 };
 
 /** @ingroup s4u_api
@@ -285,79 +286,81 @@ 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 drop sleep() completely.") 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, computing the given amount of flops at the given priority.
+ *  An execution of priority 2 computes twice as fast as an execution at priority 1. */
+XBT_PUBLIC(void) execute(double flop, double priority);
 
-  /** 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 remove Actor::recv() completely.") recv(MailboxPtr chan);
-  XBT_PUBLIC(void*)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will remove Actor::recv() completely.")
-      recv(MailboxPtr chan, double timeout);
-  XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will remove Actor::irecv() completely.")
-      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 remove Actor::send() completely.")
-      send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
-  XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will remove Actor::send() completely.")
-      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_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void*)
+    recv(MailboxPtr chan);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void*)
+    recv(MailboxPtr chan, double timeout);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC(CommPtr)
+    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_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void)
+    send(MailboxPtr chan, void* payload, double simulatedSize);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void)
+    send(MailboxPtr chan, void* payload, double simulatedSize, double timeout);
 
-  XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will remove Actor::isend() completely.")
-      isend(MailboxPtr chan, void* payload, double simulatedSize);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC(CommPtr)
+    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). */
+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. */
+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 actor 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 c1b27c9..6943de3 100644 (file)
@@ -31,8 +31,8 @@ public:
 
   virtual ~Comm();
 
-  /*! take a range of s4u::CommPtr (last excluded) and return when one of them is finished. The return value is an
-   * iterator on the finished Comms. */
+  /*! take a vector s4u::CommPtr and return when one of them is finished.
+   * The return value is the rank of the first finished CommPtr. */
   static int wait_any(std::vector<CommPtr> * comms) { return wait_any_for(comms, -1); }
   /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
   static int wait_any_for(std::vector<CommPtr> * comms_in, double timeout)
@@ -41,7 +41,7 @@ public:
     xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), [](void*ptr){
       intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
     });
-    for (auto comm : *comms_in) {
+    for (auto const& comm : *comms_in) {
       if (comm->state_ == inited)
         comm->start();
       xbt_assert(comm->state_ == started);
@@ -54,35 +54,44 @@ public:
     xbt_dynar_free(&comms);
     return idx;
   }
+
+  /*! take a vector s4u::CommPtr and return when all of them is finished. */
+  static void wait_all(std::vector<CommPtr> * comms)
+  {
+    // TODO: this should be a simcall or something
+    // TODO: we are missing a version with timeout
+    for (CommPtr comm : *comms) {
+      comm->wait();
+    }
+  }
+
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.")
-      send_init(MailboxPtr dest)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
+  send_init(MailboxPtr dest)
   {
     return dest->put_init();
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.")
-      send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
+  send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_init(data, simulatedByteAmount);
   }
   /** Creates and start an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320(
-      "Use Mailbox::put_async(): v3.20 will remove Comm::send_async() completely.")
-      send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") static CommPtr
+  send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_async(data, simulatedByteAmount);
   }
   /** Creates (but don't start) an async recv onto the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will remove Comm::recv_init() completely.")
-      recv_init(MailboxPtr from)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will turn this warning into an error.") static CommPtr
+  recv_init(MailboxPtr from)
   {
     return from->get_init();
   }
   /** Creates and start an async recv to the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320(
-      "Use Mailbox::get_async(): v3.20 will remove Comm::recv_async() completely.")
-      recv_async(MailboxPtr from, void** data)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_async(): v3.20 will turn this warning into an error.") static CommPtr
+  recv_async(MailboxPtr from, void** data)
   {
     return from->get_async(data);
   }
@@ -93,6 +102,12 @@ public:
 
   /** Start the comm, and ignore its result. It can be completely forgotten after that. */
   void detach();
+  /** Start the comm, and ignore its result. It can be completely forgotten after that. */
+  void detach(void (*cleanFunction)(void*))
+  {
+    cleanFunction_ = cleanFunction;
+    detach();
+  }
 
   /** Sets the maximal communication rate (in byte/sec). Must be done before start */
   void setRate(double rate);
index c40482f..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:
@@ -104,7 +104,10 @@ public:
   void notify_one();
   void notify_all();
 
-  XBT_ATTRIB_DEPRECATED_v319("Use notify_one(): v3.19 will remove notify() completely.") void notify() { notify_one(); }
+  XBT_ATTRIB_DEPRECATED_v319("Use notify_one(): v3.19 will change this warning into an error.") void notify()
+  {
+    notify_one();
+  }
 };
 
 using ConditionVariablePtr = ConditionVariable::Ptr;
index a42beca..805a309 100644 (file)
@@ -58,6 +58,8 @@ public:
 
   size_t getHostCount();
   void getHostList(std::vector<Host*> * whereTo);
+  size_t getLinkCount();
+  void getLinkList(std::vector<Link*> * list);
 
   /** @brief Run the simulation */
   void run();
@@ -75,7 +77,7 @@ public:
   simgrid::s4u::NetZone* getNetzoneByNameOrNull(const char* name);
 
   /** @brief Retrieve the netcard of the given name (or nullptr if not found) */
-  simgrid::kernel::routing::NetPoint* getNetpointByNameOrNull(const char* name);
+  simgrid::kernel::routing::NetPoint* getNetpointByNameOrNull(std::string name);
   void getNetpointList(std::vector<simgrid::kernel::routing::NetPoint*> * list);
   void netpointRegister(simgrid::kernel::routing::NetPoint * card);
   void netpointUnregister(simgrid::kernel::routing::NetPoint * card);
index 18d2926..e821cc1 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef SIMGRID_S4U_FILE_HPP
 #define SIMGRID_S4U_FILE_HPP
 
+#include "simgrid/plugins/file_system.h"
+#include <xbt/Extendable.hpp>
 #include <xbt/base.h>
 
 #include <simgrid/simix.h>
@@ -25,12 +27,12 @@ namespace s4u {
 XBT_PUBLIC_CLASS File
 {
 public:
-  File(const char* fullpath, void* userdata);
-  File(const char* fullpath, sg_host_t host, void* userdata);
-  ~File();
+  File(std::string fullpath, void* userdata);
+  File(std::string fullpath, sg_host_t host, void* userdata);
+  ~File() = default;
 
   /** Retrieves the path to the file */
-  const char* getPath() { return path_; }
+  const char* getPath() { return fullpath_.c_str(); }
 
   /** Simulates a local read action. Returns the size of data actually read */
   sg_size_t read(sg_size_t size);
@@ -53,23 +55,37 @@ public:
   /** Retrieves the current file position */
   sg_size_t tell();
 
-  /** Rename a file
-   *
-   * WARNING: It is forbidden to move the file to another mount point */
-  void move(const char* fullpath);
+  /** Rename a file. WARNING: It is forbidden to move the file to another mount point */
+  void move(std::string fullpath);
 
   /** Remove a file from disk */
   int unlink();
 
-  const char* storage_type;
-  const char* storageId;
-  std::string mount_point;
   int desc_id = 0;
+  Storage* localStorage;
+  std::string mount_point_;
 
 private:
-  surf_file_t pimpl_ = nullptr;
-  const char* path_  = nullptr;
-  void* userdata_    = nullptr;
+  sg_size_t size_;
+  std::string path_;
+  std::string fullpath_;
+  sg_size_t current_position_ = SEEK_SET;
+  void* userdata_             = nullptr;
+};
+
+class FileSystemStorageExt {
+public:
+  static simgrid::xbt::Extension<simgrid::s4u::Storage, FileSystemStorageExt> EXTENSION_ID;
+  explicit FileSystemStorageExt(simgrid::s4u::Storage* ptr);
+  ~FileSystemStorageExt();
+  std::map<std::string, sg_size_t>* parseContent(std::string filename);
+  std::map<std::string, sg_size_t>* getContent() { return content_; }
+  sg_size_t getUsedSize() { return usedSize_; }
+  void decrUsedSize(sg_size_t size) { usedSize_ -= size; }
+  void incrUsedSize(sg_size_t size) { usedSize_ += size; }
+private:
+  std::map<std::string, sg_size_t>* content_;
+  sg_size_t usedSize_ = 0;
 };
 }
 } // namespace simgrid::s4u
index d43c985..6913403 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2015. 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. */
@@ -6,11 +6,11 @@
 #ifndef SIMGRID_S4U_HOST_HPP
 #define SIMGRID_S4U_HOST_HPP
 
+#include <map>
 #include <string>
 #include <unordered_map>
 
 #include "xbt/Extendable.hpp"
-#include "xbt/dict.h"
 #include "xbt/signal.hpp"
 #include "xbt/string.hpp"
 #include "xbt/swag.h"
@@ -66,8 +66,10 @@ 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_; }
-  const char* getCname() { return name_.c_str(); }
+  /** Retrieves the name of that host as a C string */
+  const char* getCname() const { return name_.c_str(); }
 
   void actorList(std::vector<ActorPtr> * whereto);
 
@@ -86,9 +88,9 @@ public:
 
   double getSpeed();
   int getCoreCount();
-  xbt_dict_t getProperties();
+  std::map<std::string, std::string>* getProperties();
   const char* getProperty(const char* key);
-  void setProperty(const char* key, const char* value);
+  void setProperty(std::string key, std::string value);
   void getProcesses(std::vector<ActorPtr> * list);
   double getPstateSpeed(int pstate_index);
   int getPstatesCount() const;
@@ -102,8 +104,15 @@ public:
    */
   std::unordered_map<std::string, Storage*> const& getMountedStorages();
 
-  void routeTo(Host * dest, std::vector<Link*> * links, double* latency);
-  void routeTo(Host * dest, std::vector<surf::LinkImpl*> * links, double* latency);
+  void routeTo(Host* dest, std::vector<Link*>& links, double* latency);
+  void routeTo(Host* dest, std::vector<surf::LinkImpl*>& links, double* latency);
+
+  /** Block the calling actor on an execution located on the called host
+   *
+   * It is not a problem if the actor is not located on the called host.
+   * The actor will not be migrated in this case. Such remote execution are easy in simulation.
+   */
+  void execute(double flops);
 
 private:
   simgrid::xbt::string name_ = "noname";
index de05738..f554dfe 100644 (file)
@@ -7,11 +7,12 @@
 #define S4U_LINK_HPP_
 
 #include <simgrid/link.h>
+#include <string>
+#include <unordered_map>
+#include <xbt/Extendable.hpp>
 #include <xbt/base.h>
 #include <xbt/signal.hpp>
 
-#include <unordered_map>
-
 /***********
  * Classes *
  ***********/
@@ -22,7 +23,7 @@ class NetworkAction;
 };
 namespace s4u {
 /** @brief A Link represents the network facilities between [hosts](\ref simgrid::s4u::Host) */
-XBT_PUBLIC_CLASS Link
+XBT_PUBLIC_CLASS Link : public simgrid::xbt::Extendable<Link>
 {
   friend simgrid::surf::LinkImpl;
 
@@ -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();
@@ -49,6 +52,9 @@ public:
    */
   int sharingPolicy();
 
+  /** @brief Returns the current load (in flops per second) */
+  double getUsage();
+
   /** @brief Check if the Link is used */
   bool isUsed();
 
@@ -65,6 +71,9 @@ public:
   void setLatencyTrace(tmgr_trace_t trace); /*< setup the trace file with latency events (peak latency changes due to
                                                external load). Trace must contain absolute values */
 
+  const char* getProperty(const char* key);
+  void setProperty(std::string key, std::string value);
+
   /* The signals */
   /** @brief Callback signal fired when a new Link is created */
   static simgrid::xbt::signal<void(s4u::Link&)> onCreation;
@@ -80,6 +89,8 @@ public:
 
   /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
   static simgrid::xbt::signal<void(surf::NetworkAction*)> onCommunicationStateChange;
+
+  XBT_ATTRIB_DEPRECATED_v321("Use getCname(): v3.21 will turn this warning into an error.") const char* 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 cb9d1ee..8e7429c 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. */
@@ -38,13 +38,16 @@ XBT_PUBLIC_CLASS NetZone
 protected:
   friend simgrid::kernel::routing::NetZoneImpl;
 
-  explicit NetZone(NetZone * father, const char* name);
+  explicit NetZone(NetZone * father, std::string name);
   virtual ~NetZone();
 
 public:
   /** @brief Seal your netzone once you're done adding content, and before routing stuff through it */
   virtual void seal();
-  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
@@ -65,19 +68,22 @@ public:
   /*** Called on each newly created regular route (not on bypass routes) */
   static simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                                    kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                                   std::vector<surf::LinkImpl*>* link_list)>
+                                   std::vector<surf::LinkImpl*>& link_list)>
       onRouteCreation;
   static simgrid::xbt::signal<void(NetZone&)> onCreation;
   static simgrid::xbt::signal<void(NetZone&)> onSeal;
 
 protected:
-  std::vector<kernel::routing::NetPoint*>
-      vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
+  unsigned int getTableSize() { return vertices_.size(); }
+  std::vector<kernel::routing::NetPoint*> getVertices() { return vertices_; }
 
 private:
+  // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
+  std::vector<kernel::routing::NetPoint*> vertices_;
+
   std::unordered_map<std::string, std::string> properties_;
   NetZone* father_ = nullptr;
-  char* name_      = nullptr;
+  std::string name_;
 
   bool sealed_ = false; // We cannot add more content when sealed
 
index 2ece591..8ba939c 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef INCLUDE_SIMGRID_S4U_STORAGE_HPP_
 #define INCLUDE_SIMGRID_S4U_STORAGE_HPP_
 
+#include "xbt/Extendable.hpp"
 #include <map>
 #include <simgrid/s4u/forward.hpp>
 #include <simgrid/simix.h>
 #include <xbt/base.h>
 
 namespace simgrid {
+namespace xbt {
+extern template class XBT_PUBLIC() Extendable<simgrid::s4u::Storage>;
+}
 namespace s4u {
 
 XBT_ATTRIB_PUBLIC std::map<std::string, Storage*>* allStorages();
 
-XBT_PUBLIC_CLASS Storage
+XBT_PUBLIC_CLASS Storage : public simgrid::xbt::Extendable<Storage>
 {
   friend s4u::Engine;
   friend simgrid::surf::StorageImpl;
@@ -28,22 +32,29 @@ public:
   explicit Storage(surf::StorageImpl * pimpl) : pimpl_(pimpl) {}
   virtual ~Storage() = default;
   /** Retrieve a Storage by its name. It must exist in the platform file */
-  static Storage* byName(const char* name);
-  const char* getName();
+  static Storage* byName(std::string name);
+  /** @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 */
   sg_size_t getSizeFree();
   sg_size_t getSizeUsed();
+  void decrUsedSize(sg_size_t size);
+  void incrUsedSize(sg_size_t size);
 
-  xbt_dict_t getProperties();
-  const char* getProperty(const char* key);
-  void setProperty(const char* key, const char* value);
+  std::map<std::string, std::string>* getProperties();
+  const char* getProperty(std::string key);
+  void setProperty(std::string, std::string value);
   std::map<std::string, sg_size_t>* getContent();
 
   void setUserdata(void* data) { userdata_ = data; }
   void* getUserdata() { return userdata_; }
 
+  sg_size_t read(sg_size_t size);
+  sg_size_t write(sg_size_t size);
   surf::StorageImpl* getImpl() { return pimpl_; }
 
   /* The signals */
index b5dbf21..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 {
@@ -45,6 +45,7 @@ private:
   virtual ~VirtualMachine();
 
 public:
+  void start();
   bool isMigrating();
 
   void getParameters(vm_params_t params);
index 27efe34..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 */
@@ -158,13 +158,6 @@ XBT_PUBLIC(xbt_dynar_t) SD_daxload(const char *filename);
 XBT_PUBLIC(xbt_dynar_t) SD_dotload(const char *filename);
 XBT_PUBLIC(xbt_dynar_t) SD_dotload_with_sched(const char *filename);
 XBT_PUBLIC(xbt_dynar_t) SD_PTG_dotload(const char *filename);
-#ifdef __cplusplus
-namespace simgrid {
-namespace sd {
-XBT_PUBLIC(std::set<SD_task_t>*) simulate(double how_long);
-}
-}
-#endif
 /** @} */
 
 /* Support some backward compatibility */
@@ -203,4 +196,13 @@ XBT_PUBLIC(std::set<SD_task_t>*) simulate(double how_long);
 //SD_route_get_list
 //TRACE_sd_set_task_category
 SG_END_DECL()
+
+#ifdef __cplusplus
+namespace simgrid {
+namespace sd {
+XBT_PUBLIC(std::set<SD_task_t>*) simulate(double how_long);
+}
+}
+#endif
+
 #endif
index 6921451..7d9245d 100644 (file)
@@ -11,6 +11,9 @@
 #include "simgrid/host.h"
 #include "xbt/ex.h"
 #include "xbt/parmap.h"
+#ifdef __cplusplus
+#include <map>
+#endif
 
 /* ******************************** Host ************************************ */
 /** @brief Host datatype
@@ -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 *********************************** */
 
@@ -65,16 +68,14 @@ typedef enum {
 /* Process creation/destruction callbacks */
 typedef void (*void_pfn_smxprocess_t) (smx_actor_t);
 
-extern int smx_context_stack_size;
+extern unsigned smx_context_stack_size;
 extern int smx_context_stack_size_was_set;
-extern int smx_context_guard_size;
+extern unsigned smx_context_guard_size;
 extern int smx_context_guard_size_was_set;
 
 SG_BEGIN_DECL()
 
-XBT_PUBLIC(xbt_dynar_t) SIMIX_process_get_runnable();
 XBT_PUBLIC(smx_actor_t) SIMIX_process_from_PID(aid_t PID);
-XBT_PUBLIC(xbt_dynar_t) SIMIX_processes_as_dynar();
 
 /* parallelism */
 XBT_PUBLIC(int) SIMIX_context_is_parallel();
@@ -105,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);
@@ -140,12 +141,11 @@ XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host,
  */
 
 XBT_PUBLIC(void) SIMIX_maestro_create(void (*code)(void*), void* data);
-XBT_PUBLIC(smx_actor_t) SIMIX_process_attach(
-  const char* name,
-  void *data,
-  const char* hostname,
-  xbt_dict_t properties,
-  smx_actor_t parent_process);
+#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 *************************************/
@@ -191,7 +191,7 @@ XBT_PUBLIC(smx_activity_t) simcall_execution_start(const char *name,
                                                 double priority, double bound);
 XBT_PUBLIC(smx_activity_t)
 simcall_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                                 double* bytes_amount, double amount, double rate, double timeout);
+                                 double* bytes_amount, double rate, double timeout);
 XBT_PUBLIC(void) simcall_execution_cancel(smx_activity_t execution);
 XBT_PUBLIC(void) simcall_execution_set_priority(smx_activity_t execution, double priority);
 XBT_PUBLIC(void) simcall_execution_set_bound(smx_activity_t execution, double bound);
@@ -200,11 +200,12 @@ 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,
-                       xbt_dict_t properties);
+                       std::map<std::string, std::string>* properties);
+#endif
 
-XBT_PUBLIC(void) simcall_process_kill(smx_actor_t process);
 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);
 
@@ -216,11 +217,8 @@ XBT_PUBLIC(void) simcall_process_suspend(smx_actor_t process);
 /* Getters and Setters */
 XBT_PUBLIC(int) simcall_process_count();
 XBT_PUBLIC(void) simcall_process_set_data(smx_actor_t process, void *data);
-XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_actor_t host);
 XBT_PUBLIC(void) simcall_process_set_kill_time(smx_actor_t process, double kill_time);
 XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data);
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart);
-XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process);
 XBT_PUBLIC(void) simcall_process_join(smx_actor_t process, double timeout);
 /* Sleep control */
 XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration);
@@ -228,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*),
@@ -252,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 */
@@ -280,17 +280,13 @@ XBT_PUBLIC(void) simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex);
 XBT_PUBLIC(void) simcall_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double max_duration);
 XBT_PUBLIC(void) simcall_cond_broadcast(smx_cond_t cond);
 
-XBT_PUBLIC(smx_sem_t) simcall_sem_init(int capacity);
 XBT_PUBLIC(void) SIMIX_sem_destroy(smx_sem_t sem);
-XBT_PUBLIC(void) simcall_sem_release(smx_sem_t sem);
-XBT_PUBLIC(int) simcall_sem_would_block(smx_sem_t sem);
 XBT_PUBLIC(void) simcall_sem_acquire(smx_sem_t sem);
 XBT_PUBLIC(void) simcall_sem_acquire_timeout(smx_sem_t sem, double max_duration);
-XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
-/*****************************   File   **********************************/
-XBT_PUBLIC(sg_size_t) simcall_file_read(surf_file_t fd, sg_size_t size);
-XBT_PUBLIC(sg_size_t) simcall_file_write(surf_file_t fd, sg_size_t size);
+/*****************************   Storage   **********************************/
+XBT_PUBLIC(sg_size_t) simcall_storage_read(surf_storage_t st, sg_size_t size);
+XBT_PUBLIC(sg_size_t) simcall_storage_write(surf_storage_t fd, sg_size_t size);
 /************************** MC simcalls   **********************************/
 XBT_PUBLIC(int) simcall_mc_random(int min, int max);
 
index 7e0e9e3..f21fa3d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -7,12 +7,13 @@
 #ifndef SIMGRID_SIMIX_HPP
 #define SIMGRID_SIMIX_HPP
 
-//#include <xbt/function_types.h>
-#include <xbt/future.hpp>
+#include <simgrid/simix.h>
 #include <xbt/functional.hpp>
+#include <xbt/future.hpp>
 #include <xbt/signal.hpp>
 
-#include <simgrid/simix.h>
+#include <map>
+#include <string>
 
 XBT_PUBLIC(void) simcall_run_kernel(std::function<void()> const& code);
 
@@ -68,6 +69,7 @@ typename std::result_of<F()>::type kernelImmediate(F&& code)
   return result.get();
 }
 
+XBT_PUBLIC(const std::vector<smx_actor_t>&) process_get_runnable();
 
 XBT_PUBLIC(void) set_maestro(std::function<void()> code);
 XBT_PUBLIC(void) create_maestro(std::function<void()> code);
@@ -97,21 +99,21 @@ extern simgrid::xbt::signal<void()> onDeadlock;
  * void *data: data a pointer to any data one may want to attach to the new object.
  * sg_host_t host: the location where the new process is executed
  * int argc, char **argv: parameters passed to code
- * xbt_dict_t pros: properties
+ * std::map<std::string, std::string>* props: properties
  */
-typedef smx_actor_t (*smx_creation_func_t) (
-                                      /* name */ const char*,
-                                      std::function<void()> code,
-                                      /* userdata */ void*,
-                                      /* hostname */ sg_host_t,
-                                      /* props */ xbt_dict_t,
-                                      /* parent_process */ smx_actor_t);
+typedef smx_actor_t (*smx_creation_func_t)(
+    /* name */ const char*, std::function<void()> code,
+    /* userdata */ void*,
+    /* hostname */ sg_host_t,
+    /* props */ std::map<std::string, std::string>*,
+    /* parent_process */ smx_actor_t);
 
 extern "C"
 XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t function);
 
 XBT_PUBLIC(smx_actor_t)
-simcall_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host, xbt_dict_t properties);
+simcall_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
+                       std::map<std::string, std::string>* properties);
 
 XBT_PUBLIC(smx_timer_t) SIMIX_timer_set(double date, simgrid::xbt::Task<void()> callback);
 
index 88e522c..682b2ee 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
@@ -81,7 +81,7 @@ auto kernelSync(F code) -> decltype(code().get())
 template <class T>
 class Future {
 public:
-  Future() {}
+  Future() { /* Nothing to do*/}
   Future(simgrid::kernel::Future<T> future) : future_(std::move(future)) {}
 
   bool valid() const { return future_.valid(); }
index 9a785db..eef491c 100644 (file)
@@ -203,30 +203,6 @@ SG_BEGIN_DECL()
 #define MPI_WIN_SIZE -2
 #define MPI_WIN_DISP_UNIT -3
 
-// FIXME : used nowhere...
-typedef enum MPIR_Combiner_enum{
-  MPI_COMBINER_NAMED,
-  MPI_COMBINER_DUP,
-  MPI_COMBINER_CONTIGUOUS,
-  MPI_COMBINER_VECTOR,
-  MPI_COMBINER_HVECTOR_INTEGER,
-  MPI_COMBINER_HVECTOR,
-  MPI_COMBINER_INDEXED,
-  MPI_COMBINER_HINDEXED_INTEGER,
-  MPI_COMBINER_HINDEXED,
-  MPI_COMBINER_INDEXED_BLOCK,
-  MPI_COMBINER_STRUCT_INTEGER,
-  MPI_COMBINER_STRUCT,
-  MPI_COMBINER_SUBARRAY,
-  MPI_COMBINER_DARRAY,
-  MPI_COMBINER_F90_REAL,
-  MPI_COMBINER_F90_COMPLEX,
-  MPI_COMBINER_F90_INTEGER,
-  MPI_COMBINER_RESIZED,
-  MPI_COMBINER_HINDEXED_BLOCK
-}MPIR_Combiner_enum;
-
-
 typedef ptrdiff_t MPI_Aint;
 typedef long long MPI_Offset;
 
@@ -362,13 +338,13 @@ typedef SMPI_Group* MPI_Group;
 
 XBT_PUBLIC_DATA( MPI_Group ) MPI_GROUP_EMPTY;
 
-typedef SMPI_Comm *MPI_Comm;
+typedef SMPI_CommMPI_Comm;
 
 #define MPI_COMM_NULL ((MPI_Comm)NULL)
 XBT_PUBLIC_DATA( MPI_Comm ) MPI_COMM_WORLD;
 #define MPI_COMM_SELF smpi_process_comm_self()
 
-typedef SMPI_Request *MPI_Request;
+typedef SMPI_RequestMPI_Request;
 
 #define MPIO_Request MPI_Request
 #define MPI_REQUEST_NULL ((MPI_Request)NULL)
@@ -406,13 +382,29 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Init, (int *argc, char ***argv));
 MPI_CALL(XBT_PUBLIC(int), MPI_Finalize, (void));
 MPI_CALL(XBT_PUBLIC(int), MPI_Finalized, (int* flag));
 MPI_CALL(XBT_PUBLIC(int), MPI_Init_thread, (int *argc, char ***argv, int required, int *provided));
+MPI_CALL(XBT_PUBLIC(int), MPI_Initialized, (int* flag));
 MPI_CALL(XBT_PUBLIC(int), MPI_Query_thread, (int *provided));
 MPI_CALL(XBT_PUBLIC(int), MPI_Is_thread_main, (int *flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Get_version, (int *version,int *subversion));
+MPI_CALL(XBT_PUBLIC(int), MPI_Get_library_version, (char *version,int *len));
+MPI_CALL(XBT_PUBLIC(int), MPI_Get_processor_name, (char *name, int *resultlen));
 MPI_CALL(XBT_PUBLIC(int), MPI_Abort, (MPI_Comm comm, int errorcode));
+MPI_CALL(XBT_PUBLIC(int), MPI_Alloc_mem, (MPI_Aint size, MPI_Info info, void *baseptr));
+MPI_CALL(XBT_PUBLIC(int), MPI_Free_mem, (void *base));
 MPI_CALL(XBT_PUBLIC(double), MPI_Wtime, (void));
 MPI_CALL(XBT_PUBLIC(double), MPI_Wtick,(void));
+
 MPI_CALL(XBT_PUBLIC(int), MPI_Address, (void *location, MPI_Aint * address));
 MPI_CALL(XBT_PUBLIC(int), MPI_Get_address, (void *location, MPI_Aint * address));
+MPI_CALL(XBT_PUBLIC(int), MPI_Error_class, (int errorcode, int* errorclass));
+
+MPI_CALL(XBT_PUBLIC(int), MPI_Attr_delete, (MPI_Comm comm, int keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Attr_get, (MPI_Comm comm, int keyval, void* attr_value, int* flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Attr_put, (MPI_Comm comm, int keyval, void* attr_value));
+MPI_CALL(XBT_PUBLIC(int), MPI_Keyval_create, (MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval,
+                              void* extra_state));
+MPI_CALL(XBT_PUBLIC(int), MPI_Keyval_free, (int* keyval));
+
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_free, (MPI_Datatype * datatype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_size, (MPI_Datatype datatype, int *size));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_size_x, (MPI_Datatype datatype, MPI_Count *size));
@@ -445,10 +437,33 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_struct, (int count, int* blocklens, MP
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_vector, (int count, int blocklen, int stride,
                              MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_contiguous, (int count, MPI_Datatype old_type, MPI_Datatype* newtype));
-MPI_CALL(XBT_PUBLIC(int), MPI_Testall, (int count, MPI_Request* requests, int* flag, MPI_Status* statuses));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_resized ,(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent,
+                                                    MPI_Datatype *newtype));
+MPI_CALL(XBT_PUBLIC(MPI_Datatype), MPI_Type_f2c,(MPI_Fint datatype));
+MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Type_c2f,(MPI_Datatype datatype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Get_count, (MPI_Status * status, MPI_Datatype datatype, int *count));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_attr, (MPI_Datatype type, int type_keyval, void *attribute_val, int* flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_set_attr, (MPI_Datatype type, int type_keyval, void *att));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_delete_attr, (MPI_Datatype type, int comm_keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_keyval,(MPI_Type_copy_attr_function* copy_fn,
+                              MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_free_keyval,(int* keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_dup,(MPI_Datatype datatype,MPI_Datatype *newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_set_name,(MPI_Datatype  datatype, char * name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_name,(MPI_Datatype  datatype, char * name, int* len));
+
+
+MPI_CALL(XBT_PUBLIC(int), MPI_Pack, (void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount,
+                              int* position, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Pack_size, (int incount, MPI_Datatype datatype, MPI_Comm comm, int* size));
+MPI_CALL(XBT_PUBLIC(int), MPI_Unpack, (void* inbuf, int insize, int* position, void* outbuf, int outcount,
+                              MPI_Datatype type, MPI_Comm comm));
+
 MPI_CALL(XBT_PUBLIC(int), MPI_Op_create, (MPI_User_function * function, int commute, MPI_Op * op));
 MPI_CALL(XBT_PUBLIC(int), MPI_Op_free, (MPI_Op * op));
 MPI_CALL(XBT_PUBLIC(int), MPI_Op_commutative, (MPI_Op op, int *commute));
+MPI_CALL(XBT_PUBLIC(MPI_Op), MPI_Op_f2c,(MPI_Fint op));
+MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Op_c2f,(MPI_Op op));
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Group_free, (MPI_Group * group));
 MPI_CALL(XBT_PUBLIC(int), MPI_Group_size, (MPI_Group group, int *size));
@@ -463,21 +478,29 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Group_incl, (MPI_Group group, int n, int *ranks, M
 MPI_CALL(XBT_PUBLIC(int), MPI_Group_excl, (MPI_Group group, int n, int *ranks, MPI_Group * newgroup));
 MPI_CALL(XBT_PUBLIC(int), MPI_Group_range_incl, (MPI_Group group, int n, int ranges[][3], MPI_Group * newgroup));
 MPI_CALL(XBT_PUBLIC(int), MPI_Group_range_excl, (MPI_Group group, int n, int ranges[][3], MPI_Group * newgroup));
+MPI_CALL(XBT_PUBLIC(MPI_Group), MPI_Group_f2c,(MPI_Fint group));
+MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Group_c2f,(MPI_Group group));
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_rank, (MPI_Comm comm, int *rank));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_size, (MPI_Comm comm, int *size));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_name, (MPI_Comm comm, char* name, int* len));
-MPI_CALL(XBT_PUBLIC(int), MPI_Get_processor_name, (char *name, int *resultlen));
-MPI_CALL(XBT_PUBLIC(int), MPI_Get_count, (MPI_Status * status, MPI_Datatype datatype, int *count));
-
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_name, (MPI_Comm comm, char* name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_dup, (MPI_Comm comm, MPI_Comm * newcomm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_attr, (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_attr, (MPI_Comm comm, int comm_keyval, void *attribute_val));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_delete_attr, (MPI_Comm comm, int comm_keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create_keyval,(MPI_Comm_copy_attr_function* copy_fn,
+                              MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_free_keyval,(int* keyval));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_group, (MPI_Comm comm, MPI_Group * group));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_compare, (MPI_Comm comm1, MPI_Comm comm2, int *result));
-
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create, (MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create_group, (MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * newcomm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_free, (MPI_Comm * comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_disconnect, (MPI_Comm * comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_split, (MPI_Comm comm, int color, int key, MPI_Comm* comm_out));
+MPI_CALL(XBT_PUBLIC(MPI_Comm), MPI_Comm_f2c,(MPI_Fint comm));
+MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Comm_c2f,(MPI_Comm comm));
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Send_init, (void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm,
                              MPI_Request * request));
@@ -493,6 +516,11 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Isend, (void *buf, int count, MPI_Datatype datatyp
 MPI_CALL(XBT_PUBLIC(int), MPI_Recv, (void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm,
                              MPI_Status * status));
 MPI_CALL(XBT_PUBLIC(int), MPI_Send, (void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Ssend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Ssend_init, (void* buf, int count, MPI_Datatype datatype, int dest, int tag,
+                              MPI_Comm comm, MPI_Request* request));
+MPI_CALL(XBT_PUBLIC(int), MPI_Issend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
+                              MPI_Request* request));
 MPI_CALL(XBT_PUBLIC(int), MPI_Sendrecv, (void *sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag,
                              void *recvbuf, int recvcount, MPI_Datatype recvtype, int src, int recvtag,
                              MPI_Comm comm, MPI_Status * status));
@@ -501,13 +529,19 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Sendrecv_replace, (void *buf, int count, MPI_Datat
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Test, (MPI_Request * request, int *flag, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC(int), MPI_Testany, (int count, MPI_Request requests[], int *index, int *flag, MPI_Status * status));
+MPI_CALL(XBT_PUBLIC(int), MPI_Testall, (int count, MPI_Request* requests, int* flag, MPI_Status* statuses));
+MPI_CALL(XBT_PUBLIC(int), MPI_Testsome, (int incount, MPI_Request requests[], int *outcount, int *indices,
+                             MPI_Status status[]));
 MPI_CALL(XBT_PUBLIC(int), MPI_Wait, (MPI_Request * request, MPI_Status * status));
 MPI_CALL(XBT_PUBLIC(int), MPI_Waitany, (int count, MPI_Request requests[], int *index, MPI_Status * status));
 MPI_CALL(XBT_PUBLIC(int), MPI_Waitall, (int count, MPI_Request requests[], MPI_Status status[]));
 MPI_CALL(XBT_PUBLIC(int), MPI_Waitsome, (int incount, MPI_Request requests[], int *outcount, int *indices,
                              MPI_Status status[]));
-MPI_CALL(XBT_PUBLIC(int), MPI_Testsome, (int incount, MPI_Request requests[], int *outcount, int *indices,
-                             MPI_Status status[]));
+MPI_CALL(XBT_PUBLIC(int), MPI_Iprobe, (int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC(int), MPI_Probe, (int source, int tag, MPI_Comm comm, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC(MPI_Request), MPI_Request_f2c,(MPI_Fint request));
+MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Request_c2f,(MPI_Request request));
+
 MPI_CALL(XBT_PUBLIC(int), MPI_Bcast, (void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Barrier, (MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Gather, (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
@@ -528,6 +562,8 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Allreduce, (void *sendbuf, void *recvbuf, int coun
                              MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Scan, (void *sendbuf, void *recvbuf, int count,MPI_Datatype datatype, MPI_Op op,
                              MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Exscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
+                                      MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Reduce_scatter, (void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype,
                              MPI_Op op, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Reduce_scatter_block, (void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype,
@@ -536,12 +572,20 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Alltoall, (void *sendbuf, int sendcount, MPI_Datat
                              int recvcount, MPI_Datatype recvtype, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Alltoallv, (void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype,
                              void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC(int), MPI_Iprobe, (int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC(int), MPI_Probe, (int source, int tag, MPI_Comm comm, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC(int), MPI_Get_version, (int *version,int *subversion));
-MPI_CALL(XBT_PUBLIC(int), MPI_Get_library_version, (char *version,int *len));
 MPI_CALL(XBT_PUBLIC(int), MPI_Reduce_local,(void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op));
 
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_create,( MPI_Info *info));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_set,( MPI_Info info, char *key, char *value));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get,(MPI_Info info,char *key,int valuelen, char *value, int *flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_free,( MPI_Info *info));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_delete,( MPI_Info info,  char *key));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_dup,(MPI_Info info, MPI_Info *newinfo));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_nkeys,( MPI_Info info, int *nkeys));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_nthkey,( MPI_Info info, int n, char *key));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_valuelen,( MPI_Info info, char *key, int *valuelen, int *flag));
+MPI_CALL(XBT_PUBLIC(MPI_Info), MPI_Info_f2c,(MPI_Fint info));
+MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Info_c2f,(MPI_Info info));
+
 MPI_CALL(XBT_PUBLIC(int), MPI_Win_free,( MPI_Win* win));
 MPI_CALL(XBT_PUBLIC(int), MPI_Win_create,( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm,
                               MPI_Win *win));
@@ -563,7 +607,20 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Win_delete_attr, (MPI_Win type, int comm_keyval));
 MPI_CALL(XBT_PUBLIC(int), MPI_Win_create_keyval,(MPI_Win_copy_attr_function* copy_fn,
                               MPI_Win_delete_attr_function* delete_fn, int* keyval, void* extra_state));
 MPI_CALL(XBT_PUBLIC(int), MPI_Win_free_keyval,(int* keyval));
-
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_complete,(MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_post,(MPI_Group group, int assert, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_start,(MPI_Group group, int assert, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_wait,(MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_lock,(int lock_type, int rank, int assert, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_lock_all,(int assert, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_unlock,(int rank, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_unlock_all,(MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush,(int rank, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush_local,(int rank, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush_all,(MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush_local_all,(MPI_Win win));
+MPI_CALL(XBT_PUBLIC(MPI_Win), MPI_Win_f2c,(MPI_Fint win));
+MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Win_c2f,(MPI_Win win));
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Get,( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
     MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win));
@@ -574,7 +631,6 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Accumulate,( void *origin_addr, int origin_count,
 MPI_CALL(XBT_PUBLIC(int), MPI_Get_accumulate,( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
     void* result_addr, int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
     int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win));
-
 MPI_CALL(XBT_PUBLIC(int), MPI_Rget,( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
     MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC(int), MPI_Rput,( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
@@ -584,30 +640,46 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Raccumulate,( void *origin_addr, int origin_count,
 MPI_CALL(XBT_PUBLIC(int), MPI_Rget_accumulate,( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
     void* result_addr, int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
     int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request));
-
 MPI_CALL(XBT_PUBLIC(int), MPI_Fetch_and_op,( void *origin_addr, void* result_addr, MPI_Datatype datatype,
     int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win));
 MPI_CALL(XBT_PUBLIC(int), MPI_Compare_and_swap, (void *origin_addr, void *compare_addr,
         void *result_addr, MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Win win));
 
-MPI_CALL(XBT_PUBLIC(int), MPI_Alloc_mem, (MPI_Aint size, MPI_Info info, void *baseptr));
-MPI_CALL(XBT_PUBLIC(int), MPI_Free_mem, (void *base));
+MPI_CALL(XBT_PUBLIC(int), MPI_Cart_coords, (MPI_Comm comm, int rank, int maxdims, int* coords));
+MPI_CALL(XBT_PUBLIC(int), MPI_Cart_create, (MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder,
+                                            MPI_Comm* comm_cart));
+MPI_CALL(XBT_PUBLIC(int), MPI_Cart_get, (MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords));
+MPI_CALL(XBT_PUBLIC(int), MPI_Cart_rank, (MPI_Comm comm, int* coords, int* rank));
+MPI_CALL(XBT_PUBLIC(int), MPI_Cart_shift, (MPI_Comm comm, int direction, int displ, int* source, int* dest));
+MPI_CALL(XBT_PUBLIC(int), MPI_Cart_sub, (MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new));
+MPI_CALL(XBT_PUBLIC(int), MPI_Cartdim_get, (MPI_Comm comm, int* ndims));
+MPI_CALL(XBT_PUBLIC(int), MPI_Dims_create, (int nnodes, int ndims, int* dims));
 
-MPI_CALL(XBT_PUBLIC(MPI_Datatype), MPI_Type_f2c,(MPI_Fint datatype));
-MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Type_c2f,(MPI_Datatype datatype));
-MPI_CALL(XBT_PUBLIC(MPI_Group), MPI_Group_f2c,(MPI_Fint group));
-MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Group_c2f,(MPI_Group group));
-MPI_CALL(XBT_PUBLIC(MPI_Request), MPI_Request_f2c,(MPI_Fint request));
-MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Request_c2f,(MPI_Request request));
-MPI_CALL(XBT_PUBLIC(MPI_Win), MPI_Win_f2c,(MPI_Fint win));
-MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Win_c2f,(MPI_Win win));
-MPI_CALL(XBT_PUBLIC(MPI_Op), MPI_Op_f2c,(MPI_Fint op));
-MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Op_c2f,(MPI_Op op));
-MPI_CALL(XBT_PUBLIC(MPI_Comm), MPI_Comm_f2c,(MPI_Fint comm));
-MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Comm_c2f,(MPI_Comm comm));
 
 //FIXME: these are not yet implemented
 
+typedef enum MPIR_Combiner_enum{
+  MPI_COMBINER_NAMED,
+  MPI_COMBINER_DUP,
+  MPI_COMBINER_CONTIGUOUS,
+  MPI_COMBINER_VECTOR,
+  MPI_COMBINER_HVECTOR_INTEGER,
+  MPI_COMBINER_HVECTOR,
+  MPI_COMBINER_INDEXED,
+  MPI_COMBINER_HINDEXED_INTEGER,
+  MPI_COMBINER_HINDEXED,
+  MPI_COMBINER_INDEXED_BLOCK,
+  MPI_COMBINER_STRUCT_INTEGER,
+  MPI_COMBINER_STRUCT,
+  MPI_COMBINER_SUBARRAY,
+  MPI_COMBINER_DARRAY,
+  MPI_COMBINER_F90_REAL,
+  MPI_COMBINER_F90_COMPLEX,
+  MPI_COMBINER_F90_INTEGER,
+  MPI_COMBINER_RESIZED,
+  MPI_COMBINER_HINDEXED_BLOCK
+}MPIR_Combiner_enum;
+
 typedef void MPI_Handler_function(MPI_Comm*, int*, ...);
 
 typedef void* MPI_Errhandler;
@@ -632,20 +704,9 @@ XBT_PUBLIC_DATA(MPI_Errhandler*)  MPI_ERRORS_RETURN;
 XBT_PUBLIC_DATA(MPI_Errhandler*)  MPI_ERRORS_ARE_FATAL;
 XBT_PUBLIC_DATA(MPI_Errhandler*)  MPI_ERRHANDLER_NULL;
 
-MPI_CALL(XBT_PUBLIC(MPI_Info), MPI_Info_f2c,(MPI_Fint info));
-MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Info_c2f,(MPI_Info info));
 MPI_CALL(XBT_PUBLIC(MPI_Errhandler), MPI_Errhandler_f2c,(MPI_Fint errhandler));
 MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_Errhandler_c2f,(MPI_Errhandler errhandler));
-MPI_CALL(XBT_PUBLIC(int), MPI_Pack_size, (int incount, MPI_Datatype datatype, MPI_Comm comm, int* size));
-MPI_CALL(XBT_PUBLIC(int), MPI_Cart_coords, (MPI_Comm comm, int rank, int maxdims, int* coords));
-MPI_CALL(XBT_PUBLIC(int), MPI_Cart_create, (MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder,
-                                            MPI_Comm* comm_cart));
-MPI_CALL(XBT_PUBLIC(int), MPI_Cart_get, (MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords));
 MPI_CALL(XBT_PUBLIC(int), MPI_Cart_map, (MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank));
-MPI_CALL(XBT_PUBLIC(int), MPI_Cart_rank, (MPI_Comm comm, int* coords, int* rank));
-MPI_CALL(XBT_PUBLIC(int), MPI_Cart_shift, (MPI_Comm comm, int direction, int displ, int* source, int* dest));
-MPI_CALL(XBT_PUBLIC(int), MPI_Cart_sub, (MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new));
-MPI_CALL(XBT_PUBLIC(int), MPI_Cartdim_get, (MPI_Comm comm, int* ndims));
 MPI_CALL(XBT_PUBLIC(int), MPI_Graph_create, (MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder,
                                              MPI_Comm* comm_graph));
 MPI_CALL(XBT_PUBLIC(int), MPI_Graph_get, (MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges));
@@ -654,7 +715,6 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Graph_neighbors, (MPI_Comm comm, int rank, int max
 MPI_CALL(XBT_PUBLIC(int), MPI_Graph_neighbors_count, (MPI_Comm comm, int rank, int* nneighbors));
 MPI_CALL(XBT_PUBLIC(int), MPI_Graphdims_get, (MPI_Comm comm, int* nnodes, int* nedges));
 MPI_CALL(XBT_PUBLIC(int), MPI_Topo_test, (MPI_Comm comm, int* top_type));
-MPI_CALL(XBT_PUBLIC(int), MPI_Error_class, (int errorcode, int* errorclass));
 MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_create, (MPI_Handler_function* function, MPI_Errhandler* errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_free, (MPI_Errhandler* errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_get, (MPI_Comm comm, MPI_Errhandler* errhandler));
@@ -671,26 +731,6 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Cancel, (MPI_Request* request));
 MPI_CALL(XBT_PUBLIC(int), MPI_Buffer_attach, (void* buffer, int size));
 MPI_CALL(XBT_PUBLIC(int), MPI_Buffer_detach, (void* buffer, int* size));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_test_inter, (MPI_Comm comm, int* flag));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_attr, (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_attr, (MPI_Comm comm, int comm_keyval, void *attribute_val));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_delete_attr, (MPI_Comm comm, int comm_keyval));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create_keyval,(MPI_Comm_copy_attr_function* copy_fn,
-                              MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_free_keyval,(int* keyval));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_attr, (MPI_Datatype type, int type_keyval, void *attribute_val, int* flag));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_set_attr, (MPI_Datatype type, int type_keyval, void *att));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_delete_attr, (MPI_Datatype type, int comm_keyval));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_keyval,(MPI_Type_copy_attr_function* copy_fn,
-                              MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_free_keyval,(int* keyval));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_dup,(MPI_Datatype datatype,MPI_Datatype *newtype));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_set_name,(MPI_Datatype  datatype, char * name));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_name,(MPI_Datatype  datatype, char * name, int* len));
-MPI_CALL(XBT_PUBLIC(int), MPI_Unpack, (void* inbuf, int insize, int* position, void* outbuf, int outcount,
-                              MPI_Datatype type, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC(int), MPI_Ssend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC(int), MPI_Ssend_init, (void* buf, int count, MPI_Datatype datatype, int dest, int tag,
-                              MPI_Comm comm, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC(int), MPI_Intercomm_create, (MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm,
                               int remote_leader, int tag, MPI_Comm* comm_out));
 MPI_CALL(XBT_PUBLIC(int), MPI_Intercomm_merge, (MPI_Comm comm, int high, MPI_Comm* comm_out));
@@ -701,38 +741,15 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Ibsend, (void* buf, int count, MPI_Datatype dataty
                               MPI_Request* request));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_remote_group, (MPI_Comm comm, MPI_Group* group));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_remote_size, (MPI_Comm comm, int* size));
-MPI_CALL(XBT_PUBLIC(int), MPI_Issend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
-                              MPI_Request* request));
-MPI_CALL(XBT_PUBLIC(int), MPI_Attr_delete, (MPI_Comm comm, int keyval));
-MPI_CALL(XBT_PUBLIC(int), MPI_Attr_get, (MPI_Comm comm, int keyval, void* attr_value, int* flag));
-MPI_CALL(XBT_PUBLIC(int), MPI_Attr_put, (MPI_Comm comm, int keyval, void* attr_value));
 MPI_CALL(XBT_PUBLIC(int), MPI_Rsend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Rsend_init, (void* buf, int count, MPI_Datatype datatype, int dest, int tag,
                               MPI_Comm comm, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC(int), MPI_Irsend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
                               MPI_Request* request));
-MPI_CALL(XBT_PUBLIC(int), MPI_Keyval_create, (MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval,
-                              void* extra_state));
-MPI_CALL(XBT_PUBLIC(int), MPI_Keyval_free, (int* keyval));
 MPI_CALL(XBT_PUBLIC(int), MPI_Test_cancelled, (MPI_Status* status, int* flag));
-MPI_CALL(XBT_PUBLIC(int), MPI_Pack, (void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount,
-                              int* position, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Get_elements, (MPI_Status* status, MPI_Datatype datatype, int* elements));
-MPI_CALL(XBT_PUBLIC(int), MPI_Dims_create, (int nnodes, int ndims, int* dims));
-MPI_CALL(XBT_PUBLIC(int), MPI_Initialized, (int* flag));
 MPI_CALL(XBT_PUBLIC(int), MPI_Pcontrol, (const int level, ... ));
 
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_create,( MPI_Info *info));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_set,( MPI_Info info, char *key, char *value));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_get,(MPI_Info info,char *key,int valuelen, char *value, int *flag));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_free,( MPI_Info *info));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_delete,( MPI_Info info,  char *key));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_dup,(MPI_Info info, MPI_Info *newinfo));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_nkeys,( MPI_Info info, int *nkeys));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_nthkey,( MPI_Info info, int n, char *key));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_valuelen,( MPI_Info info, char *key, int *valuelen, int *flag));
-
-
 MPI_CALL(XBT_PUBLIC(int), MPI_Win_set_errhandler, (MPI_Win win, MPI_Errhandler errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_envelope,(MPI_Datatype datatype,int *num_integers,int *num_addresses,
                             int *num_datatypes, int *combiner));
@@ -747,19 +764,13 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Pack_external, (char *datarep, void *inbuf, int in
                                               void *outbuf, MPI_Aint outcount, MPI_Aint *position));
 MPI_CALL(XBT_PUBLIC(int), MPI_Unpack_external, (char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position,
                                                 void *outbuf, int outcount, MPI_Datatype datatype));
-MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_resized ,(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent,
-                                                    MPI_Datatype *newtype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_subarray,(int ndims,int *array_of_sizes, int *array_of_subsizes,
                               int *array_of_starts, int order, MPI_Datatype oldtype, MPI_Datatype *newtype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_match_size,(int typeclass,int size,MPI_Datatype *datatype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Alltoallw, ( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes,
                               void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC(int), MPI_Exscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
-                                      MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_name, (MPI_Comm comm, char* name));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_info, (MPI_Comm comm, MPI_Info info));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_info, (MPI_Comm comm, MPI_Info* info));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_dup, (MPI_Comm comm, MPI_Comm * newcomm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_dup_with_info,(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_split_type,(MPI_Comm comm, int split_type, int key, MPI_Info info,
                                                MPI_Comm *newcomm));
@@ -786,22 +797,7 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Comm_spawn_multiple,(int count, char **array_of_co
                                                    int* array_of_maxprocs, MPI_Info* array_of_info, int root,
                                                    MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_parent,( MPI_Comm *parent));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_complete,(MPI_Win win));
-
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_post,(MPI_Group group, int assert, MPI_Win win));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_start,(MPI_Group group, int assert, MPI_Win win));
 MPI_CALL(XBT_PUBLIC(int),  MPI_Win_test,(MPI_Win win, int *flag));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_wait,(MPI_Win win));
-
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_lock,(int lock_type, int rank, int assert, MPI_Win win));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_lock_all,(int assert, MPI_Win win));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_unlock,(int rank, MPI_Win win));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_unlock_all,(MPI_Win win));
-
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush,(int rank, MPI_Win win));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush_local,(int rank, MPI_Win win));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush_all,(MPI_Win win));
-MPI_CALL(XBT_PUBLIC(int),  MPI_Win_flush_local_all,(MPI_Win win));
 
 MPI_CALL(XBT_PUBLIC(MPI_Fint), MPI_File_c2f,(MPI_File file));
 MPI_CALL(XBT_PUBLIC(MPI_File), MPI_File_f2c,(MPI_Fint file));
@@ -918,13 +914,11 @@ XBT_PUBLIC(void) smpi_trace_set_call_location_(const char *file, int* line);
 /** Fortran binding + -fsecond-underscore **/
 XBT_PUBLIC(void) smpi_trace_set_call_location__(const char *file, int* line);
 
-#define SMPI_SAMPLE_LOCAL(iters,thres) for(smpi_sample_1(0, __FILE__, __LINE__, iters, thres); \
-                                           smpi_sample_2(0, __FILE__, __LINE__);      \
-                                           smpi_sample_3(0, __FILE__, __LINE__))
-
-#define SMPI_SAMPLE_GLOBAL(iters,thres) for(smpi_sample_1(1, __FILE__, __LINE__, iters, thres); \
-                                            smpi_sample_2(1, __FILE__, __LINE__);      \
-                                            smpi_sample_3(1, __FILE__, __LINE__))
+#define SMPI_SAMPLE_LOOP(global, iters, thres)                                                                         \
+  for (smpi_sample_1(global, __FILE__, __LINE__, iters, thres); smpi_sample_2(global, __FILE__, __LINE__);             \
+       smpi_sample_3(global, __FILE__, __LINE__))
+#define SMPI_SAMPLE_LOCAL(iters, thres) SMPI_SAMPLE_LOOP(0, iters, thres)
+#define SMPI_SAMPLE_GLOBAL(iters, thres) SMPI_SAMPLE_LOOP(1, iters, thres)
 
 #define SMPI_SAMPLE_DELAY(duration) for(smpi_execute(duration); 0; )
 #define SMPI_SAMPLE_FLOPS(flops) for(smpi_execute_flops(flops); 0; )
index 9d5510e..5890af3 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt.h - Public interface to the xbt (SimGrid's toolbox)                  */
 
-/* Copyright (c) 2004-2014. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,7 +12,6 @@
 #include <xbt/misc.h>
 #include <xbt/sysdep.h>
 #include <xbt/str.h>
-#include <xbt/file.h>
 #include <xbt/function_types.h>
 
 #include <xbt/asserts.h>
@@ -23,7 +22,6 @@
 #include <xbt/dynar.h>
 #include <xbt/dict.h>
 #include <xbt/swag.h>
-#include <xbt/heap.h>
 #include <xbt/parmap.h>
 
 #include <xbt/config.h>
index f158d50..785e337 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
@@ -22,9 +22,9 @@ class Extension {
   static const std::size_t INVALID_ID = std::numeric_limits<std::size_t>::max();
   std::size_t id_;
   friend class Extendable<T>;
-  constexpr Extension(std::size_t id) : id_(id) {}
+  explicit constexpr Extension(std::size_t id) : id_(id) {}
 public:
-  constexpr Extension() : id_(INVALID_ID) {}
+  explicit constexpr Extension() : id_(INVALID_ID) {}
   std::size_t id() const { return id_; }
   bool valid() { return id_ != INVALID_ID; }
 };
@@ -48,7 +48,6 @@ template<class T>
 class Extendable {
 private:
   static std::vector<void(*)(void*)> deleters_;
-protected:
   std::vector<void*> extensions_;
 public:
   static size_t extension_create(void (*deleter)(void*))
@@ -65,7 +64,7 @@ public:
   template<class U> static
   Extension<T,U> extension_create()
   {
-    return extension_create([](void* p){ delete static_cast<U*>(p); });
+    return Extension<T, U>(extension_create([](void* p) { delete static_cast<U*>(p); }));
   }
   Extendable() : extensions_(deleters_.size(), nullptr) {}
   ~Extendable()
@@ -77,7 +76,7 @@ public:
      * an extension of B might need to have the extension of A around when executing
      * its cleanup function/destructor. */
     for (std::size_t i = extensions_.size(); i > 0; --i)
-      if (extensions_[i - 1] != nullptr)
+      if (extensions_[i - 1] != nullptr && deleters_[i - 1] != nullptr)
         deleters_[i - 1](extensions_[i - 1]);
   }
 
diff --git a/include/xbt/algorithm.hpp b/include/xbt/algorithm.hpp
new file mode 100644 (file)
index 0000000..20e148e
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright (c) 2015-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 XBT_ALGORITHM_HPP
+#define XBT_ALGORITHM_HPP
+
+#include <utility>
+
+namespace simgrid {
+namespace xbt {
+
+/** @brief Sorts the elements of the sequence [first, last) according to their color assuming elements can have only
+ * three colors.  Since there are only three colors, it is linear and much faster than a classical sort.  See for
+ * example http://en.wikipedia.org/wiki/Dutch_national_flag_problem
+ *
+ * \param first forward iterators to the initial position of the sequence to partition.
+ * \param last forward iterators to the final position of the sequence to partition.
+ * \param color the color function that accepts an element in the range as argument, and returns a value of 0, 1, or 2.
+ *
+ * At the end of the call, elements with color 0 are at the beginning of the range, elements with color 2 are at the end
+ * and elements with color 1 are in the middle.
+ */
+template <class ForwardIterator, class ColorFunction>
+void three_way_partition(ForwardIterator first, ForwardIterator last, ColorFunction color)
+{
+  ForwardIterator iter = first;
+  while (iter < last) {
+    int c = color(*iter);
+    if (c == 1) {
+      ++iter;
+    } else if (c == 0) {
+      if (iter != first)
+        std::swap(*iter, *first);
+      ++iter;
+      ++first;
+    } else { // c == 2
+      --last;
+      if (iter != last)
+        std::swap(*iter, *last);
+    }
+  }
+}
+}
+}
+
+#endif
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..8528c62 100644 (file)
      __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
 #endif
 
+#if defined(__cplusplus)
+#if __cplusplus >= 201103L
+#define XBT_ATTRIB_NORETURN [[noreturn]]
+#endif
+#if __cplusplus >= 201703L
+#define XBT_ATTRIB_UNUSED [[maybe_unused]]
+#endif
+#if __cplusplus >= 201402L
+#define XBT_ATTRIB_DEPRECATED(msg) [[deprecated(msg)]]
+#endif
+#elif defined(__STDC_VERSION__)
+#if __STDC_VERSION__ >= 201112L
+#define XBT_ATTRIB_NORETURN _Noreturn
+#endif
+#endif
+
+#ifndef XBT_ATTRIB_NORETURN
 #define XBT_ATTRIB_NORETURN __attribute__((noreturn))
+#endif
+#ifndef XBT_ATTRIB_UNUSED
 #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 */
+#endif
+#ifndef XBT_ATTRIB_DEPRECATED
+#define XBT_ATTRIB_DEPRECATED(msg) __attribute__((deprecated(msg)))
+#endif
+
+#define XBT_ATTRIB_DEPRECATED_v319(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.19 */
+#define XBT_ATTRIB_DEPRECATED_v320(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.20 */
+#define XBT_ATTRIB_DEPRECATED_v321(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.21 */
 
 /* Constructor priorities exist since gcc 4.3.  Apparently, they are however not
  * supported on Macs. */
index 1131871..4ad8e1f 100644 (file)
@@ -10,7 +10,7 @@
 #define XBT_CONFIG_H
 
 #include <stdarg.h>
-#include <xbt/dynar.h>
+#include <xbt/base.h>
 
 /** @addtogroup XBT_config
  *  @brief Changing the configuration of SimGrid components (grounding feature)
@@ -72,8 +72,8 @@ XBT_PUBLIC(void) xbt_cfg_set_parse(const char *options);
 /* Set the value of the cell \a name in \a cfg with the provided value.*/
 XBT_PUBLIC(void) xbt_cfg_set_int       (const char *name, int val);
 XBT_PUBLIC(void) xbt_cfg_set_double    (const char *name, double val);
-XBT_PUBLIC(void) xbt_cfg_set_string    (const char *name, const char *val);
 XBT_PUBLIC(void) xbt_cfg_set_boolean   (const char *name, const char *val);
+XBT_PUBLIC(void) xbt_cfg_set_string(const char* name, const char* val);
 XBT_PUBLIC(void) xbt_cfg_set_as_string(const char *name, const char *val);
 
 /*
@@ -137,7 +137,6 @@ XBT_PUBLIC(void) xbt_cfg_help();
 
 XBT_PUBLIC(int)    xbt_cfg_get_int(const char *name);
 XBT_PUBLIC(double) xbt_cfg_get_double(const char *name);
-XBT_PUBLIC(char *) xbt_cfg_get_string(const char *name);
 XBT_PUBLIC(int)    xbt_cfg_get_boolean(const char *name);
 
 /** @} */
index f5b3c95..d457e57 100644 (file)
@@ -238,5 +238,6 @@ public:
 
 }
 }
+XBT_PUBLIC(std::string) xbt_cfg_get_string(const char* name);
 
 #endif
index c006453..24b4449 100644 (file)
@@ -27,9 +27,7 @@ typedef struct s_xbt_test_unit *xbt_test_unit_t;
 typedef void (*ts_test_cb_t) ();
 
 /* test suite operations */
-XBT_PUBLIC(xbt_test_suite_t) xbt_test_suite_new(const char *name, const char *fmt, ...);
 XBT_PUBLIC(xbt_test_suite_t) xbt_test_suite_by_name(const char *name, const char *fmt, ...);
-XBT_PUBLIC(void) xbt_test_suite_dump(xbt_test_suite_t suite);
 XBT_PUBLIC(void) xbt_test_suite_push(xbt_test_suite_t suite, const char *name, ts_test_cb_t func, const char *fmt, ...);
 
 /* Run all the specified tests. what_to_do allows to disable some tests.
index f1eb29e..9da94d6 100644 (file)
@@ -55,7 +55,8 @@ typedef struct s_xbt_dictelm {
   xbt_dictelm_t next;
 } s_xbt_dictelm_t;
 
-XBT_PUBLIC(xbt_dict_t) xbt_dict_new();
+XBT_ATTRIB_DEPRECATED_v319("Use xbt_dict_new_homogeneous(). v3.19 will turn this warning into an error.")
+    XBT_PUBLIC(xbt_dict_t) xbt_dict_new();
 XBT_PUBLIC(xbt_dict_t) xbt_dict_new_homogeneous(void_f_pvoid_t free_ctn);
 XBT_PUBLIC(void) xbt_dict_free(xbt_dict_t * dict);
 XBT_PUBLIC(unsigned int) xbt_dict_size(xbt_dict_t dict);
@@ -72,20 +73,22 @@ XBT_PUBLIC(unsigned int) xbt_dict_size(xbt_dict_t dict);
 XBT_PUBLIC(void) xbt_dict_set(xbt_dict_t dict, const char *key, void *data, void_f_pvoid_t free_ctn);
 XBT_PUBLIC(void *) xbt_dict_get(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(void *) xbt_dict_get_or_null(xbt_dict_t dict, const char *key);
-XBT_PUBLIC(char *) xbt_dict_get_key(xbt_dict_t dict, const void *data);
-XBT_PUBLIC(char *) xbt_dict_get_elm_key(xbt_dictelm_t elem);
+XBT_PUBLIC(char*) xbt_dict_get_key(xbt_dict_t dict, const void* data);
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(char*)
+    xbt_dict_get_elm_key(xbt_dictelm_t elem);
 XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key);
 
 XBT_PUBLIC(void) xbt_dict_remove(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(void) xbt_dict_reset(xbt_dict_t dict);
 XBT_PUBLIC(int) xbt_dict_length(xbt_dict_t dict);
-XBT_PUBLIC(void) xbt_dict_dump_output_string(void *s);
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
+    xbt_dict_dump_output_string(void* s);
 XBT_PUBLIC(void) xbt_dict_dump(xbt_dict_t dict, void (*output) (void *));
-XBT_PUBLIC(void) xbt_dict_dump_sizes(xbt_dict_t dict);
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
+    xbt_dict_dump_sizes(xbt_dict_t dict);
 XBT_PUBLIC(int) xbt_dict_is_empty(xbt_dict_t dict);
 
-
 /** @} */
 /** @defgroup XBT_dict_nnul Dictionaries with non-nul terminated keys
  *  @ingroup XBT_dict
@@ -95,8 +98,8 @@ XBT_PUBLIC(int) xbt_dict_is_empty(xbt_dict_t dict);
  *  @{
  */
 XBT_PUBLIC(void) xbt_dict_set_ext(xbt_dict_t dict, const char *key, int key_len, void *data, void_f_pvoid_t free_ctn);
-XBT_PUBLIC(void *) xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len);
-XBT_PUBLIC(void *) xbt_dict_get_or_null_ext(xbt_dict_t dict, const char *key, int key_len);
+XBT_PUBLIC(void*) xbt_dict_get_ext(xbt_dict_t dict, const char* key, int key_len);
+XBT_PUBLIC(void*) xbt_dict_get_or_null_ext(xbt_dict_t dict, const char* key, int key_len);
 XBT_PUBLIC(void) xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len);
 
 struct s_xbt_dict_cursor {
@@ -139,10 +142,10 @@ XBT_PUBLIC(void) xbt_dict_cursor_free(xbt_dict_cursor_t * cursor);
 
 XBT_PUBLIC(void) xbt_dict_cursor_rewind(xbt_dict_cursor_t cursor);
 
-xbt_dictelm_t xbt_dict_cursor_get_elm(xbt_dict_cursor_t cursor);
 XBT_PUBLIC(char *) xbt_dict_cursor_get_key(xbt_dict_cursor_t cursor);
 XBT_PUBLIC(void *) xbt_dict_cursor_get_data(xbt_dict_cursor_t cursor);
-XBT_PUBLIC(void) xbt_dict_cursor_set_data(xbt_dict_cursor_t cursor, void *data, void_f_pvoid_t free_ctn);
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
+    xbt_dict_cursor_set_data(xbt_dict_cursor_t cursor, void* data, void_f_pvoid_t free_ctn);
 
 XBT_PUBLIC(void) xbt_dict_cursor_first(const xbt_dict_t dict, xbt_dict_cursor_t * cursor);
 XBT_PUBLIC(void) xbt_dict_cursor_step(xbt_dict_cursor_t cursor);
index 86751e8..5484ccd 100644 (file)
@@ -93,7 +93,6 @@ XBT_PUBLIC(signed int) xbt_dynar_search_or_negative(xbt_dynar_t const dynar, voi
 XBT_PUBLIC(int) xbt_dynar_member(xbt_dynar_t const dynar, void *elem);
 XBT_PUBLIC(void) xbt_dynar_sort(xbt_dynar_t const dynar, int_f_cpvoid_cpvoid_t compar_fn);
 XBT_PUBLIC(xbt_dynar_t) xbt_dynar_sort_strings(xbt_dynar_t dynar);
-XBT_PUBLIC(void) xbt_dynar_three_way_partition(xbt_dynar_t const dynar, int_f_pvoid_t color);
 XBT_PUBLIC(int) xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2, int(*compar)(const void *, const void *));
 XBT_PUBLIC(void *) xbt_dynar_to_array (xbt_dynar_t dynar);
 
index 77bb871..d9f77b5 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2004-2007, 2009-2015. The SimGrid Team.
+/* Copyright (c) 2004-2007, 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. */
 
-#ifndef SIMGRId_XBT_DYNAR_HPP
-#define SIMGRId_XBT_DYNAR_HPP
+#ifndef SIMGRID_XBT_DYNAR_HPP
+#define SIMGRID_XBT_DYNAR_HPP
 
 #include <boost/range/iterator_range.hpp>
 #include <xbt/asserts.h>
index 6307177..78ade07 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005-2015. The SimGrid Team.
+/* Copyright (c) 2005-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /*  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>       */
 #include "xbt/misc.h"
 #include "xbt/virtu.h"
 
-/*-*-* Emergency debuging: define this when the exceptions get crazy *-*-*/
-#undef __EX_MAYDAY
-#ifdef __EX_MAYDAY
-# include <stdio.h>
-#include <errno.h>
-#  define MAYDAY_SAVE(m)    printf("%d %s:%d save %p\n",                \
-                                   xbt_getpid(), __FILE__, __LINE__,    \
-                                   (m)->jb                              \
-                                  ),
-#  define MAYDAY_RESTORE(m) printf("%d %s:%d restore %p\n",             \
-                                   xbt_getpid(), __FILE__, __LINE__,    \
-                                   (m)->jb                              \
-                                  ),
-#  define MAYDAY_CATCH(e)   printf("%d %s:%d Catched '%s'\n",           \
-                                   xbt_getpid(), __FILE__, __LINE__,    \
-                                   (e).msg                              \
-          ),
-#else
-#  define MAYDAY_SAVE(m)
-#  define MAYDAY_RESTORE(m)
-#  define MAYDAY_CATCH(e)
-#endif
-/*-*-* end of debugging stuff *-*-*/
-
 /** @addtogroup XBT_ex_c
  *  @brief Exceptions support (C)
  *
@@ -116,7 +92,8 @@ XBT_PUBLIC(const char *) xbt_ex_catname(xbt_errcat_t cat);
 typedef struct xbt_ex xbt_ex_t;
 
 /** Helper function used to throw exceptions in C */
-XBT_PUBLIC(void) _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func) XBT_ATTRIB_NORETURN;
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void)
+    _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func);
 
 /** Builds and throws an exception
  *  @ingroup XBT_ex_c
index efd8eee..7e64973 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005-2015. The SimGrid Team.
+/* Copyright (c) 2005-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /*  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>       */
@@ -79,7 +79,7 @@ struct XBT_PUBLIC() xbt_ex :
     simgrid::xbt::WithContextException(throwpoint, simgrid::xbt::backtrace())
   {}
 
-  ~xbt_ex() = default;
+  ~xbt_ex();
 
   /** Category (what went wrong) */
   xbt_errcat_t category = unknown_error;
index 6e80198..3d648a1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005-2016. The SimGrid Team.All rights reserved. */
+/* Copyright (c) 2005-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. */
@@ -72,16 +72,10 @@ public:
     procname_(xbt_procname()),
     pid_(xbt_getpid())
   {}
-  WithContextException(Backtrace bt) :
-    backtrace_(std::move(bt)),
-    procname_(xbt_procname()),
-    pid_(xbt_getpid())
+  explicit WithContextException(Backtrace bt) : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid())
   {}
-  WithContextException(ThrowPoint throwpoint, Backtrace bt) :
-    backtrace_(std::move(bt)),
-    procname_(xbt_procname()),
-    pid_(xbt_getpid()),
-    throwpoint_(throwpoint)
+  explicit WithContextException(ThrowPoint throwpoint, Backtrace bt)
+      : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid()), throwpoint_(throwpoint)
   {}
   virtual ~WithContextException();
   Backtrace const& backtrace() const
@@ -105,8 +99,7 @@ class WithContext : public E, public WithContextException
 public:
   static_assert(not std::is_base_of<WithContextException, E>::value, "Trying to appli WithContext twice");
 
-  WithContext(E exception) :
-    E(std::move(exception)) {}
+  explicit WithContext(E exception) : E(std::move(exception)) {}
   WithContext(E exception, ThrowPoint throwpoint, Backtrace backtrace) :
     E(std::move(exception)),
     WithContextException(throwpoint, std::move(backtrace)) {}
@@ -116,7 +109,7 @@ public:
   WithContext(E exception, WithContextException context) :
     E(std::move(exception)),
     WithContextException(std::move(context)) {}
-  ~WithContext() override {}
+  ~WithContext() override = default;
 };
 
 /** Throw a C++ exception with some context
diff --git a/include/xbt/file.h b/include/xbt/file.h
deleted file mode 100644 (file)
index 8f6941a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (c) 2007-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. */
-
-#ifndef XBT_FILE_H
-#define XBT_FILE_H
-
-#include <stdint.h> /* ssize_t */
-#include <stdarg.h>             /* va_* */
-#include <stdio.h>  /* FILE */
-#include <stdlib.h> /* size_t, ssize_t */
-#include "xbt/misc.h"
-#include "xbt/dynar.h"
-#include "xbt/dict.h"
-#include "simgrid_config.h"     /* FILE for getline */
-
-SG_BEGIN_DECL()
-
-/** @defgroup XBT_file File manipulation functions
- *  @ingroup XBT_misc
- *
- * This module redefine some quite classical functions such as xbt_getline() or xbt_dirname() for the platforms
- * lacking them.
- * @{
- */
-/* Our own implementation of getline, mainly useful on the platforms not enjoying this function */
-XBT_PUBLIC(ssize_t) xbt_getline(char **lineptr, size_t * n, FILE * stream);
-
-/* Our own implementation of dirname, that does not exist on windows */
-XBT_PUBLIC(char *) xbt_dirname(const char *path);
-XBT_PUBLIC(char *) xbt_basename(const char *path);
-
-/**@}*/
-
-SG_END_DECL()
-#endif                          /* XBT_FILE_H */
diff --git a/include/xbt/file.hpp b/include/xbt/file.hpp
new file mode 100644 (file)
index 0000000..e642320
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright (c) 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 XBT_FILE_HPP
+#define XBT_FILE_HPP
+
+#include <string>
+#include <xbt/base.h>
+
+namespace simgrid {
+namespace xbt {
+
+class Path {
+public:
+  explicit Path(const char* path): path_(path) {}
+  explicit Path(std::string path): path_(std::move(path)) {}
+
+  /** @brief Returns the full path name */
+  std::string getName() { return path_; }
+  /** @brief Returns the directory component of a path (reimplementation of POSIX dirname) */
+  std::string getDirname();
+  /** @brief Returns the file component of a path (reimplementation of POSIX basename) */
+  std::string getBasename();
+
+private:
+  std::string path_;
+};
+}}
+
+#endif                          /* XBT_FILE_HPP */
index 03aec81..f9883a5 100644 (file)
@@ -1,7 +1,6 @@
 /* function_type.h - classical types for pointer to function                */
 
-/* Copyright (c) 2006-2007, 2009-2010, 2012-2015. 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. */
@@ -18,8 +17,6 @@ typedef void *(*pvoid_f_void_t) (void);
 typedef void *(*pvoid_f_pvoid_t) (void *);
 typedef void (*void_f_void_t) (void);
 
-typedef int (*int_f_pvoid_t) (void*);
-
 typedef int (*int_f_pvoid_pvoid_t) (void *, void *);
 typedef int (*int_f_cpvoid_cpvoid_t) (const void *, const void *);
 
index 4f475b8..64c3caa 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2015-2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2015-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. */
@@ -39,10 +38,10 @@ public:
   {}
   void operator()() const
   {
-    char noarg[] = {'\0'};
     const int argc = args_->size();
     std::vector<std::string> args = *args_;
     if (not args.empty()) {
+      char noarg[] = {'\0'};
       std::unique_ptr<char* []> argv(new char*[argc + 1]);
       for (int i = 0; i != argc; ++i)
         argv[i]  = args[i].empty() ? noarg : &args[i].front();
@@ -131,8 +130,8 @@ private:
     std::pair<void(whatever::*)(), whatever*> memberptr;
     char any1[sizeof(std::pair<void(*)(),void*>)];
     char any2[sizeof(std::pair<void(whatever::*)(), whatever*>)];
-    TaskUnion() {}
-    ~TaskUnion() {}
+    TaskUnion() { /* Nothing to do */}
+    ~TaskUnion() { /* Nothing to do */}
   };
 #endif
 
@@ -171,9 +170,8 @@ private:
   }
 
 public:
-
-  Task() {}
-  Task(std::nullptr_t) {}
+  Task() { /* Nothing to do */}
+  Task(std::nullptr_t) { /* Nothing to do */}
   ~Task()
   {
     this->clear();
@@ -210,11 +208,11 @@ private:
   {
     const static TaskVtable vtable {
       // Call:
-      [](TaskUnion& buffer, Args... args) -> R {
+      [](TaskUnion& buffer, Args... args) {
         F* src = reinterpret_cast<F*>(&buffer);
         F code = std::move(*src);
         src->~F();
-        code(std::forward<Args>(args)...);
+        return code(std::forward<Args>(args)...);
       },
       // Destroy:
       std::is_trivially_destructible<F>::value ?
@@ -239,7 +237,7 @@ private:
   {
     const static TaskVtable vtable {
       // Call:
-      [](TaskUnion& buffer, Args... args) -> R {
+      [](TaskUnion& buffer, Args... args) {
         // Delete F when we go out of scope:
         std::unique_ptr<F> code(*reinterpret_cast<F**>(&buffer));
         return (*code)(std::forward<Args>(args)...);
index a374bec..55abdc7 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
@@ -14,6 +14,7 @@
 #include <stdexcept>
 #include <type_traits>
 #include <utility>
+#include <xbt/ex.h>
 
 namespace simgrid {
 namespace xbt {
@@ -33,7 +34,7 @@ class Result {
     exception,
   };
 public:
-  Result() {}
+  Result() { /* Nothing to do */}
   ~Result() { this->reset(); }
 
   // Copy (if T is copyable) and move:
@@ -47,12 +48,14 @@ public:
     switch (that.status_) {
       case ResultStatus::invalid:
         break;
-      case ResultStatus::valid:
+      case ResultStatus::value:
         new (&value_) T(that.value);
         break;
       case ResultStatus::exception:
         new (&exception_) T(that.exception);
         break;
+      default:
+        THROW_IMPOSSIBLE;
     }
     return *this;
   }
@@ -66,7 +69,7 @@ public:
     switch (that.status_) {
       case ResultStatus::invalid:
         break;
-      case ResultStatus::valid:
+      case ResultStatus::value:
         new (&value_) T(std::move(that.value));
         that.value.~T();
         break;
@@ -74,6 +77,8 @@ public:
         new (&exception_) T(std::move(that.exception));
         that.exception.~exception_ptr();
         break;
+      default:
+        THROW_IMPOSSIBLE;
     }
     that.status_ = ResultStatus::invalid;
     return *this;
@@ -94,6 +99,8 @@ public:
       case ResultStatus::exception:
         exception_.~exception_ptr();
         break;
+      default:
+        THROW_IMPOSSIBLE;
     }
     status_ = ResultStatus::invalid;
   }
@@ -123,9 +130,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 +143,8 @@ public:
         std::rethrow_exception(std::move(exception));
         break;
       }
+      default:
+        throw std::logic_error("Invalid result");
     }
   }
 private:
diff --git a/include/xbt/heap.h b/include/xbt/heap.h
deleted file mode 100644 (file)
index 7e4ea84..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (c) 2004-2007, 2009-2011, 2013-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. */
-
-#ifndef XBT_HEAP_H
-#define XBT_HEAP_H
-
-#include "xbt/misc.h"
-#include "xbt/dynar.h"          /* void_f_pvoid_t */
-
-SG_BEGIN_DECL()
-
-/** @addtogroup XBT_heap
- *  @brief This section describes the API to generic heap with O(log(n)) access.
- *
- *  @deprecated If you are using C++ you might want to use `std::priority_queue`
- *  instead.
- *
- *  @{
- */
-/* @brief heap datatype */
-typedef struct xbt_heap *xbt_heap_t;
-
-XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int init_size, void_f_pvoid_t const free_func);
-XBT_PUBLIC(void) xbt_heap_free(xbt_heap_t H);
-XBT_PUBLIC(int) xbt_heap_size(xbt_heap_t H);
-
-XBT_PUBLIC(void) xbt_heap_push(xbt_heap_t H, void *content, double key);
-XBT_PUBLIC(void *) xbt_heap_pop(xbt_heap_t H);
-XBT_PUBLIC(void) xbt_heap_rm_elm(xbt_heap_t H, void *content, double key);
-
-XBT_PUBLIC(double) xbt_heap_maxkey(xbt_heap_t H);
-XBT_PUBLIC(void *) xbt_heap_maxcontent(xbt_heap_t H);
-XBT_PUBLIC(void) xbt_heap_set_update_callback(xbt_heap_t H, void (*update_callback) (void*, int));
-XBT_PUBLIC(void *) xbt_heap_remove(xbt_heap_t H, int i);
-XBT_PUBLIC(void ) xbt_heap_update(xbt_heap_t H, int i, double key);
-
-/* @} */
-SG_END_DECL()
-
-#endif                          /* _XBT_HEAP_H */
index be33e86..7e86ff8 100644 (file)
@@ -1,6 +1,6 @@
 /* log - a generic logging facility in the spirit of log4j                  */
 
-/* Copyright (c) 2004-2015. 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. */
@@ -178,8 +178,8 @@ typedef enum {
 #if defined(XBT_LOG_MAYDAY) /*|| defined (NLOG) * turning logging off */
 # define XBT_LOG_DEFAULT_CATEGORY(cname)
 #else
-# define XBT_LOG_DEFAULT_CATEGORY(cname) \
-   static xbt_log_category_t _XBT_LOGV(default) XBT_ATTRIB_UNUSED = &_XBT_LOGV(cname)
+#define XBT_LOG_DEFAULT_CATEGORY(cname)                                                                                \
+  XBT_ATTRIB_UNUSED static xbt_log_category_t _XBT_LOGV(default) = &_XBT_LOGV(cname)
 #endif
 
 /**
index 905b12c..d12a2f2 100644 (file)
@@ -1,6 +1,6 @@
 /* A thread pool.                                          */
 
-/* Copyright (c) 2007, 2009-2014. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,28 +9,19 @@
 #ifndef XBT_PARMAP_H
 #define XBT_PARMAP_H
 
-#include "xbt/misc.h"           /* SG_BEGIN_DECL */
-#include "xbt/function_types.h"
-#include "xbt/dynar.h"
-
-SG_BEGIN_DECL()
-
 /** \addtogroup XBT_parmap
   * \ingroup XBT_misc
   * \brief Parallel map.
   *
-  * A function is applied to all elements of a dynar in parallel with n worker threads.
-  * The worker threads are persistent until the destruction of the parmap.
+  * A function is applied to all elements of a std::vector in parallel with n worker threads.  The worker threads are
+  * persistent until the destruction of the parmap.
   *
-  * If there are more than n elements in the dynar, the worker threads are allowed to fetch themselves remaining work
-  * with xbt_parmap_next() and execute it.
+  * If there are more than n elements in the vector, the worker threads are allowed to fetch themselves remaining work
+  * with method next() and execute it.
   *
   * \{
   */
 
-/** \brief Parallel map data type (opaque type) */
-typedef struct s_xbt_parmap *xbt_parmap_t;
-
 /** \brief Synchronization mode of the worker threads of a parmap. */
 typedef enum {
   XBT_PARMAP_POSIX,          /**< use POSIX synchronization primitives */
@@ -39,13 +30,6 @@ typedef enum {
   XBT_PARMAP_DEFAULT         /**< futex if available, posix otherwise */
 } e_xbt_parmap_mode_t;
 
-XBT_PUBLIC(xbt_parmap_t) xbt_parmap_new(unsigned int num_workers, e_xbt_parmap_mode_t mode);
-XBT_PUBLIC(void) xbt_parmap_destroy(xbt_parmap_t parmap);
-XBT_PUBLIC(void) xbt_parmap_apply(xbt_parmap_t parmap, void_f_pvoid_t fun, xbt_dynar_t data);
-XBT_PUBLIC(void*) xbt_parmap_next(xbt_parmap_t parmap);
-
 /** \} */
 
-SG_END_DECL()
-
 #endif
index 5c20a9c..be1e7e8 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
@@ -17,7 +17,7 @@ template<class T> class Range {
 public:
   Range()               : begin_(), end_() {}
   Range(T begin, T end) : begin_(std::move(begin)), end_(std::move(end)) {}
-  Range(T value) : begin_(value), end_(value + 1) {}
+  explicit Range(T value) : begin_(value), end_(value + 1) {}
   T& begin()             { return begin_; }
   T& end()               { return end_; }
   const T& begin() const { return begin_; }
index b20852b..a969fbc 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef XBT_REPLAY_HPP
 #define XBT_REPLAY_HPP
 
-#include "xbt/dict.h"
+#include "xbt/misc.h" /* SG_BEGIN_DECL */
 #ifdef __cplusplus
 #include <fstream>
 #include <queue>
index 508822c..d5ad826 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -34,7 +34,7 @@ namespace xbt {
     }
     R operator()(P... args) const
     {
-      for (auto& handler : handlers_)
+      for (auto const& handler : handlers_)
         handler(args...);
     }
     void disconnect_all_slots()
index c89cf98..8068459 100644 (file)
@@ -1,6 +1,6 @@
 /* str.h - XBT string related functions.                                    */
 
-/* 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
@@ -9,9 +9,9 @@
 #ifndef XBT_STR_H
 #define XBT_STR_H
 
-#include "xbt/misc.h"
-#include "xbt/dynar.h"
 #include "xbt/dict.h"
+#include "xbt/dynar.h"
+#include "xbt/misc.h"
 
 #include <stdarg.h>             /* va_* */
 #include <stdio.h>  /* FILE */
@@ -26,22 +26,12 @@ SG_BEGIN_DECL()
  * @{
  */
 
-/* Trim related functions */
-XBT_PUBLIC(void) xbt_str_rtrim(char *s, const char *char_list);
-XBT_PUBLIC(void) xbt_str_ltrim(char *s, const char *char_list);
-XBT_PUBLIC(void) xbt_str_trim(char *s, const char *char_list);
-
 XBT_PUBLIC(xbt_dynar_t) xbt_str_split(const char *s, const char *sep);
 XBT_PUBLIC(xbt_dynar_t) xbt_str_split_quoted(const char *s);
 XBT_PUBLIC(xbt_dynar_t) xbt_str_split_quoted_in_place(char *s);
 
-XBT_PUBLIC(xbt_dynar_t) xbt_str_split_str(const char *s, const char *sep);
-
-XBT_PUBLIC(char *) xbt_str_join(xbt_dynar_t dynar, const char *sep);
 XBT_PUBLIC(char *) xbt_str_join_array(const char *const *strs, const char *sep);
 
-XBT_PUBLIC(void) xbt_str_subst(char *str, char from, char to, int amount);
-
 XBT_PUBLIC(long int) xbt_str_parse_int(const char* str, const char* error_msg);
 XBT_PUBLIC(double) xbt_str_parse_double(const char* str, const char* error_msg);
 
index cafddcb..1916178 100644 (file)
@@ -8,17 +8,17 @@
 
 #include <simgrid_config.h>
 
-#include <string>
 #include <cstdarg>
-#include <stdlib.h>
+#include <cstdlib>
+#include <string>
 
 #if SIMGRID_HAVE_MC
 
-#include <stdexcept>
+#include <algorithm>
 #include <cstddef>
-#include <cstdlib>
 #include <cstring>
 #include <iterator>
+#include <stdexcept>
 
 #include <xbt/sysdep.h>
 
@@ -55,9 +55,9 @@ struct string_data {
  *    does not use refcouting/COW but has a small string optimization.
  */
 XBT_PUBLIC_CLASS string : private string_data {
-  static const char NUL;
-public:
+  static char NUL;
 
+public:
   // Types
   typedef std::size_t size_type;
   typedef std::ptrdiff_t difference_type;
@@ -72,7 +72,7 @@ public:
   ~string()
   {
     if (string_data::data != &NUL)
-      std::free(string_data::data);
+      delete[] string_data::data;
   }
 
   // Ctors
@@ -80,15 +80,15 @@ public:
   {
     if (size == 0) {
       string_data::len = 0;
-      string_data::data = const_cast<char*>(&NUL);
+      string_data::data = &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';
     }
   }
-  string() : string (const_cast<char*>(&NUL), 0) {}
+  string() : string(&NUL, 0) {}
   string(const char* s) : string(s, strlen(s)) {}
   string(string const& s) : string(s.c_str(), s.size()) {}
   string(string&& s)
@@ -96,22 +96,22 @@ public:
     string_data::len = s.string_data::len;
     string_data::data = s.string_data::data;
     s.string_data::len = 0;
-    s.string_data::data = const_cast<char*>(&NUL);
+    s.string_data::data = &NUL;
   }
-  string(std::string const& s) : string(s.c_str(), s.size()) {}
+  explicit string(std::string const& s) : string(s.c_str(), s.size()) {}
 
   // Assign
   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';
     }
   }
@@ -137,7 +137,7 @@ public:
   size_t size() const   { return len; }
   size_t length() const { return len; }
   bool empty() const    { return len != 0; }
-  void shrink_to_fit() {}
+  void shrink_to_fit() { /* Being there, but doing nothing */}
 
   // Alement access
   char* data()              { return string_data::data; }
@@ -165,6 +165,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
@@ -180,7 +181,7 @@ public:
   void clear()
   {
     string_data::len = 0;
-    string_data::data = const_cast<char*>(&NUL);
+    string_data::data = &NUL;
   }
 
   bool equals(const char* data, std::size_t len) const
@@ -299,14 +300,13 @@ typedef std::string string;
  *
  * @ingroup XBT_str
 */
-std::string string_printf(const char *fmt, ...);
+XBT_PUBLIC(std::string) string_printf(const char* fmt, ...);
 
 /** Create a C++ string from a C-style format
  *
  * @ingroup XBT_str
 */
-std::string string_vprintf(const char *fmt, va_list ap);
-
+XBT_PUBLIC(std::string) string_vprintf(const char* fmt, va_list ap);
 }
 }
 
index 0f25e2b..f56e8f6 100644 (file)
@@ -74,6 +74,7 @@ struct xbt_swag {
 };
 typedef struct xbt_swag  s_xbt_swag_t;
 typedef struct xbt_swag* xbt_swag_t;
+typedef const struct xbt_swag* const_xbt_swag_t;
 
 /**< A typical swag */
 /* @} */
@@ -108,13 +109,13 @@ XBT_PUBLIC(void) xbt_swag_insert_at_head(void *obj, xbt_swag_t swag);
 XBT_PUBLIC(void) xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag);
 XBT_PUBLIC(void *) xbt_swag_remove(void *obj, xbt_swag_t swag);
 XBT_PUBLIC(void *) xbt_swag_extract(xbt_swag_t swag);
-XBT_PUBLIC(int) xbt_swag_size(xbt_swag_t swag);
+XBT_PUBLIC(int) xbt_swag_size(const_xbt_swag_t swag);
 
 #define xbt_swag_getPrev(obj, offset) (((xbt_swag_hookup_t)(((char *) (obj)) + (offset)))->prev)
 #define xbt_swag_getNext(obj, offset) (((xbt_swag_hookup_t)(((char *) (obj)) + (offset)))->next)
 #define xbt_swag_belongs(obj, swag) (xbt_swag_getNext((obj), (swag)->offset) || (swag)->tail == (obj))
 
-static inline void *xbt_swag_getFirst(xbt_swag_t swag)
+static inline void *xbt_swag_getFirst(const_xbt_swag_t swag)
 {
   return (swag->head);
 }
index fac49a7..3cbeb65 100644 (file)
@@ -2,7 +2,7 @@
 /*  no system header should be loaded out of this file so that we have only */
 /*  one file to check when porting to another OS                            */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@ SG_BEGIN_DECL()
  * @{
  */
 /** @brief Kill the program in silence */
-XBT_PUBLIC(void) XBT_ATTRIB_NORETURN xbt_abort(void);
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void) xbt_abort(void);
 
 /**
  * @brief Kill the program with an error message
@@ -76,13 +76,7 @@ XBT_PUBLIC(void) xbt_backtrace_display_current();
 /** @brief Like malloc, but xbt_die() on error
     @hideinitializer */
 static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) {
-  void *res;
-/*  if (n==0) {
-     xbt_backtrace_display_current();
-     xbt_die("malloc(0) is not portable");
-  }*/
-
-  res = malloc(n);
+  void* res = malloc(n);
   if (!res)
     xbt_die("Memory allocation of %lu bytes failed", (unsigned long)n);
   return res;
@@ -91,9 +85,7 @@ static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) {
 /** @brief like malloc, but xbt_die() on error and memset data to 0
     @hideinitializer */
 static XBT_ALWAYS_INLINE void *xbt_malloc0(size_t n) {
-  void *res;
-  //if (n==0) xbt_die("calloc(0) is not portable");
-  res = calloc(n, 1);
+  void* res = calloc(n, 1);
   if (!res)
     xbt_die("Memory callocation of %lu bytes failed", (unsigned long)n);
   return res;
@@ -103,7 +95,6 @@ static XBT_ALWAYS_INLINE void *xbt_malloc0(size_t n) {
     @hideinitializer */
 static XBT_ALWAYS_INLINE void *xbt_realloc(void *p, size_t s) {
   void *res = NULL;
-  //if (s==0) xbt_die("realloc(0) is not portable");
   if (s) {
     if (p) {
       res = realloc(p, s);
index 095130f..e577631 100644 (file)
@@ -1,14 +1,27 @@
-/* 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#ifndef XBT_UTILITY_HPP
+#define XBT_UTILITY_HPP
+
 #include <tuple>
 
 namespace simgrid {
 namespace xbt {
 
+/** @brief Comparator class for using with std::priority_queue or boost::heap.
+ *
+ * Compare two std::pair by their first element (of type double), and return true when the first is greater than the
+ * second.  Useful to have priority queues with the smallest element on top.
+ */
+template <class Pair> class HeapComparator {
+public:
+  bool operator()(const Pair& a, const Pair& b) const { return a.first > b.first; }
+};
+
 // integer_sequence and friends from C++14
 // We need them to implement `apply` from C++17.
 
@@ -78,3 +91,4 @@ static_assert(std::is_same< index_sequence_for<int,double,float>, make_index_seq
 
 }
 }
+#endif
index fa4c014..23b8fc8 100644 (file)
@@ -30,19 +30,18 @@ XBT_PUBLIC(int) xbt_os_get_numcores(void);
 typedef struct xbt_os_thread_ *xbt_os_thread_t;
 XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_create(const char *name, pvoid_f_pvoid_t start_routine, void *param, void *data);
 XBT_PUBLIC(void) xbt_os_thread_exit(int *retcode);
-XBT_PUBLIC(void) xbt_os_thread_detach(xbt_os_thread_t thread);
 
 XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_self(void);
 XBT_PUBLIC(const char *) xbt_os_thread_self_name(void);
 XBT_PUBLIC(void) xbt_os_thread_set_extra_data(void *data);
 XBT_PUBLIC(void *) xbt_os_thread_get_extra_data(void);
 XBT_PUBLIC(void) xbt_os_thread_key_create(xbt_os_thread_key_t* key);
+XBT_PUBLIC(void) xbt_os_thread_key_destroy(xbt_os_thread_key_t key);
 XBT_PUBLIC(void) xbt_os_thread_set_specific(xbt_os_thread_key_t key, void* value);
 XBT_PUBLIC(void*) xbt_os_thread_get_specific(xbt_os_thread_key_t key);
   /* xbt_os_thread_join frees the joined thread (ie the XBT wrapper around it, the OS frees the rest) */
 XBT_PUBLIC(void) xbt_os_thread_join(xbt_os_thread_t thread, void **thread_return);
 XBT_PUBLIC(void) xbt_os_thread_yield(void);
-XBT_PUBLIC(void) xbt_os_thread_cancel(xbt_os_thread_t thread);
 XBT_PUBLIC(void) xbt_os_thread_setstacksize(int stack_size);
 XBT_PUBLIC(void) xbt_os_thread_setguardsize(int guard_size);
 XBT_PUBLIC(int) xbt_os_thread_bind(xbt_os_thread_t thread, int core);
index bf87105..ab7e012 100644 (file)
@@ -13,13 +13,18 @@ sonar.sources=src,examples,include,teshsuite
 
 
 # Disable some rules on some files
-sonar.issue.ignore.multicriteria=j1,jni1,jni2,c1,c2a,c2b,c3,c4a,c4b,c5a,c5b,f1
+sonar.issue.ignore.multicriteria=j1,j2,jni1,jni2,c1,c2a,c2b,c3,c4a,c4b,c5a,c5b,c6a,c6b,f1
 
 # The Object.finalize() method should not be overriden
 # But we need to clean the native memory with JNI
 sonar.issue.ignore.multicriteria.j1.ruleKey=squid:ObjectFinalizeOverridenCheck
 sonar.issue.ignore.multicriteria.j1.resourceKey=**/*.java
 
+# Throwable.printStackTrace(...) should not be called
+# But we don't have no better mechanism, and our Java apps are not rocket science
+sonar.issue.ignore.multicriteria.j2.ruleKey=squid:S1148
+sonar.issue.ignore.multicriteria.j2.resourceKey=**/*.java
+
 # "reinterpret_cast" should not be used
 # But this is exactly intended to store a pointer into a long -- what we do here
 sonar.issue.ignore.multicriteria.jni1.ruleKey=cpp:S3630
@@ -62,6 +67,13 @@ sonar.issue.ignore.multicriteria.c5a.resourceKey=**/*.cpp
 sonar.issue.ignore.multicriteria.c5b.ruleKey=cpp:S3659
 sonar.issue.ignore.multicriteria.c5b.resourceKey=**/*.hpp
 
+# Dynamically allocated memory should be released
+# We have better ways to detect memleaks in SimGrid
+# This is not disabled in example/ because our code should be nice looking
+sonar.issue.ignore.multicriteria.c6a.ruleKey=cpp:S3584
+sonar.issue.ignore.multicriteria.c6a.resourceKey=src/**/*.cpp
+sonar.issue.ignore.multicriteria.c6b.ruleKey=cpp:S3584
+sonar.issue.ignore.multicriteria.c6b.resourceKey=teshsuite/**/*.cpp
 
 # "reinterpret_cast" should not be used
 # But we need this to interface C and Fortran
@@ -91,13 +103,15 @@ sonar.cfamily.gcov.reportsPath=Testing/CoverageInfo
 # Files to ignore from coverage analysis:
 #   - foreign test suites
 #   - platform files (I fail to get sonar ignore *.xml files)
-sonar.coverage.exclusions=teshsuite/smpi/isp/**,teshsuite/smpi/mpich3-test/**,examples/platforms/**
+#   - Java code, examples and tests
+sonar.coverage.exclusions=teshsuite/smpi/isp/**,teshsuite/smpi/mpich3-test/**,examples/platforms/**,src/bindings/java/**,examples/java/**,teshsuite/java/**
 
 # Encoding of the source files
 sonar.sourceEncoding=UTF-8
 
 # Version of the used prog languages
 sonar.java.source=7
+sonar.java.binaries=CMakeFiles/simgrid-java_jar.dir,examples/java
 sonar.c.std=gnu11
 sonar.cpp.std=gnu++11
 
index e39a7b9..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>
@@ -47,10 +47,7 @@ JavaContext* JavaContextFactory::create_context(
 
 void JavaContextFactory::run_all()
 {
-  xbt_dynar_t processes = SIMIX_process_get_runnable();
-  smx_actor_t process;
-  unsigned int cursor;
-  xbt_dynar_foreach(processes, cursor, process) {
+  for (smx_actor_t const& process : simgrid::simix::process_get_runnable()) {
     static_cast<JavaContext*>(process->context)->resume();
   }
 }
@@ -133,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 4f76619..44f5f5f 100644 (file)
@@ -5,23 +5,26 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <locale.h>
+#include <algorithm>
+#include <clocale>
+#include <string>
 
 #include "simgrid/msg.h"
 #include "simgrid/plugins/energy.h"
+#include "simgrid/plugins/file_system.h"
 #include "simgrid/simix.h"
 
 #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"
 
@@ -36,7 +39,7 @@
 #endif
 /* end of eclipse-mandated pimple */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int JAVA_HOST_LEVEL = -1;
 
@@ -84,10 +87,6 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv * env, jclass
   return (jdouble) MSG_get_clock();
 }
 
-static void __JAVA_host_priv_free(void *host)
-{
-}
-
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs)
 {
   int argc = 0;
@@ -122,7 +121,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, j
 
   MSG_init(&argc, argv);
 
-  JAVA_HOST_LEVEL = simgrid::s4u::Host::extension_create(__JAVA_host_priv_free);
+  JAVA_HOST_LEVEL = simgrid::s4u::Host::extension_create(nullptr);
 
   for (int index = 0; index < argc - 1; index++) {
     env->SetObjectArrayElement(jargs, index, (jstring)env->NewStringUTF(argv[index + 1]));
@@ -154,7 +153,7 @@ JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv * env, jclass
   xbt_dynar_free(&hosts);
 
   /* Cleanup java storages */
-  for (auto elm : java_storage_map)
+  for (auto const& elm : java_storage_map)
     jstorage_unref(env, elm.second);
 }
 
@@ -242,7 +241,11 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() {
   sg_host_energy_plugin_init();
 }
 
-SG_END_DECL()
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_fileSystemInit()
+{
+  sg_storage_file_system_init();
+}
+} // extern "C"
 
 /** Run a Java org.simgrid.msg.Process
  *
@@ -269,9 +272,9 @@ static int java_main(int argc, char *argv[])
   simgrid::kernel::context::JavaContext* context = static_cast<simgrid::kernel::context::JavaContext*>(SIMIX_context_self());
 
   //Change the "." in class name for "/".
-  xbt_str_subst(argv[0],'.','/',0);
-  jclass class_Process = env->FindClass(argv[0]);
-  xbt_str_subst(argv[0],'/','.',0);
+  std::string arg0 = argv[0];
+  std::replace(begin(arg0), end(arg0), '.', '/');
+  jclass class_Process = env->FindClass(arg0.c_str());
   //Retrieve the methodID for the constructor
   xbt_assert((class_Process != nullptr), "Class not found (%s). The deployment file must use the fully qualified class name, including the package. The case is important.", argv[0]);
   jmethodID constructor_Process = env->GetMethodID(class_Process, "<init>", "(Lorg/simgrid/msg/Host;Ljava/lang/String;[Ljava/lang/String;)V");
similarity index 54%
rename from src/bindings/java/jmsg.h
rename to src/bindings/java/jmsg.hpp
index c0e7e2d..e7d0919 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,29 @@ 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_fileSystemInit();
+
+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 cd344be..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;
@@ -78,7 +78,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, job
     return nullptr;
   }
 
-  for (auto tmp_as : *self_as->getChildren()) {
+  for (auto const& tmp_as : *self_as->getChildren()) {
     jobject tmp_jas = jnetzone_new_instance(env);
     if (not tmp_jas) {
       jxbt_throw_jni(env, "java As instantiation failed");
@@ -140,7 +140,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
   }
 
   int index = 0;
-  for (auto host : table) {
+  for (auto const& host : table) {
     jhost = static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
     if (not jhost) {
       jname = env->NewStringUTF(host->getCname());
@@ -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 8d52bfe..da8c34d 100644 (file)
@@ -6,13 +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;
@@ -63,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);
@@ -79,7 +81,7 @@ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Comm_test(JNIEnv *env, jobject j
   }
 
   if (not comm) {
-    jxbt_throw_null(env, bprintf("comm is null"));
+    jxbt_throw_null(env, "comm is null");
     return JNI_FALSE;
   }
 
@@ -99,7 +101,7 @@ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Comm_test(JNIEnv *env, jobject j
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitCompletion(JNIEnv *env, jobject jcomm, jdouble timeout) {
   msg_comm_t comm = (msg_comm_t) (uintptr_t) env->GetLongField(jcomm, jcomm_field_Comm_bind);
   if (not comm) {
-    jxbt_throw_null(env, bprintf("comm is null"));
+    jxbt_throw_null(env, "comm is null");
     return;
   }
 
@@ -121,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);
@@ -130,7 +132,7 @@ static msg_comm_t* jarray_to_commArray(JNIEnv *env, jobjectArray jcomms, /* OUT
 
      comms[i] = (msg_comm_t) (uintptr_t) env->GetLongField(jcomm, jcomm_field_Comm_bind);
      if (not comms[i]) {
-       jxbt_throw_null(env, bprintf("comm at rank %d is null", i));
+       jxbt_throw_null(env, std::string("comm at rank ") + std::to_string(i) + " is null");
        return nullptr;
      }
 
@@ -146,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)
 {
@@ -160,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 e2208b3..22c54da 100644 (file)
@@ -7,15 +7,16 @@
 
 #include "simgrid/plugins/energy.h"
 #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;
@@ -55,7 +56,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName(JNIEnv * env, jcla
 
   /* get the C string from the java string */
   if (jname == nullptr) {
-    jxbt_throw_null(env,bprintf("No host can have a null name"));
+    jxbt_throw_null(env, "No host can have a null name");
     return nullptr;
   }
   const char *name = env->GetStringUTFChars(jname, 0);
@@ -237,8 +238,8 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEn
 
   int index = 0;
   jobjectArray jtable;
-  xbt_dict_t dict =  MSG_host_get_mounted_storage_list(host);
-  int count = xbt_dict_length(dict);
+  std::unordered_map<std::string, msg_storage_t> mounted_storages = host->getMountedStorages();
+  int count  = mounted_storages.size();
   jclass cls = env->FindClass("org/simgrid/msg/Storage");
 
   jtable = env->NewObjectArray((jsize) count, cls, nullptr);
@@ -248,17 +249,12 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEn
     return nullptr;
   }
 
-  xbt_dict_cursor_t cursor=nullptr;
-  const char* mount_name;
-  const char* storage_name;
-
-  xbt_dict_foreach(dict,cursor,mount_name,storage_name) {
-    jname = env->NewStringUTF(storage_name);
+  for (auto const& elm : mounted_storages) {
+    jname    = env->NewStringUTF(elm.second->getCname());
     jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname);
     env->SetObjectArrayElement(jtable, index, jstorage);
     index++;
   }
-  xbt_dict_free(&dict);
   return jtable;
 }
 
@@ -378,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 2676857..1d4b58e 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;
@@ -91,6 +91,18 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject
   env->SetIntField(jprocess, jprocess_field_Process_ppid, (jint) MSG_process_get_PPID(process));
 }
 
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess)
+{
+  msg_process_t process = jprocess_to_native(jprocess, env);
+
+  if (not process) {
+    jxbt_throw_notbound(env, "process", jprocess);
+    return;
+  }
+
+  MSG_process_daemonize(process);
+}
+
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv * env, jclass cls, jint jresetPID)
 {
   return (jint) MSG_process_killall((int) jresetPID);
@@ -101,7 +113,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv * env, jcl
   msg_process_t process = MSG_process_from_PID(pid);
 
   if (not process) {
-    jxbt_throw_process_not_found(env, bprintf("PID = %d",static_cast<int>(pid)));
+    jxbt_throw_process_not_found(env, std::string("PID = ") + std::to_string(static_cast<int>(pid)));
     return nullptr;
   }
 
@@ -156,7 +168,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_suspend(JNIEnv * env, jobjec
   /* try to suspend the process */
   msg_error_t rv = MSG_process_suspend(process);
 
-  jxbt_check_res("MSG_process_suspend()", rv, MSG_OK, bprintf("unexpected error , please report this bug"));
+  jxbt_check_res("MSG_process_suspend()", rv, MSG_OK, "unexpected error , please report this bug");
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume(JNIEnv * env, jobject jprocess)
@@ -170,7 +182,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume(JNIEnv * env, jobject
 
   /* try to resume the process */
   msg_error_t res = MSG_process_resume(process);
-  jxbt_check_res("MSG_process_resume()", res, MSG_OK, bprintf("unexpected error , please report this bug"));
+  jxbt_check_res("MSG_process_resume()", res, MSG_OK, "unexpected error , please report this bug");
 }
 
 JNIEXPORT void
@@ -187,21 +199,15 @@ JNICALL Java_org_simgrid_msg_Process_setAutoRestart (JNIEnv *env, jobject jproce
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart (JNIEnv *env, jobject jprocess) {
   msg_process_t process = jprocess_to_native(jprocess, env);
-  xbt_ex_t e;
 
   if (not process) {
     jxbt_throw_notbound(env, "process", jprocess);
     return;
   }
 
-  try {
-    MSG_process_restart(process);
-  }
-  catch (xbt_ex& e) {
-    // Nothing to do
-  }
-
+  MSG_process_restart(process);
 }
+
 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env, jobject jprocess)
 {
   msg_process_t process = jprocess_to_native(jprocess, env);
@@ -223,13 +229,6 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cl
   if (rv != MSG_OK) {
     XBT_DEBUG("Something during the MSG_process_sleep invocation was wrong, trigger a HostFailureException");
 
-    //jmsg_throw_status(env,rv);
-
-    // adsein, the code above as been replaced by the code below. Indeed, according to the documentation, a sleep can only
-    // trigger a host_failure exception. When the sleep crashes due to a host shutdown, the exception thrown by smx_context_java.c
-    // is a cancelled_error, see bindings/java/smx_context_java.c, function void smx_ctx_java_stop(smx_context_t context) and src/msg/msg_gos.c
-    // function  msg_error_t MSG_process_sleep(double nb_sec)
-
     jxbt_throw_host_failure(env, "");
   }
 }
@@ -302,5 +301,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 f771824..597f5b2 100644 (file)
@@ -47,6 +47,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_nativeInit(JNIEnv *env, jcla
 /* Implement the Java API */
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject jprocess_arg, jobject jhostname);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess);
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv* env, jclass cls, jint jresetPID);
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv* env, jclass cls, jint pid);
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv* env, jobject jprocess, jobject jname);
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 2d3a029..a31349d 100644 (file)
@@ -7,13 +7,15 @@
 
 #include "simgrid/msg.h"
 
-#include "jmsg.h"
+#include "include/xbt/signal.hpp"
+#include "jmsg.hpp"
 #include "jmsg_storage.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
+#include "simgrid/s4u/Storage.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jstorage_method_Storage_constructor;
 static jfieldID jstorage_field_Storage_bind;
@@ -56,7 +58,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, j
 
   /* get the C string from the java string */
   if (jname == nullptr) {
-    jxbt_throw_null(env,bprintf("No host can have a null name"));
+    jxbt_throw_null(env, "No host can have a null name");
     return nullptr;
   }
   const char *name = env->GetStringUTFChars(jname, 0);
@@ -164,9 +166,8 @@ Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject
   }
   const char *name = env->GetStringUTFChars((jstring) jname, 0);
   const char *value_java = env->GetStringUTFChars((jstring) jvalue, 0);
-  char *value = xbt_strdup(value_java);
 
-  MSG_storage_set_property_value(storage, name, value);
+  storage->setProperty(name, std::string(value_java));
 
   env->ReleaseStringUTFChars((jstring) jvalue, value_java);
   env->ReleaseStringUTFChars((jstring) jname, name);
@@ -227,5 +228,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv * env, jc
   xbt_dynar_free(&table);
   return jtable;
 }
-
-SG_END_DECL()
+}
index 4fd0836..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;
 
@@ -33,9 +33,8 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_acquire(JNIEnv * env, jobject
   xbt_mutex_t mutex = (xbt_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
   try {
     xbt_mutex_acquire(mutex);
-  }
-  catch(xbt_ex& e) {
-    // Nothing to do
+  } catch (xbt_ex const& e) {
+    XBT_DEBUG("Caught an exception: %s", e.what());
   }
 }
 
@@ -95,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 47dfe47..6c41d3e 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)
@@ -112,7 +116,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel(JNIEnv * env, jobject jt
 
   msg_error_t rv = MSG_task_cancel(ptask);
 
-  jxbt_check_res("MSG_task_cancel()", rv, MSG_OK, bprintf("unexpected error , please report this bug"));
+  jxbt_check_res("MSG_task_cancel()", rv, MSG_OK, "unexpected error , please report this bug");
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute(JNIEnv * env, jobject jtask)
@@ -201,7 +205,7 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount(JNIEnv * env,
     jxbt_throw_notbound(env, "task", jtask);
     return -1;
   }
-  return (jdouble) MSG_task_get_flops_amount(ptask);
+  return (jdouble)MSG_task_get_remaining_work_ratio(ptask);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname) {
@@ -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 d7e9ea1..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;
@@ -77,7 +77,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv* env, jobject jVm,
   env->ReleaseStringUTFChars(jname, name);
 
   jvm_bind(env, jVm, vm);
-  jVm = env->NewWeakGlobalRef(jVm);
+  jVm = env->NewGlobalRef(jVm);
   // We use the extension level of the host, even if that's somehow disturbing
   vm->extension_set(JAVA_HOST_LEVEL, (void*)jVm);
 }
@@ -136,11 +136,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm
   if (vm) {
     MSG_vm_shutdown(vm);
     auto vmList = &simgrid::vm::VirtualMachineImpl::allVms_;
-    vmList->erase(
-        std::remove_if(vmList->begin(), vmList->end(), [vm](simgrid::s4u::VirtualMachine* it) {
-          return vm == it;
-        }),
-        vmList->end());
+    vmList->erase(std::remove(vmList->begin(), vmList->end(), vm), vmList->end());
   }
 }
 
@@ -174,7 +170,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclas
 
   /* get the C string from the java string */
   if (jname == nullptr) {
-    jxbt_throw_null(env, bprintf("No VM can have a null name"));
+    jxbt_throw_null(env, "No VM can have a null name");
     return nullptr;
   }
   const char* name = env->GetStringUTFChars(jname, 0);
@@ -190,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 c33ba63..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)
 {
@@ -178,16 +178,24 @@ JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet
   env->ReleaseStringUTFChars(jvar, variable);
 }
 /* Missing calls
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableAdd (JNIEnv *, jclass, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSub (JNIEnv *env, jclass cls, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSetWithTime (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableAddWithTime (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSubWithTime (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableAdd (JNIEnv *, jclass, jstring, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSub (JNIEnv *, jclass, jstring, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSetWithTime (JNIEnv *env, jclass cls, jdouble, jstring, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcdstVariableAddWithTime (JNIEnv *env, jclass cls, jdouble, jstring, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime (JNIEnv *env, jclass cls, jdouble, jstring, jstring, jstring, jdouble);
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableAdd(JNIEnv *, jclass, jstring, jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSub(JNIEnv *env, jclass cls, jstring, jstring,
+                                                                       jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSetWithTime(JNIEnv *, jclass, jdouble, jstring,
+                                                                               jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableAddWithTime(JNIEnv *, jclass, jdouble, jstring,
+                                                                               jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSubWithTime(JNIEnv *, jclass, jdouble, jstring,
+                                                                               jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableAdd(JNIEnv *, jclass, jstring, jstring,
+                                                                             jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSub(JNIEnv *, jclass, jstring, jstring,
+                                                                             jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSetWithTime(JNIEnv *env, jclass cls, jdouble,
+                                                                                     jstring, jstring, jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcdstVariableAddWithTime(JNIEnv *env, jclass cls, jdouble,
+                                                                                     jstring, jstring, jstring, jdouble)
+   JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime(JNIEnv *env, jclass cls, jdouble,
+                                                                                     jstring, jstring, jstring, jdouble)
 */
-
-SG_END_DECL()
+}
index 128f077..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 <stdlib.h> /* abort */
+#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 b53f5b5..cc1cb7d 100644 (file)
@@ -1,7 +1,6 @@
 /* JNI interface to C code for MSG. */
 
-/* Copyright (c) 2006-2014. 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. */
@@ -41,6 +40,7 @@ public final class Msg {
        
        /** Tell the kernel that you want to use the energy plugin */
        public static final native void energyInit();
+       public static final native void fileSystemInit();
 
        /** Run the MSG simulation.
         *
@@ -59,9 +59,8 @@ public final class Msg {
 
        /** Example launcher. You can use it or provide your own launcher, as you wish
         * @param args
-        * @throws MsgException
         */
-       public static void main(String[]args) throws MsgException {
+       public static void main(String[]args) {
                /* initialize the MSG simulation. Must be done before anything else (even logging). */
                Msg.init(args);
 
index 43dc342..e4c7900 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006-2014. 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. */
@@ -281,11 +280,10 @@ public abstract class Process implements Runnable {
        /**
         * This method actually creates and run the process.
         * It is a noop if the process is already launched.
-        * @throws HostNotFoundException
         */
-       public final void start() throws HostNotFoundException {
-               if (bind == 0)
-                        create(host);
+       public final void start() {
+          if (bind == 0)
+            create(host);
        }
 
        /** This method runs the process. It calls the method function that you must overwrite. */
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 6f9f856..e7c3370 100644 (file)
@@ -1,26 +1,25 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* 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                                                     */
 
-#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"
-#include <ctype.h>
-#include <string.h>
+#include <cctype>
+#include <cstring>
 
 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/host.h>
+#include <simgrid/s4u/Host.hpp>
 #include <string>
 #include <vector>
 
@@ -91,8 +90,9 @@ int console_add_backbone(lua_State *L) {
   lua_pop(L, 1);
 
   lua_pushstring(L, "sharing_policy");
-  type = lua_gettable(L, -2);
+  lua_gettable(L, -2);
   const char* policy = lua_tostring(L, -1);
+  lua_pop(L, 1);
   if (policy && not strcmp(policy, "FULLDUPLEX")) {
     link.policy = SURF_LINK_FULLDUPLEX;
   } else if (policy && not strcmp(policy, "FATPIPE")) {
@@ -102,18 +102,16 @@ int console_add_backbone(lua_State *L) {
   }
 
   sg_platf_new_link(&link);
-  routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(link.id.c_str()));
+  routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(link.id));
 
   return 0;
 }
 
 int console_add_host___link(lua_State *L) {
-  s_sg_platf_host_link_cbarg_t hostlink;
-  memset(&hostlink,0,sizeof(hostlink));
+  HostLinkCreationArgs hostlink;
   int type;
 
-  lua_ensure(lua_istable(L, -1),
-      "Bad Arguments to create host_link in Lua. Should be a table with named arguments.");
+  lua_ensure(lua_istable(L, -1), "Bad Arguments to create host_link in Lua. Should be a table with named arguments.");
 
   lua_pushstring(L, "id");
   type = lua_gettable(L, -2);
@@ -135,7 +133,7 @@ int console_add_host___link(lua_State *L) {
   hostlink.link_down = lua_tostring(L, -1);
   lua_pop(L, 1);
 
-  XBT_DEBUG("Create a host_link for host %s", hostlink.id);
+  XBT_DEBUG("Create a host_link for host %s", hostlink.id.c_str());
   sg_platf_new_hostlink(&hostlink);
 
   return 0;
@@ -143,7 +141,6 @@ int console_add_host___link(lua_State *L) {
 
 int console_add_host(lua_State *L) {
   s_sg_platf_host_cbarg_t host;
-  memset(&host,0,sizeof(host));
   int type;
 
   // we get values from the table passed as argument
@@ -285,8 +282,7 @@ int  console_add_link(lua_State *L) {
  * add Router to AS components
  */
 int console_add_router(lua_State* L) {
-  lua_ensure(lua_istable(L, -1),
-      "Bad Arguments to create router, Should be a table with named arguments");
+  lua_ensure(lua_istable(L, -1), "Bad Arguments to create router, Should be a table with named arguments");
 
   lua_pushstring(L, "id");
   int type = lua_gettable(L, -2);
@@ -307,7 +303,6 @@ int console_add_router(lua_State* L) {
 int console_add_route(lua_State *L) {
   XBT_DEBUG("Adding route");
   s_sg_platf_route_cbarg_t route;
-  memset(&route,0,sizeof(route));
   int type;
 
   lua_ensure(lua_istable(L, -1), "Bad Arguments to add a route. Should be a table with named arguments");
@@ -332,19 +327,18 @@ int console_add_route(lua_State *L) {
   type = lua_gettable(L,-2);
   lua_ensure(type == LUA_TSTRING,
       "Attribute 'links' must be specified for any route and must be a string (different links separated by commas or single spaces.");
-  route.link_list   = new std::vector<simgrid::surf::LinkImpl*>();
   std::vector<std::string> names;
   const char* str = lua_tostring(L, -1);
   boost::split(names, str, boost::is_any_of(", \t\r\n"));
   if (names.empty()) {
     /* unique name */
-    route.link_list->push_back(simgrid::surf::LinkImpl::byName(lua_tostring(L, -1)));
+    route.link_list.push_back(simgrid::surf::LinkImpl::byName(lua_tostring(L, -1)));
   } else {
     // Several names separated by , \t\r\n
-    for (auto name : names) {
+    for (auto const& name : names) {
       if (name.length() > 0) {
-        simgrid::surf::LinkImpl* link = simgrid::surf::LinkImpl::byName(name.c_str());
-        route.link_list->push_back(link);
+        simgrid::surf::LinkImpl* link = simgrid::surf::LinkImpl::byName(name);
+        route.link_list.push_back(link);
       }
     }
   }
@@ -374,14 +368,12 @@ int console_add_route(lua_State *L) {
   route.gw_dst = nullptr;
 
   sg_platf_new_route(&route);
-  delete route.link_list;
 
   return 0;
 }
 
 int console_add_ASroute(lua_State *L) {
   s_sg_platf_route_cbarg_t ASroute;
-  memset(&ASroute,0,sizeof(ASroute));
 
   lua_pushstring(L, "src");
   lua_gettable(L, -2);
@@ -413,19 +405,18 @@ int console_add_ASroute(lua_State *L) {
 
   lua_pushstring(L,"links");
   lua_gettable(L,-2);
-  ASroute.link_list = new std::vector<simgrid::surf::LinkImpl*>();
   std::vector<std::string> names;
   const char* str = lua_tostring(L, -1);
   boost::split(names, str, boost::is_any_of(", \t\r\n"));
   if (names.empty()) {
     /* unique name with no comma */
-    ASroute.link_list->push_back(simgrid::surf::LinkImpl::byName(lua_tostring(L, -1)));
+    ASroute.link_list.push_back(simgrid::surf::LinkImpl::byName(lua_tostring(L, -1)));
   } else {
     // Several names separated by , \t\r\n
-    for (auto name : names) {
+    for (auto const& name : names) {
       if (name.length() > 0) {
-        simgrid::surf::LinkImpl* link = simgrid::surf::LinkImpl::byName(name.c_str());
-        ASroute.link_list->push_back(link);
+        simgrid::surf::LinkImpl* link = simgrid::surf::LinkImpl::byName(name);
+        ASroute.link_list.push_back(link);
       }
     }
   }
@@ -446,29 +437,24 @@ int console_add_ASroute(lua_State *L) {
   lua_pop(L,1);
 
   sg_platf_new_route(&ASroute);
-  delete ASroute.link_list;
 
   return 0;
 }
 
 int console_AS_open(lua_State *L) {
- const char *id;
- const char *mode;
- int type;
-
  XBT_DEBUG("Opening AS");
 
  lua_ensure(lua_istable(L, 1), "Bad Arguments to AS_open, Should be a table with named arguments");
 
  lua_pushstring(L, "id");
- type = lua_gettable(L, -2);
int type = lua_gettable(L, -2);
  lua_ensure(type == LUA_TSTRING, "Attribute 'id' must be specified for any AS and must be a string.");
- id = lua_tostring(L, -1);
const char* id = lua_tostring(L, -1);
  lua_pop(L, 1);
 
  lua_pushstring(L, "mode");
  lua_gettable(L, -2);
- mode = lua_tostring(L, -1);
const char* mode = lua_tostring(L, -1);
  lua_pop(L, 1);
 
  int mode_int = A_surfxml_AS_routing_None;
@@ -488,10 +474,10 @@ int console_AS_open(lua_State *L) {
    mode_int = A_surfxml_AS_routing_None;
  else xbt_die("Don't have the model name '%s'",mode);
 
s_sg_platf_AS_cbarg_t AS;
ZoneCreationArgs AS;
  AS.id = id;
  AS.routing = mode_int;
- simgrid::s4u::NetZone* new_as = sg_platf_new_AS_begin(&AS);
+ simgrid::s4u::NetZone* new_as = sg_platf_new_Zone_begin(&AS);
 
  /* Build a Lua representation of the new AS on the stack */
  lua_newtable(L);
@@ -506,37 +492,33 @@ int console_AS_open(lua_State *L) {
 }
 int console_AS_seal(lua_State *L) {
   XBT_DEBUG("Sealing AS");
-  sg_platf_new_AS_seal();
+  sg_platf_new_Zone_seal();
   return 0;
 }
 
 int console_host_set_property(lua_State *L) {
-  const char* name ="";
-  const char* prop_id = "";
-  const char* prop_value = "";
   lua_ensure(lua_istable(L, -1), "Bad Arguments to create link, Should be a table with named arguments");
 
   // get Host id
   lua_pushstring(L, "host");
   lua_gettable(L, -2);
-  name = lua_tostring(L, -1);
+  const char* name = lua_tostring(L, -1);
   lua_pop(L, 1);
 
   // get prop Name
   lua_pushstring(L, "prop");
   lua_gettable(L, -2);
-  prop_id = lua_tostring(L, -1);
+  const char* prop_id = lua_tostring(L, -1);
   lua_pop(L, 1);
   //get args
   lua_pushstring(L,"value");
   lua_gettable(L, -2);
-  prop_value = lua_tostring(L,-1);
+  const char* prop_value = lua_tostring(L, -1);
   lua_pop(L, 1);
 
   sg_host_t host = sg_host_by_name(name);
   lua_ensure(host, "no host '%s' found",name);
-  xbt_dict_t props = sg_host_get_properties(host);
-  xbt_dict_set(props,prop_id,xbt_strdup(prop_value),nullptr);
+  host->setProperty(prop_id, prop_value);
 
   return 0;
 }
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 8bb38ce..a3262e0 100644 (file)
@@ -12,10 +12,8 @@ SG_BEGIN_DECL()
 
 XBT_PUBLIC(int) TRACE_start ();
 XBT_PUBLIC(int) TRACE_end ();
-XBT_PUBLIC(void) TRACE_global_init(int *argc, char **argv);
+XBT_PUBLIC(void) TRACE_global_init();
 XBT_PUBLIC(void) TRACE_help(int detailed);
-XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc();
-XBT_PUBLIC(void) TRACE_surf_resource_utilization_release();
 
 SG_END_DECL()
 
index 23f056f..49e0f09 100644 (file)
@@ -30,12 +30,10 @@ extern XBT_PRIVATE int _sg_do_model_check_record;
 extern XBT_PRIVATE int _sg_mc_checkpoint;
 extern XBT_PUBLIC(int) _sg_mc_sparse_checkpoint;
 extern XBT_PUBLIC(int) _sg_mc_ksm;
-extern XBT_PUBLIC(char*) _sg_mc_property_file;
 extern XBT_PRIVATE int _sg_mc_timeout;
 extern XBT_PRIVATE int _sg_mc_hash;
 extern XBT_PRIVATE int _sg_mc_max_depth;
 extern XBT_PUBLIC(int) _sg_mc_max_visited_states;
-extern XBT_PRIVATE char* _sg_mc_dot_output_file;
 extern XBT_PUBLIC(int) _sg_mc_comms_determinism;
 extern XBT_PUBLIC(int) _sg_mc_send_determinism;
 extern XBT_PRIVATE int _sg_mc_snapshot_fds;
@@ -64,8 +62,6 @@ XBT_PRIVATE void MC_automaton_load(const char *file);
 
 /********************************* Memory *************************************/
 XBT_PUBLIC(void) MC_memory_init();  /* Initialize the memory subsystem */
-XBT_PUBLIC(void) MC_memory_exit();
-XBT_PUBLIC(void) MC_memory_init_server();
 
 SG_END_DECL()
 
index 588ac41..304b7b6 100644 (file)
@@ -7,6 +7,7 @@
 #define SIMGRID_CONFIG_H
 
 #include "xbt/config.h"
+#include "xbt/config.hpp"
 
 /** Config Globals */
 SG_BEGIN_DECL()
@@ -20,4 +21,4 @@ XBT_PUBLIC(void) sg_config_finalize();
 
 SG_END_DECL()
 
-#endif
\ No newline at end of file
+#endif
diff --git a/src/include/surf/datatypes.h b/src/include/surf/datatypes.h
deleted file mode 100644 (file)
index 1ce9da6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* 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. */
-
-#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;
-
-#endif
diff --git a/src/include/surf/datatypes.hpp b/src/include/surf/datatypes.hpp
new file mode 100644 (file)
index 0000000..235dbf1
--- /dev/null
@@ -0,0 +1,19 @@
+/* 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. */
+
+#ifndef MAXMIN_DATATYPES_HPP
+#define MAXMIN_DATATYPES_HPP
+
+namespace simgrid {
+namespace surf {
+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
diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h
deleted file mode 100644 (file)
index df7571f..0000000
+++ /dev/null
@@ -1,464 +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_MAXMIN_H
-#define SURF_MAXMIN_H
-
-#include "src/internal_config.h"
-#include "xbt/misc.h"
-#include "xbt/asserts.h"
-#include "surf/datatypes.h"
-#include <math.h>
-
-namespace simgrid {
-namespace surf {
-class Action;
-}
-}
-
-/** @addtogroup SURF_lmm
- * @details
- * A linear maxmin solver to resolve inequations systems.
- *
- * Most SimGrid model rely on a "fluid/steady-state" modeling that simulate the sharing of resources between actions at
- * relatively coarse-grain.  Such sharing is generally done by solving a set of linear inequations. Let's take an
- * example and assume we have the variables \f$x_1\f$, \f$x_2\f$, \f$x_3\f$, and \f$x_4\f$ . Let's say that \f$x_1\f$
- * and \f$x_2\f$ correspond to activities running and the same CPU \f$A\f$ whose capacity is \f$C_A\f$. In such a
- * case, we need to enforce:
- *
- *   \f[ x_1 + x_2 \leq C_A \f]
- *
- * Likewise, if \f$x_3\f$ (resp. \f$x_4\f$) corresponds to a network flow \f$F_3\f$ (resp. \f$F_4\f$) that goes through
- * a set of links \f$L_1\f$ and \f$L_2\f$ (resp. \f$L_2\f$ and \f$L_3\f$), then we need to enforce:
- *
- *   \f[ x_3  \leq C_{L_1} \f]
- *   \f[ x_3 + x_4 \leq C_{L_2} \f]
- *   \f[ x_4 \leq C_{L_3} \f]
- *
- * One could set every variable to 0 to make sure the constraints are satisfied but this would obviously not be very
- * realistic. A possible objective is to try to maximize the minimum of the \f$x_i\f$ . This ensures that all the
- * \f$x_i\f$ are positive and "as large as possible".
- *
- * This is called *max-min fairness* and is the most commonly used objective in SimGrid. Another possibility is to
- * maximize \f$\sum_if(x_i)\f$, where \f$f\f$ is a strictly increasing concave function.
- *
- * Constraint:
- *  - bound (set)
- *  - shared (set)
- *  - usage (computed)
- *
- * Variable:
- *  - weight (set)
- *  - bound (set)
- *  - value (computed)
- *
- * Element:
- *  - value (set)
- *
- * A possible system could be:
- * - three variables: `var1`, `var2`, `var3`
- * - two constraints: `cons1`, `cons2`
- * - four elements linking:
- *  - `elem1` linking `var1` and `cons1`
- *  - `elem2` linking `var2` and `cons1`
- *  - `elem3` linking `var2` and `cons2`
- *  - `elem4` linking `var3` and `cons2`
- *
- * And the corresponding inequations will be:
- *
- *     var1.value <= var1.bound
- *     var2.value <= var2.bound
- *     var3.value <= var3.bound
- *     var1.weight * var1.value * elem1.value + var2.weight * var2.value * elem2.value <= cons1.bound
- *     var2.weight * var2.value * elem3.value + var3.weight * var3.value * elem4.value <= cons2.bound
- *
- * where `var1.value`, `var2.value` and `var3.value` are the unknown values.
- *
- * If a constraint is not shared, the sum is replaced by a max.
- * For example, a third non-shared constraint `cons3` and the associated elements `elem5` and `elem6` could write as:
- *
- *     max( var1.weight * var1.value * elem5.value  ,  var3.weight * var3.value * elem6.value ) <= cons3.bound
- *
- * This is usefull for the sharing of resources for various models.
- * For instance, for the network model, each link is associated to a constraint and each communication to a variable.
- *
- * Implementation details
- *
- * For implementation reasons, we are interested in distinguishing variables that actually participate to the
- * computation of constraints, and those who are part of the equations but are stuck to zero.
- * We call enabled variables, those which var.weight is strictly positive. Zero-weight variables are called disabled
- * variables.
- * Unfortunately this concept of enabled/disabled variables intersects with active/inactive variable.
- * Semantically, the intent is similar, but the conditions under which a variable is active is slightly more strict
- * than the conditions for it to be enabled.
- * A variable is active only if its var.value is non-zero (and, by construction, its var.weight is non-zero).
- * In general, variables remain disabled after their creation, which often models an initialization phase (e.g. first
- * packet propagating in the network). Then, it is enabled by the corresponding model. Afterwards, the max-min solver
- * (lmm_solve()) activates it when appropriate. It is possible that the variable is again disabled, e.g. to model the
- * pausing of an action.
- *
- * Concurrency limit and maximum
- *
- * We call concurrency, the number of variables that can be enabled at any time for each constraint.
- * From a model perspective, this "concurrency" often represents the number of actions that actually compete for one
- * constraint.
- * The LMM solver is able to limit the concurrency for each constraint, and to monitor its maximum value.
- *
- * One may want to limit the concurrency of constraints for essentially three reasons:
- *  - Keep LMM system in a size that can be solved (it does not react very well with tens of thousands of variables per
- *    constraint)
- *  - Stay within parameters where the fluid model is accurate enough.
- *  - Model serialization effects
- *
- * The concurrency limit can also be set to a negative value to disable concurrency limit. This can improve performance
- * slightly.
- *
- * Overall, each constraint contains three fields related to concurrency:
- *  - concurrency_limit which is the limit enforced by the solver
- *  - concurrency_current which is the current concurrency
- *  - concurrency_maximum which is the observed maximum concurrency
- *
- * Variables also have one field related to concurrency: concurrency_share.
- * In effect, in some cases, one variable is involved multiple times (i.e. two elements) in a constraint.
- * For example, cross-traffic is modeled using 2 elements per constraint.
- * concurrency_share formally corresponds to the maximum number of elements that associate the variable and any given
- * constraint.
- */
-
-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)
-{
-  //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;
-}
-
-static inline int double_positive(double value, double precision)
-{
-  return (value > precision);
-}
-
-static inline int double_equals(double value1, double value2, double precision)
-{
-  return (fabs(value1 - value2) < precision);
-}
-
-SG_BEGIN_DECL()
-
-/** @{ @ingroup SURF_lmm */
-/**
- * @brief Create a new Linear MaxMim system
- * @param selective_update whether we should do lazy updates
- */
-XBT_PUBLIC(lmm_system_t) lmm_system_new(bool selective_update);
-
-/**
- * @brief Free an existing Linear MaxMin system
- * @param sys The lmm system to free
- */
-XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
-
-/**
- * @brief Create a new Linear MaxMin constraint
- * @param sys The system in which we add a constraint
- * @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);
-
-/**
- * @brief Share a constraint
- * @param cnst The constraint to share
- */
-XBT_PUBLIC(void) lmm_constraint_shared(lmm_constraint_t cnst);
-
-/**
- * @brief Check if a constraint is shared (shared by default)
- * @param cnst The constraint to share
- * @return 1 if shared, 0 otherwise
- */
-XBT_PUBLIC(int) lmm_constraint_sharing_policy(lmm_constraint_t cnst);
-
-/**
- * @brief Free a constraint
- * @param sys The system associated to the constraint
- * @param cnst The constraint to free
- */
-XBT_PUBLIC(void) lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst);
-
-/**
- * @brief Get the usage of the constraint after the last lmm solve
- * @param cnst A constraint
- * @return The usage of the constraint
- */
-XBT_PUBLIC(double) lmm_constraint_get_usage(lmm_constraint_t cnst);
-
-XBT_PUBLIC(int) lmm_constraint_get_variable_amount(lmm_constraint_t cnst);
-
-/**
- * @brief Sets the concurrency limit for this constraint
- * @param cnst A constraint
- * @param concurrency_limit The concurrency limit to use for this constraint
- */
-XBT_PUBLIC(void) lmm_constraint_concurrency_limit_set(lmm_constraint_t cnst, int concurrency_limit);
-
-/**
- * @brief Gets the concurrency limit for this constraint
- * @param cnst A constraint
- * @return The concurrency limit used by this constraint
- */
-XBT_PUBLIC(int) lmm_constraint_concurrency_limit_get(lmm_constraint_t cnst);
-
-/**
- * @brief Reset the concurrency maximum for a given variable (we will update the maximum to reflect constraint
- * evolution).
- * @param cnst A constraint
-*/
-XBT_PUBLIC(void) lmm_constraint_concurrency_maximum_reset(lmm_constraint_t cnst);
-
-/**
- * @brief Get the concurrency maximum for a given variable (which reflects constraint evolution).
- * @param cnst A constraint
- * @return the maximum concurrency of the constraint
- */
-XBT_PUBLIC(int) lmm_constraint_concurrency_maximum_get(lmm_constraint_t cnst);
-
-/**
- * @brief Create a new Linear MaxMin variable
- * @param sys The system in which we add a constaint
- * @param id Data associated to the variable (e.g.: a network communication)
- * @param weight_value The weight of the variable (0.0 if not used)
- * @param bound The maximum value of the variable (-1.0 if no maximum value)
- * @param number_of_constraints The maximum number of constraint to associate to the variable
- */
-XBT_PUBLIC(lmm_variable_t)
-lmm_variable_new(lmm_system_t sys, simgrid::surf::Action* id, double weight_value, double bound,
-                 int number_of_constraints);
-/**
- * @brief Free a variable
- * @param sys The system associated to the variable
- * @param var The variable to free
- */
-XBT_PUBLIC(void) lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
-
-/**
- * @brief Get the value of the variable after the last lmm solve
- * @param var A variable
- * @return The value of the variable
- */
-XBT_PUBLIC(double) lmm_variable_getvalue(lmm_variable_t var);
-
-/**
- * @brief Get the maximum value of the variable (-1.0 if no maximum value)
- * @param var A variable
- * @return The bound of the variable
- */
-XBT_PUBLIC(double) lmm_variable_getbound(lmm_variable_t var);
-
-/**
- * @brief Set the concurrent share of the variable
- * @param var A variable
- * @param concurrency_share The new concurrency share
- */
-XBT_PUBLIC(void) lmm_variable_concurrency_share_set(lmm_variable_t var, short int concurrency_share);
-
-/**
- * @brief Remove a variable from a constraint
- * @param sys A system
- * @param cnst A constraint
- * @param var The variable to remove
- */
-XBT_PUBLIC(void) lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var);
-
-/**
- * @brief Associate a variable to a constraint with a coefficient
- * @param sys A system
- * @param cnst A constraint
- * @param var A variable
- * @param value The coefficient associated to the variable in the constraint
- */
-XBT_PUBLIC(void) lmm_expand(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double value);
-
-/**
- * @brief Add value to the coefficient between a constraint and a variable or create one
- * @param sys A system
- * @param cnst A constraint
- * @param var A variable
- * @param value The value to add to the coefficient associated to the variable in the constraint
- */
-XBT_PUBLIC(void) lmm_expand_add(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double value);
-
-/**
- * @brief Get the numth constraint associated to the variable
- * @param sys The system associated to the variable (not used)
- * @param var A variable
- * @param num The rank of constraint we want to get
- * @return The numth constraint
- */
-XBT_PUBLIC(lmm_constraint_t) lmm_get_cnst_from_var(lmm_system_t sys, lmm_variable_t var, int num);
-
-/**
- * @brief Get the weigth of the numth constraint associated to the variable
- * @param sys The system associated to the variable (not used)
- * @param var A variable
- * @param num The rank of constraint we want to get
- * @return The numth constraint
- */
-XBT_PUBLIC(double) lmm_get_cnst_weight_from_var(lmm_system_t sys, lmm_variable_t var, int num);
-
-/**
- * @brief Get the number of constraint associated to a variable
- * @param sys The system associated to the variable (not used)
- * @param var A variable
- * @return The number of constraint associated to the variable
- */
-XBT_PUBLIC(int) lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t var);
-
-/**
- * @brief Get a var associated to a constraint
- * @details Get the first variable of the next variable of elem if elem is not NULL
- * @param sys The system associated to the variable (not used)
- * @param cnst A constraint
- * @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);
-
-/**
- * @brief Get a var associated to a constraint
- * @details Get the first variable of the next variable of elem if elem is not NULL
- * @param cnst A constraint
- * @param elem A element of constraint of the constraint or NULL
- * @param nextelem A element of constraint of the constraint or NULL, the one after elem
- * @param numelem parameter representing the number of elements to go
- *
- * @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);
-
-/**
- * @brief Get the first active constraint of a system
- * @param sys A system
- * @return The first active constraint
- */
-XBT_PUBLIC(lmm_constraint_t) lmm_get_first_active_constraint(lmm_system_t sys);
-
-/**
- * @brief Get the next active constraint of a constraint in a system
- * @param sys A system
- * @param cnst An active constraint of the system
- *
- * @return The next active constraint
- */
-XBT_PUBLIC(lmm_constraint_t) lmm_get_next_active_constraint(lmm_system_t sys, lmm_constraint_t cnst);
-
-/**
- * @brief Get the data associated to a constraint
- * @param cnst A constraint
- * @return The data associated to the constraint
- */
-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);
-
-/**
- * @brief Update the value of element linking the constraint and the variable
- * @param sys A system
- * @param cnst A constraint
- * @param var A variable
- * @param value The new value
- */
-XBT_PUBLIC(void) lmm_update(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double value);
-
-/**
- * @brief Update the bound of a variable
- * @param sys A system
- * @param var A constraint
- * @param bound The new bound
- */
-XBT_PUBLIC(void) lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var, double bound);
-
-/**
- * @brief Update the weight of a variable
- * @param sys A system
- * @param var A variable
- * @param weight The new weight of the variable
- */
-XBT_PUBLIC(void) lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double weight);
-
-/**
- * @brief Get the weight of a variable
- * @param var A variable
- * @return The weight of the variable
- */
-XBT_PUBLIC(double) lmm_get_variable_weight(lmm_variable_t var);
-
-/**
- * @brief Update a constraint bound
- * @param sys A system
- * @param cnst A constraint
- * @param bound The new bound of the consrtaint
- */
-XBT_PUBLIC(void) lmm_update_constraint_bound(lmm_system_t sys, lmm_constraint_t cnst, double bound);
-
-/**
- * @brief [brief description]
- * @param sys A system
- * @param cnst A constraint
- * @return [description]
- */
-XBT_PUBLIC(int) lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst);
-
-/**
- * @brief Print the lmm system
- * @param sys The lmm system to print
- */
-XBT_PUBLIC(void) lmm_print(lmm_system_t sys);
-
-/**
- * @brief Solve the lmm system
- * @param sys The lmm system to solve
- */
-XBT_PUBLIC(void) lmm_solve(lmm_system_t sys);
-
-XBT_PUBLIC(void) lagrange_solve(lmm_system_t sys);
-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(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_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
diff --git a/src/include/surf/maxmin.hpp b/src/include/surf/maxmin.hpp
new file mode 100644 (file)
index 0000000..1012ce1
--- /dev/null
@@ -0,0 +1,583 @@
+/* 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_MAXMIN_HPP
+#define SURF_MAXMIN_HPP
+
+#include "src/internal_config.h"
+#include "src/surf/surf_interface.hpp"
+#include "surf/surf.hpp"
+#include "xbt/asserts.h"
+#include "xbt/mallocator.h"
+#include "xbt/misc.h"
+#include "xbt/swag.h"
+#include <cmath>
+#include <limits>
+#include <vector>
+
+namespace simgrid {
+namespace surf {
+
+/** @addtogroup SURF_lmm
+ * @details
+ * A linear maxmin solver to resolve inequations systems.
+ *
+ * Most SimGrid model rely on a "fluid/steady-state" modeling that simulate the sharing of resources between actions at
+ * relatively coarse-grain.  Such sharing is generally done by solving a set of linear inequations. Let's take an
+ * example and assume we have the variables \f$x_1\f$, \f$x_2\f$, \f$x_3\f$, and \f$x_4\f$ . Let's say that \f$x_1\f$
+ * and \f$x_2\f$ correspond to activities running and the same CPU \f$A\f$ whose capacity is \f$C_A\f$. In such a
+ * case, we need to enforce:
+ *
+ *   \f[ x_1 + x_2 \leq C_A \f]
+ *
+ * Likewise, if \f$x_3\f$ (resp. \f$x_4\f$) corresponds to a network flow \f$F_3\f$ (resp. \f$F_4\f$) that goes through
+ * a set of links \f$L_1\f$ and \f$L_2\f$ (resp. \f$L_2\f$ and \f$L_3\f$), then we need to enforce:
+ *
+ *   \f[ x_3  \leq C_{L_1} \f]
+ *   \f[ x_3 + x_4 \leq C_{L_2} \f]
+ *   \f[ x_4 \leq C_{L_3} \f]
+ *
+ * One could set every variable to 0 to make sure the constraints are satisfied but this would obviously not be very
+ * realistic. A possible objective is to try to maximize the minimum of the \f$x_i\f$ . This ensures that all the
+ * \f$x_i\f$ are positive and "as large as possible".
+ *
+ * This is called *max-min fairness* and is the most commonly used objective in SimGrid. Another possibility is to
+ * maximize \f$\sum_if(x_i)\f$, where \f$f\f$ is a strictly increasing concave function.
+ *
+ * Constraint:
+ *  - bound (set)
+ *  - shared (set)
+ *  - usage (computed)
+ *
+ * Variable:
+ *  - weight (set)
+ *  - bound (set)
+ *  - value (computed)
+ *
+ * Element:
+ *  - value (set)
+ *
+ * A possible system could be:
+ * - three variables: `var1`, `var2`, `var3`
+ * - two constraints: `cons1`, `cons2`
+ * - four elements linking:
+ *  - `elem1` linking `var1` and `cons1`
+ *  - `elem2` linking `var2` and `cons1`
+ *  - `elem3` linking `var2` and `cons2`
+ *  - `elem4` linking `var3` and `cons2`
+ *
+ * And the corresponding inequations will be:
+ *
+ *     var1.value <= var1.bound
+ *     var2.value <= var2.bound
+ *     var3.value <= var3.bound
+ *     var1.weight * var1.value * elem1.value + var2.weight * var2.value * elem2.value <= cons1.bound
+ *     var2.weight * var2.value * elem3.value + var3.weight * var3.value * elem4.value <= cons2.bound
+ *
+ * where `var1.value`, `var2.value` and `var3.value` are the unknown values.
+ *
+ * If a constraint is not shared, the sum is replaced by a max.
+ * For example, a third non-shared constraint `cons3` and the associated elements `elem5` and `elem6` could write as:
+ *
+ *     max( var1.weight * var1.value * elem5.value  ,  var3.weight * var3.value * elem6.value ) <= cons3.bound
+ *
+ * This is usefull for the sharing of resources for various models.
+ * For instance, for the network model, each link is associated to a constraint and each communication to a variable.
+ *
+ * Implementation details
+ *
+ * For implementation reasons, we are interested in distinguishing variables that actually participate to the
+ * computation of constraints, and those who are part of the equations but are stuck to zero.
+ * We call enabled variables, those which var.weight is strictly positive. Zero-weight variables are called disabled
+ * variables.
+ * Unfortunately this concept of enabled/disabled variables intersects with active/inactive variable.
+ * Semantically, the intent is similar, but the conditions under which a variable is active is slightly more strict
+ * than the conditions for it to be enabled.
+ * A variable is active only if its var.value is non-zero (and, by construction, its var.weight is non-zero).
+ * In general, variables remain disabled after their creation, which often models an initialization phase (e.g. first
+ * packet propagating in the network). Then, it is enabled by the corresponding model. Afterwards, the max-min solver
+ * (lmm_solve()) activates it when appropriate. It is possible that the variable is again disabled, e.g. to model the
+ * pausing of an action.
+ *
+ * Concurrency limit and maximum
+ *
+ * We call concurrency, the number of variables that can be enabled at any time for each constraint.
+ * From a model perspective, this "concurrency" often represents the number of actions that actually compete for one
+ * constraint.
+ * The LMM solver is able to limit the concurrency for each constraint, and to monitor its maximum value.
+ *
+ * One may want to limit the concurrency of constraints for essentially three reasons:
+ *  - Keep LMM system in a size that can be solved (it does not react very well with tens of thousands of variables per
+ *    constraint)
+ *  - Stay within parameters where the fluid model is accurate enough.
+ *  - Model serialization effects
+ *
+ * The concurrency limit can also be set to a negative value to disable concurrency limit. This can improve performance
+ * slightly.
+ *
+ * Overall, each constraint contains three fields related to concurrency:
+ *  - concurrency_limit which is the limit enforced by the solver
+ *  - concurrency_current which is the current concurrency
+ *  - concurrency_maximum which is the observed maximum concurrency
+ *
+ * Variables also have one field related to concurrency: concurrency_share.
+ * In effect, in some cases, one variable is involved multiple times (i.e. two elements) in a constraint.
+ * For example, cross-traffic is modeled using 2 elements per constraint.
+ * concurrency_share formally corresponds to the maximum number of elements that associate the variable and any given
+ * constraint.
+ */
+
+/** @{ @ingroup SURF_lmm */
+
+/**
+ * @brief Solve the lmm system
+ * @param sys The lmm system to solve
+ */
+XBT_PUBLIC(void) lmm_solve(lmm_system_t sys);
+
+XBT_PUBLIC(void) lagrange_solve(lmm_system_t sys);
+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(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_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);
+
+/**
+ * @brief LMM element
+ * Elements can be seen as glue between constraint objects and variable objects.
+ * 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.
+ */
+XBT_PUBLIC_CLASS s_lmm_element_t {
+public:
+  int get_concurrency() const;
+  void decrease_concurrency();
+  void increase_concurrency();
+
+  void make_active();
+  void make_inactive();
+
+  /* hookup to constraint */
+  s_xbt_swag_hookup_t enabled_element_set_hookup;
+  s_xbt_swag_hookup_t disabled_element_set_hookup;
+  s_xbt_swag_hookup_t active_element_set_hookup;
+
+  lmm_constraint_t constraint;
+  lmm_variable_t variable;
+
+  // consumption_weight: impact of 1 byte or flop of your application onto the resource (in byte or flop)
+  //   - if CPU, then probably 1.
+  //   - If network, then 1 in forward direction and 0.05 backward for the ACKs
+  double consumption_weight;
+};
+
+struct s_lmm_constraint_light_t {
+  double remaining_over_usage;
+  lmm_constraint_t cnst;
+};
+
+/**
+ * @brief LMM constraint
+ * Each constraint contains several partially overlapping logical sets of elements:
+ * \li Disabled elements which variable's weight is zero. This variables are not at all processed by LMM, but eventually
+ *     the corresponding action will enable it (at least this is the idea).
+ * \li Enabled elements which variable's weight is non-zero. They are utilized in some LMM functions.
+ * \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.
+ */
+XBT_PUBLIC_CLASS s_lmm_constraint_t {
+public:
+  s_lmm_constraint_t() = default;
+  s_lmm_constraint_t(void* id_value, double bound_value);
+
+  /** @brief Unshare a constraint. */
+  void unshare() { sharing_policy = 0; }
+
+  /**
+   * @brief Check if a constraint is shared (shared by default)
+   * @return 1 if shared, 0 otherwise
+   */
+  int get_sharing_policy() const { return sharing_policy; }
+
+  /**
+   * @brief Get the usage of the constraint after the last lmm solve
+   * @return The usage of the constraint
+   */
+  double get_usage() const;
+  int get_variable_amount() const;
+
+  /**
+   * @brief Sets the concurrency limit for this constraint
+   * @param concurrency_limit The concurrency limit to use for this constraint
+   */
+  void set_concurrency_limit(int limit)
+  {
+    xbt_assert(limit < 0 || concurrency_maximum <= limit,
+               "New concurrency limit should be larger than observed concurrency maximum. Maybe you want to call"
+               " concurrency_maximum_reset() to reset the maximum?");
+    concurrency_limit = limit;
+  }
+
+  /**
+   * @brief Gets the concurrency limit for this constraint
+   * @return The concurrency limit used by this constraint
+   */
+  int get_concurrency_limit() const { return concurrency_limit; }
+
+  /**
+   * @brief Reset the concurrency maximum for a given variable (we will update the maximum to reflect constraint
+   * evolution).
+   */
+  void reset_concurrency_maximum() { concurrency_maximum = 0; }
+
+  /**
+   * @brief Get the concurrency maximum for a given variable (which reflects constraint evolution).
+   * @return the maximum concurrency of the constraint
+   */
+  int get_concurrency_maximum() const
+  {
+    xbt_assert(concurrency_limit < 0 || concurrency_maximum <= concurrency_limit,
+               "Very bad: maximum observed concurrency is higher than limit. This is a bug of SURF, please report it.");
+    return concurrency_maximum;
+  }
+
+  int get_concurrency_slack() const
+  {
+    return concurrency_limit < 0 ? std::numeric_limits<int>::max() : concurrency_limit - concurrency_current;
+  }
+
+  /**
+   * @brief Get a var associated to a constraint
+   * @details Get the first variable of the next variable of elem if elem is not NULL
+   * @param elem A element of constraint of the constraint or NULL
+   * @return A variable associated to a constraint
+   */
+  lmm_variable_t get_variable(lmm_element_t* elem) const;
+
+  /**
+   * @brief Get a var associated to a constraint
+   * @details Get the first variable of the next variable of elem if elem is not NULL
+   * @param elem A element of constraint of the constraint or NULL
+   * @param nextelem A element of constraint of the constraint or NULL, the one after elem
+   * @param numelem parameter representing the number of elements to go
+   * @return A variable associated to a constraint
+   */
+  lmm_variable_t get_variable_safe(lmm_element_t* elem, lmm_element_t* nextelem, int* numelem) const;
+
+  /**
+   * @brief Get the data associated to a constraint
+   * @return The data associated to the constraint
+   */
+  void* get_id() const { return id; }
+
+  /* hookup to system */
+  s_xbt_swag_hookup_t constraint_set_hookup           = {nullptr, nullptr};
+  s_xbt_swag_hookup_t active_constraint_set_hookup    = {nullptr, nullptr};
+  s_xbt_swag_hookup_t modified_constraint_set_hookup  = {nullptr, nullptr};
+  s_xbt_swag_hookup_t saturated_constraint_set_hookup = {nullptr, nullptr};
+  s_xbt_swag_t enabled_element_set;  /* a list of lmm_element_t */
+  s_xbt_swag_t disabled_element_set; /* a list of lmm_element_t */
+  s_xbt_swag_t active_element_set;   /* a list of lmm_element_t */
+  double remaining;
+  double usage;
+  double bound;
+  // TODO MARTIN Check maximum value across resources at the end of simulation and give a warning is more than e.g. 500
+  int concurrency_current; /* The current concurrency */
+  int concurrency_maximum; /* The maximum number of (enabled and disabled) variables associated to the constraint at any
+                            * given time (essentially for tracing)*/
+
+  int sharing_policy; /* see @e_surf_link_sharing_policy_t (0: FATPIPE, 1: SHARED, 2: FULLDUPLEX) */
+  int id_int;
+  double lambda;
+  double new_lambda;
+  lmm_constraint_light_t cnst_light;
+
+private:
+  static int Global_debug_id;
+  int concurrency_limit; /* The maximum number of variables that may be enabled at any time (stage variables if
+                          * necessary) */
+  void* id;
+};
+
+/**
+ * @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
+ */
+XBT_PUBLIC_CLASS s_lmm_variable_t {
+public:
+  void initialize(simgrid::surf::Action* id_value, double sharing_weight_value, double bound_value,
+                  int number_of_constraints, unsigned visited_value);
+
+  /**
+   * @brief Get the value of the variable after the last lmm solve
+   * @return The value of the variable
+   */
+  double get_value() const { return value; }
+
+  /**
+   * @brief Get the maximum value of the variable (-1.0 if no maximum value)
+   * @return The bound of the variable
+   */
+  double get_bound() const { return bound; }
+
+  /**
+   * @brief Set the concurrent share of the variable
+   * @param concurrency_share The new concurrency share
+   */
+  void set_concurrency_share(short int value) { concurrency_share = value; }
+
+  /**
+   * @brief Get the numth constraint associated to the variable
+   * @param num The rank of constraint we want to get
+   * @return The numth constraint
+   */
+  lmm_constraint_t get_constraint(unsigned num) const { return num < cnsts.size() ? cnsts[num].constraint : nullptr; }
+
+  /**
+   * @brief Get the weigth of the numth constraint associated to the variable
+   * @param num The rank of constraint we want to get
+   * @return The numth constraint
+   */
+  double get_constraint_weight(unsigned num) const { return num < cnsts.size() ? cnsts[num].consumption_weight : 0.0; }
+
+  /**
+   * @brief Get the number of constraint associated to a variable
+   * @return The number of constraint associated to the variable
+   */
+  int get_number_of_constraint() const { return cnsts.size(); }
+
+  /**
+   * @brief Get the data associated to a variable
+   * @return The data associated to the variable
+   */
+  simgrid::surf::Action* get_id() const { return id; }
+
+  /**
+   * @brief Get the weight of a variable
+   * @return The weight of the variable
+   */
+  double get_weight() const { return sharing_weight; }
+
+  /** @brief Measure the minimum concurrency slack across all constraints where the given var is involved */
+  int get_min_concurrency_slack() const;
+
+  /** @brief Check if a variable can be enabled
+   * Make sure to set staged_weight before, if your intent is only to check concurrency
+   */
+  int can_enable() const { return staged_weight > 0 && get_min_concurrency_slack() >= concurrency_share; }
+
+  /* hookup to system */
+  s_xbt_swag_hookup_t variable_set_hookup           = {nullptr, nullptr};
+  s_xbt_swag_hookup_t saturated_variable_set_hookup = {nullptr, nullptr};
+
+  std::vector<s_lmm_element_t> cnsts;
+
+  // sharing_weight: variable's impact on the resource during the sharing
+  //   if == 0, the variable is not considered by LMM
+  //   on CPU, actions with N threads have a sharing of N
+  //   on network, the actions with higher latency have a lesser sharing_weight
+  double sharing_weight;
+
+  double staged_weight; /* If non-zero, variable is staged for addition as soon as maxconcurrency constraints will be
+                         * met */
+  double bound;
+  double value;
+  short int concurrency_share; /* The maximum number of elements that variable will add to a constraint */
+  simgrid::surf::Action* id;
+  int id_int;
+  unsigned visited; /* used by lmm_update_modified_set */
+  /* \begin{For Lagrange only} */
+  double mu;
+  double new_mu;
+  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} */
+
+private:
+  static int Global_debug_id;
+};
+
+inline void s_lmm_element_t::make_active()
+{
+  xbt_swag_insert_at_head(this, &constraint->active_element_set);
+}
+inline void s_lmm_element_t::make_inactive()
+{
+  xbt_swag_remove(this, &constraint->active_element_set);
+}
+
+/**
+ * @brief LMM system
+ */
+XBT_PUBLIC_CLASS s_lmm_system_t {
+public:
+  /**
+   * @brief Create a new Linear MaxMim system
+   * @param selective_update whether we should do lazy updates
+   */
+  explicit s_lmm_system_t(bool selective_update);
+  /** @brief Free an existing Linear MaxMin system */
+  ~s_lmm_system_t();
+
+  /**
+   * @brief Create a new Linear MaxMin constraint
+   * @param id Data associated to the constraint (e.g.: a network link)
+   * @param bound_value The bound value of the constraint
+   */
+  lmm_constraint_t constraint_new(void* id, double bound_value);
+
+  /**
+   * @brief Create a new Linear MaxMin variable
+   * @param id Data associated to the variable (e.g.: a network communication)
+   * @param weight_value The weight of the variable (0.0 if not used)
+   * @param bound The maximum value of the variable (-1.0 if no maximum value)
+   * @param number_of_constraints The maximum number of constraint to associate to the variable
+   */
+  lmm_variable_t variable_new(simgrid::surf::Action* id, double weight_value, double bound, int number_of_constraints);
+
+  /**
+   * @brief Free a variable
+   * @param var The variable to free
+   */
+  void variable_free(lmm_variable_t var);
+
+  /**
+   * @brief Associate a variable to a constraint with a coefficient
+   * @param cnst A constraint
+   * @param var A variable
+   * @param value The coefficient associated to the variable in the constraint
+   */
+  void expand(lmm_constraint_t cnst, lmm_variable_t var, double value);
+
+  /**
+   * @brief Add value to the coefficient between a constraint and a variable or create one
+   * @param cnst A constraint
+   * @param var A variable
+   * @param value The value to add to the coefficient associated to the variable in the constraint
+   */
+  void expand_add(lmm_constraint_t cnst, lmm_variable_t var, double value);
+
+  /**
+   * @brief Update the bound of a variable
+   * @param var A constraint
+   * @param bound The new bound
+   */
+  void update_variable_bound(lmm_variable_t var, double bound);
+
+  /**
+   * @brief Update the weight of a variable
+   * @param var A variable
+   * @param weight The new weight of the variable
+   */
+  void update_variable_weight(lmm_variable_t var, double weight);
+
+  /**
+   * @brief Update a constraint bound
+   * @param cnst A constraint
+   * @param bound The new bound of the consrtaint
+   */
+  void update_constraint_bound(lmm_constraint_t cnst, double bound);
+
+  /**
+   * @brief [brief description]
+   * @param cnst A constraint
+   * @return [description]
+   */
+  int constraint_used(lmm_constraint_t cnst) { return xbt_swag_belongs(cnst, &active_constraint_set); }
+
+  /** @brief Print the lmm system */
+  void print();
+
+  /** @brief Solve the lmm system */
+  void solve();
+
+private:
+  static void* variable_mallocator_new_f();
+  static void variable_mallocator_free_f(void* var);
+
+  void var_free(lmm_variable_t var);
+  void cnst_free(lmm_constraint_t cnst);
+  lmm_variable_t extract_variable() { return static_cast<lmm_variable_t>(xbt_swag_extract(&variable_set)); }
+  lmm_constraint_t extract_constraint() { return static_cast<lmm_constraint_t>(xbt_swag_extract(&constraint_set)); }
+  void insert_constraint(lmm_constraint_t cnst) { xbt_swag_insert(cnst, &constraint_set); }
+  void remove_variable(lmm_variable_t var)
+  {
+    xbt_swag_remove(var, &variable_set);
+    xbt_swag_remove(var, &saturated_variable_set);
+  }
+  void make_constraint_active(lmm_constraint_t cnst) { xbt_swag_insert(cnst, &active_constraint_set); }
+  void make_constraint_inactive(lmm_constraint_t cnst)
+  {
+    xbt_swag_remove(cnst, &active_constraint_set);
+    xbt_swag_remove(cnst, &modified_constraint_set);
+  }
+
+  void enable_var(lmm_variable_t var);
+  void disable_var(lmm_variable_t var);
+  void on_disabled_var(lmm_constraint_t cnstr);
+
+  /**
+   * @brief Update the value of element linking the constraint and the variable
+   * @param cnst A constraint
+   * @param var A variable
+   * @param value The new value
+   */
+  void update(lmm_constraint_t cnst, lmm_variable_t var, double value);
+
+  void update_modified_set(lmm_constraint_t cnst);
+  void update_modified_set_rec(lmm_constraint_t cnst);
+
+  /** @brief Remove all constraints of the modified_constraint_set. */
+  void remove_all_modified_set();
+  void check_concurrency();
+
+public:
+  bool modified;
+  s_xbt_swag_t variable_set;             /* a list of lmm_variable_t */
+  s_xbt_swag_t active_constraint_set;    /* a list of lmm_constraint_t */
+  s_xbt_swag_t saturated_variable_set;   /* a list of lmm_variable_t */
+  s_xbt_swag_t saturated_constraint_set; /* a list of lmm_constraint_t */
+
+  simgrid::surf::ActionLmmListPtr keep_track;
+
+  void (*solve_fun)(lmm_system_t self);
+
+private:
+  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) */
+  s_xbt_swag_t constraint_set;  /* a list of lmm_constraint_t */
+  s_xbt_swag_t modified_constraint_set; /* a list of modified lmm_constraint_t */
+  xbt_mallocator_t variable_mallocator;
+};
+
+extern XBT_PRIVATE double (*func_f_def)(lmm_variable_t, double);
+extern XBT_PRIVATE double (*func_fp_def)(lmm_variable_t, double);
+extern XBT_PRIVATE double (*func_fpi_def)(lmm_variable_t, double);
+
+/** @} */
+}
+}
+
+#endif
similarity index 81%
rename from src/include/surf/surf.h
rename to src/include/surf/surf.hpp
index 4a43c92..a6654ac 100644 (file)
@@ -6,19 +6,20 @@
 #ifndef SURF_SURF_H
 #define SURF_SURF_H
 
-#include "xbt/swag.h"
-#include "xbt/dynar.h"
+#include "simgrid/datatypes.h"
+#include "simgrid/forward.h"
+#include "src/internal_config.h"
+#include "surf/datatypes.hpp"
+#include "xbt/config.h"
 #include "xbt/dict.h"
+#include "xbt/dynar.h"
 #include "xbt/graph.h"
 #include "xbt/misc.h"
-#include "xbt/config.h"
-#include "src/internal_config.h"
-#include "surf/datatypes.h"
-#include "simgrid/datatypes.h"
-#include "simgrid/forward.h"
-
+#include "xbt/swag.h"
 
-#ifdef __cplusplus
+#ifndef __cplusplus
+#error This is a C++ only file, now
+#endif
 
 namespace simgrid {
 namespace surf {
@@ -27,58 +28,22 @@ class CpuModel;
 class HostModel;
 class NetworkModel;
 class StorageModel;
-class Resource;
 class NetworkCm02Link;
 class Action;
 }
 }
 
-typedef simgrid::surf::Model surf_Model;
-typedef simgrid::surf::CpuModel surf_CpuModel;
-typedef simgrid::surf::Cpu surf_Cpu;
-typedef simgrid::surf::HostModel surf_HostModel;
-typedef simgrid::surf::NetworkModel surf_NetworkModel;
-typedef simgrid::surf::StorageModel surf_StorageModel;
-typedef simgrid::surf::Resource surf_Resource;
-typedef simgrid::surf::Action surf_Action;
-
-#else
-
-typedef struct surf_Model surf_Model;
-typedef struct surf_CpuModel surf_CpuModel;
-typedef struct surf_Cpu surf_Cpu;
-typedef struct surf_HostModel surf_HostModel;
-typedef struct surf_NetworkModel surf_NetworkModel;
-typedef struct surf_StorageModel surf_StorageModel;
-typedef struct surf_Resource surf_Resource;
-typedef struct surf_Host surf_Host;
-typedef struct surf_Action surf_Action;
-
-#endif
-
-SG_BEGIN_DECL()
-/* Actions and models are highly connected structures... */
-
-/* user-visible parameters */
-extern XBT_PRIVATE double sg_tcp_gamma;
-extern XBT_PRIVATE double sg_sender_gap;
-extern XBT_PRIVATE double sg_latency_factor;
-extern XBT_PRIVATE double sg_bandwidth_factor;
-extern XBT_PRIVATE double sg_weight_S_parameter;
-extern XBT_PRIVATE int sg_network_crosstraffic;
-
 /** @ingroup SURF_c_bindings
  *  \brief Model datatype
  *
  *  Generic data structure for a model. The hosts,
  *  the CPUs and the network links are examples of models.
  */
-typedef surf_Model *surf_model_t;
-typedef surf_CpuModel *surf_cpu_model_t;
-typedef surf_HostModel *surf_host_model_t;
-typedef surf_NetworkModel *surf_network_model_t;
-typedef surf_StorageModel *surf_storage_model_t;
-
+typedef simgrid::surf::Model* surf_model_t;
+typedef simgrid::surf::CpuModel* surf_cpu_model_t;
+typedef simgrid::surf::HostModel* surf_host_model_t;
+typedef simgrid::surf::NetworkModel* surf_network_model_t;
+typedef simgrid::surf::StorageModel* surf_storage_model_t;
 /** @ingroup SURF_c_bindings
  *  \brief Action structure
  *
@@ -87,21 +52,29 @@ typedef surf_StorageModel *surf_storage_model_t;
  *
  *  \see e_surf_action_state_t
  */
-typedef surf_Action *surf_action_t;
+typedef simgrid::surf::Action* surf_action_t;
 
+SG_BEGIN_DECL()
+/* Actions and models are highly connected structures... */
+
+/* user-visible parameters */
+extern XBT_PRIVATE double sg_tcp_gamma;
+extern XBT_PRIVATE double sg_latency_factor;
+extern XBT_PRIVATE double sg_bandwidth_factor;
+extern XBT_PRIVATE double sg_weight_S_parameter;
+extern XBT_PRIVATE int sg_network_crosstraffic;
 
 /** \brief Resource model description
  */
 struct surf_model_description {
-  const char *name;
-  const char *description;
+  const charname;
+  const chardescription;
   void_f_void_t model_init_preparse;
 };
-typedef struct surf_model_description  s_surf_model_description_t;
-typedef struct surf_model_description* surf_model_description_t;
+typedef struct surf_model_description s_surf_model_description_t;
 
-XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table, const char *name);
-XBT_PUBLIC(void) model_help(const char *category, s_surf_model_description_t * table);
+XBT_PUBLIC(int) find_model_description(s_surf_model_description_t* table, std::string name);
+XBT_PUBLIC(void) model_help(const char* category, s_surf_model_description_t* table);
 
 /***************************/
 /* Generic model object */
@@ -166,7 +139,6 @@ XBT_PUBLIC_DATA(surf_cpu_model_t) surf_cpu_model_pm;
  */
 XBT_PUBLIC_DATA(surf_cpu_model_t) surf_cpu_model_vm;
 
-
 /** \ingroup SURF_models
  *  \brief Initializes the CPU model with the model Cas01
  *
@@ -374,11 +346,6 @@ XBT_PUBLIC_DATA(s_surf_model_description_t) surf_host_model_description[];
  */
 XBT_PUBLIC(void) surf_vm_model_init_HL13();
 
-/** \ingroup SURF_simulation
- *  \brief List of hosts for which one want to be notified if they ever restart.
- */
-XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib;
-
 /*** SURF Globals **************************/
 
 /** \ingroup SURF_simulation
@@ -391,7 +358,7 @@ XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib;
  *
  *  \see surf_host_model_init_CM02(), surf_host_model_init_compound(), surf_exit()
  */
-XBT_PUBLIC(void) surf_init(int *argc, char **argv);     /* initialize common structures */
+XBT_PUBLIC(void) surf_init(int* argc, char** argv); /* initialize common structures */
 
 /** \ingroup SURF_simulation
  *  \brief Finish simulation initialization
@@ -428,36 +395,18 @@ XBT_PUBLIC(double) surf_get_clock();
  */
 XBT_PUBLIC(void) surf_exit();
 
-/* Prototypes of the functions that handle the properties */
-XBT_PUBLIC_DATA(xbt_dict_t) current_property_set;// the prop set for the currently parsed element (also used in SIMIX)
-
 /* surf parse file related (public because called from a test suite) */
-XBT_PUBLIC(void) parse_platform_file(const char *file);
-
-/* For the trace and trace:connect tag (store their content till the end of the parsing) */
-XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
-
-/*
- * Returns the initial path. On Windows the initial path is the current directory for the current process in the other
- * case the function returns "./" that represents the current directory on Unix/Linux platforms.
- */
-const char *__surf_get_initial_path();
+XBT_PUBLIC(void) parse_platform_file(const char* file);
 
 /********** Tracing **********/
 /* from surf_instr.c */
-void TRACE_surf_action(surf_action_t surf_action, const char *category);
-void TRACE_surf_alloc();
-void TRACE_surf_release();
+void TRACE_surf_action(surf_action_t surf_action, const char* category);
 
 /* instr_routing.c */
-void instr_routing_define_callbacks ();
-void instr_new_variable_type (const char *new_typename, const char *color);
-void instr_new_user_variable_type  (const char *father_type, const char *new_typename, const char *color);
-void instr_new_user_state_type (const char *father_type, const char *new_typename);
-void instr_new_value_for_user_state_type (const char *_typename, const char *value, const char *color);
-int instr_platform_traced ();
-xbt_graph_t instr_routing_platform_graph ();
-void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
+void instr_routing_define_callbacks();
+int instr_platform_traced();
+xbt_graph_t instr_routing_platform_graph();
+void instr_routing_platform_graph_export_graphviz(xbt_graph_t g, const char* filename);
 
 SG_END_DECL()
 
diff --git a/src/include/xbt/parmap.hpp b/src/include/xbt/parmap.hpp
new file mode 100644 (file)
index 0000000..3eeb6a2
--- /dev/null
@@ -0,0 +1,450 @@
+/* A thread pool (C++ version).                                             */
+
+/* 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 XBT_PARMAP_HPP
+#define XBT_PARMAP_HPP
+
+#include "src/internal_config.h" // HAVE_FUTEX_H
+#include "src/kernel/context/Context.hpp"
+#include <atomic>
+#include <boost/optional.hpp>
+#include <simgrid/simix.h>
+#include <vector>
+#include <xbt/log.h>
+#include <xbt/parmap.h>
+#include <xbt/xbt_os_thread.h>
+
+#if HAVE_FUTEX_H
+#include <limits>
+#include <linux/futex.h>
+#include <sys/syscall.h>
+#endif
+
+XBT_LOG_EXTERNAL_CATEGORY(xbt_parmap);
+
+namespace simgrid {
+namespace xbt {
+
+/** \addtogroup XBT_parmap
+  * \ingroup XBT_misc
+  * \brief Parallel map class
+  * \{
+  */
+template <typename T> class Parmap {
+public:
+  Parmap(unsigned num_workers, e_xbt_parmap_mode_t mode);
+  Parmap(const Parmap&) = delete;
+  ~Parmap();
+  void apply(void (*fun)(T), const std::vector<T>& data);
+  boost::optional<T> next();
+
+private:
+  enum Flag { PARMAP_WORK, PARMAP_DESTROY };
+
+  /**
+   * \brief Thread data transmission structure
+   */
+  class ThreadData {
+  public:
+    ThreadData(Parmap<T>& parmap, int id) : parmap(parmap), worker_id(id) {}
+    Parmap<T>& parmap;
+    int worker_id;
+  };
+
+  /**
+   * \brief Synchronization object (different specializations).
+   */
+  class Synchro {
+  public:
+    explicit Synchro(Parmap<T>& parmap) : parmap(parmap) {}
+    virtual ~Synchro() = default;
+    /**
+     * \brief Wakes all workers and waits for them to finish the tasks.
+     *
+     * This function is called by the controller thread.
+     */
+    virtual void master_signal() = 0;
+    /**
+     * \brief Starts the parmap: waits for all workers to be ready and returns.
+     *
+     * This function is called by the controller thread.
+     */
+    virtual void master_wait() = 0;
+    /**
+     * \brief Ends the parmap: wakes the controller thread when all workers terminate.
+     *
+     * This function is called by all worker threads when they end (not including the controller).
+     */
+    virtual void worker_signal() = 0;
+    /**
+     * \brief Waits for some work to process.
+     *
+     * This function is called by each worker thread (not including the controller) when it has no more work to do.
+     *
+     * \param round  the expected round number
+     */
+    virtual void worker_wait(unsigned) = 0;
+
+    Parmap<T>& parmap;
+  };
+
+  class PosixSynchro : public Synchro {
+  public:
+    explicit PosixSynchro(Parmap<T>& parmap);
+    ~PosixSynchro();
+    void master_signal();
+    void master_wait();
+    void worker_signal();
+    void worker_wait(unsigned round);
+
+  private:
+    xbt_os_cond_t ready_cond;
+    xbt_os_mutex_t ready_mutex;
+    xbt_os_cond_t done_cond;
+    xbt_os_mutex_t done_mutex;
+  };
+
+#if HAVE_FUTEX_H
+  class FutexSynchro : public Synchro {
+  public:
+    explicit FutexSynchro(Parmap<T>& parmap) : Synchro(parmap) {}
+    void master_signal();
+    void master_wait();
+    void worker_signal();
+    void worker_wait(unsigned);
+
+  private:
+    static void futex_wait(unsigned* uaddr, unsigned val);
+    static void futex_wake(unsigned* uaddr, unsigned val);
+  };
+#endif
+
+  class BusyWaitSynchro : public Synchro {
+  public:
+    explicit BusyWaitSynchro(Parmap<T>& parmap) : Synchro(parmap) {}
+    void master_signal();
+    void master_wait();
+    void worker_signal();
+    void worker_wait(unsigned);
+  };
+
+  static void* worker_main(void* arg);
+  Synchro* new_synchro(e_xbt_parmap_mode_t mode);
+  void work();
+
+  Flag status;              /**< is the parmap active or being destroyed? */
+  unsigned work_round;      /**< index of the current round */
+  xbt_os_thread_t* workers; /**< worker thread handlers */
+  unsigned num_workers;     /**< total number of worker threads including the controller */
+  Synchro* synchro;         /**< synchronization object */
+
+  unsigned thread_counter    = 0;       /**< number of workers that have done the work */
+  void (*fun)(const T)       = nullptr; /**< function to run in parallel on each element of data */
+  const std::vector<T>* data = nullptr; /**< parameters to pass to fun in parallel */
+  std::atomic<unsigned> index;          /**< index of the next element of data to pick */
+};
+
+/**
+ * \brief Creates a parallel map object
+ * \param num_workers number of worker threads to create
+ * \param mode how to synchronize the worker threads
+ */
+template <typename T> Parmap<T>::Parmap(unsigned num_workers, e_xbt_parmap_mode_t mode)
+{
+  XBT_CDEBUG(xbt_parmap, "Create new parmap (%u workers)", num_workers);
+
+  /* Initialize the thread pool data structure */
+  this->status      = PARMAP_WORK;
+  this->work_round  = 0;
+  this->workers     = new xbt_os_thread_t[num_workers];
+  this->num_workers = num_workers;
+  this->synchro     = new_synchro(mode);
+
+  /* Create the pool of worker threads */
+  this->workers[0] = nullptr;
+#if HAVE_PTHREAD_SETAFFINITY
+  int core_bind = 0;
+#endif
+  for (unsigned i = 1; i < num_workers; i++) {
+    ThreadData* data = new ThreadData(*this, i);
+    this->workers[i] = xbt_os_thread_create(nullptr, worker_main, data, nullptr);
+#if HAVE_PTHREAD_SETAFFINITY
+    xbt_os_thread_bind(this->workers[i], core_bind);
+    if (core_bind != xbt_os_get_numcores() - 1)
+      core_bind++;
+    else
+      core_bind = 0;
+#endif
+  }
+}
+
+/**
+ * \brief Destroys a parmap
+ */
+template <typename T> Parmap<T>::~Parmap()
+{
+  status = PARMAP_DESTROY;
+  synchro->master_signal();
+
+  for (unsigned i = 1; i < num_workers; i++)
+    xbt_os_thread_join(workers[i], nullptr);
+
+  delete[] workers;
+  delete synchro;
+}
+
+/**
+ * \brief Applies a list of tasks in parallel.
+ * \param fun the function to call in parallel
+ * \param data each element of this vector will be passed as an argument to fun
+ */
+template <typename T> void Parmap<T>::apply(void (*fun)(T), const std::vector<T>& data)
+{
+  /* Assign resources to worker threads (we are maestro here)*/
+  this->fun   = fun;
+  this->data  = &data;
+  this->index = 0;
+  this->synchro->master_signal(); // maestro runs futex_wake to wake all the minions (the working threads)
+  this->work();                   // maestro works with its minions
+  this->synchro->master_wait();   // When there is no more work to do, then maestro waits for the last minion to stop
+  XBT_CDEBUG(xbt_parmap, "Job done"); //   ... and proceeds
+}
+
+/**
+ * \brief Returns a next task to process.
+ *
+ * Worker threads call this function to get more work.
+ *
+ * \return the next task to process, or throws a std::out_of_range exception if there is no more work
+ */
+template <typename T> boost::optional<T> Parmap<T>::next()
+{
+  unsigned index = this->index.fetch_add(1, std::memory_order_relaxed);
+  if (index < this->data->size())
+    return (*this->data)[index];
+  else
+    return boost::none;
+}
+
+/**
+ * \brief Main work loop: applies fun to elements in turn.
+ */
+template <typename T> void Parmap<T>::work()
+{
+  unsigned length = this->data->size();
+  unsigned index  = this->index.fetch_add(1, std::memory_order_relaxed);
+  while (index < length) {
+    this->fun((*this->data)[index]);
+    index = this->index.fetch_add(1, std::memory_order_relaxed);
+  }
+}
+
+/**
+ * Get a synchronization object for given mode.
+ * \param mode the synchronization mode
+ */
+template <typename T> typename Parmap<T>::Synchro* Parmap<T>::new_synchro(e_xbt_parmap_mode_t mode)
+{
+  if (mode == XBT_PARMAP_DEFAULT) {
+#if HAVE_FUTEX_H
+    mode = XBT_PARMAP_FUTEX;
+#else
+    mode = XBT_PARMAP_POSIX;
+#endif
+  }
+  Synchro* res;
+  switch (mode) {
+    case XBT_PARMAP_POSIX:
+      res = new PosixSynchro(*this);
+      break;
+    case XBT_PARMAP_FUTEX:
+#if HAVE_FUTEX_H
+      res = new FutexSynchro(*this);
+#else
+      xbt_die("Futex is not available on this OS.");
+#endif
+      break;
+    case XBT_PARMAP_BUSY_WAIT:
+      res = new BusyWaitSynchro(*this);
+      break;
+    default:
+      THROW_IMPOSSIBLE;
+  }
+  return res;
+}
+
+/**
+ * \brief Main function of a worker thread.
+ */
+template <typename T> void* Parmap<T>::worker_main(void* arg)
+{
+  ThreadData* data      = static_cast<ThreadData*>(arg);
+  Parmap<T>& parmap     = data->parmap;
+  unsigned round        = 0;
+  smx_context_t context = SIMIX_context_new(std::function<void()>(), nullptr, nullptr);
+  SIMIX_context_set_current(context);
+
+  XBT_CDEBUG(xbt_parmap, "New worker thread created");
+
+  /* Worker's main loop */
+  while (1) {
+    round++;
+    parmap.synchro->worker_wait(round);
+    if (parmap.status == PARMAP_DESTROY)
+      break;
+
+    XBT_CDEBUG(xbt_parmap, "Worker %d got a job", data->worker_id);
+    parmap.work();
+    parmap.synchro->worker_signal();
+    XBT_CDEBUG(xbt_parmap, "Worker %d has finished", data->worker_id);
+  }
+  /* We are destroying the parmap */
+  delete context;
+  delete data;
+  return nullptr;
+}
+
+template <typename T> Parmap<T>::PosixSynchro::PosixSynchro(Parmap<T>& parmap) : Synchro(parmap)
+{
+  ready_cond  = xbt_os_cond_init();
+  ready_mutex = xbt_os_mutex_init();
+  done_cond   = xbt_os_cond_init();
+  done_mutex  = xbt_os_mutex_init();
+}
+
+template <typename T> Parmap<T>::PosixSynchro::~PosixSynchro()
+{
+  xbt_os_cond_destroy(ready_cond);
+  xbt_os_mutex_destroy(ready_mutex);
+  xbt_os_cond_destroy(done_cond);
+  xbt_os_mutex_destroy(done_mutex);
+}
+
+template <typename T> void Parmap<T>::PosixSynchro::master_signal()
+{
+  xbt_os_mutex_acquire(ready_mutex);
+  this->parmap.thread_counter = 1;
+  this->parmap.work_round++;
+  /* wake all workers */
+  xbt_os_cond_broadcast(ready_cond);
+  xbt_os_mutex_release(ready_mutex);
+}
+
+template <typename T> void Parmap<T>::PosixSynchro::master_wait()
+{
+  xbt_os_mutex_acquire(done_mutex);
+  while (this->parmap.thread_counter < this->parmap.num_workers) {
+    /* wait for all workers to be ready */
+    xbt_os_cond_wait(done_cond, done_mutex);
+  }
+  xbt_os_mutex_release(done_mutex);
+}
+
+template <typename T> void Parmap<T>::PosixSynchro::worker_signal()
+{
+  xbt_os_mutex_acquire(done_mutex);
+  this->parmap.thread_counter++;
+  if (this->parmap.thread_counter == this->parmap.num_workers) {
+    /* all workers have finished, wake the controller */
+    xbt_os_cond_signal(done_cond);
+  }
+  xbt_os_mutex_release(done_mutex);
+}
+
+template <typename T> void Parmap<T>::PosixSynchro::worker_wait(unsigned round)
+{
+  xbt_os_mutex_acquire(ready_mutex);
+  /* wait for more work */
+  while (this->parmap.work_round != round) {
+    xbt_os_cond_wait(ready_cond, ready_mutex);
+  }
+  xbt_os_mutex_release(ready_mutex);
+}
+
+#if HAVE_FUTEX_H
+template <typename T> inline void Parmap<T>::FutexSynchro::futex_wait(unsigned* uaddr, unsigned val)
+{
+  XBT_CVERB(xbt_parmap, "Waiting on futex %p", uaddr);
+  syscall(SYS_futex, uaddr, FUTEX_WAIT_PRIVATE, val, nullptr, nullptr, 0);
+}
+
+template <typename T> inline void Parmap<T>::FutexSynchro::futex_wake(unsigned* uaddr, unsigned val)
+{
+  XBT_CVERB(xbt_parmap, "Waking futex %p", uaddr);
+  syscall(SYS_futex, uaddr, FUTEX_WAKE_PRIVATE, val, nullptr, nullptr, 0);
+}
+
+template <typename T> void Parmap<T>::FutexSynchro::master_signal()
+{
+  __atomic_store_n(&this->parmap.thread_counter, 1, __ATOMIC_SEQ_CST);
+  __atomic_add_fetch(&this->parmap.work_round, 1, __ATOMIC_SEQ_CST);
+  /* wake all workers */
+  futex_wake(&this->parmap.work_round, std::numeric_limits<int>::max());
+}
+
+template <typename T> void Parmap<T>::FutexSynchro::master_wait()
+{
+  unsigned count = __atomic_load_n(&this->parmap.thread_counter, __ATOMIC_SEQ_CST);
+  while (count < this->parmap.num_workers) {
+    /* wait for all workers to be ready */
+    futex_wait(&this->parmap.thread_counter, count);
+    count = __atomic_load_n(&this->parmap.thread_counter, __ATOMIC_SEQ_CST);
+  }
+}
+
+template <typename T> void Parmap<T>::FutexSynchro::worker_signal()
+{
+  unsigned count = __atomic_add_fetch(&this->parmap.thread_counter, 1, __ATOMIC_SEQ_CST);
+  if (count == this->parmap.num_workers) {
+    /* all workers have finished, wake the controller */
+    futex_wake(&this->parmap.thread_counter, std::numeric_limits<int>::max());
+  }
+}
+
+template <typename T> void Parmap<T>::FutexSynchro::worker_wait(unsigned round)
+{
+  unsigned work_round = __atomic_load_n(&this->parmap.work_round, __ATOMIC_SEQ_CST);
+  /* wait for more work */
+  while (work_round != round) {
+    futex_wait(&this->parmap.work_round, work_round);
+    work_round = __atomic_load_n(&this->parmap.work_round, __ATOMIC_SEQ_CST);
+  }
+}
+#endif
+
+template <typename T> void Parmap<T>::BusyWaitSynchro::master_signal()
+{
+  __atomic_store_n(&this->parmap.thread_counter, 1, __ATOMIC_SEQ_CST);
+  __atomic_add_fetch(&this->parmap.work_round, 1, __ATOMIC_SEQ_CST);
+}
+
+template <typename T> void Parmap<T>::BusyWaitSynchro::master_wait()
+{
+  while (__atomic_load_n(&this->parmap.thread_counter, __ATOMIC_SEQ_CST) < this->parmap.num_workers) {
+    xbt_os_thread_yield();
+  }
+}
+
+template <typename T> void Parmap<T>::BusyWaitSynchro::worker_signal()
+{
+  __atomic_add_fetch(&this->parmap.thread_counter, 1, __ATOMIC_SEQ_CST);
+}
+
+template <typename T> void Parmap<T>::BusyWaitSynchro::worker_wait(unsigned round)
+{
+  /* wait for more work */
+  while (__atomic_load_n(&this->parmap.work_round, __ATOMIC_SEQ_CST) != round) {
+    xbt_os_thread_yield();
+  }
+}
+
+/** \} */
+}
+}
+
+#endif
index 82b951f..b2623ae 100644 (file)
@@ -1,11 +1,12 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* 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 "surf/surf.h"
+#include "include/xbt/config.hpp"
+#include "src/instr/instr_private.hpp"
+#include "surf/surf.hpp"
+#include <string>
 #include <vector>
 
 XBT_LOG_NEW_CATEGORY(instr, "Logging the behavior of the tracing system (used for Visualization/Analysis of simulations)");
@@ -36,8 +37,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
 #define OPT_TRACING_TOPOLOGY             "tracing/platform/topology"
 #define OPT_TRACING                      "tracing"
 #define OPT_TRACING_UNCATEGORIZED        "tracing/uncategorized"
-#define OPT_VIVA_CAT_CONF                "viva/categorized"
-#define OPT_VIVA_UNCAT_CONF              "viva/uncategorized"
 
 static bool trace_enabled = false;
 static bool trace_platform;
@@ -63,8 +62,6 @@ static int trace_precision;
 static bool trace_configured = false;
 static bool trace_active     = false;
 
-static type_t rootType = nullptr;        /* the root type */
-
 instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
 
 static void TRACE_getopts()
@@ -105,30 +102,23 @@ int TRACE_start()
     /* init the tracing module to generate the right output */
 
     /* open the trace file(s) */
-    const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
-    XBT_DEBUG("Tracing format %s\n", format);
-    if (not strcmp(format, "Paje")) {
+    std::string format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
+    XBT_DEBUG("Tracing format %s\n", format.c_str());
+    if (format == "Paje") {
       TRACE_paje_start();
-    } else if (not strcmp(format, "TI")) {
+    } else if (format == "TI") {
       instr_fmt_type = instr_fmt_TI;
       TRACE_TI_start();
     }else{
-      xbt_die("Unknown trace format :%s ", format);
+      xbt_die("Unknown trace format :%s ", format.c_str());
     }
 
     /* 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");
-
-    /* other trace initialization */
-    created_categories = xbt_dict_new_homogeneous(xbt_free_f);
-    declared_marks = xbt_dict_new_homogeneous(xbt_free_f);
-    user_host_variables = xbt_dict_new_homogeneous(xbt_free_f);
-    user_vm_variables = xbt_dict_new_homogeneous(xbt_free_f);
-    user_link_variables = xbt_dict_new_homogeneous(xbt_free_f);
   }
   return 0;
 }
@@ -141,38 +131,28 @@ int TRACE_end()
   } else {
     retval = 0;
 
-    TRACE_generate_viva_uncat_conf();
-    TRACE_generate_viva_cat_conf();
-
     /* dump trace buffer */
     TRACE_last_timestamp_to_dump = surf_get_clock();
-    TRACE_paje_dump_buffer(1);
+    TRACE_paje_dump_buffer(true);
 
+    simgrid::instr::Type* root_type = simgrid::instr::Container::getRoot()->type_;
     /* destroy all data structures of tracing (and free) */
-    PJ_container_free_all();
-    recursiveDestroyType (PJ_type_get_root());
-    PJ_container_release();
-    rootType = nullptr;
-
-    xbt_dict_free(&user_link_variables);
-    xbt_dict_free(&user_host_variables);
-    xbt_dict_free(&user_vm_variables);
-    xbt_dict_free(&declared_marks);
-    xbt_dict_free(&created_categories);
+    delete simgrid::instr::Container::getRoot();
+    delete root_type;
 
     /* close the trace files */
-    const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
-    XBT_DEBUG("Tracing format %s\n", format);
-    if (not strcmp(format, "Paje")) {
+    std::string format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
+    XBT_DEBUG("Tracing format %s\n", format.c_str());
+    if (format == "Paje") {
       TRACE_paje_end();
-    } else if (not strcmp(format, "TI")) {
+    } else if (format == "TI") {
       TRACE_TI_end();
     }else{
-      xbt_die("Unknown trace format :%s ", format);
+      xbt_die("Unknown trace format :%s ", format.c_str());
     }
 
     /* de-activate trace */
-    trace_active = 0;
+    trace_active = false;
     XBT_DEBUG("Tracing is off");
     XBT_DEBUG("Tracing system is shutdown");
   }
@@ -285,12 +265,12 @@ bool TRACE_display_sizes ()
    return trace_display_sizes && trace_smpi_enabled && TRACE_is_enabled();
 }
 
-char *TRACE_get_comment ()
+std::string TRACE_get_comment()
 {
   return xbt_cfg_get_string(OPT_TRACING_COMMENT);
 }
 
-char *TRACE_get_comment_file ()
+std::string TRACE_get_comment_file()
 {
   return xbt_cfg_get_string(OPT_TRACING_COMMENT_FILE);
 }
@@ -300,28 +280,18 @@ int TRACE_precision ()
   return xbt_cfg_get_int(OPT_TRACING_PRECISION);
 }
 
-char *TRACE_get_filename()
+std::string TRACE_get_filename()
 {
   return xbt_cfg_get_string(OPT_TRACING_FILENAME);
 }
 
-char *TRACE_get_viva_uncat_conf ()
-{
-  return xbt_cfg_get_string(OPT_VIVA_UNCAT_CONF);
-}
-
-char *TRACE_get_viva_cat_conf ()
-{
-  return xbt_cfg_get_string(OPT_VIVA_CAT_CONF);
-}
-
-void TRACE_global_init(int *argc, char **argv)
+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.");
@@ -352,9 +322,6 @@ void TRACE_global_init(int *argc, char **argv)
       "The contents of the file are added to the top of the trace file as comment.");
   xbt_cfg_register_int(OPT_TRACING_PRECISION, 6, nullptr, "Numerical precision used when timestamping events "
       "(expressed in number of digits after decimal point)");
-  /* Viva graph configuration for uncategorized tracing */
-  xbt_cfg_register_string(OPT_VIVA_UNCAT_CONF, "", nullptr, "Viva Graph configuration file for uncategorized resource utilization traces.");
-  xbt_cfg_register_string(OPT_VIVA_CAT_CONF, "", nullptr, "Viva Graph configuration file for categorized resource utilization traces.");
 
   xbt_cfg_register_alias(OPT_TRACING_COMMENT_FILE,"tracing/comment_file");
   xbt_cfg_register_alias(OPT_TRACING_DISABLE_DESTROY, "tracing/disable_destroy");
@@ -365,16 +332,15 @@ void TRACE_global_init(int *argc, char **argv)
   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)
 {
-  char str[INSTR_DEFAULT_STR_SIZE];
-  snprintf (str, INSTR_DEFAULT_STR_SIZE, "--cfg=%s ", option);
+  std::string str = std::string("--cfg=") + option + " ";
 
-  int len = strlen (str);
-  printf ("%s%*.*s %s\n", str, 30-len, 30-len, "", desc);
+  int len = str.size();
+  printf("%s%*.*s %s\n", str.c_str(), 30 - len, 30 - len, "", desc);
   if (longdesc != nullptr && detailed){
     printf ("%s\n\n", longdesc);
   }
@@ -393,13 +359,13 @@ void TRACE_help (int detailed)
       "  It activates the uncategorized resource utilization tracing. Use it if\n"
       "  this simulator do not use tracing categories and resource use have to be\n"
       "  traced.", detailed);
-  print_line (OPT_TRACING_FILENAME, "Filename to register traces",
-      "  A file with this name will be created to register the simulation. The file\n"
-      "  is in the Paje format and can be analyzed using Viva, Paje, and PajeNG visualization\n"
-      "  tools. More information can be found in these webpages:\n"
-      "     http://github.com/schnorr/viva/\n"
-      "     http://github.com/schnorr/pajeng/\n"
-      "     http://paje.sourceforge.net/", detailed);
+  print_line(OPT_TRACING_FILENAME, "Filename to register traces",
+             "  A file with this name will be created to register the simulation. The file\n"
+             "  is in the Paje format and can be analyzed using Paje, and PajeNG visualization\n"
+             "  tools. More information can be found in these webpages:\n"
+             "     http://github.com/schnorr/pajeng/\n"
+             "     http://paje.sourceforge.net/",
+             detailed);
   print_line (OPT_TRACING_SMPI, "Trace the MPI Interface (SMPI)",
       "  This option only has effect if this simulator is SMPI-based. Traces the MPI\n"
       "  interface and generates a trace that can be analyzed using Gantt-like\n"
@@ -456,18 +422,6 @@ void TRACE_help (int detailed)
       "  Use this to add a comment line to the top of the trace file.", detailed);
   print_line (OPT_TRACING_COMMENT_FILE, "File contents added to trace file as comment.",
       "  Use this to add the contents of a file to the top of the trace file as comment.", detailed);
-  print_line (OPT_VIVA_UNCAT_CONF, "Generate a graph configuration for Viva",
-      "  This option can be used in all types of simulators build with SimGrid\n"
-      "  to generate a uncategorized resource utilization graph to be used as\n"
-      "  configuration for the Viva visualization tool. This option\n"
-      "  can be used with tracing/categorized:1 and tracing:1 options to\n"
-      "  analyze an unmodified simulator before changing it to contain\n"
-      "  categories.", detailed);
-  print_line (OPT_VIVA_CAT_CONF, "Generate an uncategorized graph configuration for Viva",
-      "  This option can be used if this simulator uses tracing categories\n"
-      "  in its code. The file specified by this option holds a graph configuration\n"
-      "  file for the Viva visualization tool that can be used to analyze a categorized\n"
-      "  resource utilization.", detailed);
   print_line (OPT_TRACING_TOPOLOGY, "Register the platform topology as a graph",
         "  This option (enabled by default) can be used to disable the tracing of\n"
         "  the platform topology in the trace file. Sometimes, such task is really\n"
@@ -491,117 +445,6 @@ static void output_types (const char *name, xbt_dynar_t types, FILE *file)
   xbt_dynar_free (&types);
 }
 
-static void output_categories (const char *name, xbt_dynar_t cats, FILE *file)
-{
-  unsigned int i;
-  fprintf (file, "    values = (");
-  for (i = xbt_dynar_length(cats); i > 0; i--) {
-    char *cat = *(static_cast<char**>(xbt_dynar_get_ptr(cats, i - 1)));
-    fprintf (file, "\"%s%s\"", name, cat);
-    if (i - 1 > 0){
-      fprintf (file, ",");
-    }else{
-      fprintf (file, ");\n");
-    }
-  }
-  xbt_dynar_free (&cats);
-}
-
-static void uncat_configuration (FILE *file)
-{
-  //register NODE and EDGE types
-  output_types ("node", TRACE_get_node_types(), file);
-  output_types ("edge", TRACE_get_edge_types(), file);
-  fprintf (file, "\n");
-
-  //configuration for all nodes
-  fprintf (file,
-      "  host = {\n"
-      "    type = \"square\";\n"
-      "    size = \"power\";\n"
-      "    values = (\"power_used\");\n"
-      "  };\n"
-      "  link = {\n"
-      "    type = \"rhombus\";\n"
-      "    size = \"bandwidth\";\n"
-      "    values = (\"bandwidth_used\");\n"
-      "  };\n");
-  //close
-}
-
-static void cat_configuration (FILE *file)
-{
-  //register NODE and EDGE types
-  output_types ("node", TRACE_get_node_types(), file);
-  output_types ("edge", TRACE_get_edge_types(), file);
-  fprintf (file, "\n");
-
-  //configuration for all nodes
-  fprintf (file,
-           "  host = {\n"
-           "    type = \"square\";\n"
-           "    size = \"power\";\n");
-  output_categories ("p", TRACE_get_categories(), file);
-  fprintf (file,
-           "  };\n"
-           "  link = {\n"
-           "    type = \"rhombus\";\n"
-           "    size = \"bandwidth\";\n");
-  output_categories ("b", TRACE_get_categories(), file);
-  fprintf (file, "  };\n");
-  //close
-}
-
-static void generate_uncat_configuration (const char *output, const char *name, int brackets)
-{
-  if (output && strlen(output) > 0){
-    FILE *file = fopen (output, "w");
-    if (file == nullptr){
-      THROWF (system_error, 1, "Unable to open file (%s) for writing %s graph configuration (uncategorized).",
-              output, name);
-    }
-
-    if (brackets)
-      fprintf (file, "{\n");
-    uncat_configuration (file);
-    if (brackets)
-      fprintf (file, "}\n");
-    fclose (file);
-  }
-}
-
-static void generate_cat_configuration (const char *output, const char *name, int brackets)
-{
-  if (output && strlen(output) > 0){
-    //check if we do have categories declared
-    if (xbt_dict_is_empty(created_categories)){
-      XBT_INFO("No categories declared, ignoring generation of %s graph configuration", name);
-      return;
-    }
-
-    FILE *file = fopen (output, "w");
-    if (file == nullptr){
-      THROWF (system_error, 1, "Unable to open file (%s) for writing %s graph "
-          "configuration (categorized).", output, name);
-    }
-
-    if (brackets) fprintf (file, "{\n");
-    cat_configuration (file);
-    if (brackets) fprintf (file, "}\n");
-    fclose (file);
-  }
-}
-
-void TRACE_generate_viva_uncat_conf ()
-{
-  generate_uncat_configuration (TRACE_get_viva_uncat_conf (), "viva", 0);
-}
-
-void TRACE_generate_viva_cat_conf ()
-{
-  generate_cat_configuration (TRACE_get_viva_cat_conf(), "viva", 0);
-}
-
 static int previous_trace_state = -1;
 
 void instr_pause_tracing ()
@@ -612,7 +455,7 @@ void instr_pause_tracing ()
   }else{
     XBT_DEBUG ("Tracing is being paused.");
   }
-  trace_enabled = 0;
+  trace_enabled = false;
   XBT_DEBUG ("Tracing is paused.");
 }
 
@@ -627,26 +470,8 @@ 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;
 }
-
-#undef OPT_TRACING
-#undef OPT_TRACING_PLATFORM
-#undef OPT_TRACING_TOPOLOGY
-#undef OPT_TRACING_SMPI
-#undef OPT_TRACING_SMPI_GROUP
-#undef OPT_TRACING_CATEGORIZED
-#undef OPT_TRACING_UNCATEGORIZED
-#undef OPT_TRACING_MSG_PROCESS
-#undef OPT_TRACING_FILENAME
-#undef OPT_TRACING_BUFFER
-#undef OPT_TRACING_ONELINK_ONLY
-#undef OPT_TRACING_DISABLE_DESTROY
-#undef OPT_TRACING_BASIC
-#undef OPT_TRACING_COMMENT
-#undef OPT_TRACING_COMMENT_FILE
-#undef OPT_VIVA_UNCAT_CONF
-#undef OPT_VIVA_CAT_CONF
index 43c2b18..455dffe 100644 (file)
@@ -1,45 +1,38 @@
-/* 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 "surf/surf.h"
+#include "src/surf/surf_private.hpp"
+#include "surf/surf.hpp"
+#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");
 
-xbt_dict_t created_categories = nullptr;
-xbt_dict_t declared_marks = nullptr;
-xbt_dict_t user_host_variables = nullptr;
-xbt_dict_t user_vm_variables = nullptr;
-xbt_dict_t user_link_variables = nullptr;
-extern xbt_dict_t trivaNodeTypes;
-extern xbt_dict_t trivaEdgeTypes;
+std::set<std::string> created_categories;
+std::set<std::string> declared_marks;
+std::set<std::string> user_host_variables;
+std::set<std::string> user_vm_variables;
+std::set<std::string> user_link_variables;
+extern std::set<std::string> trivaNodeTypes;
+extern std::set<std::string> trivaEdgeTypes;
 
-static xbt_dynar_t instr_dict_to_dynar (xbt_dict_t filter)
+static xbt_dynar_t instr_set_to_dynar(std::set<std::string>* filter)
 {
   if (not TRACE_is_enabled() || not TRACE_needs_platform())
     return nullptr;
 
   xbt_dynar_t ret = xbt_dynar_new (sizeof(char*), &xbt_free_ref);
-  xbt_dict_cursor_t cursor = nullptr;
-  char *name;
-  char *value;
-  xbt_dict_foreach(filter, cursor, name, value) {
-    xbt_dynar_push_as (ret, char*, xbt_strdup(name));
-  }
+  for (auto const& name : *filter)
+    xbt_dynar_push_as(ret, char*, xbt_strdup(name.c_str()));
+
   return ret;
 }
 
@@ -88,24 +81,24 @@ void TRACE_category_with_color (const char *category, const char *color)
     return;
 
   //check if category is already created
-  if (xbt_dict_get_or_null(created_categories, category) != nullptr)
+  if (created_categories.find(category) != created_categories.end())
     return;
-
-  xbt_dict_set (created_categories, category, xbt_strdup("1"), nullptr);
+  else
+    created_categories.insert(category);
 
   //define final_color
-  char final_color[INSTR_DEFAULT_STR_SIZE];
+  std::string final_color;
   if (not color) {
     //generate a random color
     double red = drand48();
     double green = drand48();
     double blue = drand48();
-    snprintf (final_color, INSTR_DEFAULT_STR_SIZE, "%f %f %f", red, green, blue);
+    final_color  = std::to_string(red) + " " + std::to_string(green) + " " + std::to_string(blue);
   }else{
-    snprintf (final_color, INSTR_DEFAULT_STR_SIZE, "%s", color);
+    final_color = std::string(color);
   }
 
-  XBT_DEBUG("CAT,declare %s, \"%s\" \"%s\"", category, color, final_color);
+  XBT_DEBUG("CAT,declare %s, \"%s\" \"%s\"", category, color, final_color.c_str());
 
   //define the type of this category on top of hosts and links
   instr_new_variable_type (category, final_color);
@@ -127,8 +120,7 @@ xbt_dynar_t TRACE_get_categories ()
 {
   if (not TRACE_is_enabled() || not TRACE_categorized())
     return nullptr;
-
-  return instr_dict_to_dynar (created_categories);
+  return instr_set_to_dynar(&created_categories);
 }
 
 /** \ingroup TRACE_mark
@@ -151,13 +143,13 @@ void TRACE_declare_mark(const char *mark_type)
     THROWF (tracing_error, 1, "mark_type is nullptr");
 
   //check if mark_type is already declared
-  if (xbt_dict_get_or_null(declared_marks, mark_type) != nullptr) {
+  if (declared_marks.find(mark_type) != declared_marks.end()) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is already declared", mark_type);
   }
 
   XBT_DEBUG("MARK,declare %s", mark_type);
-  PJ_type_event_new(mark_type, PJ_type_get_root());
-  xbt_dict_set (declared_marks, mark_type, xbt_strdup("1"), nullptr);
+  simgrid::instr::Container::getRoot()->type_->getOrCreateEventType(mark_type);
+  declared_marks.insert(mark_type);
 }
 
 /** \ingroup TRACE_mark
@@ -186,17 +178,17 @@ 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");
 
-  type_t type = PJ_type_get (mark_type, PJ_type_get_root());
+  simgrid::instr::EventType* type =
+      static_cast<simgrid::instr::EventType*>(simgrid::instr::Container::getRoot()->type_->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;
+  } else {
+    if (not mark_color)
+      mark_color = "1.0 1.0 1.0" /*white*/;
 
-  XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
-  PJ_value_new (mark_value, mark_color, type);
+    XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
+    type->addEntityValue(mark_value, mark_color);
+  }
 }
 
 /** \ingroup TRACE_mark
@@ -242,14 +234,15 @@ 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
-  type_t type = PJ_type_get (mark_type, PJ_type_get_root());
+  simgrid::instr::EventType* type =
+      static_cast<simgrid::instr::EventType*>(simgrid::instr::Container::getRoot()->type_->byName(mark_type));
   if (not type) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
+  } else {
+    XBT_DEBUG("MARK %s %s", mark_type, mark_value);
+    new simgrid::instr::NewEvent(MSG_get_clock(), simgrid::instr::Container::getRoot(), type,
+                                 type->getEntityValue(mark_value));
   }
-
-  val_t value = PJ_value_get (mark_value, type);
-  XBT_DEBUG("MARK %s %s", mark_type, mark_value);
-  new NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value);
 }
 
 /** \ingroup TRACE_mark
@@ -264,38 +257,35 @@ xbt_dynar_t TRACE_get_marks ()
   if (not TRACE_is_enabled())
     return nullptr;
 
-  return instr_dict_to_dynar (declared_marks);
+  return instr_set_to_dynar(&declared_marks);
 }
 
-static void instr_user_variable(double time, const char *resource, const char *variable, const char *father_type,
-                         double value, InstrUserVariable what, const char *color, xbt_dict_t filter)
+static void instr_user_variable(double time, const char* resource, const char* variable_name, const char* father_type,
+                                double value, InstrUserVariable what, const char* color, std::set<std::string>* filter)
 {
   /* safe switches. tracing has to be activated and if platform is not traced, we don't allow user variables */
   if (not TRACE_is_enabled() || not TRACE_needs_platform())
     return;
 
   //check if variable is already declared
-  char *created = (char*)xbt_dict_get_or_null(filter, variable);
+  auto created = filter->find(variable_name);
   if (what == INSTR_US_DECLARE){
-    if (not created) { // not declared yet
-      xbt_dict_set (filter, variable, xbt_strdup("1"), nullptr);
-      instr_new_user_variable_type (father_type, variable, color);
+    if (created == filter->end()) { // not declared yet
+      filter->insert(variable_name);
+      instr_new_user_variable_type(father_type, variable_name, color == nullptr ? "" : color);
     }
   }else{
-    if (created) { // declared, let's work
-      char valuestr[100];
-      snprintf(valuestr, 100, "%g", value);
-      container_t container = PJ_container_get(resource);
-      type_t type = PJ_type_get (variable, container->type);
+    if (created != filter->end()) { // declared, let's work
+      simgrid::instr::VariableType* variable = simgrid::instr::Container::byName(resource)->getVariable(variable_name);
       switch (what){
       case INSTR_US_SET:
-        new SetVariableEvent(time, container, type, value);
+        variable->setEvent(time, value);
         break;
       case INSTR_US_ADD:
-        new AddVariableEvent(time, container, type, value);
+        variable->addEvent(time, value);
         break;
       case INSTR_US_SUB:
-        new SubVariableEvent(time, container, type, value);
+        variable->subEvent(time, value);
         break;
       default:
         THROW_IMPOSSIBLE;
@@ -317,9 +307,9 @@ static void instr_user_srcdst_variable(double time, const char *src, const char
     xbt_die("Element '%s' not found!",dst);
 
   std::vector<simgrid::surf::LinkImpl*> route;
-  simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, &route, nullptr);
-  for (auto link : route)
-    instr_user_variable(time, link->cname(), variable, father_type, value, what, nullptr, user_link_variables);
+  simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, route, nullptr);
+  for (auto const& link : route)
+    instr_user_variable(time, link->getCname(), variable, father_type, value, what, nullptr, &user_link_variables);
 }
 
 /** \ingroup TRACE_API
@@ -365,7 +355,7 @@ int TRACE_platform_graph_export_graphviz (const char *filename)
  */
 void TRACE_vm_variable_declare (const char *variable)
 {
-  instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, nullptr, user_vm_variables);
+  instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, nullptr, &user_vm_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -380,7 +370,7 @@ void TRACE_vm_variable_declare (const char *variable)
  */
 void TRACE_vm_variable_declare_with_color (const char *variable, const char *color)
 {
-   instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, color, user_vm_variables);
+  instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, color, &user_vm_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -442,7 +432,7 @@ void TRACE_vm_variable_sub (const char *vm, const char *variable, double value)
  */
 void TRACE_vm_variable_set_with_time (double time, const char *vm, const char *variable, double value)
 {
-  instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SET, nullptr, user_vm_variables);
+  instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SET, nullptr, &user_vm_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -462,7 +452,7 @@ void TRACE_vm_variable_set_with_time (double time, const char *vm, const char *v
  */
 void TRACE_vm_variable_add_with_time (double time, const char *vm, const char *variable, double value)
 {
-  instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_ADD, nullptr, user_vm_variables);
+  instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_ADD, nullptr, &user_vm_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -482,7 +472,7 @@ void TRACE_vm_variable_add_with_time (double time, const char *vm, const char *v
  */
 void TRACE_vm_variable_sub_with_time (double time, const char *vm, const char *variable, double value)
 {
-  instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SUB, nullptr, user_vm_variables);
+  instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SUB, nullptr, &user_vm_variables);
 }
 
 /* for host variables */
@@ -499,7 +489,7 @@ void TRACE_vm_variable_sub_with_time (double time, const char *vm, const char *v
  */
 void TRACE_host_variable_declare (const char *variable)
 {
-  instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, nullptr, user_host_variables);
+  instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, nullptr, &user_host_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -514,7 +504,7 @@ void TRACE_host_variable_declare (const char *variable)
  */
 void TRACE_host_variable_declare_with_color (const char *variable, const char *color)
 {
-  instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, color, user_host_variables);
+  instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, color, &user_host_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -576,7 +566,7 @@ void TRACE_host_variable_sub (const char *host, const char *variable, double val
  */
 void TRACE_host_variable_set_with_time (double time, const char *host, const char *variable, double value)
 {
-  instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SET, nullptr, user_host_variables);
+  instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SET, nullptr, &user_host_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -596,7 +586,7 @@ void TRACE_host_variable_set_with_time (double time, const char *host, const cha
  */
 void TRACE_host_variable_add_with_time (double time, const char *host, const char *variable, double value)
 {
-  instr_user_variable(time, host, variable, "HOST", value, INSTR_US_ADD, nullptr, user_host_variables);
+  instr_user_variable(time, host, variable, "HOST", value, INSTR_US_ADD, nullptr, &user_host_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -616,7 +606,7 @@ void TRACE_host_variable_add_with_time (double time, const char *host, const cha
  */
 void TRACE_host_variable_sub_with_time (double time, const char *host, const char *variable, double value)
 {
-  instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SUB, nullptr, user_host_variables);
+  instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SUB, nullptr, &user_host_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -629,7 +619,7 @@ void TRACE_host_variable_sub_with_time (double time, const char *host, const cha
  */
 xbt_dynar_t TRACE_get_host_variables ()
 {
-  return instr_dict_to_dynar (user_host_variables);
+  return instr_set_to_dynar(&user_host_variables);
 }
 
 /* for link variables */
@@ -646,7 +636,7 @@ xbt_dynar_t TRACE_get_host_variables ()
  */
 void TRACE_link_variable_declare (const char *variable)
 {
-  instr_user_variable (0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, nullptr, user_link_variables);
+  instr_user_variable(0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, nullptr, &user_link_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -661,7 +651,7 @@ void TRACE_link_variable_declare (const char *variable)
  */
 void TRACE_link_variable_declare_with_color (const char *variable, const char *color)
 {
-  instr_user_variable (0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, color, user_link_variables);
+  instr_user_variable(0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, color, &user_link_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -723,7 +713,7 @@ void TRACE_link_variable_sub (const char *link, const char *variable, double val
  */
 void TRACE_link_variable_set_with_time (double time, const char *link, const char *variable, double value)
 {
-  instr_user_variable (time, link, variable, "LINK", value, INSTR_US_SET, nullptr, user_link_variables);
+  instr_user_variable(time, link, variable, "LINK", value, INSTR_US_SET, nullptr, &user_link_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -743,7 +733,7 @@ void TRACE_link_variable_set_with_time (double time, const char *link, const cha
  */
 void TRACE_link_variable_add_with_time (double time, const char *link, const char *variable, double value)
 {
-  instr_user_variable (time, link, variable, "LINK", value, INSTR_US_ADD, nullptr, user_link_variables);
+  instr_user_variable(time, link, variable, "LINK", value, INSTR_US_ADD, nullptr, &user_link_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -763,7 +753,7 @@ void TRACE_link_variable_add_with_time (double time, const char *link, const cha
  */
 void TRACE_link_variable_sub_with_time (double time, const char *link, const char *variable, double value)
 {
-  instr_user_variable (time, link, variable, "LINK", value, INSTR_US_SUB, nullptr, user_link_variables);
+  instr_user_variable(time, link, variable, "LINK", value, INSTR_US_SUB, nullptr, &user_link_variables);
 }
 
 /* for link variables, but with src and dst used for get_route */
@@ -900,7 +890,7 @@ void TRACE_link_srcdst_variable_sub_with_time (double time, const char *src, con
  */
 xbt_dynar_t TRACE_get_link_variables ()
 {
-  return instr_dict_to_dynar (user_link_variables);
+  return instr_set_to_dynar(&user_link_variables);
 }
 
 /** \ingroup TRACE_user_variables
@@ -946,12 +936,11 @@ void TRACE_host_state_declare_value (const char *state, const char *value, const
  *
  *  \see TRACE_host_state_declare, TRACE_host_push_state, TRACE_host_pop_state, TRACE_host_reset_state
  */
-void TRACE_host_set_state (const char *host, const char *state, const char *value)
+void TRACE_host_set_state(const char* host, const char* state_name, const char* value_name)
 {
-  container_t container = PJ_container_get(host);
-  type_t type = PJ_type_get (state, container->type);
-  val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
-  new SetStateEvent(MSG_get_clock(), container, type, val);
+  simgrid::instr::StateType* state = simgrid::instr::Container::byName(host)->getState(state_name);
+  state->addEntityValue(value_name);
+  state->setEvent(value_name);
 }
 
 /** \ingroup TRACE_user_variables
@@ -965,12 +954,9 @@ void TRACE_host_set_state (const char *host, const char *state, const char *valu
  *
  *  \see TRACE_host_state_declare, TRACE_host_set_state, TRACE_host_pop_state, TRACE_host_reset_state
  */
-void TRACE_host_push_state (const char *host, const char *state, const char *value)
+void TRACE_host_push_state(const char* host, const char* state_name, const char* value_name)
 {
-  container_t container = PJ_container_get(host);
-  type_t type = PJ_type_get (state, container->type);
-  val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
-  new PushStateEvent(MSG_get_clock(), container, type, val);
+  simgrid::instr::Container::byName(host)->getState(state_name)->pushEvent(value_name);
 }
 
 /** \ingroup TRACE_user_variables
@@ -983,11 +969,9 @@ void TRACE_host_push_state (const char *host, const char *state, const char *val
  *
  *  \see TRACE_host_state_declare, TRACE_host_set_state, TRACE_host_push_state, TRACE_host_reset_state
  */
-void TRACE_host_pop_state (const char *host, const char *state)
+void TRACE_host_pop_state(const char* host, const char* state_name)
 {
-  container_t container = PJ_container_get(host);
-  type_t type = PJ_type_get (state, container->type);
-  new PopStateEvent(MSG_get_clock(), container, type);
+  simgrid::instr::Container::byName(host)->getState(state_name)->popEvent();
 }
 
 /** \ingroup TRACE_API
@@ -1000,7 +984,7 @@ void TRACE_host_pop_state (const char *host, const char *state)
  */
 xbt_dynar_t TRACE_get_node_types ()
 {
-  return instr_dict_to_dynar (trivaNodeTypes);
+  return instr_set_to_dynar(&trivaNodeTypes);
 }
 
 /** \ingroup TRACE_API
@@ -1013,5 +997,5 @@ xbt_dynar_t TRACE_get_node_types ()
  */
 xbt_dynar_t TRACE_get_edge_types ()
 {
-  return instr_dict_to_dynar (trivaEdgeTypes);
+  return instr_set_to_dynar(&trivaEdgeTypes);
 }
index b5d9800..ce66709 100644 (file)
@@ -5,17 +5,18 @@
 
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
-
-#include "surf/surf.h"
-
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 
 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 xbt_dict_t allContainers = nullptr;     /* all created containers indexed by name */
-xbt_dict_t trivaNodeTypes = nullptr;     /* all host types defined */
-xbt_dict_t trivaEdgeTypes = nullptr;     /* all link types defined */
+static std::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 */
 
 long long int instr_new_paje_id ()
 {
@@ -23,229 +24,208 @@ long long int instr_new_paje_id ()
   return type_id++;
 }
 
-void PJ_container_alloc ()
+namespace simgrid {
+namespace instr {
+
+container_t Container::getRoot()
 {
-  allContainers = xbt_dict_new_homogeneous(nullptr);
-  trivaNodeTypes = xbt_dict_new_homogeneous(xbt_free_f);
-  trivaEdgeTypes = xbt_dict_new_homogeneous(xbt_free_f);
+  return rootContainer;
 }
 
-void PJ_container_release ()
+NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father)
+    : Container::Container(name, "", father)
 {
-  xbt_dict_free (&allContainers);
-  xbt_dict_free (&trivaNodeTypes);
-  xbt_dict_free (&trivaEdgeTypes);
+  netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
+  xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
+  if (father_) {
+    type_ = father_->type_->getOrCreateContainerType(std::string("L") + std::to_string(level));
+    father_->children_.insert({getName(), this});
+    logCreation();
+  } else {
+    type_         = new ContainerType("0");
+    rootContainer = this;
+  }
 }
 
-void PJ_container_set_root (container_t root)
+RouterContainer::RouterContainer(std::string name, Container* father) : Container::Container(name, "ROUTER", father)
 {
-  rootContainer = root;
+  xbt_assert(father, "Only the Root container has no father");
+
+  netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
+  xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
+
+  trivaNodeTypes.insert(type_->getName());
 }
 
-container_t PJ_container_new (const char *name, e_container_types kind, container_t father)
+HostContainer::HostContainer(simgrid::s4u::Host& host, NetZoneContainer* father)
+    : Container::Container(host.getCname(), "HOST", father)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a container with a nullptr name");
-  }
+  xbt_assert(father, "Only the Root container has no father");
+
+  netpoint_ = host.pimpl_netpoint;
+  xbt_assert(netpoint_, "Element '%s' not found", host.getCname());
+
+  trivaNodeTypes.insert(type_->getName());
+}
 
+Container::Container(std::string name, std::string type_name, Container* father) : name_(name), father_(father)
+{
   static long long int container_id = 0;
-  char id_str[INSTR_DEFAULT_STR_SIZE];
-  snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", container_id);
+  id_                               = container_id; // id (or alias) of the container
   container_id++;
 
-  container_t newContainer = xbt_new0(s_container_t, 1);
-  newContainer->name = xbt_strdup (name); // name of the container
-  newContainer->id = xbt_strdup (id_str); // id (or alias) of the container
-  newContainer->father = father;
-  sg_host_t sg_host = sg_host_by_name(name);
-
-  //Search for network_element_t
-  switch (kind){
-    case INSTR_HOST:
-      newContainer->netpoint = sg_host->pimpl_netpoint;
-      xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
-      break;
-    case INSTR_ROUTER:
-      newContainer->netpoint = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
-      xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
-      break;
-    case INSTR_AS:
-      newContainer->netpoint = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
-      xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
-      break;
-    default:
-      newContainer->netpoint = nullptr;
-      break;
-  }
+  if (father_) {
+    XBT_DEBUG("new container %s, child of %s", name.c_str(), father->name_.c_str());
 
-  // level depends on level of father
-  if (newContainer->father){
-    newContainer->level = newContainer->father->level+1;
-    XBT_DEBUG("new container %s, child of %s", name, father->name);
-  }else{
-    newContainer->level = 0;
-  }
-  // type definition (method depends on kind of this new container)
-  newContainer->kind = kind;
-  if (newContainer->kind == 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", newContainer->level);
-    if (newContainer->father){
-      newContainer->type = PJ_type_get_or_null (as_typename, newContainer->father->type);
-      if (newContainer->type == nullptr){
-        newContainer->type = PJ_type_container_new (as_typename, newContainer->father->type);
-      }
-    }else{
-      newContainer->type = PJ_type_container_new ("0", nullptr);
+    if (not type_name.empty()) {
+      type_ = father_->type_->getOrCreateContainerType(type_name);
+      father_->children_.insert({name_, this});
+      logCreation();
     }
-  }else{
-    //otherwise, the name is its kind
-    char typeNameBuff[INSTR_DEFAULT_STR_SIZE];
-    switch (newContainer->kind){
-      case INSTR_HOST:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "HOST");
-        break;
-      case INSTR_LINK:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "LINK");
-        break;
-      case INSTR_ROUTER:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "ROUTER");
-        break;
-      case INSTR_SMPI:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MPI");
-        break;
-      case INSTR_MSG_PROCESS:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_PROCESS");
-        break;
-      case INSTR_MSG_VM:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_VM");
-        break;
-      case INSTR_MSG_TASK:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_TASK");
-        break;
-      default:
-        THROWF (tracing_error, 0, "new container kind is unknown.");
-        break;
-    }
-    type_t type = PJ_type_get_or_null (typeNameBuff, newContainer->father->type);
-    if (type == nullptr){
-      newContainer->type = PJ_type_container_new (typeNameBuff, newContainer->father->type);
-    }else{
-      newContainer->type = type;
-    }
-  }
-  newContainer->children = xbt_dict_new_homogeneous(nullptr);
-  if (newContainer->father){
-    xbt_dict_set(newContainer->father->children, newContainer->name, newContainer, nullptr);
-    LogContainerCreation(newContainer);
   }
 
   //register all kinds by name
-  if (xbt_dict_get_or_null(allContainers, newContainer->name) != nullptr){
-    THROWF(tracing_error, 1, "container %s already present in allContainers data structure", newContainer->name);
-  }
+  if (not allContainers.emplace(name_, this).second)
+    THROWF(tracing_error, 1, "container %s already present in allContainers data structure", name_.c_str());
 
-  xbt_dict_set (allContainers, newContainer->name, newContainer, nullptr);
-  XBT_DEBUG("Add container name '%s'",newContainer->name);
+  XBT_DEBUG("Add container name '%s'", name_.c_str());
 
   //register NODE types for triva configuration
-  if (newContainer->kind == INSTR_HOST || newContainer->kind == INSTR_LINK || newContainer->kind == INSTR_ROUTER) {
-    xbt_dict_set (trivaNodeTypes, newContainer->type->name, xbt_strdup("1"), nullptr);
-  }
-  return newContainer;
+  if (type_name == "LINK")
+    trivaNodeTypes.insert(type_->getName());
 }
 
-container_t PJ_container_get (const char *name)
+Container::~Container()
 {
-  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;
+  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
+  TRACE_last_timestamp_to_dump = SIMIX_get_clock();
+  TRACE_paje_dump_buffer(true);
+
+  // trace my destruction, but not if user requests so or if the container is root
+  if (not TRACE_disable_destroy() && this != Container::getRoot())
+    logDestruction();
+
+  // remove me from the allContainers data structure
+  allContainers.erase(name_);
 }
 
-container_t PJ_container_get_or_null (const char *name)
+Container* Container::byNameOrNull(std::string name)
 {
-  return static_cast<container_t>(name != nullptr ? xbt_dict_get_or_null(allContainers, name) : nullptr);
+  auto cont = allContainers.find(name);
+  return cont == allContainers.end() ? nullptr : cont->second;
 }
 
-container_t 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");
+  if (father_) {
+    XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", getCname(), father_->getCname());
+    father_->children_.erase(name_);
   }
+}
+
+void Container::logCreation()
+{
+  double timestamp = SIMIX_get_clock();
+  std::stringstream stream;
+
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, PAJE_CreateContainer, timestamp);
+
+  if (instr_fmt_type == instr_fmt_paje) {
+    stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_CreateContainer << " ";
+    /* 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_ << "\"";
+    XBT_DEBUG("Dump %s", stream.str().c_str());
+    fprintf(tracing_file, "%s\n", stream.str().c_str());
+  } 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();
+    }
 
-  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 (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
+      std::string folder_name = TRACE_get_filename() + "_files";
+      std::string filename    = folder_name + "/" + std::to_string(prefix) + "_" + name_ + ".txt";
+#ifdef WIN32
+      _mkdir(folder_name.c_str());
+#else
+      mkdir(folder_name.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
+#endif
+      ti_unique_file = fopen(filename.c_str(), "w");
+      xbt_assert(ti_unique_file, "Tracefile %s could not be opened for writing: %s", filename.c_str(), strerror(errno));
+      fprintf(tracing_file, "%s\n", filename.c_str());
+    }
+    tracing_files.insert({this, ti_unique_file});
+  } else {
+    THROW_IMPOSSIBLE;
   }
 }
 
-void PJ_container_free (container_t container)
+void Container::logDestruction()
 {
-  if (container == nullptr){
-    THROWF (tracing_error, 0, "trying to free a nullptr container");
-  }
-  XBT_DEBUG("destroy container %s", container->name);
-
-  //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 my destruction
-  if (not TRACE_disable_destroy() && container != PJ_container_get_root()) {
-    //do not trace the container destruction if user requests
-    //or if the container is root
-    LogContainerDestruction(container);
+  std::stringstream stream;
+  double timestamp = SIMIX_get_clock();
+
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, PAJE_DestroyContainer, timestamp);
+
+  if (instr_fmt_type == instr_fmt_paje) {
+    stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DestroyContainer << " ";
+    /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
+    if (timestamp < 1e-12)
+      stream << 0 << " " << type_->getId() << " " << id_;
+    else
+      stream << timestamp << " " << type_->getId() << " " << id_;
+    XBT_DEBUG("Dump %s", stream.str().c_str());
+    fprintf(tracing_file, "%s\n", stream.str().c_str());
+  } else if (instr_fmt_type == instr_fmt_TI) {
+    if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || tracing_files.size() == 1) {
+      fclose(tracing_files.at(this));
+    }
+    tracing_files.erase(this);
+  } else {
+    THROW_IMPOSSIBLE;
   }
-
-  //remove it from allContainers data structure
-  xbt_dict_remove (allContainers, container->name);
-
-  //free
-  xbt_free (container->name);
-  xbt_free (container->id);
-  xbt_dict_free (&container->children);
-  xbt_free (container);
-  container = nullptr;
 }
 
-static void recursiveDestroyContainer (container_t container)
+StateType* Container::getState(std::string name)
 {
-  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);
-  }
-  PJ_container_free (container);
+  StateType* ret = dynamic_cast<StateType*>(type_->byName(name));
+  ret->setCallingContainer(this);
+  return ret;
 }
 
-void PJ_container_free_all ()
+LinkType* Container::getLink(std::string name)
 {
-  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;
+  LinkType* ret = dynamic_cast<LinkType*>(type_->byName(name));
+  ret->setCallingContainer(this);
+  return ret;
+}
 
-  //checks
-  if (not xbt_dict_is_empty(allContainers)) {
-    THROWF(tracing_error, 0, "some containers still present even after destroying all of them");
-  }
+VariableType* Container::getVariable(std::string name)
+{
+  VariableType* ret = dynamic_cast<VariableType*>(type_->byName(name));
+  ret->setCallingContainer(this);
+  return ret;
+}
+}
 }
diff --git a/src/instr/instr_paje_containers.hpp b/src/instr/instr_paje_containers.hpp
new file mode 100644 (file)
index 0000000..fe1bd00
--- /dev/null
@@ -0,0 +1,63 @@
+/* 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_PAJE_CONTAINERS_HPP
+#define INSTR_PAJE_CONTAINERS_HPP
+
+#include "src/instr/instr_private.hpp"
+#include <string>
+
+namespace simgrid {
+namespace instr {
+class Type;
+class LinkType;
+class StateType;
+class VariableType;
+
+class Container {
+  long long int id_;
+  std::string name_; /* Unique name of this container */
+public:
+  Container(std::string name, std::string type_name, Container* father);
+  virtual ~Container();
+
+  Type* type_; /* Type of this container */
+  Container* father_;
+  std::map<std::string, Container*> children_;
+  sg_netpoint_t netpoint_ = nullptr;
+
+  static Container* byNameOrNull(std::string name);
+  static Container* byName(std::string name);
+  std::string getName() { return name_; }
+  const char* getCname() { return name_.c_str(); }
+  long long int getId() { return id_; }
+  void removeFromParent();
+  void logCreation();
+  void logDestruction();
+
+  StateType* getState(std::string name);
+  LinkType* getLink(std::string name);
+  VariableType* getVariable(std::string name);
+
+  static Container* getRoot();
+};
+
+class NetZoneContainer : public Container {
+public:
+  NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father);
+};
+
+class RouterContainer : public Container {
+public:
+  RouterContainer(std::string name, Container* father);
+};
+
+class HostContainer : public Container {
+public:
+  HostContainer(simgrid::s4u::Host& host, NetZoneContainer* father);
+};
+}
+}
+#endif
diff --git a/src/instr/instr_paje_events.cpp b/src/instr/instr_paje_events.cpp
new file mode 100644 (file)
index 0000000..29b7e34
--- /dev/null
@@ -0,0 +1,169 @@
+/* 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 "src/instr/instr_private.hpp"
+#include "src/instr/instr_smpi.hpp"
+#include "src/smpi/include/private.hpp"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_events, instr, "Paje tracing event system (events)");
+extern FILE* tracing_file;
+std::map<container_t, FILE*> tracing_files; // TI specific
+
+namespace simgrid {
+namespace instr {
+
+NewEvent::NewEvent(double timestamp, container_t container, Type* type, EntityValue* val)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent), val(val)
+{
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, eventType_, timestamp_);
+  insertIntoBuffer();
+}
+
+LinkEvent::LinkEvent(container_t container, Type* type, e_event_type event_type, container_t endpoint,
+                     std::string value, std::string key)
+    : LinkEvent(container, type, event_type, endpoint, value, key, -1)
+{
+}
+
+LinkEvent::LinkEvent(container_t container, Type* type, e_event_type event_type, container_t endpoint,
+                     std::string value, std::string key, int size)
+    : PajeEvent(container, type, SIMIX_get_clock(), event_type)
+    , endpoint_(endpoint)
+    , value_(value)
+    , key_(key)
+    , size_(size)
+{
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f, value:%s", __FUNCTION__, eventType_, timestamp_, value_.c_str());
+  insertIntoBuffer();
+}
+
+VariableEvent::VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value)
+    : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value)
+{
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, eventType_, timestamp_);
+  insertIntoBuffer();
+}
+
+StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value)
+    : StateEvent(container, type, event_type, value, nullptr)
+{
+}
+
+StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra)
+    : PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), 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();
+    filename                        = loc->filename;
+    linenumber                      = loc->linenumber;
+  }
+#endif
+
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, eventType_, timestamp_);
+  insertIntoBuffer();
+};
+
+void NewEvent::print()
+{
+  std::stringstream stream;
+  stream << std::fixed << std::setprecision(TRACE_precision());
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  if (instr_fmt_type != instr_fmt_paje)
+    return;
+
+  if (timestamp_ < 1e-12)
+    stream << eventType_ << " " << 0 << " ";
+  else
+    stream << eventType_ << " " << timestamp_ << " ";
+  stream << getType()->getId() << " " << getContainer()->getId() << " " << val->getId();
+  XBT_DEBUG("Dump %s", stream.str().c_str());
+  fprintf(tracing_file, "%s\n", stream.str().c_str());
+}
+
+void LinkEvent::print()
+{
+  std::stringstream stream;
+  stream << std::fixed << std::setprecision(TRACE_precision());
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  if (instr_fmt_type != instr_fmt_paje)
+    return;
+  if (timestamp_ < 1e-12)
+    stream << eventType_ << " " << 0 << " " << getType()->getId() << " " << getContainer()->getId();
+  else
+    stream << eventType_ << " " << timestamp_ << " " << getType()->getId() << " " << getContainer()->getId();
+
+  stream << " " << value_ << " " << endpoint_->getId() << " " << key_;
+
+  if (TRACE_display_sizes()) {
+    stream << " " << size_;
+  }
+  XBT_DEBUG("Dump %s", stream.str().c_str());
+  fprintf(tracing_file, "%s\n", stream.str().c_str());
+}
+
+void VariableEvent::print()
+{
+  std::stringstream stream;
+  stream << std::fixed << std::setprecision(TRACE_precision());
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  if (instr_fmt_type != instr_fmt_paje)
+    return;
+
+  if (timestamp_ < 1e-12)
+    stream << eventType_ << " " << 0 << " ";
+  else
+    stream << eventType_ << " " << timestamp_ << " ";
+  stream << getType()->getId() << " " << getContainer()->getId() << " " << value;
+  XBT_DEBUG("Dump %s", stream.str().c_str());
+  fprintf(tracing_file, "%s\n", stream.str().c_str());
+}
+
+void StateEvent::print()
+{
+  std::stringstream stream;
+  stream << std::fixed << std::setprecision(TRACE_precision());
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  if (instr_fmt_type == instr_fmt_paje) {
+    if (timestamp_ < 1e-12)
+      stream << eventType_ << " " << 0 << " " << getType()->getId() << " " << getContainer()->getId();
+    else
+      stream << eventType_ << " " << timestamp_ << " " << getType()->getId() << " " << getContainer()->getId();
+
+    if (value != nullptr) // PAJE_PopState Event does not need to have a value
+      stream << " " << value->getId();
+
+    if (TRACE_display_sizes())
+      stream << " " << ((extra_ != nullptr) ? extra_->display_size() : 0);
+
+#if HAVE_SMPI
+    if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
+      stream << " \"" << filename << "\" " << linenumber;
+    }
+#endif
+    XBT_DEBUG("Dump %s", stream.str().c_str());
+    fprintf(tracing_file, "%s\n", stream.str().c_str());
+  } else if (instr_fmt_type == instr_fmt_TI) {
+    if (extra_ == nullptr)
+      return;
+
+    /* Unimplemented calls are: WAITANY, SENDRECV, SCAN, EXSCAN, SSEND, and ISSEND. */
+
+    // FIXME: dirty extract "rank-" from the name, as we want the bare process id here
+    if (getContainer()->getName().find("rank-") != 0)
+      stream << getContainer()->getName() << " " << extra_->print();
+    else
+      stream << getContainer()->getName().erase(0, 5) << " " << extra_->print();
+
+    fprintf(tracing_files.at(getContainer()), "%s\n", stream.str().c_str());
+  } else {
+    THROW_IMPOSSIBLE;
+  }
+
+  delete extra_;
+}
+}
+}
diff --git a/src/instr/instr_paje_events.hpp b/src/instr/instr_paje_events.hpp
new file mode 100644 (file)
index 0000000..c8fa8b2
--- /dev/null
@@ -0,0 +1,98 @@
+/* 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_PAJE_EVENTS_HPP
+#define INSTR_PAJE_EVENTS_HPP
+
+#include "src/instr/instr_private.hpp"
+#include <string>
+
+namespace simgrid {
+namespace instr {
+class EntityValue;
+class TIData;
+
+enum e_event_type : unsigned int {
+  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
+};
+
+class PajeEvent {
+  Container* container_;
+  Type* type_;
+
+protected:
+  Type* getType() { return type_; }
+  Container* getContainer() { return container_; }
+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 ~PajeEvent() = default;
+  virtual void print() = 0;
+  void insertIntoBuffer();
+};
+
+class VariableEvent : public PajeEvent {
+  double value;
+
+public:
+  VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value);
+  void print() override;
+};
+
+class StateEvent : public PajeEvent {
+  EntityValue* value;
+  std::string filename;
+  int linenumber = 0;
+  TIData* extra_ = nullptr;
+
+public:
+  StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value);
+  StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra);
+  void print() override;
+};
+
+class LinkEvent : public PajeEvent {
+  Container* endpoint_;
+  std::string value_;
+  std::string key_;
+  int size_ = -1;
+
+public:
+  LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer, std::string value,
+            std::string key);
+  LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer, std::string value,
+            std::string key, int size);
+  void print() override;
+};
+
+class NewEvent : public PajeEvent {
+  EntityValue* val;
+
+public:
+  NewEvent(double timestamp, Container* container, Type* type, EntityValue* val);
+  void print() override;
+};
+}
+}
+#endif
index d0b48b1..8e293ad 100644 (file)
@@ -1,19 +1,19 @@
-/* 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", PAJE_DefineContainerType);
+  fprintf(tracing_file, "%%EventDef PajeDefineContainerType %u\n", simgrid::instr::PAJE_DefineContainerType);
   fprintf(tracing_file, "%%       Alias string\n");
   if (basic){
     fprintf(tracing_file, "%%       ContainerType string\n");
@@ -24,9 +24,9 @@ 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", PAJE_DefineVariableType);
+  fprintf(tracing_file, "%%EventDef PajeDefineVariableType %u\n", simgrid::instr::PAJE_DefineVariableType);
   fprintf(tracing_file, "%%       Alias string\n");
   if (basic){
     fprintf(tracing_file, "%%       ContainerType string\n");
@@ -38,9 +38,9 @@ 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", PAJE_DefineStateType);
+  fprintf(tracing_file, "%%EventDef PajeDefineStateType %u\n", simgrid::instr::PAJE_DefineStateType);
   fprintf(tracing_file, "%%       Alias string\n");
   if (basic){
     fprintf(tracing_file, "%%       ContainerType string\n");
@@ -51,9 +51,9 @@ 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", PAJE_DefineEventType);
+  fprintf(tracing_file, "%%EventDef PajeDefineEventType %u\n", simgrid::instr::PAJE_DefineEventType);
   fprintf(tracing_file, "%%       Alias string\n");
   if (basic){
     fprintf(tracing_file, "%%       ContainerType string\n");
@@ -64,9 +64,9 @@ 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", PAJE_DefineLinkType);
+  fprintf(tracing_file, "%%EventDef PajeDefineLinkType %u\n", simgrid::instr::PAJE_DefineLinkType);
   fprintf(tracing_file, "%%       Alias string\n");
   if (basic){
     fprintf(tracing_file, "%%       ContainerType string\n");
@@ -81,9 +81,9 @@ 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", PAJE_DefineEntityValue);
+  fprintf(tracing_file, "%%EventDef PajeDefineEntityValue %u\n", simgrid::instr::PAJE_DefineEntityValue);
   fprintf(tracing_file, "%%       Alias string\n");
   if (basic){
     fprintf(tracing_file, "%%       EntityType string\n");
@@ -95,9 +95,9 @@ 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", PAJE_CreateContainer);
+  fprintf(tracing_file, "%%EventDef PajeCreateContainer %u\n", simgrid::instr::PAJE_CreateContainer);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Alias string\n");
   fprintf(tracing_file, "%%       Type string\n");
@@ -106,18 +106,18 @@ 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", PAJE_DestroyContainer);
+  fprintf(tracing_file, "%%EventDef PajeDestroyContainer %u\n", simgrid::instr::PAJE_DestroyContainer);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Name string\n");
   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", PAJE_SetVariable);
+  fprintf(tracing_file, "%%EventDef PajeSetVariable %u\n", simgrid::instr::PAJE_SetVariable);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
@@ -125,9 +125,9 @@ 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", PAJE_AddVariable);
+  fprintf(tracing_file, "%%EventDef PajeAddVariable %u\n", simgrid::instr::PAJE_AddVariable);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
@@ -135,9 +135,9 @@ 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", PAJE_SubVariable);
+  fprintf(tracing_file, "%%EventDef PajeSubVariable %u\n", simgrid::instr::PAJE_SubVariable);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
@@ -145,10 +145,9 @@ 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", PAJE_SetState);
+  fprintf(tracing_file, "%%EventDef PajeSetState %u\n", simgrid::instr::PAJE_SetState);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
@@ -156,9 +155,9 @@ 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", PAJE_PushState);
+  fprintf(tracing_file, "%%EventDef PajePushState %u\n", simgrid::instr::PAJE_PushState);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
@@ -177,29 +176,30 @@ 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", PAJE_PopState);
+  fprintf(tracing_file, "%%EventDef PajePopState %u\n", simgrid::instr::PAJE_PopState);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
   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", PAJE_ResetState);
+  fprintf(tracing_file, "%%EventDef PajeResetState %u\n", simgrid::instr::PAJE_ResetState);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
   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", PAJE_StartLink);
+  fprintf(tracing_file, "%%EventDef PajeStartLink %u\n", simgrid::instr::PAJE_StartLink);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
@@ -214,9 +214,9 @@ 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", PAJE_EndLink);
+  fprintf(tracing_file, "%%EventDef PajeEndLink %u\n", simgrid::instr::PAJE_EndLink);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
@@ -230,9 +230,9 @@ 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", PAJE_NewEvent);
+  fprintf(tracing_file, "%%EventDef PajeNewEvent %u\n", simgrid::instr::PAJE_NewEvent);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\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 cfaf78f..e4aea24 100644 (file)
@@ -1,82 +1,68 @@
-/* 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
+#include <fstream>
 
 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::vector<PajeEvent*> buffer;
-void buffer_debug(std::vector<PajeEvent*> *buf);
+std::vector<simgrid::instr::PajeEvent*> buffer;
+void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf);
 
-void dump_comment (const char *comment)
+void dump_comment(std::string comment)
 {
-  if (not strlen(comment))
+  if (comment.empty())
     return;
-  fprintf (tracing_file, "# %s\n", comment);
+  fprintf(tracing_file, "# %s\n", comment.c_str());
 }
 
-void dump_comment_file (const char *filename)
+void dump_comment_file(std::string filename)
 {
-  if (not strlen(filename))
+  if (filename.empty())
     return;
-  FILE *file = fopen (filename, "r");
-  if (not file) {
-    THROWF (system_error, 1, "Comment file %s could not be opened for reading.", filename);
+  std::ifstream* fs = new std::ifstream();
+  fs->open(filename.c_str(), std::ifstream::in);
+
+  if (fs->fail()) {
+    THROWF(system_error, 1, "Comment file %s could not be opened for reading.", filename.c_str());
   }
-  while (not feof(file)) {
-    char c;
-    c = fgetc(file);
-    if (feof(file)) break;
+  while (not fs->eof()) {
+    std::string line;
     fprintf (tracing_file, "# ");
-    while (c != '\n'){
-      fprintf (tracing_file, "%c", c);
-      c = fgetc(file);
-      if (feof(file)) break;
-    }
-    fprintf (tracing_file, "\n");
+    std::getline(*fs, line);
+    fprintf(tracing_file, "%s", line.c_str());
   }
-  fclose(file);
+  fs->close();
 }
 
 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;
   XBT_DEBUG("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
   if (force){
-    for (auto event : buffer){
+    for (auto const& event : buffer) {
       event->print();
       delete event;
     }
     buffer.clear();
   }else{
-    std::vector<PajeEvent*>::iterator i = buffer.begin();
-    for (auto event :buffer){
-      double head_timestamp = event->timestamp;
+    std::vector<simgrid::instr::PajeEvent*>::iterator i = buffer.begin();
+    for (auto const& event : buffer) {
+      double head_timestamp = event->timestamp_;
       if (head_timestamp > TRACE_last_timestamp_to_dump)
         break;
       event->print();
@@ -88,11 +74,12 @@ void TRACE_paje_dump_buffer (int force)
   XBT_DEBUG("%s: ends", __FUNCTION__);
 }
 
-void buffer_debug(std::vector<PajeEvent*> *buf);
-void buffer_debug(std::vector<PajeEvent*> *buf) {
-  return;
+void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf)
+{
+  if (not XBT_LOG_ISENABLED(instr_paje_trace, xbt_log_priority_debug))
+    return;
   XBT_DEBUG(">>>>>> Dump the state of the buffer. %zu events", buf->size());
-  for (auto event :*buf){
+  for (auto const& event : *buf) {
     event->print();
     XBT_DEBUG("%p %s", event, stream.str().c_str());
     stream.str("");
@@ -101,41 +88,23 @@ void buffer_debug(std::vector<PajeEvent*> *buf) {
   XBT_DEBUG("<<<<<<");
 }
 
-static void print_row() {
-  stream << std::endl;
-  fprintf(tracing_file, "%s", stream.str().c_str());
-  XBT_DEBUG("Dump %s", stream.str().c_str());
-  stream.str("");
-  stream.clear();
-}
-
-static void print_timestamp(PajeEvent* event) {
-  stream << " ";
-  /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
-  if (event->timestamp < 1e-12)
-    stream << 0;
-  else
-    stream << event->timestamp;
-}
-
 /* internal do the instrumentation module */
-static void insert_into_buffer (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->event_type, tbi->timestamp, buffer.size());
-  std::vector<PajeEvent*>::reverse_iterator i;
+  XBT_DEBUG("%s: insert event_type=%u, timestamp=%f, buffersize=%zu)", __FUNCTION__, eventType_, timestamp_,
+            buffer.size());
+  std::vector<simgrid::instr::PajeEvent*>::reverse_iterator i;
   for (i = buffer.rbegin(); i != buffer.rend(); ++i) {
-    PajeEvent* e1 = *i;
-    XBT_DEBUG("compare to %p is of type %d; timestamp:%f", e1,
-        (int)e1->event_type, e1->timestamp);
-    if (e1->timestamp <= tbi->timestamp)
+    simgrid::instr::PajeEvent* e1 = *i;
+    XBT_DEBUG("compare to %p is of type %u; timestamp:%f", e1, e1->eventType_, e1->timestamp_);
+    if (e1->timestamp_ <= timestamp_)
       break;
   }
   if (i == buffer.rend())
@@ -143,27 +112,20 @@ static void insert_into_buffer (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);
 }
 
-PajeEvent:: ~PajeEvent()
-{
-  XBT_DEBUG("%s not implemented for %p: event_type=%d, timestamp=%f", __FUNCTION__,
-      this, (int)event_type, timestamp);
-}
-
 void TRACE_paje_start() {
-  char *filename = TRACE_get_filename();
-  tracing_file = fopen(filename, "w");
+  std::string filename = TRACE_get_filename();
+  tracing_file         = fopen(filename.c_str(), "w");
   if (tracing_file == nullptr){
-    THROWF (system_error, 1, "Tracefile %s could not be opened for writing.", filename);
+    THROWF(system_error, 1, "Tracefile %s could not be opened for writing.", filename.c_str());
   }
 
-  XBT_DEBUG("Filename %s is open for writing", filename);
+  XBT_DEBUG("Filename %s is open for writing", filename.c_str());
 
   /* output generator version */
   fprintf (tracing_file, "#This file was generated using SimGrid-%d.%d.%d\n",
@@ -188,692 +150,19 @@ void TRACE_paje_start() {
 
 void TRACE_paje_end() {
   fclose(tracing_file);
-  char *filename = TRACE_get_filename();
-  XBT_DEBUG("Filename %s is closed", filename);
-}
-
-void DefineContainerEvent(type_t type)
-{
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineContainerType);
-  //print it
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineContainerType, TRACE_precision(), 0.);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << PAJE_DefineContainerType;
-    stream << " " << type->id << " " << type->father->id << " " << type->name;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-  //--
-}
-
-
-
-void LogVariableTypeDefinition(type_t type)
-{
-
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineVariableType);
-
-  //print it
-if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineVariableType, TRACE_precision(), 0.);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << PAJE_DefineVariableType;
-    stream << " " << type->id << " " << type->father->id << " " << type->name;
-    if (type->color)
-      stream << " \"" << type->color << "\"";
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-
-void LogStateTypeDefinition(type_t type)
-{
-  //print it
-if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineStateType, TRACE_precision(), 0.);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << PAJE_DefineStateType;
-    stream << " " << type->id << " " << type->father->id << " " << type->name;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-
-void LogDefineEventType(type_t type)
-{
-  //print it
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineEventType, TRACE_precision(), 0.);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << PAJE_DefineEventType;
-    stream << " " << type->id << " " << type->father->id << " " << type->name;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-void LogLinkTypeDefinition(type_t type, type_t source, type_t dest)
-{
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineLinkType);
-  //print it
-if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineLinkType, TRACE_precision(), 0.);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << PAJE_DefineLinkType;
-    stream << " " << type->id << " " << type->father->id << " " << source->id << " " << dest->id << " " << type->name;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-void LogEntityValue (val_t value)
-{
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue);
-  //print it
-if (instr_fmt_type == instr_fmt_paje) {
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << PAJE_DefineEntityValue;
-    stream << " " << value->id << " " << value->father->id << " " << value->name;
-    if (value->color)
-      stream << " \"" << value->color << "\"";
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-
-void LogContainerCreation (container_t container)
-{
-  double timestamp                              = SIMIX_get_clock();
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, PAJE_CreateContainer,timestamp);
-
-if (instr_fmt_type == instr_fmt_paje) {
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << 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__, PAJE_DestroyContainer, timestamp);
-
-if (instr_fmt_type == instr_fmt_paje) {
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << 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;
-        }
-}
-
-
-SetVariableEvent::SetVariableEvent (double timestamp, container_t container, type_t type, double value)
-{
-  this->event_type                         = PAJE_SetVariable;
-  this->timestamp                          = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-void SetVariableEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id << " " << value;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-AddVariableEvent::AddVariableEvent (double timestamp, container_t container, type_t type, double value)
-{
-  this->event_type                         = PAJE_AddVariable;
-  this->timestamp                          = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-void AddVariableEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id << " " << value;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-SubVariableEvent::SubVariableEvent (double timestamp, container_t container, type_t type, double value)
-{
-  this->event_type                         = PAJE_SubVariable;
-  this->timestamp                          = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-void SubVariableEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id << " " << value;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-SetStateEvent::SetStateEvent (double timestamp, container_t container, type_t type, val_t value)
-{
-  this->event_type                      = PAJE_SetState;
-  this->timestamp                       = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
-#if HAVE_SMPI
-  if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
-    smpi_trace_call_location_t* loc = smpi_trace_get_call_location();
-    filename   = loc->filename;
-    linenumber = loc->linenumber;
-  }
-#endif
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-void SetStateEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id;
-    stream << " " << value->id;
-#if HAVE_SMPI
-    if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
-      stream << " \"" << filename << "\" " << linenumber;
-    }
-#endif
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value, void* extra)
-{
-  this->event_type                  = PAJE_PushState;
-  this->timestamp                   = timestamp;
-  this->type = type;
-  this->container = container;
-  this->value     = value;
-  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();
-    filename   = loc->filename;
-    linenumber = loc->linenumber;
-  }
-#endif
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value)
- : PushStateEvent(timestamp, container, type, value, nullptr)
-{}
-void PushStateEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id;
-    stream << " " << value->id;
-
-    if (TRACE_display_sizes()) {
-      stream << " ";
-      if (extra_ != nullptr) {
-        stream << static_cast<instr_extra_data>(extra_)->send_size;
-      } else {
-        stream << 0;
-      }
-    }
-#if HAVE_SMPI
-    if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
-      stream << " \"" << filename << "\" " << linenumber;
-    }
-#endif
-    print_row();
-
-    if (extra_ != nullptr) {
-      if (static_cast<instr_extra_data>(extra_)->sendcounts != nullptr)
-        xbt_free(static_cast<instr_extra_data>(extra_)->sendcounts);
-      if (static_cast<instr_extra_data>(extra_)->recvcounts != nullptr)
-        xbt_free(static_cast<instr_extra_data>(extra_)->recvcounts);
-      xbt_free(extra_);
-    }
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    if (extra_ == nullptr)
-      return;
-    instr_extra_data extra = (instr_extra_data)extra_;
-
-    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);
-    else
-      process_id = xbt_strdup(container->name + 5);
-
-    FILE* trace_file = (FILE*)xbt_dict_get(tracing_files, container->name);
-
-    switch (extra->type) {
-      case TRACING_INIT:
-        fprintf(trace_file, "%s init\n", process_id);
-        break;
-      case TRACING_FINALIZE:
-        fprintf(trace_file, "%s finalize\n", process_id);
-        break;
-      case TRACING_SEND:
-        fprintf(trace_file, "%s send %d %d %s\n", process_id, extra->dst, extra->send_size, extra->datatype1);
-        break;
-      case TRACING_ISEND:
-        fprintf(trace_file, "%s Isend %d %d %s\n", process_id, extra->dst, extra->send_size, extra->datatype1);
-        break;
-      case TRACING_RECV:
-        fprintf(trace_file, "%s recv %d %d %s\n", process_id, extra->src, extra->send_size, extra->datatype1);
-        break;
-      case TRACING_IRECV:
-        fprintf(trace_file, "%s Irecv %d %d %s\n", process_id, extra->src, extra->send_size, extra->datatype1);
-        break;
-      case TRACING_TEST:
-        fprintf(trace_file, "%s test\n", process_id);
-        break;
-      case TRACING_WAIT:
-        fprintf(trace_file, "%s wait\n", process_id);
-        break;
-      case TRACING_WAITALL:
-        fprintf(trace_file, "%s waitAll\n", process_id);
-        break;
-      case TRACING_BARRIER:
-        fprintf(trace_file, "%s barrier\n", process_id);
-        break;
-      case TRACING_BCAST: // rank bcast size (root) (datatype)
-        fprintf(trace_file, "%s bcast %d ", process_id, extra->send_size);
-        if (extra->root != 0 || (extra->datatype1 && strcmp(extra->datatype1, "")))
-          fprintf(trace_file, "%d %s", extra->root, extra->datatype1);
-        fprintf(trace_file, "\n");
-        break;
-      case TRACING_REDUCE: // rank reduce comm_size comp_size (root) (datatype)
-        fprintf(trace_file, "%s reduce %d %f ", process_id, extra->send_size, extra->comp_size);
-        if (extra->root != 0 || (extra->datatype1 && strcmp(extra->datatype1, "")))
-          fprintf(trace_file, "%d %s", extra->root, extra->datatype1);
-        fprintf(trace_file, "\n");
-        break;
-      case TRACING_ALLREDUCE: // rank allreduce comm_size comp_size (datatype)
-        fprintf(trace_file, "%s allReduce %d %f %s\n", process_id, extra->send_size, extra->comp_size,
-                extra->datatype1);
-        break;
-      case TRACING_ALLTOALL: // rank alltoall send_size recv_size (sendtype) (recvtype)
-        fprintf(trace_file, "%s allToAll %d %d %s %s\n", process_id, extra->send_size, extra->recv_size,
-                extra->datatype1, extra->datatype2);
-        break;
-      case TRACING_ALLTOALLV: // rank alltoallv send_size [sendcounts] recv_size [recvcounts] (sendtype) (recvtype)
-        fprintf(trace_file, "%s allToAllV %d ", process_id, extra->send_size);
-        for (int i = 0; i < extra->num_processes; i++)
-          fprintf(trace_file, "%d ", extra->sendcounts[i]);
-        fprintf(trace_file, "%d ", extra->recv_size);
-        for (int i = 0; i < extra->num_processes; i++)
-          fprintf(trace_file, "%d ", extra->recvcounts[i]);
-        fprintf(trace_file, "%s %s \n", extra->datatype1, extra->datatype2);
-        break;
-      case TRACING_GATHER: // rank gather send_size recv_size root (sendtype) (recvtype)
-        fprintf(trace_file, "%s gather %d %d %d %s %s\n", process_id, extra->send_size, extra->recv_size, extra->root,
-                extra->datatype1, extra->datatype2);
-        break;
-      case TRACING_ALLGATHERV: // rank allgatherv send_size [recvcounts] (sendtype) (recvtype)
-        fprintf(trace_file, "%s allGatherV %d ", process_id, extra->send_size);
-        for (int i = 0; i < extra->num_processes; i++)
-          fprintf(trace_file, "%d ", extra->recvcounts[i]);
-        fprintf(trace_file, "%s %s \n", extra->datatype1, extra->datatype2);
-        break;
-      case TRACING_REDUCE_SCATTER: // rank reducescatter [recvcounts] comp_size (sendtype)
-        fprintf(trace_file, "%s reduceScatter ", process_id);
-        for (int i = 0; i < extra->num_processes; i++)
-          fprintf(trace_file, "%d ", extra->recvcounts[i]);
-        fprintf(trace_file, "%f %s\n", extra->comp_size, extra->datatype1);
-        break;
-      case TRACING_COMPUTING:
-        fprintf(trace_file, "%s compute %f\n", process_id, extra->comp_size);
-        break;
-      case TRACING_SLEEPING:
-        fprintf(trace_file, "%s sleep %f\n", process_id, extra->sleep_duration);
-        break;
-      case TRACING_GATHERV: // rank gatherv send_size [recvcounts] root (sendtype) (recvtype)
-        fprintf(trace_file, "%s gatherV %d ", process_id, extra->send_size);
-        for (int i = 0; i < extra->num_processes; i++)
-          fprintf(trace_file, "%d ", extra->recvcounts[i]);
-        fprintf(trace_file, "%d %s %s\n", extra->root, extra->datatype1, extra->datatype2);
-        break;
-      case TRACING_WAITANY:
-      case TRACING_SENDRECV:
-      case TRACING_SCATTER:
-      case TRACING_SCATTERV:
-      case TRACING_ALLGATHER:
-      case TRACING_SCAN:
-      case TRACING_EXSCAN:
-      case TRACING_COMM_SIZE:
-      case TRACING_COMM_SPLIT:
-      case TRACING_COMM_DUP:
-      case TRACING_SSEND:
-      case TRACING_ISSEND:
-      default:
-        XBT_WARN("Call from %s impossible to translate into replay command : Not implemented (yet)", value->name);
-        break;
-    }
-
-    if (extra->recvcounts != nullptr)
-      xbt_free(extra->recvcounts);
-    if (extra->sendcounts != nullptr)
-      xbt_free(extra->sendcounts);
-    xbt_free(process_id);
-    xbt_free(extra);
-
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-
-PopStateEvent::PopStateEvent (double timestamp, container_t container, type_t type)
-{
-  this->event_type                      = PAJE_PopState;
-  this->timestamp                       = timestamp;
-  this->type      = type;
-  this->container = container;
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-void PopStateEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_t type)
-{
-  this->event_type                        = PAJE_ResetState;
-  this->timestamp                         = timestamp;
-  this->type      = type;
-  this->container = container;
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-  delete[] this;
-}
-
-void ResetStateEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-StartLinkEvent::~StartLinkEvent()
-{
-  free(value);
-  free(key);
-}
-StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
-    type_t type, container_t sourceContainer, const char *value, const char *key)
-  : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
-{}
-
-StartLinkEvent::StartLinkEvent (double timestamp, container_t container, type_t type, container_t sourceContainer,
-                                const char *value, const char *key, int size)
-{
-  event_type                             = PAJE_StartLink;
-  this->timestamp       = timestamp;
-  this->type            = type;
-  this->container       = container;
-  this->sourceContainer = sourceContainer;
-  this->value           = xbt_strdup(value);
-  this->key             = xbt_strdup(key);
-  this->size            = size;
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f, value:%s", __FUNCTION__,
-      (int)event_type, this->timestamp, this->value);
-
-  insert_into_buffer (this);
-}
-
-void StartLinkEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id << " " << value;
-    stream << " " << sourceContainer->id << " " << key;
-
-    if (TRACE_display_sizes()) {
-      stream << " " << size;
-    }
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-EndLinkEvent::EndLinkEvent (double timestamp, container_t container, type_t type, container_t destContainer,
-                      const char *value, const char *key)
-{
-  this->event_type                         = 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)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-EndLinkEvent::~EndLinkEvent()
-{
-  free(value);
-  free(key);
-}
-void EndLinkEvent::print() {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id << " " << value;
-    stream << " " << destContainer->id << " " << key;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-NewEvent::NewEvent (double timestamp, container_t container, type_t type, val_t value)
-{
-  this->event_type                      = PAJE_NewEvent;
-  this->timestamp                       = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
-
-  insert_into_buffer (this);
-}
-
-void NewEvent::print () {
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)this->event_type;
-    print_timestamp(this);
-    stream << " " << type->id << " " << container->id << " " << value->id;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
+  XBT_DEBUG("Filename %s is closed", TRACE_get_filename().c_str());
 }
 
 
 void TRACE_TI_start()
 {
-  char *filename = TRACE_get_filename();
-  tracing_file = fopen(filename, "w");
-  if (tracing_file == nullptr)
-    THROWF(system_error, 1, "Tracefile %s could not be opened for writing.", filename);
+  std::string filename = TRACE_get_filename();
+  tracing_file         = fopen(filename.c_str(), "w");
+  if (tracing_file == nullptr) {
+    THROWF(system_error, 1, "Tracefile %s could not be opened for writing.", filename.c_str());
+  }
 
-  XBT_DEBUG("Filename %s is open for writing", filename);
+  XBT_DEBUG("Filename %s is open for writing", filename.c_str());
 
   /* output one line comment */
   dump_comment(TRACE_get_comment());
@@ -884,9 +173,6 @@ 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);
+  XBT_DEBUG("Filename %s is closed", TRACE_get_filename().c_str());
 }
-
index 333e806..3f87707 100644 (file)
-/* Copyright (c) 2012, 2014-2015. The SimGrid Team.
+/* Copyright (c) 2012, 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/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 type_t rootType = nullptr;        /* the root type */
+extern FILE* tracing_file;
 
-void PJ_type_release ()
+namespace simgrid {
+namespace instr {
+
+Type::Type(std::string name, std::string alias, std::string color, Type* father)
+    : id_(instr_new_paje_id()), name_(name), color_(color), father_(father)
 {
-  rootType = nullptr;
+  if (name.empty() || alias.empty())
+    THROWF(tracing_error, 0, "can't create a new type with no name or alias");
+
+  if (father != nullptr){
+    father->children_.insert({alias, this});
+    XBT_DEBUG("new type %s, child of %s", name_.c_str(), father->getCname());
+  }
 }
 
-type_t PJ_type_get_root ()
+Type::~Type()
 {
-  return rootType;
+  for (auto elm : children_)
+    delete elm.second;
 }
 
-static type_t newType (const char *typeNameBuff, const char *key, const char *color, e_entity_types kind, type_t father)
+ValueType::~ValueType()
 {
-  if (typeNameBuff == nullptr || key == nullptr){
-    THROWF(tracing_error, 0, "can't create a new type with name or key equal nullptr");
-  }
+  for (auto elm : values_)
+    delete elm.second;
+}
 
-  type_t ret = xbt_new0(s_type_t, 1);
-  ret->name = xbt_strdup (typeNameBuff);
-  ret->father = father;
-  ret->kind = kind;
-  ret->children = xbt_dict_new_homogeneous(nullptr);
-  ret->values = xbt_dict_new_homogeneous(nullptr);
-  ret->color = xbt_strdup (color);
+ContainerType::ContainerType(std::string name, Type* father) : Type(name, name, "", father)
+{
+  XBT_DEBUG("ContainerType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+  logDefinition(PAJE_DefineContainerType);
+}
 
-  char str_id[INSTR_DEFAULT_STR_SIZE];
-  snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", instr_new_paje_id());
-  ret->id = xbt_strdup (str_id);
+EventType::EventType(std::string name, Type* father) : ValueType(name, father)
+{
+  XBT_DEBUG("EventType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+  logDefinition(PAJE_DefineEventType);
+}
 
-  if (father != nullptr){
-    xbt_dict_set (father->children, key, ret, nullptr);
-    XBT_DEBUG("new type %s, child of %s", typeNameBuff, father->name);
-  }
-  return ret;
+StateType::StateType(std::string name, Type* father) : ValueType(name, father)
+{
+  XBT_DEBUG("StateType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+  logDefinition(PAJE_DefineStateType);
 }
 
-void PJ_type_free (type_t type)
+StateType::~StateType()
 {
-  val_t value;
-  char *value_name;
-  xbt_dict_cursor_t cursor = nullptr;
-  xbt_dict_foreach(type->values, cursor, value_name, value) {
-     XBT_DEBUG("free value %s, child of %s", value->name, value->father->name);
-     xbt_free(value->name);
-     xbt_free(value->color);
-     xbt_free(value->id);
-     xbt_free(value);
-  }
-  xbt_dict_free (&type->values);
-  xbt_free (type->name);
-  xbt_free (type->id);
-  xbt_free (type->color);
-  xbt_dict_free (&type->children);
-  xbt_free (type);
-  type = nullptr;
-}
-
-void recursiveDestroyType (type_t type)
-{
-  XBT_DEBUG("recursiveDestroyType %s", type->name);
-  xbt_dict_cursor_t cursor = nullptr;
-  type_t child;
-  char *child_name;
-  xbt_dict_foreach(type->children, cursor, child_name, child) {
-    recursiveDestroyType (child);
-  }
-  PJ_type_free(type);
+  events_.clear();
 }
 
-type_t PJ_type_get (const char *name, type_t father)
+void StateType::setEvent(std::string value_name)
 {
-  type_t ret = PJ_type_get_or_null (name, father);
-  if (ret == nullptr){
-    THROWF (tracing_error, 2, "type with name (%s) not found in father type (%s)", name, father->name);
-  }
-  return ret;
+  events_.push_back(new StateEvent(issuer_, this, PAJE_SetState, getEntityValue(value_name)));
 }
 
-type_t PJ_type_get_or_null (const char *name, type_t father)
+void StateType::pushEvent(std::string value_name, TIData* extra)
 {
-  if (name == nullptr || father == nullptr){
-    THROWF (tracing_error, 0, "can't get type with a nullptr name or from a nullptr father");
-  }
+  events_.push_back(new StateEvent(issuer_, this, PAJE_PushState, getEntityValue(value_name), extra));
+}
 
-  type_t ret = nullptr;
-  type_t child;
-  char *child_name;
-  xbt_dict_cursor_t cursor = nullptr;
-  xbt_dict_foreach(father->children, cursor, child_name, child) {
-    if (strcmp (child->name, name) == 0){
-      if (ret != nullptr){
-        THROWF (tracing_error, 0, "there are two children types with the same name?");
-      }else{
-        ret = child;
-      }
-    }
-  }
-  return ret;
+void StateType::pushEvent(std::string value_name)
+{
+  events_.push_back(new StateEvent(issuer_, this, PAJE_PushState, getEntityValue(value_name)));
 }
 
-type_t PJ_type_container_new (const char *name, type_t father)
+void StateType::popEvent()
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a container type with a nullptr name");
-  }
+  events_.push_back(new StateEvent(issuer_, this, PAJE_PopState, nullptr));
+}
 
-  type_t ret = nullptr;
+VariableType::VariableType(std::string name, std::string color, Type* father) : Type(name, name, color, father)
+{
+  XBT_DEBUG("VariableType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+  logDefinition(PAJE_DefineVariableType);
+}
 
-  ret = newType (name, name, nullptr, TYPE_CONTAINER, father);
-  if (father == nullptr){
-    rootType = ret;
-  }
+VariableType::~VariableType()
+{
+  events_.clear();
+}
 
-  if(father){
-    XBT_DEBUG("ContainerType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
-    DefineContainerEvent(ret);
-  }
-  return ret;
+void VariableType::setEvent(double timestamp, double value)
+{
+  events_.push_back(new VariableEvent(timestamp, issuer_, this, PAJE_SetVariable, value));
 }
 
-type_t PJ_type_event_new (const char *name, type_t father)
+void VariableType::addEvent(double timestamp, double value)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create an event type with a nullptr name");
-  }
+  events_.push_back(new VariableEvent(timestamp, issuer_, this, PAJE_AddVariable, value));
+}
 
-  type_t ret = newType (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;
+void VariableType::subEvent(double timestamp, double value)
+{
+  events_.push_back(new VariableEvent(timestamp, issuer_, this, PAJE_SubVariable, value));
 }
 
-type_t PJ_type_variable_new (const char *name, const char *color, type_t father)
+LinkType::LinkType(std::string name, std::string alias, Type* father) : ValueType(name, alias, father)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a variable type with a nullptr name");
-  }
+}
+void LinkType::startEvent(container_t startContainer, std::string value, std::string key)
+{
+  startEvent(startContainer, value, key, -1);
+}
+
+void LinkType::startEvent(container_t startContainer, std::string value, std::string key, int size)
+{
+  new LinkEvent(issuer_, this, PAJE_StartLink, startContainer, value, key, size);
+}
+
+void LinkType::endEvent(container_t endContainer, std::string value, std::string key)
+{
+  new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, key);
+}
 
-  type_t ret = nullptr;
+void Type::logDefinition(e_event_type event_type)
+{
+  if (instr_fmt_type != instr_fmt_paje)
+    return;
+  std::stringstream stream;
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, event_type, TRACE_precision(), 0.);
+  stream << std::fixed << std::setprecision(TRACE_precision()) << event_type << " " << getId();
+  stream << " " << father_->getId() << " " << getName();
+  if (isColored())
+    stream << " \"" << color_ << "\"";
+  XBT_DEBUG("Dump %s", stream.str().c_str());
+  stream << std::endl;
+  fprintf(tracing_file, "%s", stream.str().c_str());
+}
+
+void Type::logDefinition(simgrid::instr::Type* source, simgrid::instr::Type* dest)
+{
+  if (instr_fmt_type != instr_fmt_paje)
+    return;
+  std::stringstream stream;
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, PAJE_DefineLinkType, TRACE_precision(), 0.);
+  stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineLinkType << " " << getId();
+  stream << " " << father_->getId() << " " << source->getId() << " " << dest->getId() << " " << getName();
+  XBT_DEBUG("Dump %s", stream.str().c_str());
+  stream << std::endl;
+  fprintf(tracing_file, "%s", stream.str().c_str());
+}
 
-  char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
-  if (not color) {
-    ret = newType (name, name, white, TYPE_VARIABLE, father);
-  }else{
-    ret = newType (name, name, color, TYPE_VARIABLE, father);
+Type* Type::byName(std::string name)
+{
+  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 = elm.second;
+      }
+    }
   }
-  XBT_DEBUG("VariableType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
-  LogVariableTypeDefinition (ret);
+  if (ret == nullptr)
+    THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name.c_str(), getCname());
   return ret;
 }
 
-type_t PJ_type_link_new (const char *name, type_t father, type_t source, type_t dest)
+void ValueType::addEntityValue(std::string name)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a link type with a nullptr name");
+  addEntityValue(name, "");
+}
+
+void ValueType::addEntityValue(std::string name, std::string color)
+{
+  if (name.empty())
+    THROWF(tracing_error, 0, "can't get a value with no name");
+
+  auto it = values_.find(name);
+  if (it == values_.end()) {
+    EntityValue* new_val = new EntityValue(name, color, this);
+    values_.insert({name, new_val});
+    XBT_DEBUG("new value %s, child of %s", name.c_str(), getCname());
+    new_val->print();
   }
+}
 
-  type_t ret = nullptr;
+EntityValue* ValueType::getEntityValue(std::string name)
+{
+  auto ret = values_.find(name);
+  if (ret == values_.end()) {
+    THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name.c_str(), getCname());
+  }
+  return ret->second;
+}
 
-  char key[INSTR_DEFAULT_STR_SIZE];
-  snprintf (key, INSTR_DEFAULT_STR_SIZE, "%s-%s-%s", name, source->id, dest->id);
-  ret = newType (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;
+ContainerType* Type::getOrCreateContainerType(std::string name)
+{
+  auto cont = children_.find(name);
+  return cont == children_.end() ? new ContainerType(name, this) : static_cast<ContainerType*>(cont->second);
 }
 
-type_t PJ_type_state_new (const char *name, type_t father)
+EventType* Type::getOrCreateEventType(std::string name)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a state type with a nullptr name");
-  }
+  auto cont = children_.find(name);
+  return cont == children_.end() ? new EventType(name, this) : static_cast<EventType*>(cont->second);
+}
 
-  type_t ret = nullptr;
+StateType* Type::getOrCreateStateType(std::string name)
+{
+  auto cont = children_.find(name);
+  return cont == children_.end() ? new StateType(name, this) : static_cast<StateType*>(cont->second);
+}
 
-  ret = newType (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;
+VariableType* Type::getOrCreateVariableType(std::string name, std::string color)
+{
+  auto cont = children_.find(name);
+  std::string mycolor = color.empty() ? "1 1 1" : color;
+  return cont == children_.end() ? new VariableType(name, mycolor, this) : static_cast<VariableType*>(cont->second);
+}
+
+LinkType* Type::getOrCreateLinkType(std::string name, Type* source, Type* dest)
+{
+  std::string alias = name + "-" + std::to_string(source->id_) + "-" + std::to_string(dest->id_);
+  auto it           = children_.find(alias);
+  if (it == children_.end()) {
+    LinkType* ret = new LinkType(name, alias, this);
+    XBT_DEBUG("LinkType %s(%lld), child of %s(%lld)  %s(%lld)->%s(%lld)", ret->getCname(), ret->getId(), getCname(),
+              getId(), source->getCname(), source->getId(), dest->getCname(), dest->getId());
+    ret->logDefinition(source, dest);
+    return ret;
+  } else
+    return static_cast<LinkType*>(it->second);
+}
+}
 }
diff --git a/src/instr/instr_paje_types.hpp b/src/instr/instr_paje_types.hpp
new file mode 100644 (file)
index 0000000..b07bc65
--- /dev/null
@@ -0,0 +1,101 @@
+/* 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_PAJE_TYPES_HPP
+#define INSTR_PAJE_TYPES_HPP
+
+#include "src/instr/instr_private.hpp"
+#include <string>
+#include <vector>
+
+namespace simgrid {
+namespace instr {
+class ContainerType;
+class EventType;
+
+class Type {
+  long long int id_;
+  std::string name_;
+  std::string color_;
+  Type* father_;
+
+public:
+  std::map<std::string, Type*> children_;
+  Container* issuer_ = nullptr;
+
+  Type(std::string name, std::string alias, std::string color, Type* father);
+  virtual ~Type();
+
+  std::string getName() { return name_; }
+  const char* getCname() { return name_.c_str(); }
+  long long int getId() { return id_; }
+  bool isColored() { return not color_.empty(); }
+
+  Type* byName(std::string name);
+  ContainerType* getOrCreateContainerType(std::string name);
+  EventType* getOrCreateEventType(std::string name);
+  LinkType* getOrCreateLinkType(std::string name, Type* source, Type* dest);
+  StateType* getOrCreateStateType(std::string name);
+  VariableType* getOrCreateVariableType(std::string name, std::string color);
+
+  void setCallingContainer(Container* container) { issuer_ = container; }
+
+  void logDefinition(e_event_type event_type);
+  void logDefinition(Type* source, Type* dest);
+};
+
+class ContainerType : public Type {
+public:
+  explicit ContainerType(std::string name) : Type(name, name, "", nullptr){};
+  ContainerType(std::string name, Type* father);
+};
+
+class VariableType : public Type {
+  std::vector<VariableEvent*> events_;
+public:
+  VariableType(std::string name, std::string color, Type* father);
+  ~VariableType();
+  void setEvent(double timestamp, double value);
+  void addEvent(double timestamp, double value);
+  void subEvent(double timestamp, double value);
+};
+
+class ValueType : public Type {
+public:
+  std::map<std::string, EntityValue*> values_;
+  ValueType(std::string name, std::string alias, Type* father) : Type(name, alias, "", father){};
+  ValueType(std::string name, Type* father) : Type(name, name, "", father){};
+  virtual ~ValueType();
+  void addEntityValue(std::string name, std::string color);
+  void addEntityValue(std::string name);
+  EntityValue* getEntityValue(std::string name);
+};
+
+class LinkType : public ValueType {
+public:
+  LinkType(std::string name, std::string alias, Type* father);
+  void startEvent(Container* startContainer, std::string value, std::string key);
+  void startEvent(Container* startContainer, std::string value, std::string key, int size);
+  void endEvent(Container* endContainer, std::string value, std::string key);
+};
+
+class EventType : public ValueType {
+public:
+  EventType(std::string name, Type* father);
+};
+
+class StateType : public ValueType {
+  std::vector<StateEvent*> events_;
+public:
+  StateType(std::string name, Type* father);
+  ~StateType();
+  void setEvent(std::string value_name);
+  void pushEvent(std::string value_name);
+  void pushEvent(std::string value_name, TIData* extra);
+  void popEvent();
+};
+}
+}
+#endif
index 88ad1bb..d0bdb9d 100644 (file)
@@ -1,59 +1,33 @@
-/* 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)");
+extern FILE* tracing_file;
 
-val_t PJ_value_new (const char *name, const char *color, type_t father)
-{
-  if (name == nullptr || father == nullptr){
-    THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
-  }
-
-  val_t ret = xbt_new0(s_val_t, 1);
-  ret->name = xbt_strdup (name);
-  ret->father = father;
-  ret->color = xbt_strdup (color);
-
-  char str_id[INSTR_DEFAULT_STR_SIZE];
-  snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", instr_new_paje_id());
-  ret->id = xbt_strdup (str_id);
+namespace simgrid {
+namespace instr {
 
-  xbt_dict_set (father->values, name, ret, nullptr);
-  XBT_DEBUG("new value %s, child of %s", ret->name, ret->father->name);
-  LogEntityValue(ret);
-  return ret;
-}
+EntityValue::EntityValue(std::string name, std::string color, Type* father)
+    : id_(instr_new_paje_id()), name_(name), color_(color), father_(father){};
 
-val_t PJ_value_get_or_new (const char *name, const char *color, type_t father)
+void EntityValue::print()
 {
-  val_t ret = 0;
-  try {
-    ret = PJ_value_get(name, father);
-  }
-  catch(xbt_ex& e) {
-    ret = PJ_value_new(name, color, father);
-  }
-  return ret;
+  if (instr_fmt_type != instr_fmt_paje)
+    return;
+  std::stringstream stream;
+  XBT_DEBUG("%s: event_type=%u", __FUNCTION__, PAJE_DefineEntityValue);
+  stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineEntityValue;
+  stream << " " << id_ << " " << father_->getId() << " " << name_;
+  if (not color_.empty())
+    stream << " \"" << color_ << "\"";
+  XBT_DEBUG("Dump %s", stream.str().c_str());
+  fprintf(tracing_file, "%s\n", stream.str().c_str());
 }
 
-val_t PJ_value_get (const char *name, type_t father)
-{
-  if (name == nullptr || father == nullptr){
-    THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
-  }
-
-  if (father->kind == TYPE_VARIABLE)
-    THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name);
-  val_t ret = (val_t)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);
-  }
-  return ret;
+}
 }
diff --git a/src/instr/instr_paje_values.hpp b/src/instr/instr_paje_values.hpp
new file mode 100644 (file)
index 0000000..7e180ba
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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_PAJE_VALUES_HPP
+#define INSTR_PAJE_VALUES_HPP
+
+#include "src/instr/instr_private.hpp"
+#include <string>
+
+namespace simgrid {
+namespace instr {
+
+class EntityValue {
+  long long int id_;
+  std::string name_;
+  std::string color_;
+  Type* father_;
+
+public:
+  explicit EntityValue(std::string name, std::string color, Type* father);
+  ~EntityValue() = default;
+  const char* getCname() { return name_.c_str(); }
+  long long int getId() { return id_; }
+  void print();
+};
+}
+}
+
+#endif
diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h
deleted file mode 100644 (file)
index d3d45c2..0000000
+++ /dev/null
@@ -1,440 +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 "simgrid/instr.h"
-#include "instr/instr_interface.h"
-#include "src/internal_config.h"
-#include "simgrid_config.h"
-
-SG_BEGIN_DECL()
-
-/* 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"
-
-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 s_type;
-typedef s_type *type_t;
-class s_type {
-  public:
-  char *id;
-  char *name;
-  char *color;
-  e_entity_types kind;
-  s_type *father;
-  xbt_dict_t children;
-  xbt_dict_t values; //valid for all types except variable and container
-};
-
-typedef s_type s_type_t;
-
-//--------------------------------------------------
-class s_val;
-typedef s_val *val_t;
-
-class s_val {
-  public:
-  char *id;
-  char *name;
-  char *color;
-  type_t father;
-};
-typedef s_val s_val_t;
-
-//--------------------------------------------------
-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 s_container;
-typedef s_container *container_t;
-
-class s_container {
-  public:
-  sg_netpoint_t netpoint;
-  char *name;     /* Unique name of this container */
-  char *id;       /* Unique id of this container */
-  type_t type;    /* Type of this container */
-  int level;      /* Level in the hierarchy, root level is 0 */
-  e_container_types kind; /* This container is of what kind */
-  s_container *father;
-  xbt_dict_t children;
-};
-typedef s_container s_container_t;
-
-//--------------------------------------------------
-class PajeEvent {
-  public:
-  double timestamp;
-  e_event_type event_type;
-  virtual void print() = 0;
-  void *data;
-  virtual ~PajeEvent();
-};
-
-//--------------------------------------------------
-
-class DefineVariableTypeEvent : public PajeEvent
-{
-  public:
-  type_t type;
-   DefineVariableTypeEvent(type_t type);
-   void print() override;
-};
-//--------------------------------------------------
-
-class DefineStateTypeEvent : public PajeEvent  {
-  type_t type;
-  public:
-  DefineStateTypeEvent(type_t type);
-  void print() override;
-};
-
-
-class SetVariableEvent : public PajeEvent  {
-  container_t container;
-  type_t type;
-  double value;
-  public:
-  SetVariableEvent (double timestamp, container_t container, type_t type, double value);
-  void print() override;
-};
-
-
-class AddVariableEvent:public PajeEvent {
-  container_t container;
-  type_t type;
-  double value;
-  public:
-  AddVariableEvent (double timestamp, container_t container, type_t type, double value);
-  void print() override;
-};
-
-//--------------------------------------------------
-
-
-class SubVariableEvent : public PajeEvent  {
-  public:
-  container_t container;
-  type_t type;
-  double value;
-  public:
-  SubVariableEvent(double timestamp, container_t container, type_t type, double value);
-  void print() override;
-};
-//--------------------------------------------------
-
-class SetStateEvent : public PajeEvent  {
-  public:
-  container_t container;
-  type_t type;
-  val_t value;
-  const char* filename;
-  int linenumber;
-  public:
-  SetStateEvent (double timestamp, container_t container, type_t type, val_t value);
-  void print() override;
-};
-
-
-class PushStateEvent : public PajeEvent  {
-  public:
-  container_t container;
-  type_t type;
-  val_t value;
-  int size;
-  const char* filename;
-  int linenumber;
-  void* extra_;
-  public:
-  PushStateEvent (double timestamp, container_t container, type_t type, val_t value);
-  PushStateEvent (double timestamp, container_t container, type_t type, val_t value,
-                                             void* extra);
-  void print() override;
-};
-
-class PopStateEvent : public PajeEvent  {
-  container_t container;
-  type_t type;
-  public:
-  PopStateEvent (double timestamp, container_t container, type_t type);
-  void print() override;
-};
-
-class ResetStateEvent : public PajeEvent  {
-  container_t container;
-  type_t type;
-  public:
-  ResetStateEvent (double timestamp, container_t container, type_t type);
-  void print() override;
-};
-
-class StartLinkEvent : public PajeEvent  {
-  public:
-  container_t container;
-  type_t type;
-  container_t sourceContainer;
-  char *value;
-  char *key;
-  int size;
-  public:
-    ~StartLinkEvent();
-    StartLinkEvent(double timestamp, container_t container, type_t type, container_t sourceContainer, const char* value,
-                   const char* key);
-    StartLinkEvent(double timestamp, container_t container, type_t type, container_t sourceContainer, const char* value,
-                   const char* key, int size);
-    void print() override;
-};
-
-class EndLinkEvent : public PajeEvent  {
-  container_t container;
-  type_t type;
-  container_t destContainer;
-  char *value;
-  char *key;
-  public:
-  EndLinkEvent (double timestamp, container_t container, type_t type, container_t destContainer,
-                                  const char *value, const char *key);
-  ~EndLinkEvent();
-  void print() override;
-};
-
-
-class NewEvent : public PajeEvent  {
-  public:
-  container_t container;
-  type_t type;
-  val_t value;
-  public:
-  NewEvent (double timestamp, container_t container, type_t type, val_t value);
-  void print() override;
-
-};
-
-
-extern XBT_PRIVATE xbt_dict_t created_categories;
-extern XBT_PRIVATE xbt_dict_t declared_marks;
-extern XBT_PRIVATE xbt_dict_t user_host_variables;
-extern XBT_PRIVATE xbt_dict_t user_vm_variables;
-extern XBT_PRIVATE xbt_dict_t 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 xbt_dict_t trivaNodeTypes;
-extern XBT_PRIVATE xbt_dict_t trivaEdgeTypes;
-XBT_PRIVATE long long int instr_new_paje_id ();
-XBT_PRIVATE void PJ_container_alloc ();
-XBT_PRIVATE void PJ_container_release ();
-XBT_PUBLIC(container_t) PJ_container_new (const char *name, e_container_types kind, container_t father);
-XBT_PUBLIC(container_t) PJ_container_get (const char *name);
-XBT_PUBLIC(container_t) 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 (container_t container);
-XBT_PUBLIC(void) PJ_container_free_all (void);
-XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container);
-
-/* instr_paje_types.c */
-XBT_PRIVATE void PJ_type_release ();
-XBT_PUBLIC(type_t)  PJ_type_get_root ();
-XBT_PRIVATE type_t PJ_type_container_new (const char *name, type_t father);
-XBT_PRIVATE type_t PJ_type_event_new (const char *name, type_t father);
-type_t PJ_type_link_new (const char *name, type_t father, type_t source, type_t dest);
-XBT_PRIVATE XBT_PRIVATE type_t PJ_type_variable_new (const char *name, const char *color, type_t father);
-XBT_PRIVATE type_t PJ_type_state_new (const char *name, type_t father);
-XBT_PUBLIC(type_t)  PJ_type_get (const char *name, const type_t father);
-XBT_PUBLIC(type_t)  PJ_type_get_or_null (const char *name, type_t father);
-XBT_PRIVATE XBT_PRIVATE void PJ_type_free (type_t type); 
-
-/* instr_config.c */
-XBT_PRIVATE void recursiveDestroyType (type_t type);
-
-/* instr_paje_values.c */
-XBT_PUBLIC(val_t)  PJ_value_new (const char *name, const char *color, type_t father);
-XBT_PUBLIC(val_t)  PJ_value_get_or_new (const char *name, const char *color, type_t father);
-XBT_PUBLIC(val_t)  PJ_value_get (const char *name, const type_t father);
-
-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 DefineContainerEvent(type_t type);
-void LogVariableTypeDefinition(type_t type);
-void LogStateTypeDefinition(type_t type);
-void LogLinkTypeDefinition(type_t type, type_t source, type_t dest);
-void LogEntityValue (val_t value);
-void LogContainerCreation (container_t container);
-void LogContainerDestruction (container_t container);
-void LogDefineEventType(type_t type);
-
-#endif
diff --git a/src/instr/instr_private.hpp b/src/instr/instr_private.hpp
new file mode 100644 (file)
index 0000000..263d4f4
--- /dev/null
@@ -0,0 +1,260 @@
+/* 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/instr/instr_paje_containers.hpp"
+#include "src/instr/instr_paje_events.hpp"
+#include "src/instr/instr_paje_types.hpp"
+#include "src/instr/instr_paje_values.hpp"
+#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
+
+typedef simgrid::instr::Container* container_t;
+
+namespace simgrid {
+namespace instr {
+
+class TIData {
+  std::string name_;
+  double amount_ = 0;
+
+public:
+  int endpoint                 = 0;
+  int send_size                = 0;
+  std::vector<int>* sendcounts = nullptr;
+  int recv_size                = 0;
+  std::vector<int>* recvcounts = nullptr;
+  std::string send_type        = "";
+  std::string recv_type        = "";
+
+  // NoOpTI: init, finalize, test, wait, barrier
+  explicit TIData(std::string name) : name_(name){};
+  // CPuTI: compute, sleep (+ waitAny and waitAll out of laziness)
+  explicit TIData(std::string name, double amount) : name_(name), amount_(amount){};
+  // Pt2PtTI: send, isend, sssend, issend, recv, irecv
+  explicit TIData(std::string name, int endpoint, int size, std::string datatype)
+      : name_(name), endpoint(endpoint), send_size(size), send_type(datatype){};
+  // CollTI: bcast, reduce, allReduce, gather, scatter, allGather, allToAll
+  explicit TIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type,
+                  std::string recv_type)
+      : name_(name)
+      , amount_(amount)
+      , endpoint(root)
+      , send_size(send_size)
+      , recv_size(recv_size)
+      , send_type(send_type)
+      , recv_type(recv_type){};
+  // VarCollTI: gatherV, scatterV, allGatherV, allToAllV (+ reduceScatter out of laziness)
+  explicit TIData(std::string name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
+                  std::vector<int>* recvcounts, std::string send_type, std::string recv_type)
+      : name_(name)
+      , endpoint(root)
+      , send_size(send_size)
+      , sendcounts(sendcounts)
+      , recv_size(recv_size)
+      , recvcounts(recvcounts)
+      , send_type(send_type)
+      , recv_type(recv_type){};
+
+  virtual ~TIData()
+  {
+    delete sendcounts;
+    delete recvcounts;
+  }
+
+  std::string getName() { return name_; }
+  double getAmount() { return amount_; }
+  virtual std::string print()        = 0;
+  virtual std::string display_size() = 0;
+};
+
+class NoOpTIData : public TIData {
+public:
+  explicit NoOpTIData(std::string name) : TIData(name){};
+  std::string print() override { return getName(); }
+  std::string display_size() override { return ""; }
+};
+
+class CpuTIData : public TIData {
+public:
+  explicit CpuTIData(std::string name, double amount) : TIData(name, amount){};
+  std::string print() override
+  {
+    std::stringstream stream;
+    stream << getName() << " " << getAmount();
+    return stream.str();
+  }
+  std::string display_size() override { return std::to_string(getAmount()); }
+};
+
+class Pt2PtTIData : public TIData {
+public:
+  explicit Pt2PtTIData(std::string name, int endpoint, int size, std::string datatype)
+      : TIData(name, endpoint, size, datatype){};
+  std::string print() override
+  {
+    std::stringstream stream;
+    stream << getName() << " ";
+    if (endpoint >= 0)
+      stream << endpoint << " ";
+    stream << send_size << " " << send_type;
+    return stream.str();
+  }
+  std::string display_size() override { return std::to_string(send_size); }
+};
+
+class CollTIData : public TIData {
+public:
+  explicit CollTIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type,
+                      std::string recv_type)
+      : TIData(name, root, amount, send_size, recv_size, send_type, recv_type){};
+  std::string print() override
+  {
+    std::stringstream stream;
+    stream << getName() << " " << send_size << " ";
+    if (recv_size >= 0)
+      stream << recv_size << " ";
+    if (getAmount() >= 0.0)
+      stream << getAmount() << " ";
+    if (endpoint > 0 || (endpoint == 0 && not send_type.empty()))
+      stream << endpoint << " ";
+    stream << send_type << " " << recv_type;
+
+    return stream.str();
+  }
+  std::string display_size() override { return std::to_string(send_size); }
+};
+
+class VarCollTIData : public TIData {
+public:
+  explicit VarCollTIData(std::string name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
+                         std::vector<int>* recvcounts, std::string send_type, std::string recv_type)
+      : TIData(name, root, send_size, sendcounts, recv_size, recvcounts, send_type, recv_type){};
+  std::string print() override
+  {
+    std::stringstream stream;
+    stream << getName() << " ";
+    if (send_size >= 0)
+      stream << send_size << " ";
+    if (sendcounts != nullptr)
+      for (auto count : *sendcounts)
+        stream << count << " ";
+    if (recv_size >= 0)
+      stream << recv_size << " ";
+    if (recvcounts != nullptr)
+      for (auto count : *recvcounts)
+        stream << count << " ";
+    if (endpoint > 0 || (endpoint == 0 && not send_type.empty()))
+      stream << endpoint << " ";
+    stream << send_type << " " << recv_type;
+
+    return stream.str();
+  }
+  std::string display_size() override { return std::to_string(send_size > 0 ? send_size : recv_size); }
+};
+}
+}
+
+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 int TRACE_precision();
+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();
+void instr_new_variable_type(std::string new_typename, std::string color);
+void instr_new_user_variable_type(std::string father_type, std::string new_typename, std::string color);
+void instr_new_user_state_type(std::string father_type, std::string new_typename);
+void instr_new_value_for_user_state_type(std::string new_typename, const char* value, std::string color);
+
+/* 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(std::string filename);
+XBT_PRIVATE void dump_comment(std::string comment);
+
+/* 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;
+}
+XBT_PRIVATE std::string TRACE_get_comment();
+XBT_PRIVATE std::string TRACE_get_comment_file();
+XBT_PRIVATE std::string TRACE_get_filename();
+
+#endif
index 3135882..19468d2 100644 (file)
-/* 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 "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
+#include <set>
+#include <string>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_resource, instr, "tracing (un)-categorized resource utilization");
 
 //to check if variables were previously set to 0, otherwise paje won't simulate them
-static xbt_dict_t platform_variables;
+static std::set<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 instr_event(double now, double delta, simgrid::instr::VariableType* variable, container_t resource,
+                        double value)
 {
-  /* 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
-   * subsequent adds/subs. If we don't do so, the first pajeAddVariable is added to a non-determined value within
-   * the Paje simulator, causing analysis problems.
+  /* To trace resource utilization, we use AddEvent and SubEvent only. This implies to add a SetEvent first to set the
+   * initial value of all variables for subsequent adds/subs. If we don't do so, the first AddEvent would be added to a
+   * non-determined value, hence causing analysis problems.
    */
 
   // create a key considering the resource and variable
-  int n = strlen(variable)+strlen(resource)+1;
-  char *key = (char*)xbt_malloc(n*sizeof(char));
-  snprintf (key, n, "%s%s", resource, variable);
+  std::string key = resource->getName() + variable->getName();
 
-  // check if key exists: if it doesn't, set the variable to zero and mark this in the dict
-  if (not xbt_dict_get_or_null(platform_variables, key)) {
-    container_t container = PJ_container_get (resource);
-    type_t type = PJ_type_get (variable, container->type);
-    new SetVariableEvent (now, container, type, 0);
-    xbt_dict_set(platform_variables, key, (char*)"", nullptr);
+  // check if key exists: if it doesn't, set the variable to zero and mark this in the global map.
+  if (platform_variables.find(key) == platform_variables.end()) {
+    variable->setEvent(now, 0);
+    platform_variables.insert(key);
   }
-  xbt_free(key);
-}
 
-static void instr_event (double now, double delta, type_t variable, container_t resource, double value)
-{
-  __TRACE_surf_check_variable_set_to_zero(now, variable->name, resource->name);
-  new AddVariableEvent(now, resource, variable, value);
-  new SubVariableEvent(now + delta, resource, variable, value);
+  variable->addEvent(now, value);
+  variable->subEvent(now + delta, value);
 }
 
-/* TRACE_surf_link_set_utilization: entry point from SimGrid */
-void TRACE_surf_link_set_utilization(const char *resource, const char *category, double value, double now, double delta)
+static void TRACE_surf_resource_set_utilization(const char* type, const char* name, 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))
-    return;
-  if (not value)
-    return;
-
-  //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);
-    type_t type = PJ_type_get ("bandwidth_used", container->type);
-    instr_event (now, delta, type, container, value);
-  }
-
-  //trace categorized utilization
-  if (TRACE_categorized()){
-    if (not category)
-      return;
-    //variable of this category starts by 'b', because we have a link here
-    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);
-    type_t type = PJ_type_get (category_type, container->type);
-    instr_event (now, delta, type, container, value);
-  }
-}
-
-/* TRACE_surf_host_set_utilization: entry point from SimGrid */
-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);
+  // only trace resource utilization if resource is known by tracing mechanism
+  container_t container = simgrid::instr::Container::byNameOrNull(resource);
   if (not container || not value)
     return;
 
-  //trace uncategorized host utilization
+  // trace uncategorized resource utilization
   if (TRACE_uncategorized()){
-    XBT_DEBUG("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, resource, value);
-    type_t type = PJ_type_get ("power_used", container->type);
-    instr_event (now, delta, type, container, value);
+    XBT_DEBUG("UNCAT %s [%f - %f] %s %s %f", type, now, now + delta, resource, name, value);
+    simgrid::instr::VariableType* variable = container->getVariable(name);
+    instr_event(now, delta, variable, container, value);
   }
 
-  //trace categorized utilization
+  // trace categorized resource utilization
   if (TRACE_categorized()){
     if (not category)
       return;
-    //variable of this category starts by 'p', because we have a host here
-    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);
-    type_t type = PJ_type_get (category_type, container->type);
-    instr_event (now, delta, type, container, value);
+    std::string category_type = name[0] + std::string(category);
+    XBT_DEBUG("CAT %s [%f - %f] %s %s %f", type, now, now + delta, resource, category_type.c_str(), value);
+    simgrid::instr::VariableType* variable = container->getVariable(category_type);
+    instr_event(now, delta, variable, container, value);
   }
 }
 
-void TRACE_surf_resource_utilization_alloc()
+/* TRACE_surf_link_set_utilization: entry point from SimGrid */
+void TRACE_surf_link_set_utilization(const char* resource, const char* category, double value, double now, double delta)
 {
-  platform_variables = xbt_dict_new_homogeneous(nullptr);
+  TRACE_surf_resource_set_utilization("LINK", "bandwidth_used", resource, category, value, now, delta);
 }
 
-void TRACE_surf_resource_utilization_release()
+/* TRACE_surf_host_set_utilization: entry point from SimGrid */
+void TRACE_surf_host_set_utilization(const char* resource, const char* category, double value, double now, double delta)
 {
-  xbt_dict_free(&platform_variables);
+  TRACE_surf_resource_set_utilization("HOST", "power_used", resource, category, value, now, delta);
 }
diff --git a/src/instr/instr_smpi.h b/src/instr/instr_smpi.h
deleted file mode 100644 (file)
index 974d10f..0000000
+++ /dev/null
@@ -1,59 +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_SMPI_H_
-#define INSTR_SMPI_H_
-
-#ifdef __cplusplus
-#include <string>
-#endif
-
-#include "smpi/smpi.h"
-#include "src/instr/instr_private.h"
-
-SG_BEGIN_DECL()
-
-XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
-XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
-XBT_PRIVATE void TRACE_smpi_collective_in(int rank, int root, const char* operation, instr_extra_data extra);
-XBT_PRIVATE void TRACE_smpi_collective_out(int rank, int root, const char* operation);
-XBT_PRIVATE void TRACE_smpi_computing_init(int rank);
-XBT_PRIVATE void TRACE_smpi_computing_out(int rank);
-XBT_PRIVATE void TRACE_smpi_computing_in(int rank, instr_extra_data extra);
-XBT_PRIVATE void TRACE_smpi_sleeping_init(int rank);
-XBT_PRIVATE void TRACE_smpi_sleeping_out(int rank);
-XBT_PRIVATE void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra);
-XBT_PRIVATE void TRACE_smpi_testing_out(int rank);
-XBT_PRIVATE void TRACE_smpi_testing_in(int rank, instr_extra_data extra);
-XBT_PRIVATE void TRACE_smpi_alloc();
-XBT_PRIVATE void TRACE_smpi_release();
-XBT_PRIVATE void TRACE_smpi_ptp_in(int rank, int src, int dst, const char* operation, instr_extra_data extra);
-XBT_PRIVATE void TRACE_smpi_ptp_out(int rank, int src, int dst, const char* operation);
-XBT_PRIVATE void TRACE_smpi_send(int rank, int src, int dst, int tag, int size);
-XBT_PRIVATE void TRACE_smpi_recv(int rank, int src, int dst, int tag);
-XBT_PRIVATE void TRACE_smpi_init(int rank);
-XBT_PRIVATE void TRACE_smpi_finalize(int rank);
-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 {
-  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);
-  }
-#endif
-
-} smpi_trace_call_location_t;
-
-SG_END_DECL()
-
-#endif
diff --git a/src/instr/instr_smpi.hpp b/src/instr/instr_smpi.hpp
new file mode 100644 (file)
index 0000000..def907b
--- /dev/null
@@ -0,0 +1,54 @@
+/* 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_SMPI_HPP
+#define INSTR_SMPI_HPP
+
+#include "smpi/smpi.h"
+#include "src/instr/instr_private.hpp"
+#include <string>
+
+XBT_PRIVATE container_t smpi_container(int rank);
+
+extern "C" {
+
+XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
+XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
+XBT_PRIVATE void TRACE_smpi_computing_init(int rank);
+XBT_PRIVATE void TRACE_smpi_computing_out(int rank);
+XBT_PRIVATE void TRACE_smpi_computing_in(int rank, double amount);
+XBT_PRIVATE void TRACE_smpi_sleeping_init(int rank);
+XBT_PRIVATE void TRACE_smpi_sleeping_out(int rank);
+XBT_PRIVATE void TRACE_smpi_sleeping_in(int rank, double duration);
+XBT_PRIVATE void TRACE_smpi_testing_out(int rank);
+XBT_PRIVATE void TRACE_smpi_testing_in(int rank);
+XBT_PRIVATE void TRACE_smpi_alloc();
+XBT_PRIVATE void TRACE_smpi_release();
+XBT_PRIVATE void TRACE_smpi_comm_in(int rank, const char* operation, simgrid::instr::TIData* extra);
+XBT_PRIVATE void TRACE_smpi_comm_out(int rank);
+XBT_PRIVATE void TRACE_smpi_send(int rank, int src, int dst, int tag, int size);
+XBT_PRIVATE void TRACE_smpi_recv(int src, int dst, int tag);
+XBT_PRIVATE void TRACE_smpi_init(int rank);
+XBT_PRIVATE void TRACE_smpi_finalize(int rank);
+
+XBT_PRIVATE const char* encode_datatype(MPI_Datatype datatype);
+
+class smpi_trace_call_location_t {
+public:
+  std::string filename;
+  int linenumber;
+
+  std::string previous_filename;
+  int previous_linenumber;
+
+  std::string get_composed_key()
+  {
+    return previous_filename + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' +
+           std::to_string(linenumber);
+  }
+};
+}
+
+#endif
index 4f7841f..3138d6a 100644 (file)
@@ -14,7 +14,7 @@ namespace jedule {
 
 Jedule::~Jedule() {
   delete this->root_container;
-  for (auto evt: this->event_set)
+  for (auto const& evt : this->event_set)
     delete evt;
   this->event_set.clear();
 }
@@ -32,7 +32,7 @@ void Jedule::writeOutput(FILE *file) {
 
     if (not this->meta_info.empty()) {
       fprintf(file, "  <jedule_meta>\n");
-      for (auto elm: this->meta_info)
+      for (auto const& elm : this->meta_info)
         fprintf(file, "        <prop key=\"%s\" value=\"%s\" />\n",elm.first,elm.second);
       fprintf(file, "  </jedule_meta>\n");
     }
@@ -42,8 +42,8 @@ void Jedule::writeOutput(FILE *file) {
     fprintf(file, "  </platform>\n");
 
     fprintf(file, "  <events>\n");
-    for (auto event :this->event_set)
-        event->print(file);
+    for (auto const& event : this->event_set)
+      event->print(file);
     fprintf(file, "  </events>\n");
 
     fprintf(file, "</jedule>\n");
index afe12f3..01ca092 100644 (file)
@@ -21,7 +21,7 @@ Event::Event(std::string name, double start_time, double end_time, std::string t
 Event::~Event()
 {
   if (not this->resource_subsets->empty()) {
-    for (auto subset: *this->resource_subsets)
+    for (auto const& subset : *this->resource_subsets)
       delete subset;
     delete this->resource_subsets;
   }
@@ -53,7 +53,7 @@ void Event::print(FILE *jed_file)
 
   xbt_assert(not this->resource_subsets->empty());
   fprintf(jed_file, "      <res_util>\n");
-  for (auto subset: *this->resource_subsets) {
+  for (auto const& subset : *this->resource_subsets) {
     fprintf(jed_file, "        <select resources=\"");
     fprintf(jed_file, "%s", subset->parent->getHierarchyAsString().c_str());
     fprintf(jed_file, ".[%d-%d]", subset->start_idx, subset->start_idx + subset->nres-1);
@@ -63,14 +63,14 @@ void Event::print(FILE *jed_file)
 
   if (not this->characteristics_list.empty()) {
     fprintf(jed_file, "      <characteristics>\n");
-    for (auto ch: this->characteristics_list)
+    for (auto const& ch : this->characteristics_list)
       fprintf(jed_file, "          <characteristic name=\"%s\" />\n", ch);
     fprintf(jed_file, "      </characteristics>\n");
   }
 
   if (not this->info_map.empty()) {
     fprintf(jed_file, "      <info>\n");
-    for (auto elm: this->info_map)
+    for (auto const& elm : this->info_map)
       fprintf(jed_file, "        <prop key=\"%s\" value=\"%s\" />\n",elm.first,elm.second);
     fprintf(jed_file, "      </info>\n");
   }
index 5109fd7..133b1f6 100644 (file)
 
 #if SIMGRID_HAVE_JEDULE
 
+namespace {
+std::unordered_map<const char*, jed_container_t> host2_simgrid_parent_container;
+std::unordered_map<std::string, jed_container_t> container_name2container;
+}
+
 namespace simgrid {
 namespace jedule {
 Subset::Subset(int start_idx, int end_idx, Container* parent)
@@ -27,13 +32,12 @@ Container::Container(std::string name): name(name)
 Container::~Container()
 {
   if (not this->children.empty())
-    for (auto child: this->children)
+    for (auto const& child : this->children)
       delete child;
 }
 
 void Container::addChild(jed_container_t child)
 {
-  xbt_assert(this != nullptr);
   xbt_assert(child != nullptr);
   this->children.push_back(child);
   child->parent = this;
@@ -47,7 +51,7 @@ void Container::addResources(std::vector<sg_host_t> hosts)
 
   //FIXME do we need to sort?: xbt_dynar_sort_strings(host_names);
 
-  for (auto host : hosts) {
+  for (auto const& host : hosts) {
     const char *host_name = sg_host_get_name(host);
     this->name2id.insert({host_name, this->last_id});
     (this->last_id)++;
@@ -66,7 +70,7 @@ void Container::createHierarchy(sg_netzone_t from_as)
     from_as->getHosts(&table);
     this->addResources(table);
   } else {
-    for (auto nz : *from_as->getChildren()) {
+    for (auto const& nz : *from_as->getChildren()) {
       jed_container_t child_container = new simgrid::jedule::Container(std::string(nz->getCname()));
       this->addChild(child_container);
       child_container->createHierarchy(nz);
@@ -76,8 +80,6 @@ void Container::createHierarchy(sg_netzone_t from_as)
 
 std::vector<int> Container::getHierarchy()
 {
-  xbt_assert( this!= nullptr );
-
   if(this->parent != nullptr ) {
 
     if (not this->parent->children.empty()) {
@@ -87,7 +89,7 @@ std::vector<int> Container::getHierarchy()
       unsigned int i =0;
       int child_nb = -1;
 
-      for (auto child : this->parent->children) {
+      for (auto const& child : this->parent->children) {
         if( child == this) {
           child_nb = i;
           break;
@@ -115,7 +117,7 @@ std::string Container::getHierarchyAsString()
 
   unsigned int length = heir_list.size();
   unsigned int i = 0;
-  for (auto id : heir_list) {
+  for (auto const& id : heir_list) {
     output += std::to_string(id);
     if( i != length-1 ) {
       output += ".";
@@ -134,7 +136,7 @@ void Container::printResources(FILE * jed_file)
   std::string resid = this->getHierarchyAsString();
 
   fprintf(jed_file, "      <rset id=\"%s\" nb=\"%u\" names=\"", resid.c_str(), res_nb);
-  for (auto res: this->resource_list) {
+  for (auto const& res : this->resource_list) {
     const char * res_name = sg_host_get_name(res);
     fprintf(jed_file, "%s", res_name);
     if( i != res_nb-1 ) {
@@ -147,10 +149,9 @@ void Container::printResources(FILE * jed_file)
 
 void Container::print(FILE* jed_file)
 {
-  xbt_assert( this != nullptr );
   fprintf(jed_file, "    <res name=\"%s\">\n", this->name.c_str());
   if (not this->children.empty()) {
-    for (auto child: this->children) {
+    for (auto const& child : this->children) {
       child->print(jed_file);
     }
   } else {
@@ -173,7 +174,7 @@ static void add_subsets_to(std::vector<jed_subset_t> *subset_list, std::vector<c
 
   std::vector<unsigned int> id_list;
 
-  for (auto host_name : hostgroup) {
+  for (auto const& host_name : hostgroup) {
     xbt_assert( host_name != nullptr );
     jed_container_t parent = host2_simgrid_parent_container.at(host_name);
     unsigned int id = parent->name2id.at(host_name);
@@ -211,7 +212,7 @@ void get_resource_selection_by_hosts(std::vector<jed_subset_t> *subset_list, std
   //  find parent container
   //  group by parent container
   std::unordered_map<const char*, std::vector<const char*>> parent2hostgroup;
-  for (auto host: *host_list) {
+  for (auto const& host : *host_list) {
     const char *host_name = sg_host_get_name(host);
     jed_container_t parent = host2_simgrid_parent_container.at(host_name);
     xbt_assert( parent != nullptr );
@@ -223,7 +224,7 @@ void get_resource_selection_by_hosts(std::vector<jed_subset_t> *subset_list, std
       host_group->second.push_back(host_name);
   }
 
-  for (auto elm: parent2hostgroup) {
+  for (auto const& elm : parent2hostgroup) {
     jed_container_t parent = container_name2container.at(elm.first);
     add_subsets_to(subset_list, elm.second, parent);
   }
index 2b4edf7..779a7b0 100644 (file)
@@ -16,7 +16,7 @@ EngineImpl::~EngineImpl()
 {
   sg_host_exit(); // Hosts should be part of the engine, at some point
   delete netRoot_;
-  for (auto kv : netpoints_)
+  for (auto const& kv : netpoints_)
     delete kv.second;
 }
 }
index c25063d..8593bf8 100644 (file)
@@ -1,20 +1,15 @@
-/* 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. */
 
+#include <simgrid/s4u/NetZone.hpp>
 #include <simgrid/s4u/forward.hpp>
-#include <xbt/dict.h>
-
 #include <string>
 #include <unordered_map>
 
 namespace simgrid {
 namespace kernel {
-namespace routing {
-class NetZoneImpl;
-class NetPoint;
-}
 
 class EngineImpl {
 public:
@@ -22,7 +17,7 @@ public:
   virtual ~EngineImpl();
   kernel::routing::NetZoneImpl* netRoot_ = nullptr;
 
-protected:
+private:
   std::unordered_map<std::string, simgrid::kernel::routing::NetPoint*> netpoints_;
   friend simgrid::s4u::Engine;
 };
index 33d31e7..7f19e42 100644 (file)
@@ -6,8 +6,8 @@
 #include "src/kernel/activity/CommImpl.hpp"
 
 #include "simgrid/modelchecker.h"
-#include "src/mc/mc_replay.h"
-#include "src/simix/smx_network_private.h"
+#include "src/mc/mc_replay.hpp"
+#include "src/simix/smx_network_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network);
index fb60e05..8480bb9 100644 (file)
@@ -7,9 +7,9 @@
 #define SIMIX_SYNCHRO_COMM_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
-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 8012e39..2fe76ae 100644 (file)
@@ -7,7 +7,7 @@
 #define SIMIX_SYNCHRO_EXEC_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index 3f8cedc..bed10c2 100644 (file)
@@ -9,13 +9,13 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_mailbox, simix, "Mailbox implementation");
 
-static xbt_dict_t mailboxes = xbt_dict_new_homogeneous([](void* data) {
-  delete static_cast<smx_mailbox_t>(data);
-});
+static std::map<std::string, smx_mailbox_t>* mailboxes = new std::map<std::string, smx_mailbox_t>;
 
 void SIMIX_mailbox_exit()
 {
-  xbt_dict_free(&mailboxes);
+  for (auto const& elm : *mailboxes)
+    delete elm.second;
+  delete mailboxes;
 }
 
 /******************************************************************************/
@@ -28,20 +28,25 @@ namespace activity {
 /** @brief Returns the mailbox of that name, or nullptr */
 MailboxImpl* MailboxImpl::byNameOrNull(const char* name)
 {
-  return static_cast<smx_mailbox_t>(xbt_dict_get_or_null(mailboxes, name));
+  auto mbox = mailboxes->find(name);
+  if (mbox != mailboxes->end())
+    return mbox->second;
+  else
+    return nullptr;
 }
 /** @brief Returns the mailbox of that name, newly created on need */
 MailboxImpl* MailboxImpl::byNameOrCreate(const char* name)
 {
   xbt_assert(name, "Mailboxes must have a name");
   /* two processes may have pushed the same mbox_create simcall at the same time */
-  smx_mailbox_t mbox = static_cast<smx_mailbox_t>(xbt_dict_get_or_null(mailboxes, name));
-  if (not mbox) {
-    mbox = new MailboxImpl(name);
+  auto m = mailboxes->find(name);
+  if (m == mailboxes->end()) {
+    smx_mailbox_t mbox = new MailboxImpl(name);
     XBT_DEBUG("Creating a mailbox at %p with name %s", mbox, name);
-    xbt_dict_set(mailboxes, mbox->name_, mbox, nullptr);
-  }
-  return mbox;
+    (*mailboxes)[mbox->name_] = mbox;
+    return mbox;
+  } else
+    return m->second;
 }
 /** @brief set the receiver of the mailbox to allow eager sends
  *  \param actor The receiving dude
@@ -68,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 6db6d88..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);
@@ -34,7 +34,6 @@ void simgrid::kernel::activity::SleepImpl::post()
     switch (surf_sleep->getState()) {
       case simgrid::surf::Action::State::failed:
         simcall->issuer->context->iwannadie = 1;
-        // SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
         state = SIMIX_SRC_HOST_FAILURE;
         break;
 
index a149ce5..5441f61 100644 (file)
@@ -7,7 +7,7 @@
 #define SIMIX_SYNCHRO_SLEEP_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index a9543f7..9001cf9 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()
@@ -21,16 +21,16 @@ void simgrid::kernel::activity::IoImpl::resume()
 
 void simgrid::kernel::activity::IoImpl::post()
 {
-  for (smx_simcall_t simcall : simcalls) {
+  for (smx_simcall_t const& simcall : simcalls) {
     switch (simcall->call) {
-    case SIMCALL_FILE_WRITE:
-      simcall_file_write__set__result(simcall, surf_io->getCost());
-      break;
-    case SIMCALL_FILE_READ:
-      simcall_file_read__set__result(simcall, surf_io->getCost());
-      break;
-    default:
-      break;
+      case SIMCALL_STORAGE_WRITE:
+        simcall_storage_write__set__result(simcall, surf_io->getCost());
+        break;
+      case SIMCALL_STORAGE_READ:
+        simcall_storage_read__set__result(simcall, surf_io->getCost());
+        break;
+      default:
+        break;
     }
   }
 
index 2b6ab93..f827ac6 100644 (file)
@@ -6,8 +6,8 @@
 #ifndef SIMIX_SYNCHRO_IO_HPP
 #define SIMIX_SYNCHRO_IO_HPP
 
-#include "surf/surf.h"
 #include "src/kernel/activity/ActivityImpl.hpp"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index f5ef90d..d416f90 100644 (file)
@@ -6,8 +6,8 @@
 #ifndef SIMIX_SYNCHRO_RAW_HPP
 #define SIMIX_SYNCHRO_RAW_HPP
 
-#include "surf/surf.h"
 #include "src/kernel/activity/ActivityImpl.hpp"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
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 087b175..7b53ca9 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 "surf/surf.hpp"
 #include "xbt/base.h"
 #include "xbt/config.h"
-#include "xbt/dict.h"
 #include "xbt/function_types.h"
 #include "xbt/mallocator.h"
-#include "xbt/swag.h"
 #include "xbt/xbt_os_time.h"
 
-#include <signal.h>
 #include "src/simix/ActorImpl.hpp"
+#include <csignal>
 
 #include <simgrid/simix.hpp>
 
@@ -82,6 +80,13 @@ namespace context {
     void_pfn_smxprocess_t cleanup_func_ = nullptr;
     smx_actor_t process_ = nullptr;
   public:
+    class StopRequest {
+      /** @brief Exception launched to kill a process, in order to properly unwind its stack and release RAII stuff
+       *
+       * Nope, Sonar, this should not inherit of std::exception.
+       * Otherwise, users may accidentally catch it with a try {} catch (std::exception)
+       */
+    };
     bool iwannadie;
 
     Context(std::function<void()> code,
@@ -143,16 +148,13 @@ 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();
 
-XBT_PRIVATE smx_context_t SIMIX_context_new(
-  std::function<void()> code,
-  void_pfn_smxprocess_t cleanup_func,
-  smx_actor_t simix_process);
+XBT_PUBLIC(smx_context_t)
+SIMIX_context_new(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t simix_process);
 
 #ifndef WIN32
 XBT_PUBLIC_DATA(char sigsegv_stack[SIGSTKSZ]);
@@ -160,12 +162,12 @@ XBT_PUBLIC_DATA(char sigsegv_stack[SIGSTKSZ]);
 
 /* We are using the bottom of the stack to save some information, like the
  * valgrind_stack_id. Define smx_context_usable_stack_size to give the remaining
- * size for the stack. */
+ * size for the stack. Round its value to a multiple of 16 (asan wants the stacks to be aligned this way). */
 #if HAVE_VALGRIND_H
-# define smx_context_usable_stack_size                                  \
-  (smx_context_stack_size - sizeof(unsigned int)) /* for valgrind_stack_id */
+#define smx_context_usable_stack_size                                                                                  \
+  ((smx_context_stack_size - sizeof(unsigned int)) & ~0xf) /* for valgrind_stack_id */
 #else
-# define smx_context_usable_stack_size smx_context_stack_size
+#define smx_context_usable_stack_size (smx_context_stack_size & ~0xf)
 #endif
 
 /** @brief Executes all the processes to run (in parallel if possible). */
@@ -176,14 +178,13 @@ XBT_PUBLIC(smx_context_t) SIMIX_context_self(); // public because it's used in s
 XBT_PRIVATE void *SIMIX_context_stack_new();
 XBT_PRIVATE void SIMIX_context_stack_delete(void *stack);
 
-XBT_PRIVATE void SIMIX_context_set_current(smx_context_t context);
+XBT_PUBLIC(void) SIMIX_context_set_current(smx_context_t context);
 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 a88920d..1d26b05 100644 (file)
@@ -1,22 +1,24 @@
-/* Copyright (c) 2015. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2015-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 <cstdint>
+#include "ContextBoost.hpp"
 
-#include <functional>
 #include <utility>
-#include <vector>
-
-#include <boost/context/all.hpp>
-
 #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"
+#if HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT
+#include <sanitizer/asan_interface.h>
+#define ASAN_EVAL(expr) (expr)
+#define ASAN_START_SWITCH(fake_stack_save, bottom, size) __sanitizer_start_switch_fiber(fake_stack_save, bottom, size)
+#define ASAN_FINISH_SWITCH(fake_stack_save, bottom_old, size_old)                                                      \
+  __sanitizer_finish_switch_fiber(fake_stack_save, bottom_old, size_old)
+#else
+#define ASAN_EVAL(expr) (void)0
+#define ASAN_START_SWITCH(fake_stack_save, bottom, size) (void)0
+#define ASAN_FINISH_SWITCH(fake_stack_save, bottom_old, size_old) (void)(fake_stack_save)
+#endif
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
@@ -24,51 +26,15 @@ namespace simgrid {
 namespace kernel {
 namespace context {
 
-class BoostSerialContext : public BoostContext {
-public:
-  BoostSerialContext(std::function<void()> code,
-      void_pfn_smxprocess_t cleanup_func,
-      smx_actor_t process)
-    : BoostContext(std::move(code), cleanup_func, process) {}
-  void stop() override;
-  void suspend() override;
-};
-
-#if HAVE_THREAD_CONTEXTS
-class BoostParallelContext : public BoostContext {
-public:
-  BoostParallelContext(std::function<void()> code,
-      void_pfn_smxprocess_t cleanup_func,
-      smx_actor_t process)
-    : BoostContext(std::move(code), cleanup_func, process) {}
-  void stop() override;
-  void suspend() override;
-  void resume() override;
-};
-#endif
-
 // BoostContextFactory
 
-bool                BoostContext::parallel_        = false;
-xbt_parmap_t        BoostContext::parmap_          = nullptr;
-uintptr_t           BoostContext::threads_working_ = 0;
-xbt_os_thread_key_t BoostContext::worker_id_key_;
-unsigned long       BoostContext::process_index_   = 0;
-BoostContext*       BoostContext::maestro_context_ = nullptr;
-std::vector<BoostContext*> BoostContext::workers_context_;
-
 BoostContextFactory::BoostContextFactory()
-  : ContextFactory("BoostContextFactory")
+    : ContextFactory("BoostContextFactory"), parallel_(SIMIX_context_is_parallel())
 {
-  BoostContext::parallel_ = SIMIX_context_is_parallel();
-  if (BoostContext::parallel_) {
+  BoostContext::setMaestro(nullptr);
+  if (parallel_) {
 #if HAVE_THREAD_CONTEXTS
-    int nthreads = SIMIX_context_get_nthreads();
-    BoostContext::parmap_ = xbt_parmap_new(nthreads, SIMIX_context_get_parallel_mode());
-    BoostContext::workers_context_.clear();
-    BoostContext::workers_context_.resize(nthreads, nullptr);
-    BoostContext::maestro_context_ = nullptr;
-    xbt_os_thread_key_create(&BoostContext::worker_id_key_);
+    ParallelBoostContext::initialize();
 #else
     xbt_die("No thread support for parallel context execution");
 #endif
@@ -78,84 +44,58 @@ BoostContextFactory::BoostContextFactory()
 BoostContextFactory::~BoostContextFactory()
 {
 #if HAVE_THREAD_CONTEXTS
-  if (BoostContext::parmap_) {
-    xbt_parmap_destroy(BoostContext::parmap_);
-    BoostContext::parmap_ = nullptr;
-  }
-  BoostContext::workers_context_.clear();
+  if (parallel_)
+    ParallelBoostContext::finalize();
 #endif
 }
 
 smx_context_t BoostContextFactory::create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func,
                                                   smx_actor_t process)
 {
-  BoostContext* context = nullptr;
-  if (BoostContext::parallel_)
 #if HAVE_THREAD_CONTEXTS
-    context = this->new_context<BoostParallelContext>(std::move(code), cleanup_func, process);
-#else
-    xbt_die("No support for parallel execution");
+  if (parallel_)
+    return this->new_context<ParallelBoostContext>(std::move(code), cleanup_func, process);
 #endif
-  else
-    context = this->new_context<BoostSerialContext>(std::move(code), cleanup_func, process);
-  return context;
+
+  return this->new_context<SerialBoostContext>(std::move(code), cleanup_func, process);
 }
 
 void BoostContextFactory::run_all()
 {
 #if HAVE_THREAD_CONTEXTS
-  if (BoostContext::parallel_) {
-    BoostContext::threads_working_ = 0;
-    xbt_parmap_apply(BoostContext::parmap_,
-      [](void* arg) {
-        smx_actor_t process = static_cast<smx_actor_t>(arg);
-        BoostContext* context  = static_cast<BoostContext*>(process->context);
-        return context->resume();
-      },
-      simix_global->process_to_run);
-  } else
+  if (parallel_)
+    ParallelBoostContext::run_all();
+  else
 #endif
-  {
-    if (xbt_dynar_is_empty(simix_global->process_to_run))
-      return;
-    smx_actor_t first_process = xbt_dynar_get_as(simix_global->process_to_run, 0, smx_actor_t);
-    BoostContext::process_index_ = 1;
-    /* execute the first process */
-    static_cast<BoostContext*>(first_process->context)->resume();
-  }
+    SerialBoostContext::run_all();
 }
 
-
 // BoostContext
 
-static void smx_ctx_boost_wrapper(std::intptr_t arg)
-{
-  BoostContext* context = (BoostContext*)(arg);
-  (*context)();
-  context->stop();
-}
+BoostContext* BoostContext::maestro_context_ = nullptr;
 
-BoostContext::BoostContext(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
-  : Context(std::move(code), cleanup_func, process)
+BoostContext::BoostContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+    : Context(std::move(code), cleanup_func, process)
 {
 
   /* if the user provided a function for the process then use it, otherwise it is the context for maestro */
   if (has_code()) {
     this->stack_ = SIMIX_context_stack_new();
-// We need to pass the bottom of the stack to make_fcontext, depending on the stack direction it may be the lower
-// or higher address:
+    /* We need to pass the bottom of the stack to make_fcontext,
+       depending on the stack direction it may be the lower or higher address: */
 #if PTH_STACKGROWTH == -1
-    void* stack = static_cast<char*>(this->stack_) + smx_context_usable_stack_size - 1;
+    void* stack = static_cast<char*>(this->stack_) + smx_context_usable_stack_size;
 #else
     void* stack = this->stack_;
 #endif
-    this->fc_ = boost::context::make_fcontext(
-                      stack,
-                      smx_context_usable_stack_size,
-                      smx_ctx_boost_wrapper);
+    ASAN_EVAL(this->asan_stack_ = stack);
+#if BOOST_VERSION < 106100
+    this->fc_ = boost::context::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
+#else
+    this->fc_ = boost::context::detail::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
+#endif
   } else {
-#if HAVE_BOOST_CONTEXTS == 1
+#if BOOST_VERSION < 105600
     this->fc_ = new boost::context::fcontext_t();
 #endif
     if (BoostContext::maestro_context_ == nullptr)
@@ -165,7 +105,7 @@ BoostContext::BoostContext(std::function<void()> code,
 
 BoostContext::~BoostContext()
 {
-#if HAVE_BOOST_CONTEXTS == 1
+#if BOOST_VERSION < 105600
   if (not this->stack_)
     delete this->fc_;
 #endif
@@ -174,95 +114,154 @@ BoostContext::~BoostContext()
   SIMIX_context_stack_delete(this->stack_);
 }
 
-// BoostSerialContext
+void BoostContext::wrapper(BoostContext::arg_type arg)
+{
+#if BOOST_VERSION < 106100
+  BoostContext* context = reinterpret_cast<BoostContext*>(arg);
+#else
+  ASAN_FINISH_SWITCH(nullptr, &static_cast<BoostContext**>(arg.data)[0]->asan_stack_,
+                     &static_cast<BoostContext**>(arg.data)[0]->asan_stack_size_);
+  static_cast<BoostContext**>(arg.data)[0]->fc_ = arg.fctx;
+  BoostContext* context                         = static_cast<BoostContext**>(arg.data)[1];
+#endif
+  try {
+    (*context)();
+    context->Context::stop();
+  } catch (StopRequest const&) {
+    XBT_DEBUG("Caught a StopRequest");
+  }
+  ASAN_EVAL(context->asan_stop_ = true);
+  context->suspend();
+}
 
-void BoostContext::resume()
+inline void BoostContext::swap(BoostContext* from, BoostContext* to)
 {
-  SIMIX_context_set_current(this);
-#if HAVE_BOOST_CONTEXTS == 1
-  boost::context::jump_fcontext(maestro_context_->fc_, this->fc_, (intptr_t) this);
+#if BOOST_VERSION < 105600
+  boost::context::jump_fcontext(from->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
+#elif BOOST_VERSION < 106100
+  boost::context::jump_fcontext(&from->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
 #else
-  boost::context::jump_fcontext(&maestro_context_->fc_, this->fc_, (intptr_t) this);
+  BoostContext* ctx[2] = {from, to};
+  void* fake_stack;
+  ASAN_START_SWITCH(from->asan_stop_ ? nullptr : &fake_stack, to->asan_stack_, to->asan_stack_size_);
+  boost::context::detail::transfer_t arg = boost::context::detail::jump_fcontext(to->fc_, ctx);
+  ASAN_FINISH_SWITCH(fake_stack, &static_cast<BoostContext**>(arg.data)[0]->asan_stack_,
+                     &static_cast<BoostContext**>(arg.data)[0]->asan_stack_size_);
+  static_cast<BoostContext**>(arg.data)[0]->fc_ = arg.fctx;
 #endif
 }
 
-void BoostSerialContext::suspend()
+void BoostContext::stop()
+{
+  Context::stop();
+  throw StopRequest();
+}
+
+// SerialBoostContext
+
+unsigned long SerialBoostContext::process_index_;
+
+void SerialBoostContext::suspend()
 {
   /* determine the next context */
-  BoostSerialContext* next_context = nullptr;
-  unsigned long int i              = process_index_;
+  SerialBoostContext* next_context;
+  unsigned long int i = process_index_;
   process_index_++;
 
-  if (i < xbt_dynar_length(simix_global->process_to_run)) {
+  if (i < simix_global->process_to_run.size()) {
     /* execute the next process */
     XBT_DEBUG("Run next process");
-    next_context =
-        static_cast<BoostSerialContext*>(xbt_dynar_get_as(simix_global->process_to_run, i, smx_actor_t)->context);
+    next_context = static_cast<SerialBoostContext*>(simix_global->process_to_run[i]->context);
   } else {
     /* all processes were run, return to maestro */
     XBT_DEBUG("No more process to run");
-    next_context = static_cast<BoostSerialContext*>(maestro_context_);
+    next_context = static_cast<SerialBoostContext*>(BoostContext::getMaestro());
   }
-  SIMIX_context_set_current((smx_context_t) next_context);
-#if HAVE_BOOST_CONTEXTS == 1
-  boost::context::jump_fcontext(this->fc_, next_context->fc_, (intptr_t) next_context);
-#else
-  boost::context::jump_fcontext(&this->fc_, next_context->fc_, (intptr_t) next_context);
-#endif
+  SIMIX_context_set_current(next_context);
+  BoostContext::swap(this, next_context);
 }
 
-void BoostSerialContext::stop()
+void SerialBoostContext::resume()
 {
-  BoostContext::stop();
-  this->suspend();
+  SIMIX_context_set_current(this);
+  BoostContext::swap(BoostContext::getMaestro(), this);
 }
 
-// BoostParallelContext
+void SerialBoostContext::run_all()
+{
+  if (simix_global->process_to_run.empty())
+    return;
+  smx_actor_t first_process = simix_global->process_to_run.front();
+  process_index_            = 1;
+  /* execute the first process */
+  static_cast<SerialBoostContext*>(first_process->context)->resume();
+}
+
+// ParallelBoostContext
 
 #if HAVE_THREAD_CONTEXTS
 
-void BoostParallelContext::suspend()
+simgrid::xbt::Parmap<smx_actor_t>* ParallelBoostContext::parmap_;
+std::atomic<uintptr_t> ParallelBoostContext::threads_working_;
+xbt_os_thread_key_t ParallelBoostContext::worker_id_key_;
+std::vector<ParallelBoostContext*> ParallelBoostContext::workers_context_;
+
+void ParallelBoostContext::initialize()
 {
-  smx_actor_t next_work = static_cast<smx_actor_t>(xbt_parmap_next(parmap_));
-  BoostParallelContext* next_context = nullptr;
+  parmap_ = nullptr;
+  workers_context_.clear();
+  workers_context_.resize(SIMIX_context_get_nthreads(), nullptr);
+  xbt_os_thread_key_create(&worker_id_key_);
+}
+
+void ParallelBoostContext::finalize()
+{
+  delete parmap_;
+  parmap_ = nullptr;
+  workers_context_.clear();
+  xbt_os_thread_key_destroy(worker_id_key_);
+}
 
-  if (next_work != nullptr) {
+void ParallelBoostContext::run_all()
+{
+  threads_working_ = 0;
+  if (parmap_ == nullptr)
+    parmap_ = new simgrid::xbt::Parmap<smx_actor_t>(SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
+  parmap_->apply(
+      [](smx_actor_t process) {
+        ParallelBoostContext* context = static_cast<ParallelBoostContext*>(process->context);
+        context->resume();
+      },
+      simix_global->process_to_run);
+}
+
+void ParallelBoostContext::suspend()
+{
+  boost::optional<smx_actor_t> next_work = parmap_->next();
+  ParallelBoostContext* next_context;
+  if (next_work) {
     XBT_DEBUG("Run next process");
-    next_context = static_cast<BoostParallelContext*>(next_work->context);
+    next_context = static_cast<ParallelBoostContext*>(next_work.get()->context);
   } else {
     XBT_DEBUG("No more processes to run");
-    uintptr_t worker_id = (uintptr_t)xbt_os_thread_get_specific(worker_id_key_);
-    next_context = static_cast<BoostParallelContext*>(workers_context_[worker_id]);
+    uintptr_t worker_id = reinterpret_cast<uintptr_t>(xbt_os_thread_get_specific(worker_id_key_));
+    next_context        = workers_context_[worker_id];
   }
 
-  SIMIX_context_set_current(static_cast<smx_context_t> (next_context));
-#if HAVE_BOOST_CONTEXTS == 1
-  boost::context::jump_fcontext(this->fc_, next_context->fc_, (intptr_t)(next_context));
-#else
-  boost::context::jump_fcontext(&this->fc_, next_context->fc_, (intptr_t)(next_context));
-#endif
-}
-
-void BoostParallelContext::stop()
-{
-  BoostContext::stop();
-  this->suspend();
+  SIMIX_context_set_current(next_context);
+  BoostContext::swap(this, next_context);
 }
 
-void BoostParallelContext::resume()
+void ParallelBoostContext::resume()
 {
-  uintptr_t worker_id = __sync_fetch_and_add(&threads_working_, 1);
-  xbt_os_thread_set_specific(worker_id_key_, (void*) worker_id);
+  uintptr_t worker_id = threads_working_.fetch_add(1, std::memory_order_relaxed);
+  xbt_os_thread_set_specific(worker_id_key_, reinterpret_cast<void*>(worker_id));
 
-  BoostParallelContext* worker_context = static_cast<BoostParallelContext*>(SIMIX_context_self());
-  workers_context_[worker_id] = worker_context;
+  ParallelBoostContext* worker_context = static_cast<ParallelBoostContext*>(SIMIX_context_self());
+  workers_context_[worker_id]          = worker_context;
 
   SIMIX_context_set_current(this);
-#if HAVE_BOOST_CONTEXTS == 1
-  boost::context::jump_fcontext(worker_context->fc_, this->fc_, (intptr_t) this);
-#else
-  boost::context::jump_fcontext(&worker_context->fc_, this->fc_, (intptr_t) this);
-#endif
+  BoostContext::swap(worker_context, this);
 }
 
 #endif
@@ -272,5 +271,4 @@ XBT_PRIVATE ContextFactory* boost_factory()
   XBT_VERB("Using Boost contexts. Welcome to the 21th century.");
   return new BoostContextFactory();
 }
-
 }}} // namespace
index 578fe10..b06ddd7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2015-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 SIMGRID_SIMIX_BOOST_CONTEXT_HPP
 #define SIMGRID_SIMIX_BOOST_CONTEXT_HPP
 
+#include <boost/version.hpp>
+#if BOOST_VERSION < 106100
+#include <boost/context/fcontext.hpp>
+#else
+#include <boost/context/detail/fcontext.hpp>
+#endif
+
+#include <atomic>
+#include <cstdint>
 #include <functional>
 #include <vector>
 
-#include <xbt/parmap.h>
-
 #include <simgrid/simix.hpp>
+#include <xbt/parmap.hpp>
+#include <xbt/xbt_os_thread.h>
 
+#include "Context.hpp"
+#include "src/internal_config.h"
+#include "src/simix/smx_private.hpp"
 
 namespace simgrid {
 namespace kernel {
 namespace context {
 
-class BoostContext;
-class BoostSerialContext;
-class BoostParallelContext;
-class BoostContextFactory;
-
 /** @brief Userspace context switching implementation based on Boost.Context */
 class BoostContext : public Context {
-protected: // static
-  static bool parallel_;
-  static xbt_parmap_t parmap_;
-  static std::vector<BoostContext*> workers_context_;
-  static uintptr_t threads_working_;
-  static xbt_os_thread_key_t worker_id_key_;
-  static unsigned long process_index_;
+public:
+  BoostContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
+  ~BoostContext() override;
+  void stop() override;
+  virtual void resume() = 0;
+
+  static void swap(BoostContext* from, BoostContext* to);
+  static BoostContext* getMaestro() { return maestro_context_; }
+  static void setMaestro(BoostContext* maestro) { maestro_context_ = maestro; }
+
+private:
   static BoostContext* maestro_context_;
+  void* stack_ = nullptr;
 
-#if HAVE_BOOST_CONTEXTS == 1
+#if BOOST_VERSION < 105600
   boost::context::fcontext_t* fc_ = nullptr;
-#else
+  typedef intptr_t arg_type;
+#elif BOOST_VERSION < 106100
   boost::context::fcontext_t fc_;
+  typedef intptr_t arg_type;
+#else
+  boost::context::detail::fcontext_t fc_;
+  typedef boost::context::detail::transfer_t arg_type;
 #endif
-  void* stack_ = nullptr;
+#if HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT
+  const void* asan_stack_ = nullptr;
+  size_t asan_stack_size_ = 0;
+  bool asan_stop_         = false;
+#endif
+
+  static void wrapper(arg_type arg);
+};
+
+class SerialBoostContext : public BoostContext {
 public:
-  friend BoostContextFactory;
-  BoostContext(std::function<void()> code,
-          void_pfn_smxprocess_t cleanup_func,
-          smx_actor_t process);
-  ~BoostContext() override;
-  virtual void resume();
+  SerialBoostContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+      : BoostContext(std::move(code), cleanup_func, process)
+  {
+  }
+  void suspend() override;
+  void resume() override;
+
+  static void run_all();
+
 private:
-  static void wrapper(int first, ...);
+  static unsigned long process_index_;
 };
 
-class BoostContextFactory : public ContextFactory {
+#if HAVE_THREAD_CONTEXTS
+class ParallelBoostContext : public BoostContext {
 public:
-  friend BoostContext;
-  friend BoostSerialContext;
-  friend BoostParallelContext;
+  ParallelBoostContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+      : BoostContext(std::move(code), cleanup_func, process)
+  {
+  }
+  void suspend() override;
+  void resume() override;
+
+  static void initialize();
+  static void finalize();
+  static void run_all();
+
+private:
+  static simgrid::xbt::Parmap<smx_actor_t>* parmap_;
+  static std::vector<ParallelBoostContext*> workers_context_;
+  static std::atomic<uintptr_t> threads_working_;
+  static xbt_os_thread_key_t worker_id_key_;
+};
+#endif
 
+class BoostContextFactory : public ContextFactory {
+public:
   BoostContextFactory();
   ~BoostContextFactory() override;
-  Context* create_context(std::function<void()> code,
-    void_pfn_smxprocess_t, smx_actor_t process) override;
+  Context* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
   void run_all() override;
-};
 
+private:
+  bool parallel_;
+};
 }}} // namespace
 
 #endif
index 057d46e..90e0d8e 100644 (file)
@@ -3,88 +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 "src/internal_config.h"
+#include "ContextRaw.hpp"
 
-#include "xbt/parmap.h"
-
-#include "src/simix/smx_private.h"
 #include "mc/mc.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
-// ***** Class definitions
-
-namespace simgrid {
-namespace kernel {
-namespace context {
-
-class RawContext;
-class RawContextFactory;
-
-/** @brief Fast context switching inspired from SystemV ucontexts.
-  *
-  * The main difference to the System V context is that Raw Contexts are much faster because they don't
-  * preserve the signal mask when switching. This saves a system call (at least on Linux) on each context switch.
-  */
-class RawContext : public Context {
-protected:
-  void* stack_ = nullptr;
-  /** pointer to top the stack stack */
-  void* stack_top_ = nullptr;
-public:
-  friend class RawContextFactory;
-  RawContext(std::function<void()> code,
-          void_pfn_smxprocess_t cleanup_func,
-          smx_actor_t process);
-  ~RawContext() override;
-
-  static void wrapper(void* arg);
-  void stop() override;
-  void suspend() override;
-  void resume();
-private:
-  void suspend_serial();
-  void suspend_parallel();
-  void resume_serial();
-  void resume_parallel();
-};
-
-class RawContextFactory : public ContextFactory {
-public:
-  RawContextFactory();
-  ~RawContextFactory() override;
-  RawContext* create_context(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
-  void run_all() override;
-private:
-  void run_all_adaptative();
-  void run_all_serial();
-  void run_all_parallel();
-};
-
-ContextFactory* raw_factory()
-{
-  XBT_VERB("Using raw contexts. Because the glibc is just not good enough for us.");
-  return new RawContextFactory();
-}
-
-}}} // namespace
-
-// ***** Loads of static stuff
-
-#if HAVE_THREAD_CONTEXTS
-static xbt_parmap_t raw_parmap;
-static simgrid::kernel::context::RawContext** raw_workers_context;    /* space to save the worker context in each thread */
-static uintptr_t raw_threads_working;     /* number of threads that have started their work */
-static xbt_os_thread_key_t raw_worker_id_key; /* thread-specific storage for the thread id */
-#endif
-static unsigned long raw_process_index = 0;   /* index of the next process to run in the
-                                               * list of runnable processes */
-static simgrid::kernel::context::RawContext* raw_maestro_context;
-
-static bool raw_context_parallel = false;
-
-// ***** Raw context routines
+// Raw context routines
 
 typedef void (*rawctx_entry_point_t)(void *);
 
@@ -257,62 +182,65 @@ namespace simgrid {
 namespace kernel {
 namespace context {
 
-RawContextFactory::RawContextFactory()
-  : ContextFactory("RawContextFactory")
+// RawContextFactory
+
+RawContextFactory::RawContextFactory() : ContextFactory("RawContextFactory"), parallel_(SIMIX_context_is_parallel())
 {
-  raw_context_parallel = SIMIX_context_is_parallel();
-  if (raw_context_parallel) {
+  RawContext::setMaestro(nullptr);
+  if (parallel_) {
 #if HAVE_THREAD_CONTEXTS
-    int nthreads = SIMIX_context_get_nthreads();
-    xbt_os_thread_key_create(&raw_worker_id_key);
-    // TODO, lazily init
-    raw_parmap = nullptr;
-    raw_workers_context = xbt_new(RawContext*, nthreads);
-    raw_maestro_context = nullptr;
+    // TODO: choose dynamically when SIMIX_context_get_parallel_threshold() > 1
+    ParallelRawContext::initialize();
+#else
+    xbt_die("You asked for a parallel execution, but you don't have any threads.");
 #endif
-    // TODO, if(SIMIX_context_get_parallel_threshold() > 1) => choose dynamically
   }
 }
 
 RawContextFactory::~RawContextFactory()
 {
 #if HAVE_THREAD_CONTEXTS
-  if (raw_parmap)
-    xbt_parmap_destroy(raw_parmap);
-  xbt_free(raw_workers_context);
+  if (parallel_)
+    ParallelRawContext::finalize();
 #endif
 }
 
-RawContext* RawContextFactory::create_context(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup, smx_actor_t process)
+Context* RawContextFactory::create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func,
+                                           smx_actor_t process)
 {
-  return this->new_context<RawContext>(std::move(code), cleanup, process);
+#if HAVE_THREAD_CONTEXTS
+  if (parallel_)
+    return this->new_context<ParallelRawContext>(std::move(code), cleanup_func, process);
+#endif
+
+  return this->new_context<SerialRawContext>(std::move(code), cleanup_func, process);
 }
 
-void RawContext::wrapper(void* arg)
+void RawContextFactory::run_all()
 {
-  RawContext* context = static_cast<RawContext*>(arg);
-  (*context)();
-  context->stop();
+#if HAVE_THREAD_CONTEXTS
+  if (parallel_)
+    ParallelRawContext::run_all();
+  else
+#endif
+    SerialRawContext::run_all();
 }
 
-RawContext::RawContext(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup, smx_actor_t process)
-  : Context(std::move(code), cleanup, process)
+// RawContext
+
+RawContext* RawContext::maestro_context_ = nullptr;
+
+RawContext::RawContext(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process)
+    : Context(std::move(code), cleanup, process)
 {
    if (has_code()) {
      this->stack_ = SIMIX_context_stack_new();
-     this->stack_top_ = raw_makecontext(this->stack_,
-                         smx_context_usable_stack_size,
-                         RawContext::wrapper,
-                         this);
+     this->stack_top_ = raw_makecontext(this->stack_, smx_context_usable_stack_size, RawContext::wrapper, this);
    } else {
-     if(process != nullptr && raw_maestro_context == nullptr)
-       raw_maestro_context = this;
+     if (process != nullptr && maestro_context_ == nullptr)
+       maestro_context_ = this;
      if (MC_is_active())
-       MC_ignore_heap(
-         &raw_maestro_context->stack_top_,
-         sizeof(raw_maestro_context->stack_top_));
+       MC_ignore_heap(&maestro_context_->stack_top_, sizeof(maestro_context_->stack_top_));
    }
 }
 
@@ -321,146 +249,143 @@ RawContext::~RawContext()
   SIMIX_context_stack_delete(this->stack_);
 }
 
-void RawContext::stop()
+void RawContext::wrapper(void* arg)
 {
-  Context::stop();
-  this->suspend();
+  RawContext* context = static_cast<RawContext*>(arg);
+  try {
+    (*context)();
+    context->Context::stop();
+  } catch (StopRequest const&) {
+    XBT_DEBUG("Caught a StopRequest");
+  }
+  context->suspend();
 }
 
-void RawContextFactory::run_all()
+inline void RawContext::swap(RawContext* from, RawContext* to)
 {
-  if (raw_context_parallel)
-    run_all_parallel();
-  else
-    run_all_serial();
+  raw_swapcontext(&from->stack_top_, to->stack_top_);
 }
 
-void RawContextFactory::run_all_serial()
+void RawContext::stop()
 {
-  if (xbt_dynar_is_empty(simix_global->process_to_run))
-    return;
-
-  smx_actor_t first_process =
-      xbt_dynar_get_as(simix_global->process_to_run, 0, smx_actor_t);
-  raw_process_index = 1;
-  static_cast<RawContext*>(first_process->context)->resume_serial();
+  Context::stop();
+  throw StopRequest();
 }
 
-void RawContextFactory::run_all_parallel()
-{
-#if HAVE_THREAD_CONTEXTS
-  raw_threads_working = 0;
-  if (raw_parmap == nullptr)
-    raw_parmap = xbt_parmap_new(
-      SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
-  xbt_parmap_apply(raw_parmap,
-      [](void* arg) {
-        smx_actor_t process = static_cast<smx_actor_t>(arg);
-        RawContext* context = static_cast<RawContext*>(process->context);
-        context->resume_parallel();
-      },
-      simix_global->process_to_run);
-#else
-  xbt_die("You asked for a parallel execution, but you don't have any threads.");
-#endif
-}
+// SerialRawContext
 
-void RawContext::suspend()
-{
-  if (raw_context_parallel)
-    RawContext::suspend_parallel();
-  else
-    RawContext::suspend_serial();
-}
+unsigned long SerialRawContext::process_index_; /* index of the next process to run in the list of runnable processes */
 
-void RawContext::suspend_serial()
+void SerialRawContext::suspend()
 {
   /* determine the next context */
-  RawContext* next_context = nullptr;
-  unsigned long int i      = raw_process_index;
-  raw_process_index++;
-  if (i < xbt_dynar_length(simix_global->process_to_run)) {
+  SerialRawContext* next_context;
+  unsigned long int i = process_index_;
+  process_index_++;
+  if (i < simix_global->process_to_run.size()) {
     /* execute the next process */
     XBT_DEBUG("Run next process");
-    next_context = static_cast<RawContext*>(xbt_dynar_get_as(simix_global->process_to_run, i, smx_actor_t)->context);
+    next_context = static_cast<SerialRawContext*>(simix_global->process_to_run[i]->context);
   } else {
     /* all processes were run, return to maestro */
     XBT_DEBUG("No more process to run");
-    next_context = static_cast<RawContext*>(raw_maestro_context);
+    next_context = static_cast<SerialRawContext*>(RawContext::getMaestro());
   }
   SIMIX_context_set_current(next_context);
-  raw_swapcontext(&this->stack_top_, next_context->stack_top_);
+  RawContext::swap(this, next_context);
 }
 
-void RawContext::suspend_parallel()
+void SerialRawContext::resume()
 {
+  SIMIX_context_set_current(this);
+  RawContext::swap(RawContext::getMaestro(), this);
+}
+
+void SerialRawContext::run_all()
+{
+  if (simix_global->process_to_run.empty())
+    return;
+  smx_actor_t first_process = simix_global->process_to_run.front();
+  process_index_            = 1;
+  static_cast<SerialRawContext*>(first_process->context)->resume();
+}
+
+// ParallelRawContext
+
 #if HAVE_THREAD_CONTEXTS
-  /* determine the next context */
-  smx_actor_t next_work    = static_cast<smx_actor_t>(xbt_parmap_next(raw_parmap));
-  RawContext* next_context = nullptr;
 
-  if (next_work != nullptr) {
+simgrid::xbt::Parmap<smx_actor_t>* ParallelRawContext::parmap_;
+std::atomic<uintptr_t> ParallelRawContext::threads_working_; /* number of threads that have started their work */
+xbt_os_thread_key_t ParallelRawContext::worker_id_key_; /* thread-specific storage for the thread id */
+std::vector<ParallelRawContext*> ParallelRawContext::workers_context_; /* space to save the worker context
+                                                                          in each thread */
+
+void ParallelRawContext::initialize()
+{
+  parmap_ = nullptr;
+  workers_context_.clear();
+  workers_context_.resize(SIMIX_context_get_nthreads(), nullptr);
+  xbt_os_thread_key_create(&worker_id_key_);
+}
+
+void ParallelRawContext::finalize()
+{
+  delete parmap_;
+  parmap_ = nullptr;
+  workers_context_.clear();
+  xbt_os_thread_key_destroy(worker_id_key_);
+}
+
+void ParallelRawContext::run_all()
+{
+  threads_working_ = 0;
+  if (parmap_ == nullptr)
+    parmap_ = new simgrid::xbt::Parmap<smx_actor_t>(SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
+  parmap_->apply(
+      [](smx_actor_t process) {
+        ParallelRawContext* context = static_cast<ParallelRawContext*>(process->context);
+        context->resume();
+      },
+      simix_global->process_to_run);
+}
+
+void ParallelRawContext::suspend()
+{
+  /* determine the next context */
+  boost::optional<smx_actor_t> next_work = parmap_->next();
+  ParallelRawContext* next_context;
+  if (next_work) {
     /* there is a next process to resume */
     XBT_DEBUG("Run next process");
-    next_context = static_cast<RawContext*>(next_work->context);
+    next_context = static_cast<ParallelRawContext*>(next_work.get()->context);
   } else {
     /* all processes were run, go to the barrier */
     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]);
-    XBT_DEBUG("Restoring worker stack %zu (working threads = %zu)",
-        worker_id, raw_threads_working);
+    uintptr_t worker_id = reinterpret_cast<uintptr_t>(xbt_os_thread_get_specific(worker_id_key_));
+    next_context        = workers_context_[worker_id];
+    XBT_DEBUG("Restoring worker stack %zu (working threads = %zu)", worker_id, threads_working_.load());
   }
 
   SIMIX_context_set_current(next_context);
-  raw_swapcontext(&this->stack_top_, next_context->stack_top_);
-#endif
+  RawContext::swap(this, next_context);
 }
 
-void RawContext::resume()
-{
-  if (raw_context_parallel)
-    resume_parallel();
-  else
-    resume_serial();
-}
-
-void RawContext::resume_serial()
+void ParallelRawContext::resume()
 {
+  uintptr_t worker_id = threads_working_.fetch_add(1, std::memory_order_relaxed);
+  xbt_os_thread_set_specific(worker_id_key_, reinterpret_cast<void*>(worker_id));
+  ParallelRawContext* worker_context = static_cast<ParallelRawContext*>(SIMIX_context_self());
+  workers_context_[worker_id]        = worker_context;
+  XBT_DEBUG("Saving worker stack %zu", worker_id);
   SIMIX_context_set_current(this);
-  raw_swapcontext(&raw_maestro_context->stack_top_, this->stack_top_);
+  RawContext::swap(worker_context, this);
 }
 
-void RawContext::resume_parallel()
-{
-#if HAVE_THREAD_CONTEXTS
-  uintptr_t worker_id = __sync_fetch_and_add(&raw_threads_working, 1);
-  xbt_os_thread_set_specific(raw_worker_id_key, (void*) worker_id);
-  RawContext* worker_context     = static_cast<RawContext*>(SIMIX_context_self());
-  raw_workers_context[worker_id] = worker_context;
-  XBT_DEBUG("Saving worker stack %zu", worker_id);
-  SIMIX_context_set_current(this);
-  raw_swapcontext(&worker_context->stack_top_, this->stack_top_);
-#else
-  xbt_die("Parallel execution disabled");
 #endif
-}
 
-/** @brief Resumes all processes ready to run. */
-void RawContextFactory::run_all_adaptative()
+ContextFactory* raw_factory()
 {
-  unsigned long nb_processes = xbt_dynar_length(simix_global->process_to_run);
-  if (SIMIX_context_is_parallel() &&
-      static_cast<unsigned long>(SIMIX_context_get_parallel_threshold()) < nb_processes) {
-    raw_context_parallel = true;
-    XBT_DEBUG("Runall // %lu", nb_processes);
-    this->run_all_parallel();
-  } else {
-    XBT_DEBUG("Runall serial %lu", nb_processes);
-    raw_context_parallel = false;
-    this->run_all_serial();
-  }
+  XBT_VERB("Using raw contexts. Because the glibc is just not good enough for us.");
+  return new RawContextFactory();
 }
-
 }}}
diff --git a/src/kernel/context/ContextRaw.hpp b/src/kernel/context/ContextRaw.hpp
new file mode 100644 (file)
index 0000000..68c7797
--- /dev/null
@@ -0,0 +1,100 @@
+/* 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. */
+
+#ifndef SIMGRID_SIMIX_RAW_CONTEXT_HPP
+#define SIMGRID_SIMIX_RAW_CONTEXT_HPP
+
+#include <atomic>
+#include <cstdint>
+#include <functional>
+#include <vector>
+
+#include <simgrid/simix.hpp>
+#include <xbt/parmap.hpp>
+#include <xbt/xbt_os_thread.h>
+
+#include "Context.hpp"
+#include "src/internal_config.h"
+#include "src/simix/smx_private.hpp"
+
+namespace simgrid {
+namespace kernel {
+namespace context {
+
+/** @brief Fast context switching inspired from SystemV ucontexts.
+  *
+  * The main difference to the System V context is that Raw Contexts are much faster because they don't
+  * preserve the signal mask when switching. This saves a system call (at least on Linux) on each context switch.
+  */
+class RawContext : public Context {
+public:
+  RawContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
+  ~RawContext() override;
+  void stop() override;
+  virtual void resume() = 0;
+
+  static void swap(RawContext* from, RawContext* to);
+  static RawContext* getMaestro() { return maestro_context_; }
+  static void setMaestro(RawContext* maestro) { maestro_context_ = maestro; }
+
+private:
+  static RawContext* maestro_context_;
+  void* stack_ = nullptr;
+  /** pointer to top the stack stack */
+  void* stack_top_ = nullptr;
+
+  static void wrapper(void* arg);
+};
+
+class SerialRawContext : public RawContext {
+public:
+  SerialRawContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+      : RawContext(std::move(code), cleanup_func, process)
+  {
+  }
+  void suspend() override;
+  void resume() override;
+
+  static void run_all();
+
+private:
+  static unsigned long process_index_;
+};
+
+#if HAVE_THREAD_CONTEXTS
+class ParallelRawContext : public RawContext {
+public:
+  ParallelRawContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+      : RawContext(std::move(code), cleanup_func, process)
+  {
+  }
+  void suspend() override;
+  void resume() override;
+
+  static void initialize();
+  static void finalize();
+  static void run_all();
+
+private:
+  static simgrid::xbt::Parmap<smx_actor_t>* parmap_;
+  static std::vector<ParallelRawContext*> workers_context_;
+  static std::atomic<uintptr_t> threads_working_;
+  static xbt_os_thread_key_t worker_id_key_;
+};
+#endif
+
+class RawContextFactory : public ContextFactory {
+public:
+  RawContextFactory();
+  ~RawContextFactory() override;
+  Context* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
+  void run_all() override;
+
+private:
+  bool parallel_;
+};
+}}} // namespace
+
+#endif
index 85ac35a..8679b20 100644 (file)
@@ -6,96 +6,61 @@
 #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"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
-static xbt_os_sem_t smx_ctx_thread_sem = nullptr;
-
 namespace simgrid {
 namespace kernel {
 namespace context {
 
-XBT_PRIVATE ContextFactory* thread_factory()
-{
-  XBT_VERB("Activating thread context factory");
-  return new ThreadContextFactory();
-}
+// ThreadContextFactory
 
 ThreadContextFactory::ThreadContextFactory()
-  : ContextFactory("ThreadContextFactory")
+    : ContextFactory("ThreadContextFactory"), parallel_(SIMIX_context_is_parallel())
 {
-  if (SIMIX_context_is_parallel()) {
-    smx_ctx_thread_sem = xbt_os_sem_init(SIMIX_context_get_nthreads());
-  } else {
-    smx_ctx_thread_sem = nullptr;
-  }
+  if (parallel_)
+    ParallelThreadContext::initialize();
 }
 
 ThreadContextFactory::~ThreadContextFactory()
 {
-  if (smx_ctx_thread_sem) {
-    xbt_os_sem_destroy(smx_ctx_thread_sem);
-    smx_ctx_thread_sem = nullptr;
-  }
+  if (parallel_)
+    ParallelThreadContext::finalize();
 }
 
-ThreadContext* ThreadContextFactory::create_context(
-    std::function<void()> code,
-    void_pfn_smxprocess_t cleanup, smx_actor_t process)
+ThreadContext* ThreadContextFactory::create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup,
+                                                    smx_actor_t process, bool maestro)
 {
-  return this->new_context<ThreadContext>(std::move(code), cleanup, process, not code);
+  if (parallel_)
+    return this->new_context<ParallelThreadContext>(std::move(code), cleanup, process, maestro);
+  else
+    return this->new_context<SerialThreadContext>(std::move(code), cleanup, process, maestro);
 }
 
 void ThreadContextFactory::run_all()
 {
-  if (smx_ctx_thread_sem == nullptr) {
-    // Serial execution
-    smx_actor_t process;
-    unsigned int cursor;
-    xbt_dynar_foreach(simix_global->process_to_run, cursor, process) {
-      XBT_DEBUG("Handling %p",process);
-      ThreadContext* context = static_cast<ThreadContext*>(process->context);
-      xbt_os_sem_release(context->begin_);
-      xbt_os_sem_acquire(context->end_);
-    }
-  } else {
+  if (parallel_) {
     // Parallel execution
-    unsigned int index;
-    smx_actor_t process;
-    xbt_dynar_foreach(simix_global->process_to_run, index, process)
-      xbt_os_sem_release(static_cast<ThreadContext*>(process->context)->begin_);
-    xbt_dynar_foreach(simix_global->process_to_run, index, process)
-       xbt_os_sem_acquire(static_cast<ThreadContext*>(process->context)->end_);
+    ParallelThreadContext::run_all();
+  } else {
+    // Serial execution
+    SerialThreadContext::run_all();
   }
 }
 
-ThreadContext* ThreadContextFactory::self()
-{
-  return static_cast<ThreadContext*>(xbt_os_thread_get_extra_data());
-}
-
-ThreadContext* ThreadContextFactory::attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
-{
-  return this->new_context<ThreadContext>(
-    std::function<void()>(), cleanup_func, process, false);
-}
-
-ThreadContext* ThreadContextFactory::create_maestro(std::function<void()> code, smx_actor_t process)
-{
-    return this->new_context<ThreadContext>(std::move(code), nullptr, process, true);
-}
+// ThreadContext
 
-ThreadContext::ThreadContext(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup, smx_actor_t process, bool maestro)
-  : AttachContext(std::move(code), cleanup, process)
+ThreadContext::ThreadContext(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process,
+                             bool maestro)
+    : AttachContext(std::move(code), cleanup, process), is_maestro_(maestro)
 {
   // We do not need the semaphores when maestro is in main,
   // but creating them anyway simplifies things when maestro is externalized
@@ -112,10 +77,7 @@ ThreadContext::ThreadContext(std::function<void()> code,
     /* create and start the process */
     /* NOTE: The first argument to xbt_os_thread_create used to be the process *
     * name, but now the name is stored at SIMIX level, so we pass a null  */
-    this->thread_ =
-      xbt_os_thread_create(nullptr,
-        maestro ? &ThreadContext::maestro_wrapper : &ThreadContext::wrapper,
-        this, this);
+    this->thread_ = xbt_os_thread_create(nullptr, ThreadContext::wrapper, this, this);
     /* wait the starting of the newly created process */
     xbt_os_sem_acquire(this->end_);
   }
@@ -148,71 +110,61 @@ void *ThreadContext::wrapper(void *param)
   stack.ss_flags = 0;
   sigaltstack(&stack, nullptr);
 #endif
-  /* Tell the maestro we are starting, and wait for its green light */
+  // Tell the caller (normally the maestro) we are starting, and wait for its green light
   xbt_os_sem_release(context->end_);
+  context->start();
+
+  try {
+    (*context)();
+    if (not context->isMaestro()) // really?
+      context->Context::stop();
+  } catch (StopRequest const&) {
+    XBT_DEBUG("Caught a StopRequest");
+    xbt_assert(not context->isMaestro(), "I'm not supposed to be maestro here.");
+  }
 
-  xbt_os_sem_acquire(context->begin_);
-  if (smx_ctx_thread_sem)       /* parallel run */
-    xbt_os_sem_acquire(smx_ctx_thread_sem);
-
-  (*context)();
-  context->stop();
-
-  return nullptr;
-}
-
-void *ThreadContext::maestro_wrapper(void *param)
-{
-  ThreadContext* context = static_cast<ThreadContext*>(param);
+  // Signal to the caller (normally the maestro) that we have finished:
+  context->yield();
 
 #ifndef WIN32
-  /* Install alternate signal stack, for SIGSEGV handler. */
-  stack_t stack;
-  stack.ss_sp = sigsegv_stack;
-  stack.ss_size = sizeof sigsegv_stack;
-  stack.ss_flags = 0;
+  stack.ss_flags = SS_DISABLE;
   sigaltstack(&stack, nullptr);
 #endif
-  /* Tell the caller we are starting */
-  xbt_os_sem_release(context->end_);
-
-  // Wait for the caller to give control back to us:
-  xbt_os_sem_acquire(context->begin_);
-  (*context)();
+  return nullptr;
+}
 
-  // Tell main that we have finished:
-  xbt_os_sem_release(context->end_);
+void ThreadContext::release()
+{
+  xbt_os_sem_release(this->begin_);
+}
 
-  return nullptr;
+void ThreadContext::wait()
+{
+  xbt_os_sem_acquire(this->end_);
 }
 
 void ThreadContext::start()
 {
   xbt_os_sem_acquire(this->begin_);
-  if (smx_ctx_thread_sem)       /* parallel run */
-    xbt_os_sem_acquire(smx_ctx_thread_sem);
+  this->start_hook();
 }
 
-void ThreadContext::stop()
+void ThreadContext::yield()
 {
-  Context::stop();
-  if (smx_ctx_thread_sem)
-    xbt_os_sem_release(smx_ctx_thread_sem);
-
-  // Signal to the maestro that it has finished:
+  this->yield_hook();
   xbt_os_sem_release(this->end_);
+}
 
-  xbt_os_thread_exit(nullptr);
+void ThreadContext::stop()
+{
+  Context::stop();
+  throw StopRequest();
 }
 
 void ThreadContext::suspend()
 {
-  if (smx_ctx_thread_sem)
-    xbt_os_sem_release(smx_ctx_thread_sem);
-  xbt_os_sem_release(this->end_);
-  xbt_os_sem_acquire(this->begin_);
-  if (smx_ctx_thread_sem)
-    xbt_os_sem_acquire(smx_ctx_thread_sem);
+  this->yield();
+  this->start();
 }
 
 void ThreadContext::attach_start()
@@ -220,14 +172,14 @@ void ThreadContext::attach_start()
   // We're breaking the layers here by depending on the upper layer:
   ThreadContext* maestro = (ThreadContext*) simix_global->maestro_process->context;
   xbt_os_sem_release(maestro->begin_);
+  xbt_assert(not this->isMaestro());
   this->start();
 }
 
 void ThreadContext::attach_stop()
 {
-  if (smx_ctx_thread_sem)
-    xbt_os_sem_release(smx_ctx_thread_sem);
-  xbt_os_sem_release(this->end_);
+  xbt_assert(not this->isMaestro());
+  this->yield();
 
   ThreadContext* maestro = (ThreadContext*) simix_global->maestro_process->context;
   xbt_os_sem_acquire(maestro->end_);
@@ -235,4 +187,56 @@ void ThreadContext::attach_stop()
   xbt_os_thread_set_extra_data(nullptr);
 }
 
+// SerialThreadContext
+
+void SerialThreadContext::run_all()
+{
+  for (smx_actor_t const& process : simix_global->process_to_run) {
+    XBT_DEBUG("Handling %p", process);
+    ThreadContext* context = static_cast<ThreadContext*>(process->context);
+    context->release();
+    context->wait();
+  }
+}
+
+// ParallelThreadContext
+
+xbt_os_sem_t ParallelThreadContext::thread_sem_ = nullptr;
+
+void ParallelThreadContext::initialize()
+{
+  thread_sem_ = xbt_os_sem_init(SIMIX_context_get_nthreads());
+}
+
+void ParallelThreadContext::finalize()
+{
+  xbt_os_sem_destroy(thread_sem_);
+  thread_sem_ = nullptr;
+}
+
+void ParallelThreadContext::run_all()
+{
+  for (smx_actor_t const& process : simix_global->process_to_run)
+    static_cast<ThreadContext*>(process->context)->release();
+  for (smx_actor_t const& process : simix_global->process_to_run)
+    static_cast<ThreadContext*>(process->context)->wait();
+}
+
+void ParallelThreadContext::start_hook()
+{
+  if (not isMaestro()) /* parallel run */
+    xbt_os_sem_acquire(thread_sem_);
+}
+
+void ParallelThreadContext::yield_hook()
+{
+  if (not isMaestro()) /* parallel run */
+    xbt_os_sem_release(thread_sem_);
+}
+
+XBT_PRIVATE ContextFactory* thread_factory()
+{
+  XBT_VERB("Activating thread context factory");
+  return new ThreadContextFactory();
+}
 }}} // namespace
index 096a01c..36104b3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -16,20 +16,19 @@ namespace simgrid {
 namespace kernel {
 namespace context {
 
-class ThreadContext;
-class ThreadContextFactory;
-
 class ThreadContext : public AttachContext {
 public:
-  friend ThreadContextFactory;
-  ThreadContext(std::function<void()> code,
-          void_pfn_smxprocess_t cleanup_func,
-          smx_actor_t process, bool maestro =false);
+  ThreadContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, bool maestro);
   ~ThreadContext() override;
   void stop() override;
   void suspend() override;
   void attach_start() override;
   void attach_stop() override;
+
+  bool isMaestro() const { return is_maestro_; }
+  void release(); // unblock context's start()
+  void wait();    // wait for context's yield()
+
 private:
   /** A portable thread */
   xbt_os_thread_t thread_ = nullptr;
@@ -37,27 +36,74 @@ private:
   xbt_os_sem_t begin_ = nullptr;
   /** Semaphore used to schedule/unschedule */
   xbt_os_sem_t end_ = nullptr;
+  bool is_maestro_;
+
+  void start();                // match a call to release()
+  void yield();                // match a call to yield()
+  virtual void start_hook() { /* empty placeholder, called after start() */}
+  virtual void yield_hook() { /* empty placeholder, called before yield() */}
 
   static void* wrapper(void *param);
-  static void* maestro_wrapper(void *param);
+};
+
+class SerialThreadContext : public ThreadContext {
+public:
+  SerialThreadContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, bool maestro)
+      : ThreadContext(std::move(code), cleanup_func, process, maestro)
+  {
+  }
+
+  static void run_all();
+};
+
+class ParallelThreadContext : public ThreadContext {
 public:
-  void start();
+  ParallelThreadContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process,
+                        bool maestro)
+      : ThreadContext(std::move(code), cleanup_func, process, maestro)
+  {
+  }
+
+  static void initialize();
+  static void finalize();
+  static void run_all();
+
+private:
+  static xbt_os_sem_t thread_sem_;
+
+  void start_hook() override;
+  void yield_hook() override;
 };
 
 class ThreadContextFactory : public ContextFactory {
 public:
   ThreadContextFactory();
   ~ThreadContextFactory() override;
-  ThreadContext* create_context(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup_func,  smx_actor_t process) override;
+  ThreadContext* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func,
+                                smx_actor_t process) override
+  {
+    bool maestro = not code;
+    return create_context(std::move(code), cleanup_func, process, maestro);
+  }
   void run_all() override;
-  ThreadContext* self() override;
+  ThreadContext* self() override { return static_cast<ThreadContext*>(xbt_os_thread_get_extra_data()); }
 
   // Optional methods:
-  ThreadContext* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process) override;
-  ThreadContext* create_maestro(std::function<void()> code, smx_actor_t process) override;
-};
+  ThreadContext* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process) override
+  {
+    return create_context(std::function<void()>(), cleanup_func, process, false);
+  }
+  ThreadContext* create_maestro(std::function<void()> code, smx_actor_t process) override
+  {
+    return create_context(std::move(code), nullptr, process, true);
+  }
+
+private:
+  bool parallel_;
 
+  ThreadContext* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process,
+                                bool maestro);
+};
 }}} // namespace
 
 #endif
index ac2a4b5..4e739c1 100644 (file)
 
 /* \file UContext.cpp Context switching with ucontexts from System V        */
 
-#include <ucontext.h>           /* context relative declarations */
+#include "ContextUnix.hpp"
 
-#include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
-#include "xbt/parmap.h"
 #include "mc/mc.h"
 #include "src/mc/mc_ignore.h"
+#include "src/simix/ActorImpl.hpp"
 
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
 /** Many integers are needed to store a pointer
  *
- * This is a bit paranoid about sizeof(smx_ctx_sysv_t) not being a multiple
- * of sizeof(int), but it doesn't harm. */
-#define CTX_ADDR_LEN                            \
-  (sizeof(void*) / sizeof(int) +       \
-   !!(sizeof(void*) % sizeof(int)))
-
-/** A better makecontext
- *
- * Makecontext expects integer arguments, we the context
- * variable is decomposed into a serie of integers and
- * each integer is passed as argument to makecontext. */
-static void simgrid_makecontext(ucontext_t* ucp, void (*func)(int first, ...), void* arg)
-{
-  int ctx_addr[CTX_ADDR_LEN];
-  memcpy(ctx_addr, &arg, sizeof(void*));
-  switch (CTX_ADDR_LEN) {
-  case 1:
-    makecontext(ucp, (void (*)())func, 1, ctx_addr[0]);
-    break;
-  case 2:
-    makecontext(ucp, (void (*)()) func, 2, ctx_addr[0], ctx_addr[1]);
-    break;
-  default:
-    xbt_die("Ucontexts are not supported on this arch yet (addr len = %zu/%zu = %zu)", sizeof(void*), sizeof(int), CTX_ADDR_LEN);
-  }
-}
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
-
-namespace simgrid {
-namespace kernel {
-namespace context {
-  class UContext;
-  class SerialUContext;
-  class ParallelUContext;
-  class UContextFactory;
-}}}
+ * Support up to two ints. */
+constexpr int CTX_ADDR_LEN = 2;
 
-#if HAVE_THREAD_CONTEXTS
-static xbt_parmap_t sysv_parmap;
-static simgrid::kernel::context::ParallelUContext** sysv_workers_context;   /* space to save the worker's context in each thread */
-static uintptr_t sysv_threads_working;     /* number of threads that have started their work */
-static xbt_os_thread_key_t sysv_worker_id_key; /* thread-specific storage for the thread id */
-#endif
-static unsigned long sysv_process_index = 0;   /* index of the next process to run in the
-                                                * list of runnable processes */
-static simgrid::kernel::context::UContext* sysv_maestro_context;
-static bool sysv_parallel;
+static_assert(sizeof(simgrid::kernel::context::UContext*) <= CTX_ADDR_LEN * sizeof(int),
+              "Ucontexts are not supported on this arch yet");
 
 // The name of this function is currently hardcoded in the code (as string).
 // Do not change it without fixing those references as well.
-static void smx_ctx_sysv_wrapper(int first, ...);
+static void smx_ctx_sysv_wrapper(int i1, int i2)
+{
+  // Rebuild the Context* pointer from the integers:
+  int ctx_addr[CTX_ADDR_LEN] = {i1, i2};
+  simgrid::kernel::context::UContext* context;
+  memcpy(&context, ctx_addr, sizeof context);
+
+  try {
+    (*context)();
+    context->Context::stop();
+  } catch (simgrid::kernel::context::Context::StopRequest const&) {
+    XBT_DEBUG("Caught a StopRequest");
+  }
+  context->suspend();
+}
 
 namespace simgrid {
 namespace kernel {
 namespace context {
 
-class UContext : public Context {
-protected:
-  ucontext_t uc_;         /* the ucontext that executes the code */
-  char *stack_ = nullptr; /* the thread stack */
-public:
-  friend UContextFactory;
-  UContext(std::function<void()>  code,
-    void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
-  ~UContext() override;
-};
-
-class SerialUContext : public UContext {
-public:
-  SerialUContext(std::function<void()>  code,
-      void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
-    : UContext(std::move(code), cleanup_func, process)
-  {}
-  void stop() override;
-  void suspend() override;
-  void resume();
-};
-
-class ParallelUContext : public UContext {
-public:
-  ParallelUContext(std::function<void()>  code,
-      void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
-    : UContext(std::move(code), cleanup_func, process)
-  {}
-  void stop() override;
-  void suspend() override;
-  void resume();
-};
-
-class UContextFactory : public ContextFactory {
-public:
-  friend UContext;
-  friend SerialUContext;
-  friend ParallelUContext;
-
-  UContextFactory();
-  ~UContextFactory() override;
-  Context* create_context(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
-  void run_all() override;
-};
+// UContextFactory
 
-XBT_PRIVATE ContextFactory* sysv_factory()
+UContextFactory::UContextFactory() : ContextFactory("UContextFactory"), parallel_(SIMIX_context_is_parallel())
 {
-  XBT_VERB("Activating SYSV context factory");
-  return new UContextFactory();
-}
-
-UContextFactory::UContextFactory() : ContextFactory("UContextFactory")
-{
-  if (SIMIX_context_is_parallel()) {
-    sysv_parallel = true;
-#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_maestro_context = nullptr;
-    xbt_os_thread_key_create(&sysv_worker_id_key);
+  UContext::setMaestro(nullptr);
+  if (parallel_) {
+#if HAVE_THREAD_CONTEXTS
+    ParallelUContext::initialize();
 #else
-    THROWF(arg_error, 0, "No thread support for parallel context execution");
+    xbt_die("No thread support for parallel context execution");
 #endif
-  } else {
-    sysv_parallel = false;
   }
 }
 
 UContextFactory::~UContextFactory()
 {
 #if HAVE_THREAD_CONTEXTS
-  if (sysv_parmap)
-    xbt_parmap_destroy(sysv_parmap);
-  xbt_free(sysv_workers_context);
+  if (parallel_)
+    ParallelUContext::finalize();
 #endif
 }
 
-/* This function is called by maestro at the beginning of a scheduling round to get all working threads executing some stuff
- * It is much easier to understand what happens if you see the working threads as bodies that swap their soul for the
- *    ones of the simulated processes that must run.
- */
-void UContextFactory::run_all()
+Context* UContextFactory::create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process)
 {
-  if (sysv_parallel) {
 #if HAVE_THREAD_CONTEXTS
-      sysv_threads_working = 0;
-      // Parmap_apply ensures that every working thread get an index in the
-      // process_to_run array (through an atomic fetch_and_add),
-      //  and runs the smx_ctx_sysv_resume_parallel function on that index
-
-      // We lazily create the parmap because the parmap creates context
-      // with simix_global->context_factory (which might not be initialized
-      // when bootstrapping):
-      if (sysv_parmap == nullptr)
-        sysv_parmap = xbt_parmap_new(
-          SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
-
-      xbt_parmap_apply(sysv_parmap,
-        [](void* arg) {
-          smx_actor_t process = (smx_actor_t) arg;
-          ParallelUContext* context = static_cast<ParallelUContext*>(process->context);
-          context->resume();
-        },
-        simix_global->process_to_run);
-#else
-      xbt_die("You asked for a parallel execution, but you don't have any threads.");
+  if (parallel_)
+    return new_context<ParallelUContext>(std::move(code), cleanup, process);
+  else
 #endif
-  } else {
-    // Serial:
-    if (xbt_dynar_is_empty(simix_global->process_to_run))
-      return;
-
-    smx_actor_t first_process = xbt_dynar_get_as(simix_global->process_to_run, 0, smx_actor_t);
-    sysv_process_index = 1;
-    SerialUContext* context = static_cast<SerialUContext*>(first_process->context);
-    context->resume();
-  }
+    return new_context<SerialUContext>(std::move(code), cleanup, process);
 }
 
-Context* UContextFactory::create_context(std::function<void()> code,
-  void_pfn_smxprocess_t cleanup, smx_actor_t process)
+/* This function is called by maestro at the beginning of a scheduling round to get all working threads executing some
+ * stuff It is much easier to understand what happens if you see the working threads as bodies that swap their soul for
+ * the ones of the simulated processes that must run.
+ */
+void UContextFactory::run_all()
 {
-  if (sysv_parallel)
-    return new_context<ParallelUContext>(std::move(code), cleanup, process);
+#if HAVE_THREAD_CONTEXTS
+  if (parallel_)
+    ParallelUContext::run_all();
   else
-    return new_context<SerialUContext>(std::move(code), cleanup, process);
+#endif
+    SerialUContext::run_all();
 }
 
-UContext::UContext(std::function<void()> code,
-    void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
-  : Context(std::move(code), cleanup_func, process)
+// UContext
+
+UContext* UContext::maestro_context_ = nullptr;
+
+UContext::UContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+    : Context(std::move(code), cleanup_func, process)
 {
   /* if the user provided a function for the process then use it, otherwise it is the context for maestro */
   if (has_code()) {
-    this->stack_ = (char*) SIMIX_context_stack_new();
+    this->stack_ = SIMIX_context_stack_new();
     getcontext(&this->uc_);
     this->uc_.uc_link = nullptr;
     this->uc_.uc_stack.ss_sp   = sg_makecontext_stack_addr(this->stack_);
     this->uc_.uc_stack.ss_size = sg_makecontext_stack_size(smx_context_usable_stack_size);
-    simgrid_makecontext(&this->uc_, smx_ctx_sysv_wrapper, this);
+    UContext::make_ctx(&this->uc_, UContext::wrapper, this);
   } else {
-    if (process != nullptr && sysv_maestro_context == nullptr)
-      sysv_maestro_context = this;
+    if (process != nullptr && maestro_context_ == nullptr)
+      maestro_context_ = this;
   }
 
 #if SIMGRID_HAVE_MC
   if (MC_is_active() && has_code()) {
-    MC_register_stack_area(this->stack_, process,
-                      &(this->uc_), smx_context_usable_stack_size);
+    MC_register_stack_area(this->stack_, process, &(this->uc_), smx_context_usable_stack_size);
   }
 #endif
 }
@@ -233,146 +121,173 @@ UContext::~UContext()
   SIMIX_context_stack_delete(this->stack_);
 }
 
-}}} // namespace simgrid::kernel::context
-
-static void smx_ctx_sysv_wrapper(int first, ...)
+void UContext::wrapper(int i1, int i2)
 {
-  // Rebuild the Context* pointer from the integers:
-  int ctx_addr[CTX_ADDR_LEN];
-  simgrid::kernel::context::UContext* context;
-  ctx_addr[0] = first;
-  if (CTX_ADDR_LEN > 1) {
-    va_list ap;
-    va_start(ap, first);
-    for (unsigned i = 1; i < CTX_ADDR_LEN; i++)
-      ctx_addr[i] = va_arg(ap, int);
-    va_end(ap);
-  }
-  memcpy(&context, ctx_addr, sizeof(simgrid::kernel::context::UContext*));
-
-  (*context)();
-  context->stop();
+  smx_ctx_sysv_wrapper(i1, i2);
 }
 
-namespace simgrid {
-namespace kernel {
-namespace context {
+/** A better makecontext
+ *
+ * Makecontext expects integer arguments, we the context variable is decomposed into a serie of integers and each
+ * integer is passed as argument to makecontext.
+ */
+void UContext::make_ctx(ucontext_t* ucp, void (*func)(int, int), UContext* arg)
+{
+  int ctx_addr[CTX_ADDR_LEN]{};
+  memcpy(ctx_addr, &arg, sizeof arg);
+  makecontext(ucp, (void (*)())func, 2, ctx_addr[0], ctx_addr[1]);
+}
 
-void SerialUContext::stop()
+void UContext::stop()
 {
   Context::stop();
-  this->suspend();
+  throw StopRequest();
 }
 
+// SerialUContext
+
+unsigned long SerialUContext::process_index_; /* index of the next process to run in the list of runnable processes */
+
 void SerialUContext::suspend()
 {
   /* determine the next context */
-  SerialUContext* next_context = nullptr;
-  unsigned long int i = sysv_process_index++;
+  SerialUContext* next_context;
+  unsigned long int i = process_index_;
+  process_index_++;
 
-  if (i < xbt_dynar_length(simix_global->process_to_run)) {
+  if (i < simix_global->process_to_run.size()) {
     /* execute the next process */
     XBT_DEBUG("Run next process");
-    next_context = (SerialUContext*) xbt_dynar_get_as(
-        simix_global->process_to_run,i, smx_actor_t)->context;
+    next_context = static_cast<SerialUContext*>(simix_global->process_to_run[i]->context);
   } else {
     /* all processes were run, return to maestro */
     XBT_DEBUG("No more process to run");
-    next_context = (SerialUContext*) sysv_maestro_context;
+    next_context = static_cast<SerialUContext*>(UContext::getMaestro());
   }
   SIMIX_context_set_current(next_context);
-  swapcontext(&this->uc_, &next_context->uc_);
+  UContext::swap(this, next_context);
 }
 
-// UContextSerial
-
 void SerialUContext::resume()
 {
   SIMIX_context_set_current(this);
-  swapcontext(&((SerialUContext*)sysv_maestro_context)->uc_, &this->uc_);
+  UContext::swap(UContext::getMaestro(), this);
 }
 
-void ParallelUContext::stop()
+void SerialUContext::run_all()
 {
-  UContext::stop();
-  this->suspend();
+  if (simix_global->process_to_run.empty())
+    return;
+  smx_actor_t first_process = simix_global->process_to_run.front();
+  process_index_            = 1;
+  static_cast<SerialUContext*>(first_process->context)->resume();
 }
 
-/** Run one particular simulated process on the current thread. */
-void ParallelUContext::resume()
-{
+// ParallelUContext
+
 #if HAVE_THREAD_CONTEXTS
-  // What is my containing body?
-  uintptr_t worker_id = __sync_fetch_and_add(&sysv_threads_working, 1);
-  // Store the number of my containing body in os-thread-specific area :
-  xbt_os_thread_set_specific(sysv_worker_id_key, (void*) worker_id);
-  // Get my current soul:
-  ParallelUContext* worker_context = (ParallelUContext*) SIMIX_context_self();
-  // Write down that this soul is hosted in that body (for now)
-  sysv_workers_context[worker_id] = worker_context;
-  // Retrieve the system-level info that fuels this soul:
-  ucontext_t* worker_stack = &((ParallelUContext*) worker_context)->uc_;
-  // Write in simix that I switched my soul
-  SIMIX_context_set_current(this);
-   // Actually do that using the relevant library call:
-  swapcontext(worker_stack, &this->uc_);
-  // No body runs that soul anymore at this point.
-  // Instead the current body took the soul of simulated process
-  // The simulated process wakes back after the call to
-  // "SIMIX_context_suspend(self->context);" within
-  // smx_process.c::SIMIX_process_yield()
 
-  // From now on, the simulated processes will change their
-  // soul with the next soul to execute (in suspend_parallel, below).
-  // When nobody is to be executed in this scheduling round,
-  // the last simulated process will take back the initial
-  // soul of the current working thread
-#endif
+simgrid::xbt::Parmap<smx_actor_t>* ParallelUContext::parmap_;
+std::atomic<uintptr_t> ParallelUContext::threads_working_;         /* number of threads that have started their work */
+xbt_os_thread_key_t ParallelUContext::worker_id_key_;              /* thread-specific storage for the thread id */
+std::vector<ParallelUContext*> ParallelUContext::workers_context_; /* space to save the worker's context
+                                                                    * in each thread */
+
+void ParallelUContext::initialize()
+{
+  parmap_ = nullptr;
+  workers_context_.clear();
+  workers_context_.resize(SIMIX_context_get_nthreads(), nullptr);
+  xbt_os_thread_key_create(&worker_id_key_);
+}
+
+void ParallelUContext::finalize()
+{
+  delete parmap_;
+  parmap_ = nullptr;
+  workers_context_.clear();
+  xbt_os_thread_key_destroy(worker_id_key_);
+}
+
+void ParallelUContext::run_all()
+{
+  threads_working_ = 0;
+  // Parmap_apply ensures that every working thread get an index in the process_to_run array (through an atomic
+  // fetch_and_add), and runs the ParallelUContext::resume function on that index
+
+  // We lazily create the parmap because the parmap creates context with simix_global->context_factory (which might not
+  // be initialized when bootstrapping):
+  if (parmap_ == nullptr)
+    parmap_ = new simgrid::xbt::Parmap<smx_actor_t>(SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
+  parmap_->apply(
+      [](smx_actor_t process) {
+        ParallelUContext* context = static_cast<ParallelUContext*>(process->context);
+        context->resume();
+      },
+      simix_global->process_to_run);
 }
 
 /** Yield
  *
- * This function is called when a simulated process wants to yield back
- * to the maestro in a blocking simcall. This naturally occurs within
- * SIMIX_context_suspend(self->context), called from SIMIX_process_yield()
- * Actually, it does not really yield back to maestro, but into the next
- * process that must be executed. If no one is to be executed, then it
- * yields to the initial soul that was in this working thread (that was
- * saved in resume_parallel).
+ * This function is called when a simulated process wants to yield back to the maestro in a blocking simcall. This
+ * naturally occurs within SIMIX_context_suspend(self->context), called from SIMIX_process_yield() Actually, it does not
+ * really yield back to maestro, but into the next process that must be executed. If no one is to be executed, then it
+ * yields to the initial soul that was in this working thread (that was saved in resume_parallel).
  */
 void ParallelUContext::suspend()
 {
-#if HAVE_THREAD_CONTEXTS
   /* determine the next context */
   // Get the next soul to embody now:
-  smx_actor_t next_work = (smx_actor_t) xbt_parmap_next(sysv_parmap);
-  ParallelUContext* next_context = nullptr;
-  // Will contain the next soul to run, either simulated or initial minion's one
-  ucontext_t* next_stack;
-
-  if (next_work != nullptr) {
+  boost::optional<smx_actor_t> next_work = parmap_->next();
+  ParallelUContext* next_context;
+  if (next_work) {
     // There is a next soul to embody (ie, a next process to resume)
     XBT_DEBUG("Run next process");
-    next_context = (ParallelUContext*) next_work->context;
+    next_context = static_cast<ParallelUContext*>(next_work.get()->context);
   } else {
     // All processes were run, go to the barrier
     XBT_DEBUG("No more processes to run");
-    // Get back the identity of my body that was stored when starting
-    // the scheduling round
-    uintptr_t worker_id =
-        (uintptr_t) xbt_os_thread_get_specific(sysv_worker_id_key);
+    // Get back the identity of my body that was stored when starting the scheduling round
+    uintptr_t worker_id = reinterpret_cast<uintptr_t>(xbt_os_thread_get_specific(worker_id_key_));
     // Deduce the initial soul of that body
-    next_context = (ParallelUContext*) sysv_workers_context[worker_id];
+    next_context = workers_context_[worker_id];
     // When given that soul, the body will wait for the next scheduling round
   }
 
-  next_stack = &next_context->uc_;
-
   SIMIX_context_set_current(next_context);
-  // Get that next soul:
-  swapcontext(&this->uc_, next_stack);
-#endif
+  // Get the next soul to run, either simulated or initial minion's one:
+  UContext::swap(this, next_context);
 }
 
-}}} // namespace simgrid::kernel::context
+/** Run one particular simulated process on the current thread. */
+void ParallelUContext::resume()
+{
+  // What is my containing body?
+  uintptr_t worker_id = threads_working_.fetch_add(1, std::memory_order_relaxed);
+  // Store the number of my containing body in os-thread-specific area :
+  xbt_os_thread_set_specific(worker_id_key_, reinterpret_cast<void*>(worker_id));
+  // Get my current soul:
+  ParallelUContext* worker_context = static_cast<ParallelUContext*>(SIMIX_context_self());
+  // Write down that this soul is hosted in that body (for now)
+  workers_context_[worker_id] = worker_context;
+  // Write in simix that I switched my soul
+  SIMIX_context_set_current(this);
+  // Actually do that using the relevant library call:
+  UContext::swap(worker_context, this);
+  // No body runs that soul anymore at this point.  Instead the current body took the soul of simulated process The
+  // simulated process wakes back after the call to "SIMIX_context_suspend(self->context);" within
+  // smx_process.c::SIMIX_process_yield()
+
+  // From now on, the simulated processes will change their soul with the next soul to execute (in suspend_parallel,
+  // below).  When nobody is to be executed in this scheduling round, the last simulated process will take back the
+  // initial soul of the current working thread
+}
+
+#endif
 
+XBT_PRIVATE ContextFactory* sysv_factory()
+{
+  XBT_VERB("Activating SYSV context factory");
+  return new UContextFactory();
+}
+}}} // namespace simgrid::kernel::context
diff --git a/src/kernel/context/ContextUnix.hpp b/src/kernel/context/ContextUnix.hpp
new file mode 100644 (file)
index 0000000..471b11f
--- /dev/null
@@ -0,0 +1,97 @@
+/* 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. */
+
+#ifndef SIMGRID_SIMIX_UNIX_CONTEXT_HPP
+#define SIMGRID_SIMIX_UNIX_CONTEXT_HPP
+
+#include <ucontext.h> /* context relative declarations */
+
+#include <atomic>
+#include <cstdint>
+#include <functional>
+#include <vector>
+
+#include <simgrid/simix.hpp>
+#include <xbt/parmap.hpp>
+#include <xbt/xbt_os_thread.h>
+
+#include "Context.hpp"
+#include "src/internal_config.h"
+#include "src/simix/smx_private.hpp"
+
+namespace simgrid {
+namespace kernel {
+namespace context {
+
+class UContext : public Context {
+public:
+  UContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
+  ~UContext() override;
+  void stop() override;
+  virtual void resume() = 0;
+
+  static void swap(UContext* from, UContext* to) { swapcontext(&from->uc_, &to->uc_); }
+  static UContext* getMaestro() { return maestro_context_; }
+  static void setMaestro(UContext* maestro) { maestro_context_ = maestro; }
+
+private:
+  static UContext* maestro_context_;
+  void* stack_ = nullptr; /* the thread stack */
+  ucontext_t uc_;         /* the ucontext that executes the code */
+
+  static void wrapper(int, int);
+  static void make_ctx(ucontext_t* ucp, void (*func)(int, int), UContext* arg);
+};
+
+class SerialUContext : public UContext {
+public:
+  SerialUContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+      : UContext(std::move(code), cleanup_func, process)
+  {
+  }
+  void suspend() override;
+  void resume() override;
+
+  static void run_all();
+
+private:
+  static unsigned long process_index_;
+};
+
+#if HAVE_THREAD_CONTEXTS
+class ParallelUContext : public UContext {
+public:
+  ParallelUContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
+      : UContext(std::move(code), cleanup_func, process)
+  {
+  }
+  void suspend() override;
+  void resume() override;
+
+  static void initialize();
+  static void finalize();
+  static void run_all();
+
+private:
+  static simgrid::xbt::Parmap<smx_actor_t>* parmap_;
+  static std::vector<ParallelUContext*> workers_context_;
+  static std::atomic<uintptr_t> threads_working_;
+  static xbt_os_thread_key_t worker_id_key_;
+};
+#endif
+
+class UContextFactory : public ContextFactory {
+public:
+  UContextFactory();
+  ~UContextFactory() override;
+  Context* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
+  void run_all() override;
+
+private:
+  bool parallel_;
+};
+}}} // namespace
+
+#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 73ab218..ad30187 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -16,21 +16,21 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf"
 namespace simgrid {
 namespace kernel {
 namespace routing {
-ClusterZone::ClusterZone(NetZone* father, const char* name) : NetZoneImpl(father, name)
+ClusterZone::ClusterZone(NetZone* father, std::string name) : NetZoneImpl(father, name)
 {
 }
 
 void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
-  XBT_VERB("cluster getLocalRoute from '%s'[%d] to '%s'[%d]", 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?");
 
   if ((src->id() == dst->id()) && hasLoopback_) {
     xbt_assert(not src->isRouter(), "Routing from a cluster private router to itself is meaningless");
 
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(src->id() * linkCountPerNode_);
-    route->link_list->push_back(info.first);
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePosition(src->id()));
+    route->link_list.push_back(info.first);
     if (lat)
       *lat += info.first->latency();
     return;
@@ -38,64 +38,62 @@ void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cba
 
   if (not src->isRouter()) { // No private link for the private router
     if (hasLimiter_) { // limiter for sender
-      std::pair<surf::LinkImpl*, surf::LinkImpl*> info =
-          privateLinks_.at(src->id() * linkCountPerNode_ + (hasLoopback_ ? 1 : 0));
-      route->link_list->push_back(info.first);
+      std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePositionWithLoopback(src->id()));
+      route->link_list.push_back(info.first);
     }
 
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info =
-        privateLinks_.at(src->id() * linkCountPerNode_ + (hasLoopback_ ? 1 : 0) + (hasLimiter_ ? 1 : 0));
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePositionWithLimiter(src->id()));
     if (info.first) { // link up
-      route->link_list->push_back(info.first);
+      route->link_list.push_back(info.first);
       if (lat)
         *lat += info.first->latency();
     }
   }
 
   if (backbone_) {
-    route->link_list->push_back(backbone_);
+    route->link_list.push_back(backbone_);
     if (lat)
       *lat += backbone_->latency();
   }
 
   if (not dst->isRouter()) { // No specific link for router
 
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info =
-        privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_ + hasLimiter_);
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePositionWithLimiter(dst->id()));
     if (info.second) { // link down
-      route->link_list->push_back(info.second);
+      route->link_list.push_back(info.second);
       if (lat)
         *lat += info.second->latency();
     }
     if (hasLimiter_) { // limiter for receiver
-      info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_);
-      route->link_list->push_back(info.first);
+      info = privateLinks_.at(nodePositionWithLoopback(dst->id()));
+      route->link_list.push_back(info.first);
     }
   }
 }
 
-void ClusterZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
+void ClusterZone::getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                           std::map<std::string, xbt_edge_t>* edges)
 {
   xbt_assert(router_,
              "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 src : vertices_) {
+  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_) {
@@ -106,7 +104,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_) {
@@ -119,9 +117,9 @@ void ClusterZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges
   }
 }
 
-void ClusterZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int /*rank*/, int position)
+void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int /*rank*/, unsigned int position)
 {
-  char* link_id = bprintf("%s_link_%d", cluster->id, id);
+  std::string link_id = cluster->id + "_link_" + std::to_string(id);
 
   LinkCreationArgs link;
   link.id        = link_id;
@@ -133,17 +131,12 @@ void ClusterZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id
   surf::LinkImpl *linkUp;
   surf::LinkImpl *linkDown;
   if (link.policy == SURF_LINK_FULLDUPLEX) {
-    char* tmp_link = bprintf("%s_UP", link_id);
-    linkUp         = surf::LinkImpl::byName(tmp_link);
-    xbt_free(tmp_link);
-    tmp_link = bprintf("%s_DOWN", link_id);
-    linkDown = surf::LinkImpl::byName(tmp_link);
-    xbt_free(tmp_link);
+    linkUp   = surf::LinkImpl::byName(link_id + "_UP");
+    linkDown = surf::LinkImpl::byName(link_id + "_DOWN");
   } else {
     linkUp   = surf::LinkImpl::byName(link_id);
     linkDown = linkUp;
   }
-  xbt_free(link_id);
   privateLinks_.insert({position, {linkUp, linkDown}});
 }
 }
index 7a347a8..376747e 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. */
@@ -67,13 +67,14 @@ namespace routing {
 
 class XBT_PRIVATE ClusterZone : public NetZoneImpl {
 public:
-  explicit ClusterZone(NetZone* father, const char* name);
+  explicit ClusterZone(NetZone* father, std::string name);
 
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
-  void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
+  void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                std::map<std::string, xbt_edge_t>* edges) override;
 
-  virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
-  virtual void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
+  virtual void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position);
+  virtual void parse_specific_arguments(ClusterCreationArgs* cluster)
   {
     /* this routing method does not require any specific argument */
   }
@@ -82,6 +83,10 @@ public:
   /* The pair is {linkUp, linkDown} */
   std::unordered_map<unsigned int, std::pair<surf::LinkImpl*, surf::LinkImpl*>> privateLinks_;
 
+  unsigned int nodePosition(int id) { return id * linkCountPerNode_; }
+  unsigned int nodePositionWithLoopback(int id) { return nodePosition(id) + (hasLoopback_ ? 1 : 0); }
+  unsigned int nodePositionWithLimiter(int id) { return nodePositionWithLoopback(id) + (hasLimiter_ ? 1 : 0); }
+
   surf::LinkImpl* backbone_      = nullptr;
   void* loopback_                = nullptr;
   NetPoint* router_              = nullptr;
index 0efd92e..85dfd1a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -7,34 +7,24 @@
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
 
-#include <float.h>
+#include <cfloat>
+#include <queue>
+#include <vector>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic");
 
 /* 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
+static void graph_edge_data_free(void* e)
 {
-  sg_platf_route_cbarg_t e_route = (sg_platf_route_cbarg_t)e;
-  if (e_route) {
-    delete e_route->link_list;
-    xbt_free(e_route);
-  }
+  sg_platf_route_cbarg_t e_route = static_cast<sg_platf_route_cbarg_t>(e);
+  delete e_route;
 }
 
 /* Utility functions */
@@ -50,8 +40,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,9 +56,8 @@ void DijkstraZone::seal()
       }
 
       if (not found) {
-        sg_platf_route_cbarg_t e_route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
-        e_route->link_list             = new std::vector<surf::LinkImpl*>();
-        e_route->link_list->push_back(surf_network_model->loopback_);
+        sg_platf_route_cbarg_t e_route = new s_sg_platf_route_cbarg_t;
+        e_route->link_list.push_back(surf_network_model->loopback_);
         xbt_graph_new_edge(routeGraph_, node, node, e_route);
       }
     }
@@ -80,28 +67,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 +98,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 +130,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,30 +147,26 @@ 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 link : *e_route->link_list) {
-      route->link_list->insert(route->link_list->begin(), link);
+    for (auto const& link : e_route->link_list) {
+      route->link_list.insert(route->link_list.begin(), link);
       if (lat)
         *lat += static_cast<surf::LinkImpl*>(link)->latency();
     }
   }
 
-  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 */
+    typedef std::pair<double, int> Qelt;
+    std::priority_queue<Qelt, std::vector<Qelt>, std::greater<Qelt>> pqueue;
 
     /* initialize */
     cost_arr[src_node_id] = 0.0;
@@ -199,40 +179,31 @@ 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;
-      xbt_heap_push(pqueue, nodeid, cost_arr[i]);
+      pqueue.emplace(cost_arr[i], i);
     }
 
     /* apply dijkstra using the indexes from the graph's node array */
-    while (xbt_heap_size(pqueue) > 0) {
-      int* v_id         = static_cast<int*>(xbt_heap_pop(pqueue));
-      xbt_node_t v_node = xbt_dynar_get_as(nodes, *v_id, xbt_node_t);
+    while (not pqueue.empty()) {
+      int v_id = pqueue.top().second;
+      pqueue.pop();
+      xbt_node_t v_node = xbt_dynar_get_as(nodes, v_id, xbt_node_t);
       xbt_edge_t edge   = nullptr;
       unsigned int cursor;
 
       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);
-        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;
-          xbt_heap_push(pqueue, nodeid, cost_arr[u_id]);
+        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];
+          pqueue.emplace(cost_arr[u_id], u_id);
         }
       }
-
-      /* free item popped from pqueue */
-      xbt_free(v_id);
     }
-
-    xbt_free(cost_arr);
-    xbt_heap_free(pqueue);
   }
 
   /* compose route path with links */
@@ -246,9 +217,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,28 +228,26 @@ 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;
       NetPoint* prev_gw_src_net_elm = nullptr;
-      getGlobalRoute(gw_dst_net_elm, prev_gw_src_net_elm, &e_route_as_to_as, nullptr);
-      auto pos = route->link_list->begin();
-      for (auto link : e_route_as_to_as) {
-        route->link_list->insert(pos, link);
+      getGlobalRoute(gw_dst_net_elm, prev_gw_src_net_elm, e_route_as_to_as, nullptr);
+      auto pos = route->link_list.begin();
+      for (auto const& link : e_route_as_to_as) {
+        route->link_list.insert(pos, link);
         if (lat)
           *lat += link->latency();
         pos++;
       }
     }
 
-    for (auto link : *e_route->link_list) {
-      route->link_list->insert(route->link_list->begin(), link);
+    for (auto const& link : e_route->link_list) {
+      route->link_list.insert(route->link_list.begin(), link);
       if (lat)
         *lat += static_cast<surf::LinkImpl*>(link)->latency();
     }
-    size++;
   }
 
   if (hierarchy_ == RoutingMode::recursive) {
@@ -286,47 +255,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, const char* 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 */
@@ -337,20 +292,23 @@ void DijkstraZone::addRoute(sg_platf_route_cbarg_t route)
 
   // Symmetrical YES
   if (route->symmetrical == true) {
-    if (not route->gw_dst && not route->gw_src)
-      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", 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_dynar_t nodes   = xbt_graph_get_nodes(routeGraph_);
     xbt_node_t node_s_v = xbt_dynar_get_as(nodes, src->id(), xbt_node_t);
     xbt_node_t node_e_v = xbt_dynar_get_as(nodes, dst->id(), xbt_node_t);
     xbt_edge_t edge     = xbt_graph_get_edge(routeGraph_, node_e_v, node_s_v);
 
-    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());
+    if (not route->gw_dst || not route->gw_src){
+      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dstName, srcName);
+      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->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->getCname(), srcName,
+               route->gw_src->getCname());
+    }
 
     if (route->gw_dst && route->gw_src) {
       NetPoint* gw_tmp = route->gw_src;
index 2e089ed..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 {
@@ -43,12 +32,12 @@ namespace routing {
  */
 class XBT_PRIVATE DijkstraZone : public RoutedZone {
 public:
-  DijkstraZone(NetZone* father, const char* name, bool cached);
+  DijkstraZone(NetZone* father, std::string name, bool cached);
   void seal() override;
 
   ~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 827aa98..d6eecc5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -17,7 +17,7 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-DragonflyZone::DragonflyZone(NetZone* father, const char* name) : ClusterZone(father, name)
+DragonflyZone::DragonflyZone(NetZone* father, std::string name) : ClusterZone(father, name)
 {
 }
 
@@ -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_;
   }
 }
 
@@ -41,14 +41,13 @@ void DragonflyZone::rankId_to_coords(int rankId, unsigned int (*coords)[4])
   (*coords)[3]         = rankId % numNodesPerBlade_;
 }
 
-void DragonflyZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
+void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 {
   std::vector<std::string> parameters;
   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");
   }
@@ -59,17 +58,34 @@ void DragonflyZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
     surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
   }
 
-  this->numGroups_    = xbt_str_parse_int(tmp[0].c_str(), "Invalid number of groups: %s");
-  this->numLinksBlue_ = xbt_str_parse_int(tmp[1].c_str(), "Invalid number of links for the blue level: %s");
+  try {
+    this->numGroups_ = std::stoi(tmp[0]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
+  }
 
+  try {
+    this->numLinksBlue_ = std::stoi(tmp[1]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid number of links for the blue level:") + tmp[1]);
+  }
   // Black network : number of chassis/group, number of links between each router on the black network
   boost::split(tmp, parameters[1], boost::is_any_of(","));
   if (tmp.size() != 2) {
     surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
   }
 
-  this->numChassisPerGroup_ = xbt_str_parse_int(tmp[0].c_str(), "Invalid number of groups: %s");
-  this->numLinksBlack_      = xbt_str_parse_int(tmp[1].c_str(), "Invalid number of links  for the black level: %s");
+  try {
+    this->numChassisPerGroup_ = std::stoi(tmp[0]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
+  }
+
+  try {
+    this->numLinksBlack_ = std::stoi(tmp[1]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid number of links for the black level:") + tmp[1]);
+  }
 
   // Green network : number of blades/chassis, number of links between each router on the green network
   boost::split(tmp, parameters[2], boost::is_any_of(","));
@@ -77,18 +93,32 @@ void DragonflyZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
     surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
   }
 
-  this->numBladesPerChassis_ = xbt_str_parse_int(tmp[0].c_str(), "Invalid number of groups: %s");
-  this->numLinksGreen_       = xbt_str_parse_int(tmp[1].c_str(), "Invalid number of links for the green level: %s");
+  try {
+    this->numBladesPerChassis_ = std::stoi(tmp[0]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
+  }
+
+  try {
+    this->numLinksGreen_ = std::stoi(tmp[1]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Invalid number of links for the green level:") + tmp[1]);
+  }
 
   // The last part of topo_parameters should be the number of nodes per blade
-  this->numNodesPerBlade_ =
-      xbt_str_parse_int(parameters[3].c_str(), "Last parameter is not the amount of nodes per blade: %s");
+  try {
+    this->numNodesPerBlade_ = std::stoi(parameters[3]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Last parameter is not the amount of nodes per blade:") + parameters[3]);
+  }
+
+  if (cluster->sharing_policy == SURF_LINK_FULLDUPLEX)
+    this->numLinksperLink_ = 2;
+
   this->cluster_ = cluster;
 }
 
-/*
-* Generate the cluster once every node is created
-*/
+/* Generate the cluster once every node is created */
 void DragonflyZone::seal()
 {
   if (this->numNodesPerBlade_ == 0) {
@@ -105,20 +135,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++) {
@@ -131,7 +156,7 @@ void DragonflyZone::generateRouters()
   }
 }
 
-void DragonflyZone::createLink(std::string id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown)
+void DragonflyZone::createLink(const std::string& id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown)
 {
   *linkup   = nullptr;
   *linkdown = nullptr;
@@ -143,16 +168,11 @@ void DragonflyZone::createLink(std::string id, int numlinks, surf::LinkImpl** li
   sg_platf_new_link(&linkTemplate);
   XBT_DEBUG("Generating link %s", id.c_str());
   surf::LinkImpl* link;
-  std::string tmpID;
   if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX) {
-    tmpID     = linkTemplate.id + "_UP";
-    link      = surf::LinkImpl::byName(tmpID.c_str());
-    *linkup   = link; // check link?
-    tmpID     = linkTemplate.id + "_DOWN";
-    link      = surf::LinkImpl::byName(tmpID.c_str());
-    *linkdown = link; // check link ?
+    *linkup   = surf::LinkImpl::byName(linkTemplate.id + "_UP");   // check link?
+    *linkdown = surf::LinkImpl::byName(linkTemplate.id + "_DOWN"); // check link ?
   } else {
-    link      = surf::LinkImpl::byName(linkTemplate.id.c_str());
+    link      = surf::LinkImpl::byName(linkTemplate.id);
     *linkup   = link;
     *linkdown = link;
   }
@@ -166,30 +186,22 @@ void DragonflyZone::generateLinks()
 
   unsigned int numRouters = this->numGroups_ * this->numChassisPerGroup_ * this->numBladesPerChassis_;
 
-  if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX)
-    numLinksperLink_ = 2;
-
   // 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_" +
           std::to_string(j / numLinksperLink_) + "_" + std::to_string(uniqueId);
       this->createLink(id, 1, &linkup, &linkdown);
 
-      if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX) {
-        this->routers_[i]->myNodes_[j]     = linkup;
+      this->routers_[i]->myNodes_[j] = linkup;
+      if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX)
         this->routers_[i]->myNodes_[j + 1] = linkdown;
-      } else {
-        this->routers_[i]->myNodes_[j] = linkup;
-      }
+
       uniqueId++;
     }
   }
@@ -235,8 +247,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);
@@ -256,13 +268,12 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
   if (dst->isRouter() || src->isRouter())
     return;
 
-  XBT_VERB("dragonfly getLocalRout from '%s'[%d] to '%s'[%d]", 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(src->id() * linkCountPerNode_);
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePosition(src->id()));
 
-    route->link_list->push_back(info.first);
+    route->link_list.push_back(info.first);
     if (latency)
       *latency += info.first->latency();
     return;
@@ -283,13 +294,13 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
   DragonflyRouter* currentRouter = myRouter;
 
   // node->router local link
-  route->link_list->push_back(myRouter->myNodes_[myCoords[3] * numLinksperLink_]);
+  route->link_list.push_back(myRouter->myNodes_[myCoords[3] * numLinksperLink_]);
   if (latency)
     *latency += myRouter->myNodes_[myCoords[3] * numLinksperLink_]->latency();
 
   if (hasLimiter_) { // limiter for sender
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(src->id() * linkCountPerNode_ + hasLoopback_);
-    route->link_list->push_back(info.first);
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePositionWithLoopback(src->id()));
+    route->link_list.push_back(info.first);
   }
 
   if (targetRouter != myRouter) {
@@ -299,7 +310,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
       // go to the router of our group connected to this one.
       if (currentRouter->blade_ != targetCoords[0]) {
         // go to the nth router in our chassis
-        route->link_list->push_back(currentRouter->greenLinks_[targetCoords[0]]);
+        route->link_list.push_back(currentRouter->greenLinks_[targetCoords[0]]);
         if (latency)
           *latency += currentRouter->greenLinks_[targetCoords[0]]->latency();
         currentRouter = routers_[myCoords[0] * (numChassisPerGroup_ * numBladesPerChassis_) +
@@ -308,14 +319,14 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
 
       if (currentRouter->chassis_ != 0) {
         // go to the first chassis of our group
-        route->link_list->push_back(currentRouter->blackLinks_[0]);
+        route->link_list.push_back(currentRouter->blackLinks_[0]);
         if (latency)
           *latency += currentRouter->blackLinks_[0]->latency();
         currentRouter = routers_[myCoords[0] * (numChassisPerGroup_ * numBladesPerChassis_) + targetCoords[0]];
       }
 
       // go to destination group - the only optical hop
-      route->link_list->push_back(currentRouter->blueLinks_[0]);
+      route->link_list.push_back(currentRouter->blueLinks_[0]);
       if (latency)
         *latency += currentRouter->blueLinks_[0]->latency();
       currentRouter = routers_[targetCoords[0] * (numChassisPerGroup_ * numBladesPerChassis_) + myCoords[0]];
@@ -323,7 +334,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
 
     // same group, but same blade ?
     if (targetRouter->blade_ != currentRouter->blade_) {
-      route->link_list->push_back(currentRouter->greenLinks_[targetCoords[2]]);
+      route->link_list.push_back(currentRouter->greenLinks_[targetCoords[2]]);
       if (latency)
         *latency += currentRouter->greenLinks_[targetCoords[2]]->latency();
       currentRouter = routers_[targetCoords[0] * (numChassisPerGroup_ * numBladesPerChassis_) + targetCoords[2]];
@@ -331,21 +342,19 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
 
     // same blade, but same chassis ?
     if (targetRouter->chassis_ != currentRouter->chassis_) {
-      route->link_list->push_back(currentRouter->blackLinks_[targetCoords[1]]);
+      route->link_list.push_back(currentRouter->blackLinks_[targetCoords[1]]);
       if (latency)
         *latency += currentRouter->blackLinks_[targetCoords[1]]->latency();
-      currentRouter = routers_[targetCoords[0] * (numChassisPerGroup_ * numBladesPerChassis_) +
-                               targetCoords[1] * numBladesPerChassis_ + targetCoords[2]];
     }
   }
 
   if (hasLimiter_) { // limiter for receiver
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_);
-    route->link_list->push_back(info.first);
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePositionWithLoopback(dst->id()));
+    route->link_list.push_back(info.first);
   }
 
   // router->node local link
-  route->link_list->push_back(targetRouter->myNodes_[targetCoords[3] * numLinksperLink_ + numLinksperLink_ - 1]);
+  route->link_list.push_back(targetRouter->myNodes_[targetCoords[3] * numLinksperLink_ + numLinksperLink_ - 1]);
   if (latency)
     *latency += targetRouter->myNodes_[targetCoords[3] * numLinksperLink_ + numLinksperLink_ - 1]->latency();
 }
index b974803..fd63be5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -60,19 +60,19 @@ public:
  */
 class XBT_PRIVATE DragonflyZone : public ClusterZone {
 public:
-  explicit DragonflyZone(NetZone* father, const char* name);
+  explicit DragonflyZone(NetZone* father, std::string name);
   ~DragonflyZone() override;
   //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
-  void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
+  void parse_specific_arguments(ClusterCreationArgs* cluster) override;
   void seal() override;
   void generateRouters();
   void generateLinks();
-  void createLink(std::string id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown);
+  void createLink(const std::string& id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown);
 
 private:
   void rankId_to_coords(int rankId, unsigned int (*coords)[4]);
-  sg_platf_cluster_cbarg_t cluster_;
+  ClusterCreationArgs* cluster_     = nullptr;
   unsigned int numNodesPerBlade_    = 0;
   unsigned int numBladesPerChassis_ = 0;
   unsigned int numChassisPerGroup_  = 0;
index 732cab8..f4b386a 100644 (file)
@@ -15,13 +15,14 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-EmptyZone::EmptyZone(NetZone* father, const char* name) : NetZoneImpl(father, name)
+EmptyZone::EmptyZone(NetZone* father, std::string name) : NetZoneImpl(father, name)
 {
 }
 
 EmptyZone::~EmptyZone() = default;
 
-void EmptyZone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /*edges*/)
+void EmptyZone::getGraph(xbt_graph_t /*graph*/, std::map<std::string, xbt_node_t>* /*nodes*/,
+                         std::map<std::string, xbt_edge_t>* /*edges*/)
 {
   XBT_ERROR("No routing no graph");
 }
index a63d75f..6d479b8 100644 (file)
@@ -21,7 +21,7 @@ namespace routing {
 
 class XBT_PRIVATE EmptyZone : public NetZoneImpl {
 public:
-  explicit EmptyZone(NetZone* father, const char* name);
+  explicit EmptyZone(NetZone* father, std::string name);
   ~EmptyZone() override;
 
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override
@@ -29,7 +29,8 @@ public:
     /* There can't be route in an Empty zone */
   }
 
-  void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
+  void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* /*nodes*/,
+                std::map<std::string, xbt_edge_t>* /*edges*/) override;
 };
 }
 }
index a364180..16e2798 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -20,7 +20,7 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-FatTreeZone::FatTreeZone(NetZone* father, const char* name) : ClusterZone(father, name)
+FatTreeZone::FatTreeZone(NetZone* father, std::string name) : ClusterZone(father, name)
 {
   XBT_DEBUG("Creating a new fat tree.");
 }
@@ -64,21 +64,21 @@ 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 [%d] in the fat tree",
-             src->name().c_str(), src->id());
+  xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%u] in the fat tree",
+             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 [%d] in the fat tree",
-             dst->name().c_str(), dst->id());
+  xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%u] in the fat tree",
+             dst->getCname(), dst->id());
   FatTreeNode* destination = searchedNode->second;
 
-  XBT_VERB("Get route and latency from '%s' [%d] to '%s' [%d] 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_) {
-    into->link_list->push_back(source->loopback);
+    into->link_list.push_back(source->loopback);
     if (latency)
       *latency += source->loopback->latency();
     return;
@@ -95,13 +95,13 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cba
 
     int k = this->upperLevelNodesNumber_[currentNode->level];
     d     = d % k;
-    into->link_list->push_back(currentNode->parents[d]->upLink);
+    into->link_list.push_back(currentNode->parents[d]->upLink);
 
     if (latency)
       *latency += currentNode->parents[d]->upLink->latency();
 
     if (this->hasLimiter_)
-      into->link_list->push_back(currentNode->limiterLink);
+      into->link_list.push_back(currentNode->limiterLink);
     currentNode = currentNode->parents[d]->upNode;
   }
 
@@ -112,12 +112,12 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cba
   while (currentNode != destination) {
     for (unsigned int i = 0; i < currentNode->children.size(); i++) {
       if (i % this->lowerLevelNodesNumber_[currentNode->level - 1] == destination->label[currentNode->level - 1]) {
-        into->link_list->push_back(currentNode->children[i]->downLink);
+        into->link_list.push_back(currentNode->children[i]->downLink);
         if (latency)
           *latency += currentNode->children[i]->downLink->latency();
         currentNode = currentNode->children[i]->downNode;
         if (this->hasLimiter_)
-          into->link_list->push_back(currentNode->limiterLink);
+          into->link_list.push_back(currentNode->limiterLink);
         XBT_DEBUG("%d(%u,%u) is accessible through %d(%u,%u)", destination->id, destination->level,
                   destination->position, currentNode->id, currentNode->level, currentNode->position);
       }
@@ -241,9 +241,9 @@ void FatTreeZone::generateSwitches()
     this->nodesByLevel_[0] *= this->lowerLevelNodesNumber_[i];
 
   if (this->nodesByLevel_[0] != this->nodes_.size()) {
-    surf_parse_error("The number of provided nodes does not fit with the wanted topology."
-                     " Please check your platform description (We need %d nodes, we got %zu)",
-                     this->nodesByLevel_[0], this->nodes_.size());
+    surf_parse_error(std::string("The number of provided nodes does not fit with the wanted topology.") +
+                     " Please check your platform description (We need " + std::to_string(this->nodesByLevel_[0]) +
+                     "nodes, we got " + std::to_string(this->nodes_.size()));
     return;
   }
 
@@ -264,7 +264,7 @@ void FatTreeZone::generateSwitches()
   for (unsigned int i = 0; i < this->levels_; i++) {
     for (unsigned int j = 0; j < this->nodesByLevel_[i + 1]; j++) {
       FatTreeNode* newNode = new FatTreeNode(this->cluster_, --k, i + 1, j);
-      XBT_DEBUG("We create the switch %d(%d,%d)", newNode->id, newNode->level, newNode->position);
+      XBT_DEBUG("We create the switch %d(%u,%u)", newNode->id, newNode->level, newNode->position);
       newNode->children.resize(this->lowerLevelNodesNumber_[i] * this->lowerLevelPortsNumber_[i]);
       if (i != this->levels_ - 1) {
         newNode->parents.resize(this->upperLevelNodesNumber_[i + 1] * this->lowerLevelPortsNumber_[i + 1]);
@@ -348,7 +348,7 @@ void FatTreeZone::addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeN
 {
   FatTreeLink* newLink;
   newLink = new FatTreeLink(this->cluster_, child, parent);
-  XBT_DEBUG("Creating a link between the parent (%d,%d,%u) and the child (%d,%d,%u)", parent->level, parent->position,
+  XBT_DEBUG("Creating a link between the parent (%u,%u,%u) and the child (%u,%u,%u)", parent->level, parent->position,
             parentPort, child->level, child->position, childPort);
   parent->children[parentPort] = newLink;
   child->parents[childPort]    = newLink;
@@ -356,49 +356,62 @@ void FatTreeZone::addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeN
   this->links_.push_back(newLink);
 }
 
-void FatTreeZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
+void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 {
   std::vector<std::string> parameters;
   std::vector<std::string> tmp;
   boost::split(parameters, cluster->topo_parameters, boost::is_any_of(";"));
+  const std::string error_msg {"Fat trees are defined by the levels number and 3 vectors, see the documentation for more information"};
 
   // TODO : we have to check for zeros and negative numbers, or it might crash
   if (parameters.size() != 4) {
-    surf_parse_error(
-        "Fat trees are defined by the levels number and 3 vectors, see the documentation for more information");
+    surf_parse_error(error_msg);
   }
 
   // The first parts of topo_parameters should be the levels number
-  this->levels_ = xbt_str_parse_int(parameters[0].c_str(), "First parameter is not the amount of levels: %s");
+  try {
+    this->levels_ = std::stoi(parameters[0]);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("First parameter is not the amount of levels:") + parameters[0]);
+  }
 
   // Then, a l-sized vector standing for the children number by level
   boost::split(tmp, parameters[1], boost::is_any_of(","));
   if (tmp.size() != this->levels_) {
-    surf_parse_error("Fat trees are defined by the levels number and 3 vectors"
-                     ", see the documentation for more information");
+    surf_parse_error(error_msg);
   }
   for (size_t i = 0; i < tmp.size(); i++) {
-    this->lowerLevelNodesNumber_.push_back(xbt_str_parse_int(tmp[i].c_str(), "Invalid lower level node number: %s"));
+    try {
+      this->lowerLevelNodesNumber_.push_back(std::stoi(tmp[i]));
+    } catch (std::invalid_argument& ia) {
+      throw std::invalid_argument(std::string("Invalid lower level node number:") + tmp[i]);
+    }
   }
 
   // Then, a l-sized vector standing for the parents number by level
   boost::split(tmp, parameters[2], boost::is_any_of(","));
   if (tmp.size() != this->levels_) {
-    surf_parse_error("Fat trees are defined by the levels number and 3 vectors"
-                     ", see the documentation for more information");
+    surf_parse_error(error_msg);
   }
   for (size_t i = 0; i < tmp.size(); i++) {
-    this->upperLevelNodesNumber_.push_back(xbt_str_parse_int(tmp[i].c_str(), "Invalid upper level node number: %s"));
+    try {
+      this->upperLevelNodesNumber_.push_back(std::stoi(tmp[i]));
+    } catch (std::invalid_argument& ia) {
+      throw std::invalid_argument(std::string("Invalid upper level node number:") + tmp[i]);
+    }
   }
 
   // Finally, a l-sized vector standing for the ports number with the lower level
   boost::split(tmp, parameters[3], boost::is_any_of(","));
   if (tmp.size() != this->levels_) {
-    surf_parse_error("Fat trees are defined by the levels number and 3 vectors"
-                     ", see the documentation for more information");
+    surf_parse_error(error_msg);
   }
   for (size_t i = 0; i < tmp.size(); i++) {
-    this->lowerLevelPortsNumber_.push_back(xbt_str_parse_int(tmp[i].c_str(), "Invalid lower level node number: %s"));
+    try {
+      this->lowerLevelPortsNumber_.push_back(std::stoi(tmp[i]));
+    } catch (std::invalid_argument& ia) {
+      throw std::invalid_argument(std::string("Invalid lower level port number:") + tmp[i]);
+    }
   }
   this->cluster_ = cluster;
 }
@@ -425,7 +438,7 @@ void FatTreeZone::generateDotFile(const std::string& filename) const
   file.close();
 }
 
-FatTreeNode::FatTreeNode(sg_platf_cluster_cbarg_t cluster, int id, int level, int position)
+FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int position)
     : id(id), level(level), position(position)
 {
   LinkCreationArgs linkTemplate;
@@ -435,7 +448,7 @@ FatTreeNode::FatTreeNode(sg_platf_cluster_cbarg_t cluster, int id, int level, in
     linkTemplate.policy    = SURF_LINK_SHARED;
     linkTemplate.id        = "limiter_"+std::to_string(id);
     sg_platf_new_link(&linkTemplate);
-    this->limiterLink = surf::LinkImpl::byName(linkTemplate.id.c_str());
+    this->limiterLink = surf::LinkImpl::byName(linkTemplate.id);
   }
   if (cluster->loopback_bw || cluster->loopback_lat) {
     linkTemplate.bandwidth = cluster->loopback_bw;
@@ -443,11 +456,11 @@ FatTreeNode::FatTreeNode(sg_platf_cluster_cbarg_t cluster, int id, int level, in
     linkTemplate.policy    = SURF_LINK_FATPIPE;
     linkTemplate.id        = "loopback_"+ std::to_string(id);
     sg_platf_new_link(&linkTemplate);
-    this->loopback = surf::LinkImpl::byName(linkTemplate.id.c_str());
+    this->loopback = surf::LinkImpl::byName(linkTemplate.id);
   }
 }
 
-FatTreeLink::FatTreeLink(sg_platf_cluster_cbarg_t cluster, FatTreeNode* downNode, FatTreeNode* upNode)
+FatTreeLink::FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* downNode, FatTreeNode* upNode)
     : upNode(upNode), downNode(downNode)
 {
   static int uniqueId = 0;
@@ -461,11 +474,11 @@ FatTreeLink::FatTreeLink(sg_platf_cluster_cbarg_t cluster, FatTreeNode* downNode
 
   if (cluster->sharing_policy == SURF_LINK_FULLDUPLEX) {
     std::string tmpID = std::string(linkTemplate.id) + "_UP";
-    this->upLink      = surf::LinkImpl::byName(tmpID.c_str()); // check link?
+    this->upLink      = surf::LinkImpl::byName(tmpID); // check link?
     tmpID          = std::string(linkTemplate.id) + "_DOWN";
-    this->downLink    = surf::LinkImpl::byName(tmpID.c_str()); // check link ?
+    this->downLink    = surf::LinkImpl::byName(tmpID); // check link ?
   } else {
-    this->upLink   = surf::LinkImpl::byName(linkTemplate.id.c_str());
+    this->upLink   = surf::LinkImpl::byName(linkTemplate.id);
     this->downLink = this->upLink;
   }
   uniqueId++;
index 8050329..7e329b6 100644 (file)
@@ -51,7 +51,7 @@ public:
    * instead of passing by an upper level switch.
    */
   surf::LinkImpl* loopback;
-  FatTreeNode(sg_platf_cluster_cbarg_t cluster, int id, int level, int position);
+  FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int position);
 };
 
 /** \brief Link in a fat tree (@ref FatTreeZone).
@@ -61,7 +61,7 @@ public:
  */
 class FatTreeLink {
 public:
-  FatTreeLink(sg_platf_cluster_cbarg_t cluster, FatTreeNode* source, FatTreeNode* destination);
+  FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* source, FatTreeNode* destination);
   /** Link going up in the tree */
   surf::LinkImpl* upLink;
   /** Link going down in the tree */
@@ -83,7 +83,7 @@ public:
  * which are not currently enforced.
  *
  * The exact topology is described in the mandatory topo_parameters
- * field, and follow the "h ; m_h, ..., m_1 ; w_h, ..., w_1 ; p_h, ..., p_1" format.
+ * field, and follow the "h ; m_1, ..., m_h ; w_1, ..., w_h ; p_1, ..., p_h" format.
  * h stands for the switches levels number, i.e. the fat tree is of height h,
  * without the processing nodes. m_i stands for the number of lower level nodes
  * connected to a node in level i. w_i stands for the number of upper levels
@@ -98,7 +98,7 @@ public:
  */
 class XBT_PRIVATE FatTreeZone : public ClusterZone {
 public:
-  explicit FatTreeZone(NetZone* father, const char* name);
+  explicit FatTreeZone(NetZone* father, std::string name);
   ~FatTreeZone() override;
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
 
@@ -113,13 +113,13 @@ public:
    *
    * It will also store the cluster for future use.
    */
-  void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
+  void parse_specific_arguments(ClusterCreationArgs* cluster) override;
   void addProcessingNode(int id);
   void generateDotFile(const std::string& filename = "fatTree.dot") const;
 
 private:
   // description of a PGFT (TODO : better doc)
-  unsigned int levels_ = 0;
+  unsigned long levels_ = 0;
   std::vector<unsigned int> lowerLevelNodesNumber_; // number of children by node
   std::vector<unsigned int> upperLevelNodesNumber_; // number of parents by node
   std::vector<unsigned int> lowerLevelPortsNumber_; // ports between each level l and l-1
@@ -129,7 +129,7 @@ private:
   std::vector<FatTreeLink*> links_;
   std::vector<unsigned int> nodesByLevel_;
 
-  sg_platf_cluster_cbarg_t cluster_ = nullptr;
+  ClusterCreationArgs* cluster_ = nullptr;
 
   void addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeNode* child, unsigned int childPort);
   int getLevelPosition(const unsigned int level);
index 894aa18..354f13d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -8,7 +8,7 @@
 #include "src/surf/network_interface.hpp"
 #include "xbt/log.h"
 
-#include <float.h>
+#include <cfloat>
 #include <limits>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf");
@@ -21,7 +21,7 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-FloydZone::FloydZone(NetZone* father, const char* name) : RoutedZone(father, name)
+FloydZone::FloydZone(NetZone* father, std::string name) : RoutedZone(father, name)
 {
   predecessorTable_ = nullptr;
   costTable_        = nullptr;
@@ -32,20 +32,20 @@ FloydZone::~FloydZone()
 {
   if (linkTable_ == nullptr) // Dealing with a parse error in the file?
     return;
-  int table_size = vertices_.size();
+  unsigned int table_size = getTableSize();
   /* Delete link_table */
-  for (int i = 0; i < table_size; i++)
-    for (int j = 0; j < table_size; j++)
-      routing_route_free(TO_FLOYD_LINK(i, j));
-  xbt_free(linkTable_);
+  for (unsigned int i = 0; i < table_size; i++)
+    for (unsigned int j = 0; j < table_size; j++)
+      delete TO_FLOYD_LINK(i, j);
+  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)
 {
-  size_t table_size = vertices_.size();
+  unsigned int table_size = getTableSize();
 
   getRouteCheckParams(src, dst);
 
@@ -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,12 +70,12 @@ 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);
     }
 
-    for (auto link : *e_route->link_list) {
-      route->link_list->push_back(link);
+    for (auto const& link : e_route->link_list) {
+      route->link_list.push_back(link);
       if (lat)
         *lat += link->latency();
     }
@@ -87,19 +87,19 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
 void FloydZone::addRoute(sg_platf_route_cbarg_t route)
 {
   /* set the size of table routing */
-  int table_size = static_cast<int>(vertices_.size());
+  unsigned int table_size = getTableSize();
 
   addRouteCheckParams(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 (int i = 0; i < table_size; i++)
-      for (int j = 0; j < table_size; j++) {
+    for (unsigned int i = 0; i < table_size; i++)
+      for (unsigned int j = 0; j < table_size; j++) {
         TO_FLOYD_COST(i, j) = DBL_MAX;
         TO_FLOYD_PRED(i, j) = -1;
         TO_FLOYD_LINK(i, j) = nullptr;
@@ -110,29 +110,27 @@ 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();
   TO_FLOYD_COST(route->src->id(), route->dst->id()) =
-      (TO_FLOYD_LINK(route->src->id(), route->dst->id()))->link_list->size();
+      (TO_FLOYD_LINK(route->src->id(), route->dst->id()))->link_list.size();
 
   if (route->symmetrical == true) {
     if (route->gw_dst) // netzone route (to adapt the error message, if any)
       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;
@@ -140,29 +138,29 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route)
       route->gw_dst   = gw_tmp;
     }
 
-    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());
+    if (not route->gw_src || not route->gw_dst)
+      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();
     TO_FLOYD_COST(route->dst->id(), route->src->id()) =
-        (TO_FLOYD_LINK(route->dst->id(), route->src->id()))->link_list->size(); /* count of links, old model assume 1 */
+        (TO_FLOYD_LINK(route->dst->id(), route->src->id()))->link_list.size(); /* count of links, old model assume 1 */
   }
 }
 
 void FloydZone::seal()
 {
   /* set the size of table routing */
-  size_t table_size = vertices_.size();
+  unsigned int table_size = getTableSize();
 
   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,11 +176,10 @@ 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*>();
-        e_route->link_list->push_back(surf_network_model->loopback_);
+        e_route->link_list.push_back(surf_network_model->loopback_);
         TO_FLOYD_LINK(i, i) = e_route;
         TO_FLOYD_PRED(i, i) = i;
         TO_FLOYD_COST(i, i) = 1;
@@ -193,12 +190,11 @@ void FloydZone::seal()
   for (unsigned int c = 0; c < table_size; c++) {
     for (unsigned int a = 0; a < table_size; a++) {
       for (unsigned int b = 0; b < table_size; b++) {
-        if (TO_FLOYD_COST(a, c) < DBL_MAX && TO_FLOYD_COST(c, b) < DBL_MAX) {
-          if (fabs(TO_FLOYD_COST(a, b) - DBL_MAX) < std::numeric_limits<double>::epsilon() ||
-              (TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b) < TO_FLOYD_COST(a, b))) {
-            TO_FLOYD_COST(a, b) = TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b);
-            TO_FLOYD_PRED(a, b) = TO_FLOYD_PRED(c, b);
-          }
+        if (TO_FLOYD_COST(a, c) < DBL_MAX && TO_FLOYD_COST(c, b) < DBL_MAX &&
+            (fabs(TO_FLOYD_COST(a, b) - DBL_MAX) < std::numeric_limits<double>::epsilon() ||
+             (TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b) < TO_FLOYD_COST(a, b)))) {
+          TO_FLOYD_COST(a, b) = TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b);
+          TO_FLOYD_PRED(a, b) = TO_FLOYD_PRED(c, b);
         }
       }
     }
index f1cb156..a612425 100644 (file)
@@ -23,7 +23,7 @@ namespace routing {
  */
 class XBT_PRIVATE FloydZone : public RoutedZone {
 public:
-  explicit FloydZone(NetZone* father, const char* name);
+  explicit FloydZone(NetZone* father, std::string name);
   ~FloydZone() override;
 
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
index 89cdec6..a05458a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -14,28 +14,27 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 namespace simgrid {
 namespace kernel {
 namespace routing {
-FullZone::FullZone(NetZone* father, const char* name) : RoutedZone(father, name)
+FullZone::FullZone(NetZone* father, std::string name) : RoutedZone(father, name)
 {
 }
 
 void FullZone::seal()
 {
-  int table_size = static_cast<int>(vertices_.size());
+  unsigned int table_size = getTableSize();
 
   /* 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 (int i = 0; i < table_size; i++) {
+    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*>();
-        e_route->link_list->push_back(surf_network_model->loopback_);
+        e_route->link_list.push_back(surf_network_model->loopback_);
         TO_ROUTE_FULL(i, i) = e_route;
       }
     }
@@ -45,31 +44,27 @@ void FullZone::seal()
 FullZone::~FullZone()
 {
   if (routingTable_) {
-    int table_size = static_cast<int>(vertices_.size());
+    unsigned int table_size = getTableSize();
     /* Delete routing table */
-    for (int i = 0; i < table_size; i++)
-      for (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));
-        }
-      }
-    xbt_free(routingTable_);
+    for (unsigned int i = 0; i < table_size; i++)
+      for (unsigned int j = 0; j < table_size; j++)
+        delete TO_ROUTE_FULL(i, j);
+    delete[] routingTable_;
   }
 }
 
 void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t res, double* lat)
 {
-  XBT_DEBUG("full getLocalRoute from %s[%d] to %s[%d]", 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());
 
-  size_t table_size              = vertices_.size();
+  unsigned int table_size        = getTableSize();
   sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(src->id(), dst->id());
 
   if (e_route != nullptr) {
     res->gw_src = e_route->gw_src;
     res->gw_dst = e_route->gw_dst;
-    for (auto link : *e_route->link_list) {
-      res->link_list->push_back(link);
+    for (auto const& link : e_route->link_list) {
+      res->link_list.push_back(link);
       if (lat)
         *lat += link->latency();
     }
@@ -82,20 +77,20 @@ void FullZone::addRoute(sg_platf_route_cbarg_t route)
   NetPoint* dst = route->dst;
   addRouteCheckParams(route);
 
-  size_t table_size = vertices_.size();
+  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);
@@ -106,15 +101,15 @@ void FullZone::addRoute(sg_platf_route_cbarg_t route)
       route->gw_src   = route->gw_dst;
       route->gw_dst   = gw_tmp;
     }
-    if (route->gw_dst) // inter-zone route (to adapt the error message, if any)
+    if (route->gw_dst && route->gw_src) // inter-zone route (to adapt the error message, if any)
       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 f13764f..ab13bc5 100644 (file)
@@ -15,13 +15,12 @@ namespace routing {
 /** @ingroup ROUTING_API
  *  @brief NetZone with an explicit routing provided by the user
  *
- *  The full communication matrix is provided at creation, so this model
- *  has the highest expressive power and the lowest computational requirements,
- *  but also the highest memory requirements (both in platform file and in memory).
+ *  The full communication matrix is provided at creation, so this model has the highest expressive power and the lowest
+ *  computational requirements, but also the highest memory requirements (both in platform file and in memory).
  */
 class XBT_PRIVATE FullZone : public RoutedZone {
 public:
-  explicit FullZone(NetZone* father, const char* name);
+  explicit FullZone(NetZone* father, std::string name);
   void seal() override;
   ~FullZone() override;
 
index 285ef6a..0a48274 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. */
 #include <xbt/signal.hpp>
 
 #include "src/kernel/routing/NetZoneImpl.hpp"
-/*
-#include <float.h>
-#include <vector>
-*/
+
 namespace simgrid {
 namespace kernel {
 namespace routing {
@@ -34,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 2b4a84d..08b74df 100644 (file)
@@ -26,24 +26,25 @@ public:
   std::vector<surf::LinkImpl*> links;
 };
 
-NetZoneImpl::NetZoneImpl(NetZone* father, const char* name) : NetZone(father, name)
+NetZoneImpl::NetZoneImpl(NetZone* father, std::string name) : NetZone(father, name)
 {
-  xbt_assert(nullptr == simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name),
-             "Refusing to create a second NetZone called '%s'.", name);
+  xbt_assert(nullptr == simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name.c_str()),
+             "Refusing to create a second NetZone called '%s'.", name.c_str());
 
   netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast<NetZoneImpl*>(father));
-  XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netpoint_->id());
+  XBT_DEBUG("NetZone '%s' created with the id '%u'", name.c_str(), netpoint_->id());
 }
+
 NetZoneImpl::~NetZoneImpl()
 {
-  for (auto& kv : bypassRoutes_)
+  for (auto const& kv : bypassRoutes_)
     delete kv.second;
 
   simgrid::s4u::Engine::getInstance()->netpointUnregister(netpoint_);
 }
 
 simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
-                                            std::unordered_map<std::string, std::string>* props)
+                                            std::map<std::string, std::string>* props)
 {
   simgrid::s4u::Host* res = new simgrid::s4u::Host(name);
 
@@ -55,8 +56,8 @@ simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector<double
   surf_cpu_model_pm->createCpu(res, speedPerPstate, coreAmount);
 
   if (props != nullptr)
-    for (auto kv : *props)
-      res->setProperty(kv.first.c_str(), kv.second.c_str());
+    for (auto const& kv : *props)
+      res->setProperty(kv.first, kv.second);
 
   simgrid::s4u::Host::onCreation(*res); // notify the signal
 
@@ -67,24 +68,26 @@ 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_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());
+    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->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_assert(not e_route->link_list->empty(), "Bypass route between %s and %s cannot be empty.",
-               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->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 */
   kernel::routing::BypassRoute* newRoute = new kernel::routing::BypassRoute(e_route->gw_src, e_route->gw_dst);
-  for (auto link : *e_route->link_list)
+  for (auto const& link : e_route->link_list)
     newRoute->links.push_back(link);
 
   /* Store it */
@@ -159,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;
@@ -202,7 +205,7 @@ static void find_common_ancestors(NetPoint* src, NetPoint* dst,
 
 /* PRECONDITION: this is the common ancestor of src and dst */
 bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
-                                 /* OUT */ std::vector<surf::LinkImpl*>* links, double* latency)
+                                 /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
 {
   // If never set a bypass route return nullptr without any further computations
   if (bypassRoutes_.empty())
@@ -212,12 +215,12 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
   if (dst->netzone() == this && src->netzone() == this) {
     if (bypassRoutes_.find({src, dst}) != bypassRoutes_.end()) {
       BypassRoute* bypassedRoute = bypassRoutes_.at({src, dst});
-      for (surf::LinkImpl* link : bypassedRoute->links) {
-        links->push_back(link);
+      for (surf::LinkImpl* const& link : bypassedRoute->links) {
+        links.push_back(link);
         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;
     }
@@ -260,15 +263,17 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
     for (int i = 0; i < max; i++) {
       if (i <= max_index_src && max <= max_index_dst) {
         key = {path_src.at(i)->netpoint_, path_dst.at(max)->netpoint_};
-        if (bypassRoutes_.find(key) != bypassRoutes_.end()) {
-          bypassedRoute = bypassRoutes_.at(key);
+        auto bpr = bypassRoutes_.find(key);
+        if (bpr != bypassRoutes_.end()) {
+          bypassedRoute = bpr->second;
           break;
         }
       }
       if (max <= max_index_src && i <= max_index_dst) {
         key = {path_src.at(max)->netpoint_, path_dst.at(i)->netpoint_};
-        if (bypassRoutes_.find(key) != bypassRoutes_.end()) {
-          bypassedRoute = bypassRoutes_.at(key);
+        auto bpr = bypassRoutes_.find(key);
+        if (bpr != bypassRoutes_.end()) {
+          bypassedRoute = bpr->second;
           break;
         }
       }
@@ -279,8 +284,9 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
 
     if (max <= max_index_src && max <= max_index_dst) {
       key = {path_src.at(max)->netpoint_, path_dst.at(max)->netpoint_};
-      if (bypassRoutes_.find(key) != bypassRoutes_.end()) {
-        bypassedRoute = bypassRoutes_.at(key);
+      auto bpr = bypassRoutes_.find(key);
+      if (bpr != bypassRoutes_.end()) {
+        bypassedRoute = bpr->second;
         break;
       }
     }
@@ -290,11 +296,11 @@ 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* link : bypassedRoute->links) {
-      links->push_back(link);
+    for (surf::LinkImpl* const& link : bypassedRoute->links) {
+      links.push_back(link);
       if (latency)
         *latency += link->latency();
     }
@@ -302,17 +308,16 @@ 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;
 }
 
 void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
-                                 /* OUT */ std::vector<surf::LinkImpl*>* links, double* latency)
+                                 /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
 {
   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;
@@ -328,25 +333,23 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
 
   /* If src and dst are in the same netzone, life is good */
   if (src_ancestor == dst_ancestor) { /* SURF_ROUTING_BASE */
-    route.link_list = links;
+    route.link_list = std::move(links);
     common_ancestor->getLocalRoute(src, dst, &route, latency);
+    links = std::move(route.link_list);
     return;
   }
 
   /* Not in the same netzone, no bypass. We'll have to find our path between the netzones recursively */
 
-  route.link_list = new std::vector<surf::LinkImpl*>();
-
   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)
     getGlobalRoute(src, route.gw_src, links, latency);
-  for (auto link : *route.link_list)
-    links->push_back(link);
-  delete route.link_list;
+  for (auto const& link : route.link_list)
+    links.push_back(link);
 
   /* If dest gateway is not our destination, we have to recursively find our way from this point */
   if (route.gw_dst != dst)
index fe97e73..c2d7738 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. */
@@ -53,13 +53,13 @@ XBT_PUBLIC_CLASS NetZoneImpl : public s4u::NetZone
   friend simgrid::kernel::EngineImpl; // it destroys netRoot_
 
 protected:
-  explicit NetZoneImpl(NetZone * father, const char* name);
+  explicit NetZoneImpl(NetZone * father, std::string name);
   virtual ~NetZoneImpl();
 
 public:
   /** @brief Make an host within that NetZone */
   simgrid::s4u::Host* createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
-                                 std::unordered_map<std::string, std::string>* props);
+                                 std::map<std::string, std::string>* props);
   /** @brief Creates a new route in this NetZone */
   void addBypassRoute(sg_platf_route_cbarg_t e_route) override;
 
@@ -76,7 +76,7 @@ protected:
   /** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
   /* returns whether we found a bypass path */
   bool getBypassRoute(routing::NetPoint * src, routing::NetPoint * dst,
-                      /* OUT */ std::vector<surf::LinkImpl*> * links, double* latency);
+                      /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
 
 public:
   /* @brief get the route between two nodes in the full platform
@@ -87,9 +87,10 @@ public:
    * @param latency Accumulator in which the latencies should be added (caller must set it to 0)
    */
   static void getGlobalRoute(routing::NetPoint * src, routing::NetPoint * dst,
-                             /* OUT */ std::vector<surf::LinkImpl*> * links, double* latency);
+                             /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
 
-  virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) = 0;
+  virtual void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t> * nodes,
+                        std::map<std::string, xbt_edge_t> * edges) = 0;
   enum class RoutingMode {
     unset = 0, /**< Undefined type                                   */
     base,      /**< Base case: use simple link lists for routing     */
index d947b4a..dab2e4e 100644 (file)
@@ -4,7 +4,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/dict.h"
-#include "xbt/dynar.h"
 #include "xbt/graph.h"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
 
-void routing_route_free(sg_platf_route_cbarg_t route)
-{
-  if (route) {
-    delete route->link_list;
-    xbt_free(route);
-  }
-}
-
 /* ***************************************************************** */
 /* *********************** GENERIC METHODS ************************* */
 
@@ -32,57 +23,61 @@ static const char* instr_node_name(xbt_node_t node)
   return static_cast<const char*>(data);
 }
 
-xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name, xbt_dict_t nodes)
+xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name, std::map<std::string, xbt_node_t>* nodes)
 {
-  xbt_node_t ret = static_cast<xbt_node_t>(xbt_dict_get_or_null(nodes, name));
-  if (ret)
-    return ret;
 
-  ret = xbt_graph_new_node(graph, xbt_strdup(name));
-  xbt_dict_set(nodes, name, ret, nullptr);
-  return ret;
+  auto elm = nodes->find(name);
+  if (elm == nodes->end()) {
+    xbt_node_t ret = xbt_graph_new_node(graph, xbt_strdup(name));
+    nodes->insert({name, ret});
+    return ret;
+  } else
+    return elm->second;
 }
 
-xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges)
+xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d, std::map<std::string, xbt_edge_t>* edges)
 {
   const char* sn = instr_node_name(s);
   const char* dn = instr_node_name(d);
   std::string name = std::string(sn) + dn;
 
-  xbt_edge_t ret = static_cast<xbt_edge_t>(xbt_dict_get_or_null(edges, name.c_str()));
-  if (ret == nullptr) {
+  auto elm = edges->find(name);
+  if (elm == edges->end()) {
     name = std::string(dn) + sn;
-    ret  = static_cast<xbt_edge_t>(xbt_dict_get_or_null(edges, name.c_str()));
+    elm  = edges->find(name);
   }
 
-  if (ret == nullptr) {
-    ret = xbt_graph_new_edge(graph, s, d, nullptr);
-    xbt_dict_set(edges, name.c_str(), ret, nullptr);
-  }
-  return ret;
+  if (elm == edges->end()) {
+    xbt_edge_t ret = xbt_graph_new_edge(graph, s, d, nullptr);
+    edges->insert({name, ret});
+    return ret;
+  } else
+    return elm->second;
 }
 
 namespace simgrid {
 namespace kernel {
 namespace routing {
 
-RoutedZone::RoutedZone(NetZone* father, const char* name) : NetZoneImpl(father, name)
+RoutedZone::RoutedZone(NetZone* father, std::string name) : NetZoneImpl(father, name)
 {
 }
 
-void RoutedZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
+void RoutedZone::getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                          std::map<std::string, xbt_edge_t>* edges)
 {
-  for (auto my_src : vertices_) {
-    for (auto my_dst : vertices_) {
+  std::vector<kernel::routing::NetPoint*> vertices = getVertices();
+
+  for (auto const& my_src : vertices) {
+    for (auto const& my_dst : vertices) {
       if (my_src == my_dst)
         continue;
 
-      sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
-      route->link_list             = new std::vector<surf::LinkImpl*>();
+      sg_platf_route_cbarg_t route = new s_sg_platf_route_cbarg_t;
 
       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;
@@ -90,15 +85,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 link : *route->link_list) {
-        const char* link_name = link->cname();
+      for (auto const& link : route->link_list) {
+        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);
@@ -108,17 +103,16 @@ 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;
     }
   }
 }
@@ -131,8 +125,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->link_list = new std::vector<surf::LinkImpl*>();
+  result            = new s_sg_platf_route_cbarg_t;
 
   xbt_assert(hierarchy == RoutingMode::base || hierarchy == RoutingMode::recursive,
              "The hierarchy of this netzone is neither BASIC nor RECURSIVE, I'm lost here.");
@@ -144,45 +137,45 @@ sg_platf_route_cbarg_t RoutedZone::newExtendedRoute(RoutingMode hierarchy, sg_pl
     result->gw_dst = routearg->gw_dst;
   }
 
-  for (auto link : *routearg->link_list) {
+  for (auto const& link : routearg->link_list) {
     if (change_order)
-      result->link_list->push_back(link);
+      result->link_list.push_back(link);
     else
-      result->link_list->insert(result->link_list->begin(), link);
+      result->link_list.insert(result->link_list.begin(), link);
   }
-  result->link_list->shrink_to_fit();
+  result->link_list.shrink_to_fit();
 
   return result;
 }
 
 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) {
+  if (not route->gw_dst || not route->gw_src) {
     XBT_DEBUG("Load Route from \"%s\" to \"%s\"", srcName, dstName);
     xbt_assert(src, "Cannot add a route from %s to %s: %s does not exist.", srcName, dstName, srcName);
     xbt_assert(dst, "Cannot add a route from %s to %s: %s does not exist.", srcName, dstName, dstName);
-    xbt_assert(not route->link_list->empty(), "Empty route (between %s and %s) forbidden.", srcName, dstName);
+    xbt_assert(not route->link_list.empty(), "Empty route (between %s and %s) forbidden.", srcName, dstName);
     xbt_assert(not src->isNetZone(),
                "When defining a route, src cannot be a netzone such as '%s'. Did you meant to have an NetzoneRoute?",
                srcName);
@@ -190,7 +183,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);
 
@@ -199,14 +193,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(not route->link_list->empty(), "Empty route (between %s@%s and %s@%s) forbidden.", srcName,
-               route->gw_src->cname(), dstName, route->gw_dst->cname());
+    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->getCname(), dstName, route->gw_dst->getCname());
   }
 
   onRouteCreation(route->symmetrical, route->src, route->dst, route->gw_src, route->gw_dst, route->link_list);
index 25be9b4..62ebe81 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. */
@@ -50,9 +50,10 @@ namespace routing {
 
 class XBT_PRIVATE RoutedZone : public NetZoneImpl {
 public:
-  explicit RoutedZone(NetZone* father, const char* name);
+  explicit RoutedZone(NetZone* father, std::string name);
 
-  void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
+  void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                std::map<std::string, xbt_edge_t>* edges) override;
   virtual sg_platf_route_cbarg_t newExtendedRoute(RoutingMode hierarchy, sg_platf_route_cbarg_t routearg,
                                                   bool change_order);
 
@@ -64,9 +65,11 @@ protected:
 }
 } // namespace
 
-SG_BEGIN_DECL()
-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()
+extern "C" {
+XBT_PRIVATE xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name,
+                                          std::map<std::string, xbt_node_t>* nodes);
+XBT_PRIVATE xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d,
+                                          std::map<std::string, xbt_edge_t>* edges);
+}
 
 #endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
index dca285d..c9d1636 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* 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. */
@@ -17,7 +17,7 @@ inline void rankId_to_coords(int rankId, std::vector<unsigned int> dimensions, u
 {
   unsigned int dim_size_product = 1;
   unsigned int i = 0;
-  for (auto cur_dim_size: dimensions) {
+  for (auto const& cur_dim_size : dimensions) {
     (*coords)[i] = (rankId / dim_size_product) % cur_dim_size;
     dim_size_product *= cur_dim_size;
     i++;
@@ -27,11 +27,11 @@ inline void rankId_to_coords(int rankId, std::vector<unsigned int> dimensions, u
 namespace simgrid {
 namespace kernel {
 namespace routing {
-TorusZone::TorusZone(NetZone* father, const char* name) : ClusterZone(father, name)
+TorusZone::TorusZone(NetZone* father, std::string name) : ClusterZone(father, name)
 {
 }
 
-void TorusZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position)
+void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position)
 {
   /* Create all links that exist in the torus. Each rank creates @a dimensions-1 links */
   int dim_product = 1; // Needed to calculate the next neighbor_id
@@ -45,7 +45,8 @@ void TorusZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id,
                                ? rank - (current_dimension - 1) * dim_product
                                : rank + dim_product;
     // name of neighbor is not right for non contiguous cluster radicals (as id != rank in this case)
-    char* link_id  = bprintf("%s_link_from_%i_to_%i", cluster->id, id, neighbor_rank_id);
+    std::string link_id =
+        std::string(cluster->id) + "_link_from_" + std::to_string(id) + "_to_" + std::to_string(neighbor_rank_id);
     link.id        = link_id;
     link.bandwidth = cluster->bw;
     link.latency   = cluster->lat;
@@ -54,41 +55,37 @@ void TorusZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id,
     surf::LinkImpl* linkUp;
     surf::LinkImpl* linkDown;
     if (link.policy == SURF_LINK_FULLDUPLEX) {
-      char* tmp_link = bprintf("%s_UP", link_id);
+      std::string tmp_link = link_id + "_UP";
       linkUp         = surf::LinkImpl::byName(tmp_link);
-      free(tmp_link);
-      tmp_link = bprintf("%s_DOWN", link_id);
+      tmp_link             = link_id + "_DOWN";
       linkDown = surf::LinkImpl::byName(tmp_link);
-      free(tmp_link);
     } else {
       linkUp   = surf::LinkImpl::byName(link_id);
       linkDown = linkUp;
     }
     /*
-     * Add the link to its appropriate position;
-     * note that position rankId*(xbt_dynar_length(dimensions)+has_loopback?+has_limiter?)
+     * Add the link to its appropriate position.
+     * Note that position rankId*(xbt_dynar_length(dimensions)+has_loopback?+has_limiter?)
      * holds the link "rankId->rankId"
      */
     privateLinks_.insert({position + j, {linkUp, linkDown}});
     dim_product *= current_dimension;
-    xbt_free(link_id);
   }
   rank++;
 }
 
-void TorusZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
+void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 {
   std::vector<std::string> dimensions;
   boost::split(dimensions, cluster->topo_parameters, boost::is_any_of(","));
 
   if (not dimensions.empty()) {
     /* We are in a torus cluster
-     * Parse attribute dimensions="dim1,dim2,dim3,...,dimN" and safe it in a vector.
+     * Parse attribute dimensions="dim1,dim2,dim3,...,dimN" and save them into a vector.
      * Additionally, we need to know how many ranks we have in total
      */
-    for (auto group : dimensions) {
-      dimensions_.push_back(surf_parse_get_int(group.c_str()));
-    }
+    for (auto const& group : dimensions)
+      dimensions_.push_back(surf_parse_get_int(group));
 
     linkCountPerNode_ = dimensions_.size();
   }
@@ -97,8 +94,7 @@ void TorusZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
 void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
 
-  XBT_VERB("torus getLocalRoute from '%s'[%d] to '%s'[%d]", 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;
@@ -106,7 +102,7 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
   if (src->id() == dst->id() && hasLoopback_) {
     std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(src->id() * linkCountPerNode_);
 
-    route->link_list->push_back(info.first);
+    route->link_list.push_back(info.first);
     if (lat)
       *lat += info.first->latency();
     return;
@@ -116,25 +112,19 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
    * Dimension based routing routes through each dimension consecutively
    * TODO Change to dynamic assignment
    */
-  unsigned int dim_product = 1;
   unsigned int current_node = src->id();
   unsigned int next_node    = 0;
   /*
-   * Arrays that hold the coordinates of the current node and
-   * the target; comparing the values at the i-th position of
-   * both arrays, we can easily assess whether we need to route
-   * into this dimension or not.
+   * Arrays that hold the coordinates of the current node andthe target; comparing the values at the i-th position of
+   * both arrays, we can easily assess whether we need to route into this dimension or not.
    */
   unsigned int myCoords[4];
   rankId_to_coords(src->id(), dimensions_, &myCoords);
   unsigned int targetCoords[4];
   rankId_to_coords(dst->id(), dimensions_, &targetCoords);
   /*
-   * linkOffset describes the offset where the link
-   * we want to use is stored
-   * (+1 is added because each node has a link from itself to itself,
-   * which can only be the case if src->m_id == dst->m_id -- see above
-   * for this special case)
+   * linkOffset describes the offset where the link we want to use is stored(+1 is added because each node has a link
+   * from itself to itself, which can only be the case if src->m_id == dst->m_id -- see above for this special case)
    */
   int nodeOffset = (dimensions_.size() + 1) * src->id();
 
@@ -142,9 +132,9 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
   bool use_lnk_up = false; // Is this link of the form "cur -> next" or "next -> cur"?
   // false means: next -> cur
   while (current_node != dst->id()) {
-    dim_product = 1; // First, we will route in x-dimension
+    unsigned int dim_product = 1; // First, we will route in x-dimension
     int j=0;
-    for (auto cur_dim : dimensions_){
+    for (auto const& cur_dim : dimensions_) {
       // current_node/dim_product = position in current dimension
       if ((current_node / dim_product) % cur_dim != (dst->id() / dim_product) % cur_dim) {
 
@@ -176,7 +166,7 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
 
           assert(linkOffset >= 0);
         }
-        XBT_DEBUG("torus_get_route_and_latency - current_node: %i, next_node: %u, linkOffset is %i", current_node,
+        XBT_DEBUG("torus_get_route_and_latency - current_node: %u, next_node: %u, linkOffset is %i", current_node,
                   next_node, linkOffset);
         break;
       }
@@ -188,18 +178,18 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
     std::pair<surf::LinkImpl*, surf::LinkImpl*> info;
 
     if (hasLimiter_) { // limiter for sender
-      info = privateLinks_.at(nodeOffset + hasLoopback_);
-      route->link_list->push_back(info.first);
+      info = privateLinks_.at(nodeOffset + (hasLoopback_ ? 1 : 0));
+      route->link_list.push_back(info.first);
     }
 
     info = privateLinks_.at(linkOffset);
 
     if (use_lnk_up == false) {
-      route->link_list->push_back(info.second);
+      route->link_list.push_back(info.second);
       if (lat)
         *lat += info.second->latency();
     } else {
-      route->link_list->push_back(info.first);
+      route->link_list.push_back(info.first);
       if (lat)
         *lat += info.first->latency();
     }
index bf0c845..0cdad3d 100644 (file)
@@ -20,10 +20,10 @@ namespace routing {
 
 class XBT_PRIVATE TorusZone : public ClusterZone {
 public:
-  explicit TorusZone(NetZone* father, const char* name);
-  void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
+  explicit TorusZone(NetZone* father, std::string name);
+  void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position) override;
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
-  void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
+  void parse_specific_arguments(ClusterCreationArgs* cluster) override;
 
 private:
   std::vector<unsigned int> dimensions_;
index ddc4b6d..3d78b3a 100644 (file)
@@ -20,23 +20,26 @@ namespace routing {
 namespace vivaldi {
 simgrid::xbt::Extension<NetPoint, Coords> Coords::EXTENSION_ID;
 
-Coords::Coords(NetPoint* netpoint, const char* coordStr)
+Coords::Coords(NetPoint* netpoint, std::string coordStr)
 {
   if (not Coords::EXTENSION_ID.valid())
     Coords::EXTENSION_ID = NetPoint::extension_create<Coords>();
 
   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 str : string_values)
-    coords.push_back(xbt_str_parse_double(str.c_str(), "Invalid coordinate: %s"));
+  for (auto const& str : string_values)
+    try {
+      coords.push_back(std::stod(str));
+    } catch (std::invalid_argument const& ia) {
+      throw std::invalid_argument(std::string("Invalid coordinate: ") + ia.what());
+    }
   coords.shrink_to_fit();
 
   netpoint->extension_set<Coords>(this);
-  XBT_DEBUG("Coords of %s %p: %s", netpoint->cname(), netpoint, coordStr);
+  XBT_DEBUG("Coords of %s %p: %s", netpoint->getCname(), netpoint, coordStr.c_str());
 }
-Coords::~Coords() = default;
 }; // namespace vivaldi
 
 static inline double euclidean_dist_comp(int index, std::vector<double>* src, std::vector<double>* dst)
@@ -51,53 +54,61 @@ 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;
 }
-VivaldiZone::VivaldiZone(NetZone* father, const char* name) : ClusterZone(father, name)
+
+VivaldiZone::VivaldiZone(NetZone* father, std::string name) : ClusterZone(father, name)
 {
 }
 
-void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, const char* coord)
+void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, std::string coord)
 {
   xbt_assert(netpoint->netzone() == this, "Cannot add a peer link to a netpoint that is not in this netzone");
 
   new simgrid::kernel::routing::vivaldi::Coords(netpoint, coord);
 
-  std::string link_up   = "link_" + netpoint->name() + "_UP";
-  std::string link_down = "link_" + netpoint->name() + "_DOWN";
-  surf::LinkImpl* linkUp   = surf_network_model->createLink(link_up.c_str(), bw_out, 0, SURF_LINK_SHARED);
-  surf::LinkImpl* linkDown = surf_network_model->createLink(link_down.c_str(), bw_in, 0, SURF_LINK_SHARED);
+  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}});
 }
 
 void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
-  XBT_DEBUG("vivaldi getLocalRoute from '%s'[%d] '%s'[%d]", 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());
   }
 
   /* Retrieve the private links */
-  if (privateLinks_.find(src->id()) != privateLinks_.end()) {
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(src->id());
+  auto src_link = privateLinks_.find(src->id());
+  if (src_link != privateLinks_.end()) {
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = src_link->second;
     if (info.first) {
-      route->link_list->push_back(info.first);
+      route->link_list.push_back(info.first);
       if (lat)
         *lat += info.first->latency();
     }
+  } else {
+    XBT_DEBUG("Source of private link (%u) doesn't exist", src->id());
   }
-  if (privateLinks_.find(dst->id()) != privateLinks_.end()) {
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(dst->id());
+
+  auto dst_link = privateLinks_.find(dst->id());
+  if (dst_link != privateLinks_.end()) {
+    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = dst_link->second;
     if (info.second) {
-      route->link_list->push_back(info.second);
+      route->link_list.push_back(info.second);
       if (lat)
         *lat += info.second->latency();
     }
+  } else {
+    XBT_DEBUG("Destination of private link (%u) doesn't exist", dst->id());
   }
 
   /* Compute the extra latency due to the euclidean distance if needed */
index 9b7c9ff..64ea9bd 100644 (file)
@@ -45,9 +45,9 @@ namespace routing {
 
 class XBT_PRIVATE VivaldiZone : public ClusterZone {
 public:
-  explicit VivaldiZone(NetZone* father, const char* name);
+  explicit VivaldiZone(NetZone* father, std::string name);
 
-  void setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, const char* coord);
+  void setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, std::string coord);
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
 };
 
@@ -55,8 +55,8 @@ namespace vivaldi {
 class XBT_PRIVATE Coords {
 public:
   static simgrid::xbt::Extension<NetPoint, Coords> EXTENSION_ID;
-  explicit Coords(NetPoint* host, const char* str);
-  virtual ~Coords();
+  explicit Coords(NetPoint* host, std::string str);
+  virtual ~Coords() = default;
 
   std::vector<double> coords;
 };
index b60f938..c3a6357 100644 (file)
@@ -38,17 +38,15 @@ ChunkedData::ChunkedData(PageStore& store, AddressSpace& as,
       xbt_assert(simgrid::mc::mmu::split(page.address()).second == 0,
         "Not at the beginning of a page");
 
-        /* Adding another copy (and a syscall) will probably slow things a lot.
-           TODO, optimize this somehow (at least by grouping the syscalls)
-           if needed. Either:
-            - reduce the number of syscalls;
-            - let the application snapshot itself;
-            - move the segments in shared memory (this will break `fork` however).
-        */
-
-        as.read_bytes(
-          buffer.data(), xbt_pagesize, page,
-          simgrid::mc::ProcessIndexDisabled);
+      /* Adding another copy (and a syscall) will probably slow things a lot.
+         TODO, optimize this somehow (at least by grouping the syscalls)
+         if needed. Either:
+         - reduce the number of syscalls
+         - let the application snapshot itself
+         - move the segments in shared memory (this will break `fork` however)
+      */
+
+      as.read_bytes(buffer.data(), xbt_pagesize, page, simgrid::mc::ProcessIndexDisabled);
 
       pagenos_[i] = store_->store_page(buffer.data());
 
index 9652ea1..6263496 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* 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. */
@@ -38,7 +37,7 @@ public:
   ChunkedData() = default;
   void clear()
   {
-    for (std::size_t pageno : pagenos_)
+    for (std::size_t const& pageno : pagenos_)
       store_->unref_page(pageno);
     pagenos_.clear();
   }
@@ -51,16 +50,15 @@ public:
   ChunkedData(ChunkedData const& that)
      : store_ (that.store_)
      , pagenos_(that.pagenos_)
-
   {
-    for (std::size_t pageno : pagenos_)
+    for (std::size_t const& pageno : pagenos_)
       store_->ref_page(pageno);
   }
   ChunkedData(ChunkedData&& that)
+     : store_(that.store_)
+     , pagenos_(std::move(that.pagenos_))
   {
-    store_ = that.store_;
     that.store_ = nullptr;
-    pagenos_ = std::move(that.pagenos_);
     that.pagenos_.clear();
   }
   ChunkedData& operator=(ChunkedData const& that)
@@ -68,7 +66,7 @@ public:
     this->clear();
     store_ = that.store_;
     pagenos_ = that.pagenos_;
-    for (std::size_t pageno : pagenos_)
+    for (std::size_t const& pageno : pagenos_)
       store_->ref_page(pageno);
     return *this;
   }
index fe55a37..696d262 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,22 +9,21 @@
 
 #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;
 
 namespace simgrid {
 namespace dwarf {
 
-evaluation_error::~evaluation_error() noexcept(true) {}
-
 void execute(
   const Dwarf_Op* ops, std::size_t n,
   const ExpressionContext& context, ExpressionStack& stack)
@@ -32,6 +31,8 @@ void execute(
   for (size_t i = 0; i != n; ++i) {
     const Dwarf_Op *op = ops + i;
     std::uint8_t atom = op->atom;
+    intptr_t first;
+    intptr_t second;
 
     switch (atom) {
 
@@ -205,19 +206,17 @@ void execute(
       // and replace the top of the stack with the computed value
       // (stack.top() += stack.before_top()).
 
-    case DW_OP_plus: {
-      intptr_t first = stack.pop();
-      intptr_t second = stack.pop();
+    case DW_OP_plus:
+      first  = stack.pop();
+      second = stack.pop();
       stack.push(first + second);
       break;
-    }
 
-    case DW_OP_mul: {
-      intptr_t first = stack.pop();
-      intptr_t second = stack.pop();
+    case DW_OP_mul:
+      first  = stack.pop();
+      second = stack.pop();
       stack.push(first * second);
       break;
-    }
 
     case DW_OP_plus_uconst:
       stack.top() += op->number;
@@ -231,33 +230,29 @@ void execute(
       stack.top() = - (intptr_t) stack.top();
       break;
 
-    case DW_OP_minus: {
-      intptr_t first = stack.pop();
-      intptr_t second = stack.pop();
+    case DW_OP_minus:
+      first  = stack.pop();
+      second = stack.pop();
       stack.push(second - first);
       break;
-    }
 
-    case DW_OP_and: {
-      intptr_t first = stack.pop();
-      intptr_t second = stack.pop();
+    case DW_OP_and:
+      first  = stack.pop();
+      second = stack.pop();
       stack.push(first & second);
       break;
-    }
 
-    case DW_OP_or: {
-      intptr_t first = stack.pop();
-      intptr_t second = stack.pop();
+    case DW_OP_or:
+      first  = stack.pop();
+      second = stack.pop();
       stack.push(first | second);
       break;
-    }
 
-    case DW_OP_xor: {
-      intptr_t first = stack.pop();
-      intptr_t second = stack.pop();
+    case DW_OP_xor:
+      first  = stack.pop();
+      second = stack.pop();
       stack.push(first ^ second);
       break;
-    }
 
     case DW_OP_nop:
       break;
index 1bf89d8..19c5b14 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) {}
@@ -55,10 +56,9 @@ struct ExpressionContext {
 };
 
 /** When an error happens in the execution of a DWARF expression */
-class evaluation_error : std::runtime_error {
+class evaluation_error : public std::runtime_error {
 public:
-  evaluation_error(const char* what): std::runtime_error(what) {}
-  ~evaluation_error() noexcept(true);
+  explicit evaluation_error(const char* what) : std::runtime_error(what) {}
 };
 
 /** A stack for evaluating a DWARF expression
index 0ad9375..8bb4661 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2004-2015. 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. */
index 58b9fe2..807291e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2004-2015. 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. */
@@ -34,11 +33,13 @@ private:
   // By default, the expression is always valid:
   range_type range_ = {0, UINT64_MAX};
 public:
-  LocationListEntry() {}
+  LocationListEntry() = default;
   LocationListEntry(DwarfExpression expression, range_type range)
     : expression_(std::move(expression)), range_(range)
   {}
-  LocationListEntry(DwarfExpression expression) : expression_(std::move(expression)), range_({0, UINT64_MAX}) {}
+  explicit LocationListEntry(DwarfExpression expression) : expression_(std::move(expression)), range_({0, UINT64_MAX})
+  {
+  }
 
   DwarfExpression& expression()
   {
@@ -63,7 +64,8 @@ typedef std::vector<LocationListEntry> LocationList;
 class Location {
 private:
   void* memory_;
-  int register_id_;
+  int register_id_ = 0;
+
 public:
   explicit Location(void* x) : memory_(x) {}
   explicit Location(int register_id) : memory_(nullptr), register_id_(register_id) {}
index d5a8195..53ebd7e 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
 #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");
 
 ::simgrid::mc::ModelChecker* mc_model_checker = nullptr;
+extern std::string _sg_mc_dot_output_file;
 
 using simgrid::mc::remote;
 
@@ -96,7 +97,7 @@ void ModelChecker::start()
 
   process_->init();
 
-  if ((_sg_mc_dot_output_file != nullptr) && (_sg_mc_dot_output_file[0] != '\0'))
+  if (not _sg_mc_dot_output_file.empty())
     MC_init_dot_output();
 
   setup_ignore();
@@ -147,7 +148,7 @@ void ModelChecker::shutdown()
   simgrid::mc::RemoteClient* process = &this->process();
   if (process->running()) {
     XBT_DEBUG("Killing process");
-    kill(process->pid(), SIGTERM);
+    kill(process->pid(), SIGKILL);
     process->terminate();
   }
 }
@@ -175,7 +176,7 @@ static void MC_report_crash(int status)
     XBT_INFO("No core dump was generated by the system.");
   XBT_INFO("Counter-example execution trace:");
   simgrid::mc::dumpRecordPath();
-  for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
+  for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
     XBT_INFO("%s", s.c_str());
   simgrid::mc::session->logState();
   XBT_INFO("Stack trace:");
@@ -189,14 +190,14 @@ static void MC_report_assertion_error()
   XBT_INFO("**************************");
   XBT_INFO("Counter-example execution trace:");
   simgrid::mc::dumpRecordPath();
-  for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
+  for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
     XBT_INFO("%s", s.c_str());
   simgrid::mc::session->logState();
 }
 
 bool ModelChecker::handle_message(char* buffer, ssize_t size)
 {
-  mc_message_t base_message;
+  s_mc_message_t base_message;
   if (size < (ssize_t) sizeof(base_message))
     xbt_die("Broken message");
   memcpy(&base_message, buffer, sizeof(base_message));
@@ -375,13 +376,8 @@ void ModelChecker::handle_waitpid()
 
 void ModelChecker::on_signal(int signo)
 {
-  switch(signo) {
-  case SIGCHLD:
+  if (signo == SIGCHLD)
     this->handle_waitpid();
-    break;
-  default:
-    break;
-  }
 }
 
 void ModelChecker::wait_for_requests()
@@ -393,7 +389,7 @@ void ModelChecker::wait_for_requests()
 
 void ModelChecker::handle_simcall(Transition const& transition)
 {
-  s_mc_message_simcall_handle m;
+  s_mc_message_simcall_handle_t m;
   memset(&m, 0, sizeof(m));
   m.type  = MC_MESSAGE_SIMCALL_HANDLE;
   m.pid   = transition.pid;
@@ -409,7 +405,7 @@ bool ModelChecker::checkDeadlock()
   int res;
   if ((res = this->process().getChannel().send(MC_MESSAGE_DEADLOCK_CHECK)))
     xbt_die("Could not check deadlock state");
-  mc_message_int_t message;
+  s_mc_message_int_t message;
   ssize_t s = mc_model_checker->process().getChannel().receive(message);
   if (s == -1)
     xbt_die("Could not receive message");
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 015a60b..78d557f 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
@@ -17,7 +17,7 @@ namespace mc {
 
 /* For an executable object, addresses are virtual address
  * (there is no offset) i.e.
- * \f$\text{virtual address} = \{dwarf address}\f$;
+ * \f$\text{virtual address} = \{dwarf address}\f$
  *
  * For a shared object, the addreses are offset from the begining
  * of the shared object (the base address of the mapped shared
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 56c33d4..5f2d921 100644 (file)
@@ -1,11 +1,11 @@
-/* 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <cstring> // memcpy, memcmp
 #include <unistd.h>
-#include <string.h> // memcpy, memcmp
 
 #include <sys/mman.h>
 #ifdef __FreeBSD__
 
 #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");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc, "Logging specific to mc_page_snapshot");
 
 namespace simgrid {
 namespace mc {
@@ -50,18 +49,14 @@ static XBT_ALWAYS_INLINE PageStore::hash_type mc_hash_page(const void* data)
 
 // ***** snapshot_page_manager
 
-PageStore::PageStore(size_t size) :
-  memory_(nullptr), capacity_(0), top_index_(0)
+PageStore::PageStore(size_t size) : memory_(nullptr), capacity_(size), top_index_(0)
 {
-  // Using mmap in order to be able to expand the region
-  // by relocating it somewhere else in the virtual memory
-  // space:
+  // Using mmap in order to be able to expand the region by relocating it somewhere else in the virtual memory space:
   void* memory = ::mmap(nullptr, size << xbt_pagebits, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE, -1, 0);
   if (memory == MAP_FAILED)
     xbt_die("Could not mmap initial snapshot pages.");
 
   this->top_index_ = 0;
-  this->capacity_ = size;
   this->memory_ = memory;
   this->page_counts_.resize(size);
 }
@@ -143,7 +138,6 @@ std::size_t PageStore::alloc_page()
     size_t res = this->free_pages_[this->free_pages_.size() - 1];
     this->free_pages_.pop_back();
     return res;
-
   }
 }
 
@@ -160,29 +154,26 @@ std::size_t PageStore::store_page(void* page)
 {
   xbt_assert(top_index_ <= this->capacity_, "top_index is not consistent");
 
-  // First, we check if a page with the same content is already in the page
-  // store:
-  //  1. compute the hash of the page;
-  //  2. find pages with the same hash using `hash_index_`;
-  //  3. find a page with the same content.
+  // First, we check if a page with the same content is already in the page store:
+  //  1. compute the hash of the page
+  //  2. find pages with the same hash using `hash_index_`
+  //  3. find a page with the same content
   hash_type hash = mc_hash_page(page);
 
   // Try to find a duplicate in set of pages with the same hash:
   page_set_type& page_set = this->hash_index_[hash];
-  for (size_t pageno : page_set) {
+  for (size_t const& pageno : page_set) {
     const void* snapshot_page = this->get_page(pageno);
     if (memcmp(page, snapshot_page, xbt_pagesize) == 0) {
 
-      // If a page with the same content is already in the page store it is
-      // reused and its reference count is incremented.
+      // If a page with the same content is already in the page store it's reused and its refcount is incremented.
       page_counts_[pageno]++;
       return pageno;
 
     }
   }
 
-  // Otherwise, a new page is allocated in the page store and the content
-  // of the page is `memcpy()`-ed to this new page.
+  // Otherwise, a new page is allocated in the page store and the content of the page is `memcpy()`-ed to this new page.
   std::size_t pageno = alloc_page();
   xbt_assert(this->page_counts_[pageno]==0, "Allocated page is already used");
   void* snapshot_page = (void*) this->get_page(pageno);
@@ -227,8 +218,7 @@ XBT_TEST_UNIT("base", test_mc_page_store, "Test adding/removing pages in the sto
 
   xbt_test_add("Init");
   std::size_t pagesize = (size_t) getpagesize();
-  std::unique_ptr<PageStore> store
-    = std::unique_ptr<PageStore>(new simgrid::mc::PageStore(500));
+  std::unique_ptr<PageStore> store = std::unique_ptr<PageStore>(new simgrid::mc::PageStore(500));
   void* data = getpage();
   xbt_test_assert(store->size()==0, "Bad size");
 
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 104e8ff..69a40e1 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
@@ -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"
@@ -42,7 +42,7 @@ Buffer::Buffer(std::size_t size, Type type) : size_(size), type_(type)
 {
   switch(type_) {
   case Type::Malloc:
-    data_ = ::malloc(size_);
+    data_ = ::operator new(size_);
     break;
   case Type::Mmap:
     data_ = ::mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE, -1, 0);
@@ -62,7 +62,7 @@ void Buffer::clear() noexcept
 {
   switch(type_) {
   case Type::Malloc:
-    std::free(data_);
+    ::operator delete(data_);
     break;
   case Type::Mmap:
     if (munmap(data_, size_) != 0)
@@ -81,8 +81,8 @@ RegionSnapshot dense_region(
   void *start_addr, void* permanent_addr, size_t size)
 {
   // When KSM support is enables, we allocate memory using mmap:
-  // * we don't want to advise bits of the heap as mergable;
-  // * mmap gives data aligned on page boundaries which is merge friendly.
+  // * we don't want to advise bits of the heap as mergable
+  // * mmap gives data aligned on page boundaries which is merge friendly
   simgrid::mc::Buffer data;
   if (_sg_mc_ksm)
     data = Buffer::mmap(size);
index baa41dd..07baf1d 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2015. 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. */
@@ -45,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) {}
@@ -161,16 +160,16 @@ public:
   RegionSnapshot(RegionSnapshot const&) = default;
   RegionSnapshot& operator=(RegionSnapshot const&) = default;
   RegionSnapshot(RegionSnapshot&& that)
+      : region_type_(that.region_type_)
+      , storage_type_(that.storage_type_)
+      , object_info_(that.object_info_)
+      , start_addr_(that.start_addr_)
+      , size_(that.size_)
+      , permanent_addr_(that.permanent_addr_)
+      , flat_data_(std::move(that.flat_data_))
+      , page_numbers_(std::move(that.page_numbers_))
+      , privatized_regions_(std::move(that.privatized_regions_))
   {
-    region_type_ = that.region_type_;
-    storage_type_ = that.storage_type_;
-    object_info_ = that.object_info_;
-    start_addr_ = that.start_addr_;
-    size_ = that.size_;
-    permanent_addr_ = that.permanent_addr_;
-    flat_data_ = std::move(that.flat_data_);
-    page_numbers_ = std::move(that.page_numbers_);
-    privatized_regions_ = std::move(that.privatized_regions_);
     that.clear();
   }
   RegionSnapshot& operator=(RegionSnapshot&& that)
@@ -277,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 d38c528..a01cf12 100644 (file)
@@ -1,11 +1,11 @@
-/* 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <csignal>
 #include <fcntl.h>
-#include <signal.h>
 
 #include <functional>
 
 #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"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Session, mc, "Model-checker session");
+extern std::string _sg_mc_dot_output_file;
 
 namespace simgrid {
 namespace mc {
@@ -122,7 +123,7 @@ void Session::logState()
 {
   mc_model_checker->getChecker()->logState();
 
-  if ((_sg_mc_dot_output_file != nullptr) && (_sg_mc_dot_output_file[0] != '\0')) {
+  if (not _sg_mc_dot_output_file.empty()) {
     fprintf(dot_output, "}\n");
     fclose(dot_output);
   }
@@ -140,7 +141,7 @@ Session* Session::fork(std::function<void()> code)
   // process:
   int res;
   int sockets[2];
-  res = socketpair(AF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0, sockets);
+  res = socketpair(AF_LOCAL, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sockets);
   if (res == -1)
     throw simgrid::xbt::errno_error("Could not create socketpair");
 
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 308a584..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");
@@ -34,7 +34,7 @@ static int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::Visi
 }
 
 /** @brief Save the current state */
-VisitedState::VisitedState(unsigned long state_number)
+VisitedState::VisitedState(unsigned long state_number) : num(state_number)
 {
   simgrid::mc::RemoteClient* process = &(mc_model_checker->process());
   this->heap_bytes_used = mmalloc_get_bytes_used_remote(
@@ -44,14 +44,9 @@ VisitedState::VisitedState(unsigned long state_number)
   this->actors_count = mc_model_checker->process().actors().size();
 
   this->system_state = simgrid::mc::take_snapshot(state_number);
-  this->num = state_number;
   this->original_num = -1;
 }
 
-VisitedState::~VisitedState()
-{
-}
-
 void VisitedStates::prune()
 {
   while (states_.size() > (std::size_t)_sg_mc_max_visited_states) {
index 3665060..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;
@@ -25,7 +26,7 @@ struct XBT_PRIVATE VisitedState {
   int original_num = 0; // num field of the VisitedState to which I was declared equal to (used for dot_output)
 
   explicit VisitedState(unsigned long state_number);
-  ~VisitedState();
+  ~VisitedState() = default;
 };
 
 class XBT_PRIVATE VisitedStates {
index a685913..6f44f0c 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
@@ -21,26 +21,5 @@ Checker::Checker(Session& session) : session_(&session)
   mc_model_checker->setChecker(this);
 }
 
-Checker::~Checker()
-{
-}
-
-// virtual
-RecordTrace Checker::getRecordTrace()
-{
-  return {};
-}
-
-// virtual
-std::vector<std::string> Checker::getTextualTrace()
-{
-  return {};
-}
-
-// virtual
-void Checker::logState()
-{
-}
-
 }
 }
index ce27ab2..d69ba24 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 {
@@ -40,7 +40,7 @@ public:
   Checker(Checker const&) = delete;
   Checker& operator=(Checker const&) = delete;
 
-  virtual ~Checker();
+  virtual ~Checker() = default;
 
   /** Main function of this algorithm */
   virtual void run() = 0;
@@ -52,13 +52,13 @@ public:
   /** Show the current trace/stack
    *
    *  Could this be handled in the Session/ModelChecker instead? */
-  virtual RecordTrace getRecordTrace();
+  virtual RecordTrace getRecordTrace() = 0;
 
   /** Generate a textual execution trace of the simulated application */
-  virtual std::vector<std::string> getTextualTrace();
+  virtual std::vector<std::string> getTextualTrace() = 0;
 
   /** Log additional information about the state of the model-checker */
-  virtual void logState();
+  virtual void logState() = 0;
 
 protected:
   Session& getSession() { return *session_; }
index fad3f3a..955a2f2 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"
@@ -67,25 +67,25 @@ static char* print_determinism_result(e_mc_comm_pattern_difference_t diff, int p
 
   switch(diff) {
   case TYPE_DIFF:
-    res = bprintf("%s Different type for communication #%d", type, cursor);
+    res = bprintf("%s Different type for communication #%u", type, cursor);
     break;
   case RDV_DIFF:
-    res = bprintf("%s Different rdv for communication #%d", type, cursor);
+    res = bprintf("%s Different rdv for communication #%u", type, cursor);
     break;
   case TAG_DIFF:
-    res = bprintf("%s Different tag for communication #%d", type, cursor);
+    res = bprintf("%s Different tag for communication #%u", type, cursor);
     break;
   case SRC_PROC_DIFF:
-      res = bprintf("%s Different source for communication #%d", type, cursor);
+    res = bprintf("%s Different source for communication #%u", type, cursor);
     break;
   case DST_PROC_DIFF:
-      res = bprintf("%s Different destination for communication #%d", type, cursor);
+    res = bprintf("%s Different destination for communication #%u", type, cursor);
     break;
   case DATA_SIZE_DIFF:
-    res = bprintf("%s\n Different data size for communication #%d", type, cursor);
+    res = bprintf("%s\n Different data size for communication #%u", type, cursor);
     break;
   case DATA_DIFF:
-    res = bprintf("%s\n Different data for communication #%d", type, cursor);
+    res = bprintf("%s\n Different data for communication #%u", type, cursor);
     break;
   default:
     res = nullptr;
@@ -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);
@@ -314,7 +316,6 @@ std::vector<std::string> CommunicationDeterminismChecker::getTextualTrace() // o
 
 void CommunicationDeterminismChecker::logState() // override
 {
-  Checker::logState();
   if (_sg_mc_comms_determinism && not this->recv_deterministic && this->send_deterministic) {
     XBT_INFO("******************************************************");
     XBT_INFO("**** Only-send-deterministic communication pattern ****");
@@ -390,7 +391,6 @@ void CommunicationDeterminismChecker::restoreState()
   /* Restore the initial state */
   simgrid::mc::session->restoreInitialState();
 
-  // int n = xbt_dynar_length(incomplete_communications_pattern);
   unsigned n = MC_smx_get_maxpid();
   assert(n == xbt_dynar_length(incomplete_communications_pattern));
   assert(n == xbt_dynar_length(initial_communications_pattern));
@@ -436,14 +436,18 @@ void CommunicationDeterminismChecker::main()
     simgrid::mc::State* state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth = %zi (state = %d, interleaved processes = %zd)", stack_.size(), state->num,
+    XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), state->num,
               state->interleaveSize());
 
     /* Update statistics */
     mc_model_checker->visited_states++;
 
-    if (stack_.size() <= (std::size_t)_sg_mc_max_depth && (req = MC_state_get_request(state)) != nullptr &&
-        (visited_state == nullptr)) {
+    if (stack_.size() <= (std::size_t)_sg_mc_max_depth)
+      req = MC_state_get_request(state);
+    else
+      req = nullptr;
+
+    if (req != nullptr && visited_state == nullptr) {
 
       int req_num = state->transition.argument;
 
@@ -481,9 +485,12 @@ void CommunicationDeterminismChecker::main()
        * with the initial pattern. */
       bool compare_snapshots = all_communications_are_finished() && this->initial_communications_pattern_done;
 
-      if (_sg_mc_max_visited_states == 0 ||
-          (visited_state = visitedStates_.addVisitedState(expandedStatesCount_, next_state.get(), compare_snapshots)) ==
-              nullptr) {
+      if (_sg_mc_max_visited_states != 0)
+        visited_state = visitedStates_.addVisitedState(expandedStatesCount_, next_state.get(), compare_snapshots);
+      else
+        visited_state = nullptr;
+
+      if (visited_state == nullptr) {
 
         /* Get enabled actors and insert them in the interleave set of the next state */
         for (auto& actor : mc_model_checker->process().actors())
@@ -508,13 +515,13 @@ void CommunicationDeterminismChecker::main()
         XBT_DEBUG("State already visited (equal to state %d), exploration stopped on this path.",
             visited_state->original_num == -1 ? visited_state->num : visited_state->original_num);
       else
-        XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size());
+        XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size());
 
       if (not this->initial_communications_pattern_done)
         this->initial_communications_pattern_done = 1;
 
       /* Trash the current state, no longer needed */
-      XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size());
+      XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size());
       stack_.pop_back();
 
       visited_state = nullptr;
@@ -522,7 +529,7 @@ void CommunicationDeterminismChecker::main()
       /* Check for deadlocks */
       if (mc_model_checker->checkDeadlock()) {
         MC_show_deadlock();
-        throw new simgrid::mc::DeadlockError();
+        throw simgrid::mc::DeadlockError();
       }
 
       while (not stack_.empty()) {
@@ -530,16 +537,16 @@ void CommunicationDeterminismChecker::main()
         stack_.pop_back();
         if (state->interleaveSize() && stack_.size() < (std::size_t)_sg_mc_max_depth) {
           /* We found a back-tracking point, let's loop */
-          XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1);
+          XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
           stack_.push_back(std::move(state));
 
           this->restoreState();
 
-          XBT_DEBUG("Back-tracking to state %d at depth %zi done", stack_.back()->num, stack_.size());
+          XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size());
 
           break;
         } else {
-          XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size() + 1);
+          XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1);
         }
       }
     }
index 01ab0ac..cf35963 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2011-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2011-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/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_replay.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_private.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_replay.hpp"
+#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");
+extern std::string _sg_mc_property_file;
 
 /********* Static functions *********/
 
 namespace simgrid {
 namespace mc {
 
-VisitedPair::VisitedPair(
-  int pair_num, xbt_automaton_state_t automaton_state,
-  std::shared_ptr<const std::vector<int>> atomic_propositions,
-  std::shared_ptr<simgrid::mc::State> graph_state)
+VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t automaton_state,
+                         std::shared_ptr<const std::vector<int>> atomic_propositions,
+                         std::shared_ptr<simgrid::mc::State> graph_state)
+    : num(pair_num), automaton_state(automaton_state)
 {
   simgrid::mc::RemoteClient* process = &(mc_model_checker->process());
 
   this->graph_state = std::move(graph_state);
   if(this->graph_state->system_state == nullptr)
     this->graph_state->system_state = simgrid::mc::take_snapshot(pair_num);
-  this->heap_bytes_used = mmalloc_get_bytes_used_remote(
-    process->get_heap()->heaplimit,
-    process->get_malloc_info());
+  this->heap_bytes_used = mmalloc_get_bytes_used_remote(process->get_heap()->heaplimit, process->get_malloc_info());
 
   this->actors_count = mc_model_checker->process().actors().size();
 
-  this->automaton_state = automaton_state;
-  this->num = pair_num;
   this->other_num = -1;
   this->atomic_propositions = std::move(atomic_propositions);
 }
@@ -80,6 +76,7 @@ static bool evaluate_label(xbt_automaton_exp_label_t l, std::vector<int> const&
           return values[cursor] != 0;
       }
       xbt_die("Missing predicate");
+      break;
     }
   case xbt_automaton_exp_label::AUT_ONE:
     return true;
@@ -270,7 +267,6 @@ RecordTrace LivenessChecker::getRecordTrace() // override
 
 void LivenessChecker::logState() // override
 {
-  Checker::logState();
   XBT_INFO("Expanded pairs = %lu", expandedPairsCount_);
   XBT_INFO("Visited pairs = %lu", visitedPairsCount_);
   XBT_INFO("Executed transitions = %lu", mc_model_checker->executed_transitions);
@@ -283,10 +279,10 @@ void LivenessChecker::showAcceptanceCycle(std::size_t depth)
   XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
   XBT_INFO("Counter-example that violates formula :");
   simgrid::mc::dumpRecordPath();
-  for (auto& s : this->getTextualTrace())
+  for (auto const& s : this->getTextualTrace())
     XBT_INFO("%s", s.c_str());
   simgrid::mc::session->logState();
-  XBT_INFO("Counter-example depth : %zd", depth);
+  XBT_INFO("Counter-example depth : %zu", depth);
 }
 
 std::vector<std::string> LivenessChecker::getTextualTrace() // override
@@ -305,7 +301,8 @@ std::vector<std::string> LivenessChecker::getTextualTrace() // override
 std::shared_ptr<Pair> LivenessChecker::newPair(Pair* current_pair, xbt_automaton_state_t state,
                                                std::shared_ptr<const std::vector<int>> propositions)
 {
-  std::shared_ptr<Pair> next_pair = std::make_shared<Pair>(++expandedPairsCount_);
+  expandedPairsCount_++;
+  std::shared_ptr<Pair> next_pair = std::make_shared<Pair>(expandedPairsCount_);
   next_pair->automaton_state      = state;
   next_pair->graph_state          = std::shared_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
   next_pair->atomic_propositions  = std::move(propositions);
@@ -350,8 +347,8 @@ void LivenessChecker::backtrack()
 
 void LivenessChecker::run()
 {
-  XBT_INFO("Check the liveness property %s", _sg_mc_property_file);
-  MC_automaton_load(_sg_mc_property_file);
+  XBT_INFO("Check the liveness property %s", _sg_mc_property_file.c_str());
+  MC_automaton_load(_sg_mc_property_file.c_str());
 
   XBT_DEBUG("Starting the liveness algorithm");
   simgrid::mc::session->initialize();
@@ -376,11 +373,10 @@ void LivenessChecker::run()
     /* Update current state in buchi automaton */
     simgrid::mc::property_automaton->current_state = current_pair->automaton_state;
 
-    XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d, interleave size = %zd, pair_num = %d, requests = %d)",
-       current_pair->depth, current_pair->search_cycle,
-       current_pair->graph_state->interleaveSize(),
-       current_pair->num,
-       current_pair->requests);
+    XBT_DEBUG(
+        "********************* ( Depth = %d, search_cycle = %d, interleave size = %zu, pair_num = %d, requests = %d)",
+        current_pair->depth, current_pair->search_cycle, current_pair->graph_state->interleaveSize(), current_pair->num,
+        current_pair->requests);
 
     if (current_pair->requests == 0) {
       this->backtrack();
@@ -388,26 +384,28 @@ void LivenessChecker::run()
     }
 
     std::shared_ptr<VisitedPair> reached_pair;
-    if (current_pair->automaton_state->type == 1 && not current_pair->exploration_started &&
-        (reached_pair = this->insertAcceptancePair(current_pair.get())) == nullptr) {
-      this->showAcceptanceCycle(current_pair->depth);
-      throw simgrid::mc::LivenessError();
+    if (current_pair->automaton_state->type == 1 && not current_pair->exploration_started) {
+      reached_pair = this->insertAcceptancePair(current_pair.get());
+      if (reached_pair == nullptr) {
+        this->showAcceptanceCycle(current_pair->depth);
+        throw simgrid::mc::LivenessError();
+      }
     }
 
     /* Pair already visited ? stop the exploration on the current path */
-    int visited_num = -1;
-    if ((not current_pair->exploration_started) &&
-        (visited_num = this->insertVisitedPair(reached_pair, current_pair.get())) != -1) {
-      if (dot_output != nullptr){
-        fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n",
-          this->previousPair_, visited_num,
-          this->previousRequest_.c_str());
-        fflush(dot_output);
+    if (not current_pair->exploration_started) {
+      int visited_num = this->insertVisitedPair(reached_pair, current_pair.get());
+      if (visited_num != -1) {
+        if (dot_output != nullptr) {
+          fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", this->previousPair_, visited_num,
+                  this->previousRequest_.c_str());
+          fflush(dot_output);
+        }
+        XBT_DEBUG("Pair already visited (equal to pair %d), exploration on the current path stopped.", visited_num);
+        current_pair->requests = 0;
+        this->backtrack();
+        continue;
       }
-      XBT_DEBUG("Pair already visited (equal to pair %d), exploration on the current path stopped.", visited_num);
-      current_pair->requests = 0;
-      this->backtrack();
-      continue;
     }
 
     smx_simcall_t req = MC_state_get_request(current_pair->graph_state.get());
index 2722fc5..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,11 +41,12 @@ struct XBT_PRIVATE Pair {
   Pair& operator=(Pair const&) = delete;
 };
 
-struct XBT_PRIVATE VisitedPair {
-  int num = 0;
+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 */
-  xbt_automaton_state_t automaton_state = nullptr;
+  xbt_automaton_state_t automaton_state;
   std::shared_ptr<const std::vector<int>> atomic_propositions;
   std::size_t heap_bytes_used = 0;
   int actors_count            = 0;
@@ -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 7906265..8bad4a5 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"
 
@@ -48,7 +48,7 @@ void SafetyChecker::checkNonTermination(simgrid::mc::State* current_state)
       XBT_INFO("*** NON-PROGRESSIVE CYCLE DETECTED ***");
       XBT_INFO("******************************************");
       XBT_INFO("Counter-example execution trace:");
-      for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
+      for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
         XBT_INFO("%s", s.c_str());
       simgrid::mc::session->logState();
 
@@ -79,7 +79,6 @@ std::vector<std::string> SafetyChecker::getTextualTrace() // override
 
 void SafetyChecker::logState() // override
 {
-  Checker::logState();
   XBT_INFO("Expanded states = %lu", expandedStatesCount_);
   XBT_INFO("Visited states = %lu", mc_model_checker->visited_states);
   XBT_INFO("Executed transitions = %lu", mc_model_checker->executed_transitions);
@@ -97,8 +96,8 @@ void SafetyChecker::run()
     simgrid::mc::State* state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth=%zi (state=%p, num %d)(%zu interleave)",
-      stack_.size(), state, state->num, state->interleaveSize());
+    XBT_DEBUG("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num,
+              state->interleaveSize());
 
     mc_model_checker->visited_states++;
 
@@ -125,7 +124,7 @@ void SafetyChecker::run()
     // req is now the transition of the process that was selected to be executed
 
     if (req == nullptr) {
-      XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size() + 1);
+      XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size() + 1);
 
       this->backtrack();
       continue;
@@ -259,15 +258,13 @@ void SafetyChecker::backtrack()
     if (state->interleaveSize()
         && stack_.size() < (std::size_t) _sg_mc_max_depth) {
       /* We found a back-tracking point, let's loop */
-      XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1);
+      XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
       stack_.push_back(std::move(state));
       this->restoreState();
-      XBT_DEBUG("Back-tracking to state %d at depth %zi done",
-        stack_.back()->num, stack_.size());
+      XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size());
       break;
     } else {
-      XBT_DEBUG("Delete state %d at depth %zi",
-        state->num, stack_.size() + 1);
+      XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1);
     }
   }
 }
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 ffcff71..277dead 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
 #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");
+extern std::string _sg_mc_property_file;
 
 static inline
 char** argvdup(int argc, char** argv)
 {
-  char** argv_copy = xbt_new(char*, argc+1);
+  char** argv_copy = new char*[argc + 1];
   std::memcpy(argv_copy, argv, sizeof(char*) * argc);
   argv_copy[argc] = nullptr;
   return argv_copy;
 }
 
-static
-std::unique_ptr<simgrid::mc::Checker> createChecker(simgrid::mc::Session& session)
+static std::unique_ptr<simgrid::mc::Checker> createChecker(simgrid::mc::Session& session)
 {
   if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
-    return std::unique_ptr<simgrid::mc::Checker>(
-      simgrid::mc::createCommunicationDeterminismChecker(session));
-  else if (_sg_mc_property_file == nullptr || _sg_mc_property_file[0] == '\0')
-    return std::unique_ptr<simgrid::mc::Checker>(
-      simgrid::mc::createSafetyChecker(session));
+    return std::unique_ptr<simgrid::mc::Checker>(simgrid::mc::createCommunicationDeterminismChecker(session));
+  else if (_sg_mc_property_file.empty())
+    return std::unique_ptr<simgrid::mc::Checker>(simgrid::mc::createSafetyChecker(session));
   else
-    return std::unique_ptr<simgrid::mc::Checker>(
-      simgrid::mc::createLivenessChecker(session));
+    return std::unique_ptr<simgrid::mc::Checker>(simgrid::mc::createLivenessChecker(session));
 }
 
 int main(int argc, char** argv)
 {
   using simgrid::mc::Session;
+  XBT_LOG_CONNECT(mc_main);
 
   try {
     if (argc < 2)
@@ -73,7 +71,7 @@ int main(int argc, char** argv)
 
     std::unique_ptr<Session> session =
       std::unique_ptr<Session>(Session::spawnvp(argv_copy[1], argv_copy+1));
-    free(argv_copy);
+    delete[] argv_copy;
 
     simgrid::mc::session = session.get();
     std::unique_ptr<simgrid::mc::Checker> checker = createChecker(*session);
index fabd66b..ab4bc29 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");
 
@@ -70,21 +67,21 @@ using simgrid::mc::remote;
 namespace simgrid {
 namespace mc {
 
-struct HeapLocation {
-  int block = 0;
-  int fragment = 0;
+class HeapLocation {
+public:
+  int block_    = 0;
+  int fragment_ = 0;
 
-  HeapLocation() {}
-  HeapLocation(int block, int fragment = 0) : block(block), fragment(fragment) {}
+  HeapLocation() = default;
+  HeapLocation(int block, int fragment = 0) : block_(block), fragment_(fragment) {}
 
   bool operator==(HeapLocation const& that) const
   {
-    return block == that.block && fragment == that.fragment;
+    return block_ == that.block_ && fragment_ == that.fragment_;
   }
   bool operator<(HeapLocation const& that) const
   {
-    return std::make_pair(block, fragment)
-      < std::make_pair(that.block, that.fragment);
+    return std::make_pair(block_, fragment_) < std::make_pair(that.block_, that.fragment_);
   }
 };
 
@@ -97,18 +94,20 @@ HeapLocationPair makeHeapLocationPair(int block1, int fragment1, int block2, int
   }};
 }
 
-struct HeapArea : public HeapLocation {
-  bool valid = false;
-  int block = 0;
-  int fragment = 0;
-  HeapArea() {}
-  HeapArea(int block)
-    : valid(true), block(block) {}
-  HeapArea(int block, int fragment = 0)
-    : valid(true), block(block), fragment(fragment) {}
+class HeapArea : public HeapLocation {
+public:
+  bool valid_ = false;
+  HeapArea() = default;
+  explicit HeapArea(int block) : valid_(true) { block_ = block; }
+  HeapArea(int block, int fragment) : valid_(true)
+  {
+    block_    = block;
+    fragment_ = fragment;
+  }
 };
 
-struct ProcessComparisonState {
+class ProcessComparisonState {
+public:
   std::vector<simgrid::mc::IgnoredHeapRegion>* to_ignore = nullptr;
   std::vector<HeapArea> equals_to;
   std::vector<simgrid::mc::Type*> types;
@@ -123,22 +122,23 @@ namespace {
  *
  *  It can hash pairs: the standard hash currently doesn't include this.
  */
-template<class X> struct hash : public std::hash<X> {};
+template <class X> class hash : public std::hash<X> {
+};
 
-template<class X, class Y>
-struct hash<std::pair<X,Y>> {
+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);
   }
 };
 
 }
 
-
-struct StateComparator {
+class StateComparator {
+public:
   s_xbt_mheap_t std_heap_copy;
   std::size_t heaplimit;
   std::array<ProcessComparisonState, 2> processStates;
@@ -197,8 +197,7 @@ struct StateComparator {
    */
   bool blocksEqual(int b1, int b2) const
   {
-    return this->equals_to1_(b1, 0).block == b2
-        && this->equals_to2_(b2, 0).block == b1;
+    return this->equals_to1_(b1, 0).block_ == b2 && this->equals_to2_(b2, 0).block_ == b1;
   }
 
   /** Check whether two fragments are known to be matching
@@ -211,10 +210,8 @@ struct StateComparator {
    */
   int fragmentsEqual(int b1, int f1, int b2, int f2) const
   {
-    return this->equals_to1_(b1, f1).block == b2
-        && this->equals_to1_(b1, f1).fragment == f2
-        && this->equals_to2_(b2, f2).block == b1
-        && this->equals_to2_(b2, f2).fragment == f1;
+    return this->equals_to1_(b1, f1).block_ == b2 && this->equals_to1_(b1, f1).fragment_ == f2 &&
+           this->equals_to2_(b2, f2).block_ == b1 && this->equals_to2_(b2, f2).fragment_ == f1;
   }
 
   void match_equals(HeapLocationPairs* list);
@@ -269,12 +266,12 @@ namespace mc {
 void StateComparator::match_equals(HeapLocationPairs* list)
 {
   for (auto const& pair : *list) {
-    if (pair[0].fragment != -1) {
-      this->equals_to1_(pair[0].block, pair[0].fragment) = simgrid::mc::HeapArea(pair[1].block, pair[1].fragment);
-      this->equals_to2_(pair[1].block, pair[1].fragment) = simgrid::mc::HeapArea(pair[0].block, pair[0].fragment);
+    if (pair[0].fragment_ != -1) {
+      this->equals_to1_(pair[0].block_, pair[0].fragment_) = simgrid::mc::HeapArea(pair[1].block_, pair[1].fragment_);
+      this->equals_to2_(pair[1].block_, pair[1].fragment_) = simgrid::mc::HeapArea(pair[0].block_, pair[0].fragment_);
     } else {
-      this->equals_to1_(pair[0].block, 0) = simgrid::mc::HeapArea(pair[1].block, pair[1].fragment);
-      this->equals_to2_(pair[1].block, 0) = simgrid::mc::HeapArea(pair[0].block, pair[0].fragment);
+      this->equals_to1_(pair[0].block_, 0) = simgrid::mc::HeapArea(pair[1].block_, pair[1].fragment_);
+      this->equals_to2_(pair[1].block_, 0) = simgrid::mc::HeapArea(pair[0].block_, pair[0].fragment_);
     }
   }
 }
@@ -306,7 +303,7 @@ int StateComparator::initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2,
 static inline
 mc_mem_region_t MC_get_heap_region(simgrid::mc::Snapshot* snapshot)
 {
-  for (auto& region : snapshot->snapshot_regions)
+  for (auto const& region : snapshot->snapshot_regions)
     if (region->region_type() == simgrid::mc::RegionType::Heap)
       return region.get();
   xbt_die("No heap region");
@@ -331,7 +328,6 @@ int mmalloc_compare_heap(
   int nb_diff1 = 0;
   int nb_diff2 = 0;
   int equal;
-  int res_compare = 0;
 
   /* Check busy blocks */
   i1 = 1;
@@ -380,21 +376,19 @@ int mmalloc_compare_heap(
         continue;
       }
 
-      if (state.equals_to1_(i1, 0).valid) {
+      if (state.equals_to1_(i1, 0).valid_) {
         i1++;
         continue;
       }
 
       i2          = 1;
       equal       = 0;
-      res_compare = 0;
 
       /* Try first to associate to same block in the other heap */
-      if (heapinfo2->type == heapinfo1->type
-        && state.equals_to2_(i1, 0).valid == 0) {
+      if (heapinfo2->type == heapinfo1->type && state.equals_to2_(i1, 0).valid_ == 0) {
         addr_block2 = (ADDR2UINT(i1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
-        res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_block1, addr_block2, snapshot1,
-                                        snapshot2, nullptr, nullptr, 0);
+        int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_block1, addr_block2,
+                                            snapshot1, snapshot2, nullptr, nullptr, 0);
         if (res_compare != 1) {
           for (k = 1; k < heapinfo2->busy_block.size; k++)
             state.equals_to2_(i1 + k, 0) = HeapArea(i1, -1);
@@ -421,14 +415,13 @@ int mmalloc_compare_heap(
           continue;
         }
 
-        if (state.equals_to2_(i2, 0).valid) {
+        if (state.equals_to2_(i2, 0).valid_) {
           i2++;
           continue;
         }
 
-        res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing,
-            addr_block1, addr_block2, snapshot1, snapshot2,
-            nullptr, nullptr, 0);
+        int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_block1, addr_block2,
+                                            snapshot1, snapshot2, nullptr, nullptr, 0);
 
         if (res_compare != 1) {
           for (k = 1; k < heapinfo2b->busy_block.size; k++)
@@ -446,17 +439,16 @@ int mmalloc_compare_heap(
         XBT_DEBUG("Block %zu not found (size_used = %zu, addr = %p)", i1, heapinfo1->busy_block.busy_size, addr_block1);
         i1 = state.heaplimit + 1;
         nb_diff1++;
-        //i1++;
       }
 
     } else {                    /* Fragmented block */
 
       for (j1 = 0; j1 < (size_t) (BLOCKSIZE >> heapinfo1->type); j1++) {
 
-        if (heapinfo1->busy_frag.frag_size[j1] == -1) /* Free fragment */
+        if (heapinfo1->busy_frag.frag_size[j1] == -1) /* Free fragment_ */
           continue;
 
-        if (state.equals_to1_(i1, j1).valid)
+        if (state.equals_to1_(i1, j1).valid_)
           continue;
 
         addr_frag1 = (void*)((char*)addr_block1 + (j1 << heapinfo1->type));
@@ -464,15 +456,15 @@ int mmalloc_compare_heap(
         i2 = 1;
         equal = 0;
 
-        /* Try first to associate to same fragment in the other heap */
-        if (heapinfo2->type == heapinfo1->type && not state.equals_to2_(i1, j1).valid) {
+        /* Try first to associate to same fragment_ in the other heap */
+        if (heapinfo2->type == heapinfo1->type && not state.equals_to2_(i1, j1).valid_) {
           addr_block2 = (ADDR2UINT(i1) - 1) * BLOCKSIZE +
                          (char *) state.std_heap_copy.heapbase;
           addr_frag2 =
               (void *) ((char *) addr_block2 +
                         (j1 << heapinfo2->type));
-          res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2, snapshot1,
-                                          snapshot2, nullptr, nullptr, 0);
+          int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2,
+                                              snapshot1, snapshot2, nullptr, nullptr, 0);
           if (res_compare != 1)
             equal = 1;
         }
@@ -505,14 +497,14 @@ int mmalloc_compare_heap(
             if (i2 == i1 && j2 == j1)
               continue;
 
-            if (state.equals_to2_(i2, j2).valid)
+            if (state.equals_to2_(i2, j2).valid_)
               continue;
 
             addr_block2 = (ADDR2UINT(i2) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
             addr_frag2  = (void*)((char*)addr_block2 + (j2 << heapinfo2b->type));
 
-            res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2, snapshot2,
-                                            snapshot2, nullptr, nullptr, 0);
+            int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2,
+                                                snapshot2, snapshot2, nullptr, nullptr, 0);
             if (res_compare != 1) {
               equal = 1;
               break;
@@ -523,9 +515,8 @@ int mmalloc_compare_heap(
         }
 
         if (not equal) {
-          XBT_DEBUG("Block %zu, fragment %zu not found (size_used = %zd, address = %p)\n", i1, j1,
+          XBT_DEBUG("Block %zu, fragment_ %zu not found (size_used = %zd, address = %p)\n", i1, j1,
                     heapinfo1->busy_frag.frag_size[j1], addr_frag1);
-          i2 = state.heaplimit + 1;
           i1 = state.heaplimit + 1;
           nb_diff1++;
           break;
@@ -536,7 +527,7 @@ int mmalloc_compare_heap(
     }
   }
 
-  /* All blocks/fragments are equal to another block/fragment ? */
+  /* All blocks/fragments are equal to another block/fragment_ ? */
   size_t i = 1;
   size_t j = 0;
 
@@ -545,7 +536,7 @@ int mmalloc_compare_heap(
       heap_region1, &heapinfo_temp1, &heapinfos1[i], sizeof(malloc_info));
 
     if (heapinfo1->type == MMALLOC_TYPE_UNFRAGMENTED && i1 == state.heaplimit && heapinfo1->busy_block.busy_size > 0 &&
-        not state.equals_to1_(i, 0).valid) {
+        not state.equals_to1_(i, 0).valid_) {
       XBT_DEBUG("Block %zu not found (size used = %zu)", i, heapinfo1->busy_block.busy_size);
       nb_diff1++;
     }
@@ -553,7 +544,7 @@ int mmalloc_compare_heap(
     if (heapinfo1->type <= 0)
       continue;
     for (j = 0; j < (size_t) (BLOCKSIZE >> heapinfo1->type); j++)
-      if (i1 == state.heaplimit && heapinfo1->busy_frag.frag_size[j] > 0 && not state.equals_to1_(i, j).valid) {
+      if (i1 == state.heaplimit && heapinfo1->busy_frag.frag_size[j] > 0 && not state.equals_to1_(i, j).valid_) {
         XBT_DEBUG("Block %zu, Fragment %zu not found (size used = %zd)", i, j, heapinfo1->busy_frag.frag_size[j]);
         nb_diff1++;
       }
@@ -566,7 +557,7 @@ int mmalloc_compare_heap(
     const malloc_info* heapinfo2 = (const malloc_info*) MC_region_read(
       heap_region2, &heapinfo_temp2, &heapinfos2[i], sizeof(malloc_info));
     if (heapinfo2->type == MMALLOC_TYPE_UNFRAGMENTED && i1 == state.heaplimit && heapinfo2->busy_block.busy_size > 0 &&
-        not state.equals_to2_(i, 0).valid) {
+        not state.equals_to2_(i, 0).valid_) {
       XBT_DEBUG("Block %zu not found (size used = %zu)", i,
                 heapinfo2->busy_block.busy_size);
       nb_diff2++;
@@ -576,7 +567,7 @@ int mmalloc_compare_heap(
       continue;
 
     for (j = 0; j < (size_t) (BLOCKSIZE >> heapinfo2->type); j++)
-      if (i1 == state.heaplimit && heapinfo2->busy_frag.frag_size[j] > 0 && not state.equals_to2_(i, j).valid) {
+      if (i1 == state.heaplimit && heapinfo2->busy_frag.frag_size[j] > 0 && not state.equals_to2_(i, j).valid_) {
         XBT_DEBUG("Block %zu, Fragment %zu not found (size used = %zd)",
           i, j, heapinfo2->busy_frag.frag_size[j]);
         nb_diff2++;
@@ -694,204 +685,179 @@ static int compare_heap_area_with_type(
   int area_size, int check_ignore,
   int pointer_level)
 {
-top:
-
-  // HACK: This should not happen but in pratice, there are some
-  // DW_TAG_typedef without an associated DW_AT_type:
-  //<1><538832>: Abbrev Number: 111 (DW_TAG_typedef)
-  //    <538833>   DW_AT_name        : (indirect string, offset: 0x2292f3): gregset_t
-  //    <538837>   DW_AT_decl_file   : 98
-  //    <538838>   DW_AT_decl_line   : 37
-  if (type == nullptr)
-    return 0;
-
-  if (is_stack(real_area1) && is_stack(real_area2))
-    return 0;
+  do {
+
+    // HACK: This should not happen but in pratice, there are some
+    // DW_TAG_typedef without an associated DW_AT_type:
+    //<1><538832>: Abbrev Number: 111 (DW_TAG_typedef)
+    //    <538833>   DW_AT_name        : (indirect string, offset: 0x2292f3): gregset_t
+    //    <538837>   DW_AT_decl_file   : 98
+    //    <538838>   DW_AT_decl_line   : 37
+    if (type == nullptr)
+      return 0;
 
-  if (check_ignore > 0) {
-    ssize_t ignore1 = heap_comparison_ignore_size(
-      state.processStates[0].to_ignore, real_area1);
-    if (ignore1 > 0
-        && heap_comparison_ignore_size(
-          state.processStates[1].to_ignore, real_area2) == ignore1)
+    if (is_stack(real_area1) && is_stack(real_area2))
       return 0;
-  }
 
-  simgrid::mc::Type* subtype;
-  simgrid::mc::Type* subsubtype;
-  int res;
-  int elm_size;
-  const void* addr_pointed1;
-  const void* addr_pointed2;
+    if (check_ignore > 0) {
+      ssize_t ignore1 = heap_comparison_ignore_size(state.processStates[0].to_ignore, real_area1);
+      if (ignore1 > 0 && heap_comparison_ignore_size(state.processStates[1].to_ignore, real_area2) == ignore1)
+        return 0;
+    }
 
-  mc_mem_region_t heap_region1 = MC_get_heap_region(snapshot1);
-  mc_mem_region_t heap_region2 = MC_get_heap_region(snapshot2);
+    simgrid::mc::Type* subtype;
+    simgrid::mc::Type* subsubtype;
+    int res;
+    int elm_size;
+    const void* addr_pointed1;
+    const void* addr_pointed2;
 
-  switch (type->type) {
-  case DW_TAG_unspecified_type:
-    return 1;
+    mc_mem_region_t heap_region1 = MC_get_heap_region(snapshot1);
+    mc_mem_region_t heap_region2 = MC_get_heap_region(snapshot2);
 
-  case DW_TAG_base_type:
-    if (not type->name.empty() && type->name == "char") { /* String, hence random (arbitrary ?) size */
-      if (real_area1 == real_area2)
-        return -1;
-      else
-        return MC_snapshot_region_memcmp(real_area1, heap_region1, real_area2, heap_region2, area_size) != 0;
-    } else {
-      if (area_size != -1 && type->byte_size != area_size)
-        return -1;
-      else
-        return MC_snapshot_region_memcmp(real_area1, heap_region1, real_area2, heap_region2, type->byte_size) != 0;
-    }
-    break;
+    switch (type->type) {
+      case DW_TAG_unspecified_type:
+        return 1;
 
-  case DW_TAG_enumeration_type:
-    if (area_size != -1 && type->byte_size != area_size)
-      return -1;
-    return MC_snapshot_region_memcmp(real_area1, heap_region1, real_area2, heap_region2, type->byte_size) != 0;
-
-  case DW_TAG_typedef:
-  case DW_TAG_const_type:
-  case DW_TAG_volatile_type:
-    // Poor man's TCO:
-    type = type->subtype;
-    goto top;
-
-  case DW_TAG_array_type:
-    subtype = type->subtype;
-    switch (subtype->type) {
-    case DW_TAG_unspecified_type:
-      return 1;
+      case DW_TAG_base_type:
+        if (not type->name.empty() && type->name == "char") { /* String, hence random (arbitrary ?) size */
+          if (real_area1 == real_area2)
+            return -1;
+          else
+            return MC_snapshot_region_memcmp(real_area1, heap_region1, real_area2, heap_region2, area_size) != 0;
+        } else {
+          if (area_size != -1 && type->byte_size != area_size)
+            return -1;
+          else
+            return MC_snapshot_region_memcmp(real_area1, heap_region1, real_area2, heap_region2, type->byte_size) != 0;
+        }
+        break;
 
-    case DW_TAG_base_type:
-    case DW_TAG_enumeration_type:
-    case DW_TAG_pointer_type:
-    case DW_TAG_reference_type:
-    case DW_TAG_rvalue_reference_type:
-    case DW_TAG_structure_type:
-    case DW_TAG_class_type:
-    case DW_TAG_union_type:
-      if (subtype->full_type)
-        subtype = subtype->full_type;
-      elm_size = subtype->byte_size;
-      break;
-      // TODO, just remove the type indirection?
-    case DW_TAG_const_type:
-    case DW_TAG_typedef:
-    case DW_TAG_volatile_type:
-      subsubtype = subtype->subtype;
-      if (subsubtype->full_type)
-        subsubtype = subsubtype->full_type;
-      elm_size = subsubtype->byte_size;
-      break;
-    default:
-      return 0;
-      break;
-    }
-    for (int i = 0; i < type->element_count; i++) {
-      // TODO, add support for variable stride (DW_AT_byte_stride)
-      res =
-          compare_heap_area_with_type(state, process_index,
-                                      (char *) real_area1 + (i * elm_size),
-                                      (char *) real_area2 + (i * elm_size),
-                                      snapshot1, snapshot2, previous,
-                                      type->subtype, subtype->byte_size,
-                                      check_ignore, pointer_level);
-      if (res == 1)
-        return res;
-    }
-    return 0;
+      case DW_TAG_enumeration_type:
+        if (area_size != -1 && type->byte_size != area_size)
+          return -1;
+        return MC_snapshot_region_memcmp(real_area1, heap_region1, real_area2, heap_region2, type->byte_size) != 0;
 
-  case DW_TAG_reference_type:
-  case DW_TAG_rvalue_reference_type:
-  case DW_TAG_pointer_type:
-    if (type->subtype && type->subtype->type == DW_TAG_subroutine_type) {
-      addr_pointed1 = snapshot1->read(remote((void**)real_area1), process_index);
-      addr_pointed2 = snapshot2->read(remote((void**)real_area2), process_index);
-      return (addr_pointed1 != addr_pointed2);
-    }
-    pointer_level++;
-    if (pointer_level <= 1) {
-      addr_pointed1 = snapshot1->read(remote((void**)real_area1), process_index);
-      addr_pointed2 = snapshot2->read(remote((void**)real_area2), process_index);
-      if (addr_pointed1 > state.std_heap_copy.heapbase
-          && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1)
-          && addr_pointed2 > state.std_heap_copy.heapbase
-          && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2))
-        return compare_heap_area(state, process_index,
-            addr_pointed1, addr_pointed2, snapshot1,
-            snapshot2, previous, type->subtype,
-            pointer_level);
-      else
-        return (addr_pointed1 != addr_pointed2);
-    }
-    for (size_t i = 0; i < (area_size / sizeof(void *)); i++) {
-      addr_pointed1 = snapshot1->read(
-        remote((void**)((char*) real_area1 + i * sizeof(void *))),
-        process_index);
-      addr_pointed2 = snapshot2->read(
-        remote((void**)((char*) real_area2 + i * sizeof(void *))),
-        process_index);
-      if (addr_pointed1 > state.std_heap_copy.heapbase
-          && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1)
-          && addr_pointed2 > state.std_heap_copy.heapbase
-          && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2))
-        res =
-            compare_heap_area(state, process_index,
-              addr_pointed1, addr_pointed2, snapshot1,
-              snapshot2, previous, type->subtype,
-              pointer_level);
-      else
-        res = (addr_pointed1 != addr_pointed2);
-      if (res == 1)
-        return res;
-    }
-    return 0;
+      case DW_TAG_typedef:
+      case DW_TAG_const_type:
+      case DW_TAG_volatile_type:
+        // Poor man's TCO:
+        type = type->subtype;
+        continue; // restart
+
+      case DW_TAG_array_type:
+        subtype = type->subtype;
+        switch (subtype->type) {
+          case DW_TAG_unspecified_type:
+            return 1;
+
+          case DW_TAG_base_type:
+          case DW_TAG_enumeration_type:
+          case DW_TAG_pointer_type:
+          case DW_TAG_reference_type:
+          case DW_TAG_rvalue_reference_type:
+          case DW_TAG_structure_type:
+          case DW_TAG_class_type:
+          case DW_TAG_union_type:
+            if (subtype->full_type)
+              subtype = subtype->full_type;
+            elm_size  = subtype->byte_size;
+            break;
+          // TODO, just remove the type indirection?
+          case DW_TAG_const_type:
+          case DW_TAG_typedef:
+          case DW_TAG_volatile_type:
+            subsubtype = subtype->subtype;
+            if (subsubtype->full_type)
+              subsubtype = subsubtype->full_type;
+            elm_size     = subsubtype->byte_size;
+            break;
+          default:
+            return 0;
+            break;
+        }
+        for (int i = 0; i < type->element_count; i++) {
+          // TODO, add support for variable stride (DW_AT_byte_stride)
+          res = compare_heap_area_with_type(state, process_index, (char*)real_area1 + (i * elm_size),
+                                            (char*)real_area2 + (i * elm_size), snapshot1, snapshot2, previous,
+                                            type->subtype, subtype->byte_size, check_ignore, pointer_level);
+          if (res == 1)
+            return res;
+        }
+        return 0;
 
-  case DW_TAG_structure_type:
-  case DW_TAG_class_type:
-    if (type->full_type)
-      type = type->full_type;
-    if (area_size != -1 && type->byte_size != area_size) {
-      if (area_size <= type->byte_size || area_size % type->byte_size != 0)
-        return -1;
-      for (size_t i = 0; i < (size_t)(area_size / type->byte_size); i++) {
-        int res = compare_heap_area_with_type(state, process_index,
-                    (char *) real_area1 + i * type->byte_size,
-                    (char *) real_area2 + i * type->byte_size,
-                    snapshot1, snapshot2, previous, type, -1,
-                    check_ignore, 0);
-        if (res == 1)
-          return res;
-      }
-    } else {
-      for(simgrid::mc::Member& member : type->members) {
-        // TODO, optimize this? (for the offset case)
-        void *real_member1 = simgrid::dwarf::resolve_member(
-          real_area1, type, &member, (simgrid::mc::AddressSpace*) snapshot1, process_index);
-        void *real_member2 = simgrid::dwarf::resolve_member(
-            real_area2, type, &member, (simgrid::mc::AddressSpace*) snapshot2, process_index);
-        int res = compare_heap_area_with_type(
-                    state, process_index, real_member1, real_member2,
-                    snapshot1, snapshot2,
-                    previous, member.type, -1,
-                    check_ignore, 0);
-        if (res == 1)
-          return res;
-      }
-    }
-    return 0;
+      case DW_TAG_reference_type:
+      case DW_TAG_rvalue_reference_type:
+      case DW_TAG_pointer_type:
+        if (type->subtype && type->subtype->type == DW_TAG_subroutine_type) {
+          addr_pointed1 = snapshot1->read(remote((void**)real_area1), process_index);
+          addr_pointed2 = snapshot2->read(remote((void**)real_area2), process_index);
+          return (addr_pointed1 != addr_pointed2);
+        }
+        pointer_level++;
+        if (pointer_level <= 1) {
+          addr_pointed1 = snapshot1->read(remote((void**)real_area1), process_index);
+          addr_pointed2 = snapshot2->read(remote((void**)real_area2), process_index);
+          if (addr_pointed1 > state.std_heap_copy.heapbase && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1) &&
+              addr_pointed2 > state.std_heap_copy.heapbase && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2))
+            return compare_heap_area(state, process_index, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous,
+                                     type->subtype, pointer_level);
+          else
+            return (addr_pointed1 != addr_pointed2);
+        }
+        for (size_t i = 0; i < (area_size / sizeof(void*)); i++) {
+          addr_pointed1 = snapshot1->read(remote((void**)((char*)real_area1 + i * sizeof(void*))), process_index);
+          addr_pointed2 = snapshot2->read(remote((void**)((char*)real_area2 + i * sizeof(void*))), process_index);
+          if (addr_pointed1 > state.std_heap_copy.heapbase && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1) &&
+              addr_pointed2 > state.std_heap_copy.heapbase && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2))
+            res = compare_heap_area(state, process_index, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous,
+                                    type->subtype, pointer_level);
+          else
+            res = (addr_pointed1 != addr_pointed2);
+          if (res == 1)
+            return res;
+        }
+        return 0;
 
-  case DW_TAG_union_type:
-    return compare_heap_area_without_type(state, process_index, real_area1, real_area2,
-                                          snapshot1, snapshot2, previous,
-                                          type->byte_size, check_ignore);
+      case DW_TAG_structure_type:
+      case DW_TAG_class_type:
+        if (type->full_type)
+          type = type->full_type;
+        if (area_size != -1 && type->byte_size != area_size) {
+          if (area_size <= type->byte_size || area_size % type->byte_size != 0)
+            return -1;
+          for (size_t i = 0; i < (size_t)(area_size / type->byte_size); i++) {
+            int res = compare_heap_area_with_type(state, process_index, (char*)real_area1 + i * type->byte_size,
+                                                  (char*)real_area2 + i * type->byte_size, snapshot1, snapshot2,
+                                                  previous, type, -1, check_ignore, 0);
+            if (res == 1)
+              return res;
+          }
+        } else {
+          for (simgrid::mc::Member& member : type->members) {
+            // TODO, optimize this? (for the offset case)
+            void* real_member1 = simgrid::dwarf::resolve_member(real_area1, type, &member,
+                                                                (simgrid::mc::AddressSpace*)snapshot1, process_index);
+            void* real_member2 = simgrid::dwarf::resolve_member(real_area2, type, &member,
+                                                                (simgrid::mc::AddressSpace*)snapshot2, process_index);
+            int res = compare_heap_area_with_type(state, process_index, real_member1, real_member2, snapshot1,
+                                                  snapshot2, previous, member.type, -1, check_ignore, 0);
+            if (res == 1)
+              return res;
+          }
+        }
+        return 0;
 
-  default:
-    return 0;
-  }
+      case DW_TAG_union_type:
+        return compare_heap_area_without_type(state, process_index, real_area1, real_area2, snapshot1, snapshot2,
+                                              previous, type->byte_size, check_ignore);
+
+      default:
+        return 0;
+    }
 
-  xbt_die("Unreachable");
+    xbt_die("Unreachable");
+  } while (true);
 }
 
 /** Infer the type of a part of the block from the type of the block
@@ -926,7 +892,7 @@ static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc::
         return nullptr;
     }
 
-    for(simgrid::mc::Member& member : type->members) {
+    for (simgrid::mc::Member& member : type->members) {
       if (member.has_offset_location()) {
         // We have the offset, use it directly (shortcut):
         if (member.offset() == offset)
@@ -967,18 +933,11 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 {
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
 
-  int res_compare;
   ssize_t block1;
-  ssize_t frag1;
   ssize_t block2;
-  ssize_t frag2;
   ssize_t size;
   int check_ignore = 0;
 
-  void* real_addr_block1;
-  void* real_addr_block2;
-  void* real_addr_frag1;
-  void* real_addr_frag2;
   int type_size = -1;
   int offset1   = 0;
   int offset2   = 0;
@@ -996,7 +955,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) {
@@ -1024,8 +984,8 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
   }
 
   // Process address of the block:
-  real_addr_block1 = (ADDR2UINT(block1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
-  real_addr_block2 = (ADDR2UINT(block2) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
+  void* real_addr_block1 = (ADDR2UINT(block1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
+  void* real_addr_block2 = (ADDR2UINT(block2) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
 
   if (type) {
     if (type->full_type)
@@ -1065,23 +1025,19 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 
     // TODO, lookup variable type from block type as done for fragmented blocks
 
-    offset1 = (char*)area1 - (char*)real_addr_block1;
-    offset2 = (char*)area2 - (char*)real_addr_block2;
-
-    if (state.equals_to1_(block1, 0).valid && state.equals_to2_(block2, 0).valid && state.blocksEqual(block1, block2)) {
+    if (state.equals_to1_(block1, 0).valid_ && state.equals_to2_(block2, 0).valid_ &&
+        state.blocksEqual(block1, block2)) {
       if (match_pairs)
         state.match_equals(previous);
       return 0;
     }
 
-    if (type_size != -1) {
-      if (type_size != (ssize_t) heapinfo1->busy_block.busy_size
-          && type_size != (ssize_t)   heapinfo2->busy_block.busy_size
-          && (type->name.empty() || type->name == "struct s_smx_context")) {
-        if (match_pairs)
-          state.match_equals(previous);
-        return -1;
-      }
+    if (type_size != -1 && type_size != (ssize_t)heapinfo1->busy_block.busy_size &&
+        type_size != (ssize_t)heapinfo2->busy_block.busy_size &&
+        (type->name.empty() || type->name == "struct s_smx_context")) {
+      if (match_pairs)
+        state.match_equals(previous);
+      return -1;
     }
 
     if (heapinfo1->busy_block.size != heapinfo2->busy_block.size)
@@ -1110,9 +1066,6 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
       return 0;
     }
 
-    frag1 = -1;
-    frag2 = -1;
-
     if (heapinfo1->busy_block.ignore > 0
         && heapinfo2->busy_block.ignore == heapinfo1->busy_block.ignore)
       check_ignore = heapinfo1->busy_block.ignore;
@@ -1120,12 +1073,12 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
   } else if ((heapinfo1->type > 0) && (heapinfo2->type > 0)) {      /* Fragmented block */
 
     // Fragment number:
-    frag1 = ((uintptr_t)(ADDR2UINT(area1) % (BLOCKSIZE))) >> heapinfo1->type;
-    frag2 = ((uintptr_t)(ADDR2UINT(area2) % (BLOCKSIZE))) >> heapinfo2->type;
+    ssize_t frag1 = ((uintptr_t)(ADDR2UINT(area1) % (BLOCKSIZE))) >> heapinfo1->type;
+    ssize_t frag2 = ((uintptr_t)(ADDR2UINT(area2) % (BLOCKSIZE))) >> heapinfo2->type;
 
-    // Process address of the fragment:
-    real_addr_frag1 = (void*)((char*)real_addr_block1 + (frag1 << heapinfo1->type));
-    real_addr_frag2 = (void*)((char*)real_addr_block2 + (frag2 << heapinfo2->type));
+    // Process address of the fragment_:
+    void* real_addr_frag1 = (void*)((char*)real_addr_block1 + (frag1 << heapinfo1->type));
+    void* real_addr_frag2 = (void*)((char*)real_addr_block2 + (frag2 << heapinfo2->type));
 
     // Check the size of the fragments against the size of the type:
     if (type_size != -1) {
@@ -1144,12 +1097,11 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
     }
 
     // Check if the blocks are already matched together:
-    if (state.equals_to1_(block1, frag1).valid && state.equals_to2_(block2, frag2).valid) {
-      if (offset1==offset2 && state.fragmentsEqual(block1, frag1, block2, frag2)) {
-        if (match_pairs)
-          state.match_equals(previous);
-        return 0;
-      }
+    if (state.equals_to1_(block1, frag1).valid_ && state.equals_to2_(block2, frag2).valid_ && offset1 == offset2 &&
+        state.fragmentsEqual(block1, frag1, block2, frag2)) {
+      if (match_pairs)
+        state.match_equals(previous);
+      return 0;
     }
     // Compare the size of both fragments:
     if (heapinfo1->busy_frag.frag_size[frag1] != heapinfo2->busy_frag.frag_size[frag2]) {
@@ -1161,11 +1113,11 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
         return 1;
     }
 
-    // Size of the fragment:
+    // Size of the fragment_:
     size = heapinfo1->busy_frag.frag_size[frag1];
 
     // Remember (basic) type inference.
-    // The current data structure only allows us to do this for the whole fragment.
+    // The current data structure only allows us to do this for the whole fragment_.
     if (type != nullptr && area1 == real_addr_frag1)
       state.types1_(block1, frag1) = type;
     if (type != nullptr && area2 == real_addr_frag2)
@@ -1173,8 +1125,7 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 
     // The type of the variable is already known:
     if (type) {
-      new_type1 = type;
-      new_type2 = type;
+      new_type1 = new_type2 = type;
     }
     // Type inference from the block type.
     else if (state.types1_(block1, frag1) != nullptr || state.types2_(block2, frag2) != nullptr) {
@@ -1249,6 +1200,7 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 
 
   /* Start comparison */
+  int res_compare;
   if (type)
     res_compare = compare_heap_area_with_type(state, process_index, area1, area2, snapshot1, snapshot2, previous, type,
                                               size, check_ignore, pointer_level);
@@ -1284,142 +1236,129 @@ static int compare_areas_with_type(simgrid::mc::StateComparator& state,
   int i;
   int res;
 
-  top:
-  switch (type->type) {
-  case DW_TAG_unspecified_type:
-    return 1;
-
-  case DW_TAG_base_type:
-  case DW_TAG_enumeration_type:
-  case DW_TAG_union_type:
-    return MC_snapshot_region_memcmp(real_area1, region1, real_area2, region2, type->byte_size) != 0;
-  case DW_TAG_typedef:
-  case DW_TAG_volatile_type:
-  case DW_TAG_const_type:
-    // Poor man's TCO:
-    type = type->subtype;
-    goto top;
-  case DW_TAG_array_type:
-    subtype = type->subtype;
-    switch (subtype->type) {
-    case DW_TAG_unspecified_type:
-      return 1;
-
-    case DW_TAG_base_type:
-    case DW_TAG_enumeration_type:
-    case DW_TAG_pointer_type:
-    case DW_TAG_reference_type:
-    case DW_TAG_rvalue_reference_type:
-    case DW_TAG_structure_type:
-    case DW_TAG_class_type:
-    case DW_TAG_union_type:
-      if (subtype->full_type)
-        subtype = subtype->full_type;
-      elm_size = subtype->byte_size;
-      break;
-    case DW_TAG_const_type:
-    case DW_TAG_typedef:
-    case DW_TAG_volatile_type:
-      subsubtype = subtype->subtype;
-      if (subsubtype->full_type)
-        subsubtype = subsubtype->full_type;
-      elm_size = subsubtype->byte_size;
-      break;
-    default:
-      return 0;
-      break;
-    }
-    for (i = 0; i < type->element_count; i++) {
-      size_t off = i * elm_size;
-      res = compare_areas_with_type(state, process_index,
-            (char*) real_area1 + off, snapshot1, region1,
-            (char*) real_area2 + off, snapshot2, region2,
-            type->subtype, pointer_level);
-      if (res == 1)
-        return res;
-    }
-    break;
-  case DW_TAG_pointer_type:
-  case DW_TAG_reference_type:
-  case DW_TAG_rvalue_reference_type:
-  {
-    void* addr_pointed1 = MC_region_read_pointer(region1, real_area1);
-    void* addr_pointed2 = MC_region_read_pointer(region2, real_area2);
-
-    if (type->subtype && type->subtype->type == DW_TAG_subroutine_type)
-      return (addr_pointed1 != addr_pointed2);
-    if (addr_pointed1 == nullptr && addr_pointed2 == nullptr)
-      return 0;
-    if (addr_pointed1 == nullptr || addr_pointed2 == nullptr)
-      return 1;
-    if (not state.compared_pointers.insert(std::make_pair(addr_pointed1, addr_pointed2)).second)
-      return 0;
-
-    pointer_level++;
-
-      // Some cases are not handled here:
-      // * the pointers lead to different areas (one to the heap, the other to the RW segment ...);
-      // * a pointer leads to the read-only segment of the current object;
-      // * a pointer lead to a different ELF object.
+  do {
+    switch (type->type) {
+      case DW_TAG_unspecified_type:
+        return 1;
 
-      if (addr_pointed1 > process->heap_address
-          && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1)) {
-        if (not(addr_pointed2 > process->heap_address && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2)))
+      case DW_TAG_base_type:
+      case DW_TAG_enumeration_type:
+      case DW_TAG_union_type:
+        return MC_snapshot_region_memcmp(real_area1, region1, real_area2, region2, type->byte_size) != 0;
+      case DW_TAG_typedef:
+      case DW_TAG_volatile_type:
+      case DW_TAG_const_type:
+        // Poor man's TCO:
+        type = type->subtype;
+        continue; // restart
+      case DW_TAG_array_type:
+        subtype = type->subtype;
+        switch (subtype->type) {
+          case DW_TAG_unspecified_type:
+            return 1;
+
+          case DW_TAG_base_type:
+          case DW_TAG_enumeration_type:
+          case DW_TAG_pointer_type:
+          case DW_TAG_reference_type:
+          case DW_TAG_rvalue_reference_type:
+          case DW_TAG_structure_type:
+          case DW_TAG_class_type:
+          case DW_TAG_union_type:
+            if (subtype->full_type)
+              subtype = subtype->full_type;
+            elm_size  = subtype->byte_size;
+            break;
+          case DW_TAG_const_type:
+          case DW_TAG_typedef:
+          case DW_TAG_volatile_type:
+            subsubtype = subtype->subtype;
+            if (subsubtype->full_type)
+              subsubtype = subsubtype->full_type;
+            elm_size     = subsubtype->byte_size;
+            break;
+          default:
+            return 0;
+            break;
+        }
+        for (i = 0; i < type->element_count; i++) {
+          size_t off = i * elm_size;
+          res        = compare_areas_with_type(state, process_index, (char*)real_area1 + off, snapshot1, region1,
+                                        (char*)real_area2 + off, snapshot2, region2, type->subtype, pointer_level);
+          if (res == 1)
+            return res;
+        }
+        break;
+      case DW_TAG_pointer_type:
+      case DW_TAG_reference_type:
+      case DW_TAG_rvalue_reference_type: {
+        void* addr_pointed1 = MC_region_read_pointer(region1, real_area1);
+        void* addr_pointed2 = MC_region_read_pointer(region2, real_area2);
+
+        if (type->subtype && type->subtype->type == DW_TAG_subroutine_type)
+          return (addr_pointed1 != addr_pointed2);
+        if (addr_pointed1 == nullptr && addr_pointed2 == nullptr)
+          return 0;
+        if (addr_pointed1 == nullptr || addr_pointed2 == nullptr)
           return 1;
-        // The pointers are both in the heap:
-        return simgrid::mc::compare_heap_area(state,
-          process_index, addr_pointed1, addr_pointed2, snapshot1,
-          snapshot2, nullptr, type->subtype, pointer_level);
-      }
+        if (not state.compared_pointers.insert(std::make_pair(addr_pointed1, addr_pointed2)).second)
+          return 0;
+
+        pointer_level++;
+
+        // Some cases are not handled here:
+        // * the pointers lead to different areas (one to the heap, the other to the RW segment ...)
+        // * a pointer leads to the read-only segment of the current object
+        // * a pointer lead to a different ELF object
+
+        if (addr_pointed1 > process->heap_address && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1)) {
+          if (not(addr_pointed2 > process->heap_address && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2)))
+            return 1;
+          // The pointers are both in the heap:
+          return simgrid::mc::compare_heap_area(state, process_index, addr_pointed1, addr_pointed2, snapshot1,
+                                                snapshot2, nullptr, type->subtype, pointer_level);
+
+        } else if (region1->contain(simgrid::mc::remote(addr_pointed1))) {
+          // The pointers are both in the current object R/W segment:
+          if (not region2->contain(simgrid::mc::remote(addr_pointed2)))
+            return 1;
+          if (not type->type_id)
+            return (addr_pointed1 != addr_pointed2);
+          else
+            return compare_areas_with_type(state, process_index, addr_pointed1, snapshot1, region1, addr_pointed2,
+                                           snapshot2, region2, type->subtype, pointer_level);
+        } else {
+
+          // TODO, We do not handle very well the case where
+          // it belongs to a different (non-heap) region from the current one.
 
-      // The pointers are both in the current object R/W segment:
-      else if (region1->contain(simgrid::mc::remote(addr_pointed1))) {
-        if (not region2->contain(simgrid::mc::remote(addr_pointed2)))
-          return 1;
-        if (not type->type_id)
           return (addr_pointed1 != addr_pointed2);
-        else
-          return compare_areas_with_type(state, process_index,
-                                         addr_pointed1, snapshot1, region1,
-                                         addr_pointed2, snapshot2, region2,
-                                         type->subtype, pointer_level);
+        }
+        break;
       }
-
-      // TODO, We do not handle very well the case where
-      // it belongs to a different (non-heap) region from the current one.
-
-      else
-        return (addr_pointed1 != addr_pointed2);
-
-    break;
-  }
-  case DW_TAG_structure_type:
-  case DW_TAG_class_type:
-    for(simgrid::mc::Member& member : type->members) {
-      void *member1 = simgrid::dwarf::resolve_member(
-        real_area1, type, &member, snapshot1, process_index);
-      void *member2 = simgrid::dwarf::resolve_member(
-        real_area2, type, &member, snapshot2, process_index);
-      mc_mem_region_t subregion1 = mc_get_region_hinted(member1, snapshot1, process_index, region1);
-      mc_mem_region_t subregion2 = mc_get_region_hinted(member2, snapshot2, process_index, region2);
-      res =
-          compare_areas_with_type(state, process_index,
-                                  member1, snapshot1, subregion1,
-                                  member2, snapshot2, subregion2,
-                                  member.type, pointer_level);
-      if (res == 1)
-        return res;
+      case DW_TAG_structure_type:
+      case DW_TAG_class_type:
+        for (simgrid::mc::Member& member : type->members) {
+          void* member1 = simgrid::dwarf::resolve_member(real_area1, type, &member, snapshot1, process_index);
+          void* member2 = simgrid::dwarf::resolve_member(real_area2, type, &member, snapshot2, process_index);
+          mc_mem_region_t subregion1 = mc_get_region_hinted(member1, snapshot1, process_index, region1);
+          mc_mem_region_t subregion2 = mc_get_region_hinted(member2, snapshot2, process_index, region2);
+          res = compare_areas_with_type(state, process_index, member1, snapshot1, subregion1, member2, snapshot2,
+                                        subregion2, member.type, pointer_level);
+          if (res == 1)
+            return res;
+        }
+        break;
+      case DW_TAG_subroutine_type:
+        return -1;
+        break;
+      default:
+        XBT_VERB("Unknown case: %d", type->type);
+        break;
     }
-    break;
-  case DW_TAG_subroutine_type:
-    return -1;
-    break;
-  default:
-    XBT_VERB("Unknown case: %d", type->type);
-    break;
-  }
 
-  return 0;
+    return 0;
+  } while (true);
 }
 
 static int compare_global_variables(
@@ -1459,7 +1398,7 @@ static int compare_global_variables(
 
   std::vector<simgrid::mc::Variable>& variables = object_info->global_variables;
 
-  for (simgrid::mc::Variable& current_var : variables) {
+  for (simgrid::mc::Variable const& current_var : variables) {
 
     // If the variable is not in this object, skip it:
     // We do not expect to find a pointer to something which is not reachable
@@ -1497,7 +1436,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];
@@ -1638,8 +1578,7 @@ int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc:
 #else
 
 #ifdef MC_VERBOSE
-      XBT_VERB("(%d - %d) Different local variables between stacks %d", num1,
-               num2, cursor + 1);
+      XBT_VERB("(%d - %d) Different local variables between stacks %u", num1, num2, cursor + 1);
 #endif
 
       return 1;
index 90fedff..ad06017 100644 (file)
@@ -7,8 +7,8 @@
 
 #include "mc/mc.h"
 #include "src/mc/mc_base.h"
-#include "src/mc/mc_replay.h"
-#include "src/simix/smx_private.h"
+#include "src/mc/mc_replay.hpp"
+#include "src/simix/smx_private.hpp"
 
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
@@ -35,13 +35,9 @@ void wait_for_requests()
 #if SIMGRID_HAVE_MC
   xbt_assert(mc_model_checker == nullptr, "This must be called from the client");
 #endif
-
-  smx_actor_t process;
-  unsigned int iter;
-
-  while (not xbt_dynar_is_empty(simix_global->process_to_run)) {
+  while (not simix_global->process_to_run.empty()) {
     SIMIX_process_runall();
-    xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
+    for (smx_actor_t const& process : simix_global->process_that_ran) {
       smx_simcall_t req = &process->simcall;
       if (req->call != SIMCALL_NONE && not simgrid::mc::request_is_visible(req))
         SIMIX_simcall_handle(req, 0);
@@ -49,7 +45,7 @@ void wait_for_requests()
   }
 #if SIMGRID_HAVE_MC
   xbt_dynar_reset(simix_global->actors_vector);
-  for (std::pair<aid_t, smx_actor_t> kv : simix_global->process_list) {
+  for (std::pair<aid_t, smx_actor_t> const& kv : simix_global->process_list) {
     xbt_dynar_push_as(simix_global->actors_vector, smx_actor_t, kv.second);
   }
 #endif
@@ -101,14 +97,9 @@ bool actor_is_enabled(smx_actor_t actor)
     }
 
     case SIMCALL_COMM_WAITANY: {
-      xbt_dynar_t comms;
-      simgrid::kernel::activity::CommImpl* act =
-          static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
-
-      comms = simcall_comm_waitany__get__comms(req);
-
+      xbt_dynar_t comms = simcall_comm_waitany__get__comms(req);
       for (unsigned int index = 0; index < comms->used; ++index) {
-        act = xbt_dynar_get_as(comms, index, simgrid::kernel::activity::CommImpl*);
+        simgrid::kernel::activity::CommImpl* act = xbt_dynar_get_as(comms, index, simgrid::kernel::activity::CommImpl*);
         if (act->src_proc && act->dst_proc)
           return true;
       }
@@ -120,8 +111,7 @@ bool actor_is_enabled(smx_actor_t actor)
 
       if (mutex->owner == nullptr)
         return true;
-      else
-        return mutex->owner->pid == req->issuer->pid;
+      return mutex->owner->pid == req->issuer->pid;
     }
 
     case SIMCALL_SEM_ACQUIRE: {
@@ -155,16 +145,10 @@ bool request_is_visible(smx_simcall_t req)
   xbt_assert(mc_model_checker == nullptr, "This should be called from the client side");
 #endif
 
-  return req->call == SIMCALL_COMM_ISEND
-      || req->call == SIMCALL_COMM_IRECV
-      || req->call == SIMCALL_COMM_WAIT
-      || req->call == SIMCALL_COMM_WAITANY
-      || req->call == SIMCALL_COMM_TEST
-      || req->call == SIMCALL_COMM_TESTANY
-      || req->call == SIMCALL_MC_RANDOM
-      || req->call == SIMCALL_MUTEX_LOCK
-      || req->call == SIMCALL_MUTEX_TRYLOCK
-      ;
+  return req->call == SIMCALL_COMM_ISEND || req->call == SIMCALL_COMM_IRECV || req->call == SIMCALL_COMM_WAIT ||
+         req->call == SIMCALL_COMM_WAITANY || req->call == SIMCALL_COMM_TEST || req->call == SIMCALL_COMM_TESTANY ||
+         req->call == SIMCALL_MC_RANDOM || req->call == SIMCALL_MUTEX_LOCK || req->call == SIMCALL_MUTEX_TRYLOCK ||
+         req->call == SIMCALL_MUTEX_UNLOCK;
 }
 
 }
@@ -191,7 +175,7 @@ static int prng_random(int min, int max)
 
 int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max)
 {
-  if (not MC_is_active() && not MC_record_path)
+  if (not MC_is_active() && MC_record_path.empty())
     return prng_random(min, max);
   return simcall->mc_value;
 }
index 9f7775c..9c531b3 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
@@ -6,36 +6,37 @@
 
 #include <unistd.h>
 
+#include <cstring>
+#include <dirent.h>
 #include <fcntl.h>
-#include <string.h>
 #include <link.h>
-#include <dirent.h>
 
 #ifndef WIN32
 #include <sys/mman.h>
 #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/file.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"
@@ -47,6 +48,12 @@ using simgrid::mc::remote;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_checkpoint, mc, "Logging specific to mc_checkpoint");
 
+#define PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC)
+#define PROT_RW (PROT_READ | PROT_WRITE)
+#define PROT_RX (PROT_READ | PROT_EXEC)
+extern std::string _sg_mc_property_file;
+extern std::string _sg_mc_dot_output_file;
+
 namespace simgrid {
 namespace mc {
 
@@ -60,11 +67,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 +80,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;
   }
 }
 
@@ -139,7 +145,6 @@ void add_region(int index, simgrid::mc::Snapshot* snapshot,
   snapshot->snapshot_regions[index]
     = std::unique_ptr<simgrid::mc::RegionSnapshot>(
       new simgrid::mc::RegionSnapshot(std::move(region)));
-  return;
 }
 
 static void get_memory_regions(simgrid::mc::RemoteClient* process, simgrid::mc::Snapshot* snapshot)
@@ -175,10 +180,6 @@ static void get_memory_regions(simgrid::mc::RemoteClient* process, simgrid::mc::
     snapshot->privatization_index = simgrid::mc::ProcessIndexMissing;
 }
 
-#define PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC)
-#define PROT_RW (PROT_READ | PROT_WRITE)
-#define PROT_RX (PROT_READ | PROT_EXEC)
-
 /** \brief Fills the position of the segments (executable, read-only, read/write).
  * */
 // TODO, use the ELF segment information for more robustness
@@ -186,18 +187,15 @@ void find_object_address(
   std::vector<simgrid::xbt::VmMap> const& maps,
   simgrid::mc::ObjectInformation* result)
 {
-  char* name = xbt_basename(result->file_name.c_str());
+  std::string name = simgrid::xbt::Path(result->file_name).getBasename();
 
   for (size_t i = 0; i < maps.size(); ++i) {
     simgrid::xbt::VmMap const& reg = maps[i];
     if (maps[i].pathname.empty())
       continue;
-    char* map_basename = xbt_basename(maps[i].pathname.c_str());
-    if (strcmp(name, map_basename) != 0) {
-      free(map_basename);
+    std::string map_basename = simgrid::xbt::Path(maps[i].pathname).getBasename();
+    if (map_basename != name)
       continue;
-    }
-    free(map_basename);
 
     // This is the non-GNU_RELRO-part of the data segment:
     if (reg.prot == PROT_RW) {
@@ -251,8 +249,6 @@ void find_object_address(
     result->end = result->end_exec;
 
   xbt_assert(result->start_exec || result->start_rw || result->start_ro);
-
-  free(name);
 }
 
 /************************************* Take Snapshot ************************************/
@@ -278,18 +274,15 @@ 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();
 
   if (not scope || not scope->range.contain(stack_frame->ip))
     return;
 
-  for(simgrid::mc::Variable& current_variable :
-      scope->variables) {
+  for (simgrid::mc::Variable& current_variable : scope->variables) {
 
     if (not valid_variable(&current_variable, scope, (void*)stack_frame->ip))
       continue;
@@ -331,15 +324,15 @@ static void fill_local_variables_values(mc_stack_frame_t stack_frame,
   }
 
   // Recursive processing of nested scopes:
-  for(simgrid::mc::Frame& nested_scope : scope->scopes)
+  for (simgrid::mc::Frame& nested_scope : scope->scopes)
     fill_local_variables_values(
       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;
@@ -453,7 +446,7 @@ static void snapshot_handle_ignore(simgrid::mc::Snapshot* snapshot)
   }
 
   // Zero the memory:
-  for(auto const& region : mc_model_checker->process().ignored_regions())
+  for (auto const& region : mc_model_checker->process().ignored_regions())
     snapshot->process()->clear_bytes(remote(region.addr), region.size);
 
 }
@@ -526,12 +519,9 @@ static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
 
     // If dot_output enabled, do not handle the corresponding file
     if (dot_output != nullptr) {
-      char* link_basename = xbt_basename(link);
-      if (strcmp(link_basename, _sg_mc_dot_output_file) == 0) {
-        free(link_basename);
+      std::string link_basename = simgrid::xbt::Path(link).getBasename();
+      if (link_basename == _sg_mc_dot_output_file)
         continue;
-      }
-      free(link_basename);
     }
 
     // This is probably a shared memory used by lttng-ust:
@@ -559,7 +549,7 @@ std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
 
   std::shared_ptr<simgrid::mc::Snapshot> snapshot = std::make_shared<simgrid::mc::Snapshot>(mc_process, num_state);
 
-  for (auto& p : mc_model_checker->process().actors())
+  for (auto const& p : mc_model_checker->process().actors())
     snapshot->enabled_processes.insert(p.copy.getBuffer()->pid);
 
   snapshot_handle_ignore(snapshot.get());
@@ -572,7 +562,7 @@ std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
 
   snapshot->to_ignore = mc_model_checker->process().ignored_heap();
 
-  if (_sg_mc_max_visited_states > 0 || strcmp(_sg_mc_property_file, "")) {
+  if (_sg_mc_max_visited_states > 0 || not _sg_mc_property_file.empty()) {
     snapshot->stacks = take_snapshot_stacks(snapshot.get());
     if (_sg_mc_hash)
       snapshot->hash = simgrid::mc::hash(*snapshot);
@@ -588,7 +578,7 @@ std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
 static inline
 void restore_snapshot_regions(simgrid::mc::Snapshot* snapshot)
 {
-  for(std::unique_ptr<s_mc_mem_region_t> const& region : snapshot->snapshot_regions) {
+  for (std::unique_ptr<s_mc_mem_region_t> const& region : snapshot->snapshot_regions) {
     // For privatized, variables we decided it was not necessary to take the snapshot:
     if (region)
       restore(region.get());
@@ -597,7 +587,7 @@ void restore_snapshot_regions(simgrid::mc::Snapshot* snapshot)
 #if HAVE_SMPI
   if(snapshot->privatization_index >= 0) {
     // Fix the privatization mmap:
-    s_mc_message_restore message{MC_MESSAGE_RESTORE, snapshot->privatization_index};
+    s_mc_message_restore_t message{MC_MESSAGE_RESTORE, snapshot->privatization_index};
     mc_model_checker->process().getChannel().send(message);
   }
 #endif
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 3f3d1bd..48608a8 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 <string.h>
+#include <cstring>
 
 #include "xbt/dynar.h"
 #include "xbt/sysdep.h"
@@ -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 8aaefaf..bfee449 100644 (file)
@@ -1,25 +1,23 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2008-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/config.h"
 #include "xbt/log.h"
-#include <xbt/str.h>
 #include <xbt/sysdep.h>
 
+#include "src/mc/mc_replay.hpp"
 #include <mc/mc.h>
-#include "src/mc/mc_replay.h"
 
 #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");
 
@@ -40,7 +38,7 @@ int _sg_mc_timeout = 0;
 
 void _mc_cfg_cb_timeout(const char *name)
 {
-  if (_sg_cfg_init_status && not(_sg_do_model_check || MC_record_path))
+  if (_sg_cfg_init_status && not(_sg_do_model_check || not MC_record_path.empty()))
     xbt_die("You are specifying a value to enable/disable timeout for wait requests after the initialization (through MSG_config?), but model-checking was not activated at config time (through bu the program was not runned under the model-checker (with simgrid-mc)). This won't work, sorry.");
 
   _sg_mc_timeout = xbt_cfg_get_boolean(name);
@@ -52,11 +50,11 @@ int _sg_do_model_check_record = 0;
 int _sg_mc_checkpoint = 0;
 int _sg_mc_sparse_checkpoint = 0;
 int _sg_mc_ksm = 0;
-char *_sg_mc_property_file = nullptr;
+std::string _sg_mc_property_file;
 int _sg_mc_hash = 0;
 int _sg_mc_max_depth = 1000;
 int _sg_mc_max_visited_states = 0;
-char *_sg_mc_dot_output_file = nullptr;
+std::string _sg_mc_dot_output_file;
 int _sg_mc_comms_determinism = 0;
 int _sg_mc_send_determinism = 0;
 int _sg_mc_snapshot_fds = 0;
@@ -68,14 +66,13 @@ void _mc_cfg_cb_reduce(const char *name)
     xbt_die
         ("You are specifying a reduction strategy after the initialization (through MSG_config?), but model-checking was not activated at config time (through bu the program was not runned under the model-checker (with simgrid-mc)). This won't work, sorry.");
 
-  char *val = xbt_cfg_get_string(name);
-  if (not strcasecmp(val, "none"))
+  std::string val = xbt_cfg_get_string(name);
+  if (val == "none")
     simgrid::mc::reduction_mode = simgrid::mc::ReductionMode::none;
-  else if (not strcasecmp(val, "dpor"))
+  else if (val == "dpor")
     simgrid::mc::reduction_mode = simgrid::mc::ReductionMode::dpor;
   else
-    xbt_die("configuration option %s can only take 'none' or 'dpor' as a value",
-            name);
+    xbt_die("configuration option %s can only take 'none' or 'dpor' as a value", name);
 }
 
 void _mc_cfg_cb_checkpoint(const char *name)
index 47b5771..daedf1a 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
 
 #include "src/simgrid/util.hpp"
 #include "xbt/log.h"
+#include "xbt/string.hpp"
 #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,15 +533,11 @@ 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:
-    xbt_die("Can't handle form class (%i) / form 0x%x as DW_AT_member_location",
-            (int) form_class, form);
+    // 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);
   }
 
 }
@@ -624,7 +621,7 @@ static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* info, Dwarf_Die
 /** \brief Create a MC type object from a DIE
  *
  *  \param info current object info object
- *  \param DIE (for a given type);
+ *  \param DIE (for a given type)
  *  \param unit compilation unit of the current DIE
  *  \return MC representation of the type
  */
@@ -658,10 +655,10 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
 
   const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
   if (name != nullptr) {
-    char* full_name = ns ? bprintf("%s%s::%s", prefix, ns, name) :
-      bprintf("%s%s", prefix, name);
-    type.name = std::string(full_name);
-    free(full_name);
+    if (ns)
+      type.name = simgrid::xbt::string_printf("%s%s::%s", prefix, ns, name);
+    else
+      type.name = simgrid::xbt::string_printf("%s%s", prefix, name);
   }
 
   type.type_id = MC_dwarf_at_type(die);
@@ -672,7 +669,7 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   if (type.type == DW_TAG_pointer_type)
     type.byte_size = sizeof(void*);
 
-  // Computation of the byte_size;
+  // Computation of the byte_size
   if (dwarf_hasattr_integrate(die, DW_AT_byte_size))
     type.byte_size = MC_dwarf_attr_integrate_uint(die, DW_AT_byte_size, 0);
   else if (type.type == DW_TAG_array_type
@@ -684,6 +681,10 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   }
 
   switch (type.type) {
+  default:
+    XBT_DEBUG("Unhandled type: %d (%s)", type.type, simgrid::dwarf::tagname(type.type));
+    break;
+
   case DW_TAG_array_type:
     type.element_count = MC_dwarf_array_element_count(die, unit);
     // TODO, handle DW_byte_stride and (not) DW_bit_stride
@@ -698,10 +699,8 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   case DW_TAG_union_type:
   case DW_TAG_class_type:
     MC_dwarf_add_members(info, die, unit, &type);
-    char *new_ns = ns == nullptr ? xbt_strdup(type.name.c_str())
-        : bprintf("%s::%s", ns, name);
-    MC_dwarf_handle_children(info, die, unit, frame, new_ns);
-    free(new_ns);
+    std::string new_ns = ns ? simgrid::xbt::string_printf("%s::%s", ns, name) : type.name;
+    MC_dwarf_handle_children(info, die, unit, frame, new_ns.c_str());
     break;
   }
 
@@ -777,7 +776,7 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
         variable->address = (void *) (base + offset);
       } else
         variable->location_list = {
-          simgrid::dwarf::DwarfExpression(expr, expr + len) };
+            simgrid::dwarf::LocationListEntry(simgrid::dwarf::DwarfExpression(expr, expr + len))};
 
       break;
     }
@@ -790,11 +789,8 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
     break;
 
   default:
-    xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location "
-            "in <%" PRIx64 ">%s",
-            form, form, (int) form_class, (int) form_class,
-            (uint64_t) variable->id,
-            variable->name.c_str());
+    xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%" PRIx64 ">%s", (unsigned)form, form,
+            (unsigned)form_class, (int)form_class, (uint64_t)variable->id, variable->name.c_str());
   }
 
   // Handle start_scope:
@@ -803,20 +799,13 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
     dwarf_attr(die, DW_AT_start_scope, &attr);
     int form = dwarf_whatform(&attr);
     simgrid::dwarf::FormClass form_class = simgrid::dwarf::classify_form(form);
-    switch (form_class) {
-    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",
-           form, (int) form_class, name == nullptr ? "?" : name);
+    if (form_class == simgrid::dwarf::FormClass::Constant) {
+      Dwarf_Word value;
+      variable->start_scope = dwarf_formudata(&attr, &value) == 0 ? (size_t)value : 0;
+    } else {
+      // TODO: FormClass::RangeListPtr
+      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);
     }
   }
 
@@ -826,10 +815,10 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
 
   // The current code needs a variable name,
   // generate a fake one:
-  if (variable->name.empty())
-    variable->name =
-      "@anonymous#" + std::to_string(mc_anonymous_variable_index++);
-
+  if (variable->name.empty()) {
+    variable->name = "@anonymous#" + std::to_string(mc_anonymous_variable_index);
+    mc_anonymous_variable_index++;
+  }
   return variable;
 }
 
@@ -842,7 +831,7 @@ static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, D
   if (not variable)
     return;
   // Those arrays are sorted later:
-  else if (variable->global)
+  if (variable->global)
     info->global_variables.push_back(std::move(*variable));
   else if (frame != nullptr)
     frame->variables.push_back(std::move(*variable));
@@ -1139,7 +1128,7 @@ std::string find_by_build_id(std::vector<char> id)
 {
   std::string filename;
   std::string hex = to_hex(id);
-  for (const char* debug_path : debug_paths) {
+  for (const char* const& debug_path : debug_paths) {
     // Example:
     filename = std::string(debug_path) + ".build-id/"
       + to_hex(id.data(), 1) + '/'
@@ -1194,8 +1183,8 @@ void MC_load_dwarf(simgrid::mc::ObjectInformation* info)
 
   // If there was no DWARF in the file, try to find it in a separate file.
   // Different methods might be used to store the DWARF informations:
-  //  * GNU NT_GNU_BUILD_ID;
-  //  * .gnu_debuglink.
+  //  * GNU NT_GNU_BUILD_ID
+  //  * .gnu_debuglink
   // See https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
   // for reference of what we are doing.
 
@@ -1282,7 +1271,7 @@ static void MC_post_process_variables(simgrid::mc::ObjectInformation* info)
   // Someone needs this to be sorted but who?
   boost::range::sort(info->global_variables, MC_compare_variable);
 
-  for(simgrid::mc::Variable& variable : info->global_variables)
+  for (simgrid::mc::Variable& variable : info->global_variables)
     if (variable.type_id)
       variable.type = simgrid::util::find_map_ptr(
         info->types, variable.type_id);
@@ -1308,8 +1297,7 @@ static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid:
 
   // Recursive post-processing of nested-scopes:
   for (simgrid::mc::Frame& nested_scope : scope->scopes)
-      mc_post_process_scope(info, &nested_scope);
-
+    mc_post_process_scope(info, &nested_scope);
 }
 
 static
@@ -1342,7 +1330,7 @@ simgrid::mc::Type* MC_resolve_type(
 static void MC_post_process_types(simgrid::mc::ObjectInformation* info)
 {
   // Lookup "subtype" field:
-  for(auto& i : info->types) {
+  for (auto& i : info->types) {
     i.second.subtype = MC_resolve_type(info, i.second.type_id);
     for (simgrid::mc::Member& member : i.second.members)
       member.type = MC_resolve_type(info, member.type_id);
index ce4ddd4..4f6dbd2 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
 
 /* Warning: autogenerated, do not edit! */
 
-#include <dwarf.h>
-#include <src/mc/mc_dwarf.hpp>
+#include <string>
+#include <unordered_map>
 
-#include "xbt/base.h"
+#include "src/mc/mc_dwarf.hpp"
+
+namespace {
+const std::unordered_map<int, const char*> attrname_map = {
+    {0x01, "DW_AT_sibling"},
+    {0x02, "DW_AT_location"},
+    {0x03, "DW_AT_name"},
+    {0x09, "DW_AT_ordering"},
+    {0x0a, "DW_AT_subscr_data"},
+    {0x0b, "DW_AT_byte_size"},
+    {0x0c, "DW_AT_bit_offset"},
+    {0x0d, "DW_AT_bit_size"},
+    {0x0f, "DW_AT_element_list"},
+    {0x10, "DW_AT_stmt_list"},
+    {0x11, "DW_AT_low_pc"},
+    {0x12, "DW_AT_high_pc"},
+    {0x13, "DW_AT_language"},
+    {0x14, "DW_AT_member"},
+    {0x15, "DW_AT_discr"},
+    {0x16, "DW_AT_discr_value"},
+    {0x17, "DW_AT_visibility"},
+    {0x18, "DW_AT_import"},
+    {0x19, "DW_AT_string_length"},
+    {0x1a, "DW_AT_common_reference"},
+    {0x1b, "DW_AT_comp_dir"},
+    {0x1c, "DW_AT_const_value"},
+    {0x1d, "DW_AT_containing_type"},
+    {0x1e, "DW_AT_default_value"},
+    {0x20, "DW_AT_inline"},
+    {0x21, "DW_AT_is_optional"},
+    {0x22, "DW_AT_lower_bound"},
+    {0x25, "DW_AT_producer"},
+    {0x27, "DW_AT_prototyped"},
+    {0x2a, "DW_AT_return_addr"},
+    {0x2c, "DW_AT_start_scope"},
+    {0x2e, "DW_AT_bit_stride"},
+    {0x2f, "DW_AT_upper_bound"},
+    {0x31, "DW_AT_abstract_origin"},
+    {0x32, "DW_AT_accessibility"},
+    {0x33, "DW_AT_address_class"},
+    {0x34, "DW_AT_artificial"},
+    {0x35, "DW_AT_base_types"},
+    {0x36, "DW_AT_calling_convention"},
+    {0x37, "DW_AT_count"},
+    {0x38, "DW_AT_data_member_location"},
+    {0x39, "DW_AT_decl_column"},
+    {0x3a, "DW_AT_decl_file"},
+    {0x3b, "DW_AT_decl_line"},
+    {0x3c, "DW_AT_declaration"},
+    {0x3d, "DW_AT_discr_list"},
+    {0x3e, "DW_AT_encoding"},
+    {0x3f, "DW_AT_external"},
+    {0x40, "DW_AT_frame_base"},
+    {0x41, "DW_AT_friend"},
+    {0x42, "DW_AT_identifier_case"},
+    {0x43, "DW_AT_macro_info"},
+    {0x44, "DW_AT_namelist_item"},
+    {0x45, "DW_AT_priority"},
+    {0x46, "DW_AT_segment"},
+    {0x47, "DW_AT_specification"},
+    {0x48, "DW_AT_static_link"},
+    {0x49, "DW_AT_type"},
+    {0x4a, "DW_AT_use_location"},
+    {0x4b, "DW_AT_variable_parameter"},
+    {0x4c, "DW_AT_virtuality"},
+    {0x4d, "DW_AT_vtable_elem_location"},
+    {0x4e, "DW_AT_allocated"},
+    {0x4f, "DW_AT_associated"},
+    {0x50, "DW_AT_data_location"},
+    {0x51, "DW_AT_byte_stride"},
+    {0x52, "DW_AT_entry_pc"},
+    {0x53, "DW_AT_use_UTF8"},
+    {0x54, "DW_AT_extension"},
+    {0x55, "DW_AT_ranges"},
+    {0x56, "DW_AT_trampoline"},
+    {0x57, "DW_AT_call_column"},
+    {0x58, "DW_AT_call_file"},
+    {0x59, "DW_AT_call_line"},
+    {0x5a, "DW_AT_description"},
+    {0x5b, "DW_AT_binary_scale"},
+    {0x5c, "DW_AT_decimal_scale"},
+    {0x5d, "DW_AT_small"},
+    {0x5e, "DW_AT_decimal_sign"},
+    {0x5f, "DW_AT_digit_count"},
+    {0x60, "DW_AT_picture_string"},
+    {0x61, "DW_AT_mutable"},
+    {0x62, "DW_AT_threads_scaled"},
+    {0x63, "DW_AT_explicit"},
+    {0x64, "DW_AT_object_pointer"},
+    {0x65, "DW_AT_endianity"},
+    {0x66, "DW_AT_elemental"},
+    {0x67, "DW_AT_pure"},
+    {0x68, "DW_AT_recursive"},
+    {0x69, "DW_AT_signature"},
+    {0x6a, "DW_AT_main_subprogram"},
+    {0x6b, "DW_AT_data_bit_offset"},
+    {0x6c, "DW_AT_const_expr"},
+    {0x6d, "DW_AT_enum_class"},
+    {0x6e, "DW_AT_linkage_name"},
+    {0x87, "DW_AT_noreturn"},
+    {0x2000, "DW_AT_lo_user"},
+    {0x2001, "DW_AT_MIPS_fde"},
+    {0x2002, "DW_AT_MIPS_loop_begin"},
+    {0x2003, "DW_AT_MIPS_tail_loop_begin"},
+    {0x2004, "DW_AT_MIPS_epilog_begin"},
+    {0x2005, "DW_AT_MIPS_loop_unroll_factor"},
+    {0x2006, "DW_AT_MIPS_software_pipeline_depth"},
+    {0x2007, "DW_AT_MIPS_linkage_name"},
+    {0x2008, "DW_AT_MIPS_stride"},
+    {0x2009, "DW_AT_MIPS_abstract_name"},
+    {0x200a, "DW_AT_MIPS_clone_origin"},
+    {0x200b, "DW_AT_MIPS_has_inlines"},
+    {0x200c, "DW_AT_MIPS_stride_byte"},
+    {0x200d, "DW_AT_MIPS_stride_elem"},
+    {0x200e, "DW_AT_MIPS_ptr_dopetype"},
+    {0x200f, "DW_AT_MIPS_allocatable_dopetype"},
+    {0x2010, "DW_AT_MIPS_assumed_shape_dopetype"},
+    {0x2011, "DW_AT_MIPS_assumed_size"},
+    {0x2101, "DW_AT_sf_names"},
+    {0x2102, "DW_AT_src_info"},
+    {0x2103, "DW_AT_mac_info"},
+    {0x2104, "DW_AT_src_coords"},
+    {0x2105, "DW_AT_body_begin"},
+    {0x2106, "DW_AT_body_end"},
+    {0x2107, "DW_AT_GNU_vector"},
+    {0x2108, "DW_AT_GNU_guarded_by"},
+    {0x2109, "DW_AT_GNU_pt_guarded_by"},
+    {0x210a, "DW_AT_GNU_guarded"},
+    {0x210b, "DW_AT_GNU_pt_guarded"},
+    {0x210c, "DW_AT_GNU_locks_excluded"},
+    {0x210d, "DW_AT_GNU_exclusive_locks_required"},
+    {0x210e, "DW_AT_GNU_shared_locks_required"},
+    {0x210f, "DW_AT_GNU_odr_signature"},
+    {0x2110, "DW_AT_GNU_template_name"},
+    {0x2111, "DW_AT_GNU_call_site_value"},
+    {0x2112, "DW_AT_GNU_call_site_data_value"},
+    {0x2113, "DW_AT_GNU_call_site_target"},
+    {0x2114, "DW_AT_GNU_call_site_target_clobbered"},
+    {0x2115, "DW_AT_GNU_tail_call"},
+    {0x2116, "DW_AT_GNU_all_tail_call_sites"},
+    {0x2117, "DW_AT_GNU_all_call_sites"},
+    {0x2118, "DW_AT_GNU_all_source_call_sites"},
+    {0x2119, "DW_AT_GNU_macros"},
+    {0x211a, "DW_AT_GNU_deleted"},
+    {0x3fff, "DW_AT_hi_user"},
+};
+}
 
 namespace simgrid {
 namespace dwarf  {
@@ -22,149 +168,8 @@ namespace dwarf  {
 XBT_PRIVATE
 const char *attrname(int attr)
 {
-  switch (attr) {
-  case 0x01: return "DW_AT_sibling";
-  case 0x02: return "DW_AT_location";
-  case 0x03: return "DW_AT_name";
-  case 0x09: return "DW_AT_ordering";
-  case 0x0a: return "DW_AT_subscr_data";
-  case 0x0b: return "DW_AT_byte_size";
-  case 0x0c: return "DW_AT_bit_offset";
-  case 0x0d: return "DW_AT_bit_size";
-  case 0x0f: return "DW_AT_element_list";
-  case 0x10: return "DW_AT_stmt_list";
-  case 0x11: return "DW_AT_low_pc";
-  case 0x12: return "DW_AT_high_pc";
-  case 0x13: return "DW_AT_language";
-  case 0x14: return "DW_AT_member";
-  case 0x15: return "DW_AT_discr";
-  case 0x16: return "DW_AT_discr_value";
-  case 0x17: return "DW_AT_visibility";
-  case 0x18: return "DW_AT_import";
-  case 0x19: return "DW_AT_string_length";
-  case 0x1a: return "DW_AT_common_reference";
-  case 0x1b: return "DW_AT_comp_dir";
-  case 0x1c: return "DW_AT_const_value";
-  case 0x1d: return "DW_AT_containing_type";
-  case 0x1e: return "DW_AT_default_value";
-  case 0x20: return "DW_AT_inline";
-  case 0x21: return "DW_AT_is_optional";
-  case 0x22: return "DW_AT_lower_bound";
-  case 0x25: return "DW_AT_producer";
-  case 0x27: return "DW_AT_prototyped";
-  case 0x2a: return "DW_AT_return_addr";
-  case 0x2c: return "DW_AT_start_scope";
-  case 0x2e: return "DW_AT_bit_stride";
-  case 0x2f: return "DW_AT_upper_bound";
-  case 0x31: return "DW_AT_abstract_origin";
-  case 0x32: return "DW_AT_accessibility";
-  case 0x33: return "DW_AT_address_class";
-  case 0x34: return "DW_AT_artificial";
-  case 0x35: return "DW_AT_base_types";
-  case 0x36: return "DW_AT_calling_convention";
-  case 0x37: return "DW_AT_count";
-  case 0x38: return "DW_AT_data_member_location";
-  case 0x39: return "DW_AT_decl_column";
-  case 0x3a: return "DW_AT_decl_file";
-  case 0x3b: return "DW_AT_decl_line";
-  case 0x3c: return "DW_AT_declaration";
-  case 0x3d: return "DW_AT_discr_list";
-  case 0x3e: return "DW_AT_encoding";
-  case 0x3f: return "DW_AT_external";
-  case 0x40: return "DW_AT_frame_base";
-  case 0x41: return "DW_AT_friend";
-  case 0x42: return "DW_AT_identifier_case";
-  case 0x43: return "DW_AT_macro_info";
-  case 0x44: return "DW_AT_namelist_item";
-  case 0x45: return "DW_AT_priority";
-  case 0x46: return "DW_AT_segment";
-  case 0x47: return "DW_AT_specification";
-  case 0x48: return "DW_AT_static_link";
-  case 0x49: return "DW_AT_type";
-  case 0x4a: return "DW_AT_use_location";
-  case 0x4b: return "DW_AT_variable_parameter";
-  case 0x4c: return "DW_AT_virtuality";
-  case 0x4d: return "DW_AT_vtable_elem_location";
-  case 0x4e: return "DW_AT_allocated";
-  case 0x4f: return "DW_AT_associated";
-  case 0x50: return "DW_AT_data_location";
-  case 0x51: return "DW_AT_byte_stride";
-  case 0x52: return "DW_AT_entry_pc";
-  case 0x53: return "DW_AT_use_UTF8";
-  case 0x54: return "DW_AT_extension";
-  case 0x55: return "DW_AT_ranges";
-  case 0x56: return "DW_AT_trampoline";
-  case 0x57: return "DW_AT_call_column";
-  case 0x58: return "DW_AT_call_file";
-  case 0x59: return "DW_AT_call_line";
-  case 0x5a: return "DW_AT_description";
-  case 0x5b: return "DW_AT_binary_scale";
-  case 0x5c: return "DW_AT_decimal_scale";
-  case 0x5d: return "DW_AT_small";
-  case 0x5e: return "DW_AT_decimal_sign";
-  case 0x5f: return "DW_AT_digit_count";
-  case 0x60: return "DW_AT_picture_string";
-  case 0x61: return "DW_AT_mutable";
-  case 0x62: return "DW_AT_threads_scaled";
-  case 0x63: return "DW_AT_explicit";
-  case 0x64: return "DW_AT_object_pointer";
-  case 0x65: return "DW_AT_endianity";
-  case 0x66: return "DW_AT_elemental";
-  case 0x67: return "DW_AT_pure";
-  case 0x68: return "DW_AT_recursive";
-  case 0x69: return "DW_AT_signature";
-  case 0x6a: return "DW_AT_main_subprogram";
-  case 0x6b: return "DW_AT_data_bit_offset";
-  case 0x6c: return "DW_AT_const_expr";
-  case 0x6d: return "DW_AT_enum_class";
-  case 0x6e: return "DW_AT_linkage_name";
-  case 0x2000: return "DW_AT_lo_user";
-  case 0x2001: return "DW_AT_MIPS_fde";
-  case 0x2002: return "DW_AT_MIPS_loop_begin";
-  case 0x2003: return "DW_AT_MIPS_tail_loop_begin";
-  case 0x2004: return "DW_AT_MIPS_epilog_begin";
-  case 0x2005: return "DW_AT_MIPS_loop_unroll_factor";
-  case 0x2006: return "DW_AT_MIPS_software_pipeline_depth";
-  case 0x2007: return "DW_AT_MIPS_linkage_name";
-  case 0x2008: return "DW_AT_MIPS_stride";
-  case 0x2009: return "DW_AT_MIPS_abstract_name";
-  case 0x200a: return "DW_AT_MIPS_clone_origin";
-  case 0x200b: return "DW_AT_MIPS_has_inlines";
-  case 0x200c: return "DW_AT_MIPS_stride_byte";
-  case 0x200d: return "DW_AT_MIPS_stride_elem";
-  case 0x200e: return "DW_AT_MIPS_ptr_dopetype";
-  case 0x200f: return "DW_AT_MIPS_allocatable_dopetype";
-  case 0x2010: return "DW_AT_MIPS_assumed_shape_dopetype";
-  case 0x2011: return "DW_AT_MIPS_assumed_size";
-  case 0x2101: return "DW_AT_sf_names";
-  case 0x2102: return "DW_AT_src_info";
-  case 0x2103: return "DW_AT_mac_info";
-  case 0x2104: return "DW_AT_src_coords";
-  case 0x2105: return "DW_AT_body_begin";
-  case 0x2106: return "DW_AT_body_end";
-  case 0x2107: return "DW_AT_GNU_vector";
-  case 0x2108: return "DW_AT_GNU_guarded_by";
-  case 0x2109: return "DW_AT_GNU_pt_guarded_by";
-  case 0x210a: return "DW_AT_GNU_guarded";
-  case 0x210b: return "DW_AT_GNU_pt_guarded";
-  case 0x210c: return "DW_AT_GNU_locks_excluded";
-  case 0x210d: return "DW_AT_GNU_exclusive_locks_required";
-  case 0x210e: return "DW_AT_GNU_shared_locks_required";
-  case 0x210f: return "DW_AT_GNU_odr_signature";
-  case 0x2110: return "DW_AT_GNU_template_name";
-  case 0x2111: return "DW_AT_GNU_call_site_value";
-  case 0x2112: return "DW_AT_GNU_call_site_data_value";
-  case 0x2113: return "DW_AT_GNU_call_site_target";
-  case 0x2114: return "DW_AT_GNU_call_site_target_clobbered";
-  case 0x2115: return "DW_AT_GNU_tail_call";
-  case 0x2116: return "DW_AT_GNU_all_tail_call_sites";
-  case 0x2117: return "DW_AT_GNU_all_call_sites";
-  case 0x2118: return "DW_AT_GNU_all_source_call_sites";
-  case 0x2119: return "DW_AT_GNU_macros";
-  case 0x3fff: return "DW_AT_hi_user";
-  default:
-    return "DW_AT_unknown";
-  }
+  auto name = attrname_map.find(attr);
+  return name == attrname_map.end() ? "DW_AT_unknown" : name->second;
 }
 
 }
index f19d0f4..f656b08 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
@@ -6,11 +6,90 @@
 
 /* Warning: autogenerated, do not edit! */
 
-#include <dwarf.h>
-#include <elfutils/libdw.h>
+#include <string>
+#include <unordered_map>
+
 #include "src/mc/mc_dwarf.hpp"
 
-#include "xbt/base.h"
+namespace {
+const std::unordered_map<int, const char*> tagname_map = {
+    {0x00, "DW_TAG_invalid"},
+    {0x01, "DW_TAG_array_type"},
+    {0x02, "DW_TAG_class_type"},
+    {0x03, "DW_TAG_entry_point"},
+    {0x04, "DW_TAG_enumeration_type"},
+    {0x05, "DW_TAG_formal_parameter"},
+    {0x08, "DW_TAG_imported_declaration"},
+    {0x0a, "DW_TAG_label"},
+    {0x0b, "DW_TAG_lexical_block"},
+    {0x0d, "DW_TAG_member"},
+    {0x0f, "DW_TAG_pointer_type"},
+    {0x10, "DW_TAG_reference_type"},
+    {0x11, "DW_TAG_compile_unit"},
+    {0x12, "DW_TAG_string_type"},
+    {0x13, "DW_TAG_structure_type"},
+    {0x15, "DW_TAG_subroutine_type"},
+    {0x16, "DW_TAG_typedef"},
+    {0x17, "DW_TAG_union_type"},
+    {0x18, "DW_TAG_unspecified_parameters"},
+    {0x19, "DW_TAG_variant"},
+    {0x1a, "DW_TAG_common_block"},
+    {0x1b, "DW_TAG_common_inclusion"},
+    {0x1c, "DW_TAG_inheritance"},
+    {0x1d, "DW_TAG_inlined_subroutine"},
+    {0x1e, "DW_TAG_module"},
+    {0x1f, "DW_TAG_ptr_to_member_type"},
+    {0x20, "DW_TAG_set_type"},
+    {0x21, "DW_TAG_subrange_type"},
+    {0x22, "DW_TAG_with_stmt"},
+    {0x23, "DW_TAG_access_declaration"},
+    {0x24, "DW_TAG_base_type"},
+    {0x25, "DW_TAG_catch_block"},
+    {0x26, "DW_TAG_const_type"},
+    {0x27, "DW_TAG_constant"},
+    {0x28, "DW_TAG_enumerator"},
+    {0x29, "DW_TAG_file_type"},
+    {0x2a, "DW_TAG_friend"},
+    {0x2b, "DW_TAG_namelist"},
+    {0x2c, "DW_TAG_namelist_item"},
+    {0x2d, "DW_TAG_packed_type"},
+    {0x2e, "DW_TAG_subprogram"},
+    {0x2f, "DW_TAG_template_type_parameter"},
+    {0x30, "DW_TAG_template_value_parameter"},
+    {0x31, "DW_TAG_thrown_type"},
+    {0x32, "DW_TAG_try_block"},
+    {0x33, "DW_TAG_variant_part"},
+    {0x34, "DW_TAG_variable"},
+    {0x35, "DW_TAG_volatile_type"},
+    {0x36, "DW_TAG_dwarf_procedure"},
+    {0x37, "DW_TAG_restrict_type"},
+    {0x38, "DW_TAG_interface_type"},
+    {0x39, "DW_TAG_namespace"},
+    {0x3a, "DW_TAG_imported_module"},
+    {0x3b, "DW_TAG_unspecified_type"},
+    {0x3c, "DW_TAG_partial_unit"},
+    {0x3d, "DW_TAG_imported_unit"},
+    {0x3f, "DW_TAG_condition"},
+    {0x40, "DW_TAG_shared_type"},
+    {0x41, "DW_TAG_type_unit"},
+    {0x42, "DW_TAG_rvalue_reference_type"},
+    {0x43, "DW_TAG_template_alias"},
+    {0x47, "DW_TAG_atomic_type"},
+    {0x4080, "DW_TAG_lo_user"},
+    {0x4081, "DW_TAG_MIPS_loop"},
+    {0x4101, "DW_TAG_format_label"},
+    {0x4102, "DW_TAG_function_template"},
+    {0x4103, "DW_TAG_class_template"},
+    {0x4104, "DW_TAG_GNU_BINCL"},
+    {0x4105, "DW_TAG_GNU_EINCL"},
+    {0x4106, "DW_TAG_GNU_template_template_param"},
+    {0x4107, "DW_TAG_GNU_template_parameter_pack"},
+    {0x4108, "DW_TAG_GNU_formal_parameter_pack"},
+    {0x4109, "DW_TAG_GNU_call_site"},
+    {0x410a, "DW_TAG_GNU_call_site_parameter"},
+    {0xffff, "DW_TAG_hi_user"},
+};
+}
 
 namespace simgrid {
 namespace dwarf {
@@ -23,86 +102,8 @@ namespace dwarf {
 XBT_PRIVATE
 const char *tagname(int tag)
 {
-  switch (tag) {
-  case 0x01: return "DW_TAG_array_type";
-  case 0x02: return "DW_TAG_class_type";
-  case 0x03: return "DW_TAG_entry_point";
-  case 0x04: return "DW_TAG_enumeration_type";
-  case 0x05: return "DW_TAG_formal_parameter";
-  case 0x08: return "DW_TAG_imported_declaration";
-  case 0x0a: return "DW_TAG_label";
-  case 0x0b: return "DW_TAG_lexical_block";
-  case 0x0d: return "DW_TAG_member";
-  case 0x0f: return "DW_TAG_pointer_type";
-  case 0x10: return "DW_TAG_reference_type";
-  case 0x11: return "DW_TAG_compile_unit";
-  case 0x12: return "DW_TAG_string_type";
-  case 0x13: return "DW_TAG_structure_type";
-  case 0x15: return "DW_TAG_subroutine_type";
-  case 0x16: return "DW_TAG_typedef";
-  case 0x17: return "DW_TAG_union_type";
-  case 0x18: return "DW_TAG_unspecified_parameters";
-  case 0x19: return "DW_TAG_variant";
-  case 0x1a: return "DW_TAG_common_block";
-  case 0x1b: return "DW_TAG_common_inclusion";
-  case 0x1c: return "DW_TAG_inheritance";
-  case 0x1d: return "DW_TAG_inlined_subroutine";
-  case 0x1e: return "DW_TAG_module";
-  case 0x1f: return "DW_TAG_ptr_to_member_type";
-  case 0x20: return "DW_TAG_set_type";
-  case 0x21: return "DW_TAG_subrange_type";
-  case 0x22: return "DW_TAG_with_stmt";
-  case 0x23: return "DW_TAG_access_declaration";
-  case 0x24: return "DW_TAG_base_type";
-  case 0x25: return "DW_TAG_catch_block";
-  case 0x26: return "DW_TAG_const_type";
-  case 0x27: return "DW_TAG_constant";
-  case 0x28: return "DW_TAG_enumerator";
-  case 0x29: return "DW_TAG_file_type";
-  case 0x2a: return "DW_TAG_friend";
-  case 0x2b: return "DW_TAG_namelist";
-  case 0x2c: return "DW_TAG_namelist_item";
-  case 0x2d: return "DW_TAG_packed_type";
-  case 0x2e: return "DW_TAG_subprogram";
-  case 0x2f: return "DW_TAG_template_type_parameter";
-  case 0x30: return "DW_TAG_template_value_parameter";
-  case 0x31: return "DW_TAG_thrown_type";
-  case 0x32: return "DW_TAG_try_block";
-  case 0x33: return "DW_TAG_variant_part";
-  case 0x34: return "DW_TAG_variable";
-  case 0x35: return "DW_TAG_volatile_type";
-  case 0x36: return "DW_TAG_dwarf_procedure";
-  case 0x37: return "DW_TAG_restrict_type";
-  case 0x38: return "DW_TAG_interface_type";
-  case 0x39: return "DW_TAG_namespace";
-  case 0x3a: return "DW_TAG_imported_module";
-  case 0x3b: return "DW_TAG_unspecified_type";
-  case 0x3c: return "DW_TAG_partial_unit";
-  case 0x3d: return "DW_TAG_imported_unit";
-  case 0x3e: return "DW_TAG_mutable_type";
-  case 0x3f: return "DW_TAG_condition";
-  case 0x40: return "DW_TAG_shared_type";
-  case 0x41: return "DW_TAG_type_unit";
-  case 0x42: return "DW_TAG_rvalue_reference_type";
-  case 0x43: return "DW_TAG_template_alias";
-  case 0x4080: return "DW_TAG_lo_user";
-  case 0x4081: return "DW_TAG_MIPS_loop";
-  case 0x4101: return "DW_TAG_format_label";
-  case 0x4102: return "DW_TAG_function_template";
-  case 0x4103: return "DW_TAG_class_template";
-  case 0x4104: return "DW_TAG_GNU_BINCL";
-  case 0x4105: return "DW_TAG_GNU_EINCL";
-  case 0x4106: return "DW_TAG_GNU_template_template_param";
-  case 0x4107: return "DW_TAG_GNU_template_parameter_pack";
-  case 0x4108: return "DW_TAG_GNU_formal_parameter_pack";
-  case 0x4109: return "DW_TAG_GNU_call_site";
-  case 0x410a: return "DW_TAG_GNU_call_site_parameter";
-  case 0xffff: return "DW_TAG_hi_user";
-  case DW_TAG_invalid:
-    return "DW_TAG_invalid";
-  default:
-    return "DW_TAG_unknown";
-  }
+  auto name = tagname_map.find(tag);
+  return name == tagname_map.end() ? "DW_TAG_unknown" : name->second;
 }
 
 }
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 07eeace..b143298 100644 (file)
@@ -13,6 +13,7 @@
 #include <vector>
 
 #include "xbt/automaton.h"
+#include "xbt/backtrace.hpp"
 #include "xbt/dynar.h"
 #include "xbt/swag.h"
 
 #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"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc, "Logging specific to MC (global)");
 
+extern std::string _sg_mc_dot_output_file;
+
 namespace simgrid {
 namespace mc {
 
@@ -76,7 +79,7 @@ FILE *dot_output = nullptr;
 
 void MC_init_dot_output()
 {
-  dot_output = fopen(_sg_mc_dot_output_file, "w");
+  dot_output = fopen(_sg_mc_dot_output_file.c_str(), "w");
 
   if (dot_output == nullptr) {
     perror("Error open dot output file");
@@ -96,7 +99,7 @@ void MC_run()
   simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
   MC_ignore_heap(simgrid::mc::processes_time.data(),
     simgrid::mc::processes_time.size() * sizeof(simgrid::mc::processes_time[0]));
-  for (auto kv : simix_global->process_list) {
+  for (auto const& kv : simix_global->process_list) {
     smx_actor_t actor = kv.second;
     MC_ignore_heap(&(actor->process_hookup), sizeof(actor->process_hookup));
   }
@@ -110,7 +113,7 @@ void MC_show_deadlock()
   XBT_INFO("*** DEAD-LOCK DETECTED ***");
   XBT_INFO("**************************");
   XBT_INFO("Counter-example execution trace:");
-  for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
+  for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
     XBT_INFO("%s", s.c_str());
   simgrid::mc::session->logState();
 }
@@ -134,24 +137,20 @@ void dumpStack(FILE* file, unw_cursor_t cursor)
   unw_word_t off;
   do {
     const char* name = not unw_get_proc_name(&cursor, buffer, 100, &off) ? buffer : "?";
-
-    int status;
-
     // Unmangle C++ names:
-    char* realname = abi::__cxa_demangle(name, 0, 0, &status);
+    auto realname = simgrid::xbt::demangle(name);
 
 #if defined(__x86_64__)
     unw_word_t rip = 0;
     unw_word_t rsp = 0;
     unw_get_reg(&cursor, UNW_X86_64_RIP, &rip);
     unw_get_reg(&cursor, UNW_X86_64_RSP, &rsp);
-    fprintf(file, "  %i: %s (RIP=0x%" PRIx64 " RSP=0x%" PRIx64 ")\n",
-      nframe, realname ? realname : name, (std::uint64_t) rip, (std::uint64_t) rsp);
+    fprintf(file, "  %i: %s (RIP=0x%" PRIx64 " RSP=0x%" PRIx64 ")\n", nframe, realname.get(), (std::uint64_t)rip,
+            (std::uint64_t)rsp);
 #else
-    fprintf(file, "  %i: %s\n", nframe, realname ? realname : name);
+    fprintf(file, "  %i: %s\n", nframe, realname.get());
 #endif
 
-    free(realname);
     ++nframe;
   } while(unw_step(&cursor));
 }
@@ -163,7 +162,8 @@ static void MC_dump_stacks(FILE* file)
 {
   int nstack = 0;
   for (auto const& stack : mc_model_checker->process().stack_areas()) {
-    fprintf(file, "Stack %i:\n", nstack++);
+    fprintf(file, "Stack %i:\n", nstack);
+    nstack++;
 
     simgrid::mc::UnwindContext context;
     unw_context_t raw_context =
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..2864b9d 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,
@@ -26,9 +26,4 @@ void MC_memory_init()
     xbt_die("Model-checking support is not enabled: run with simgrid-mc.");
 }
 
-/* Finalize the memory subsystem */
-void MC_memory_exit()
-{
-}
-
 }
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 ce2bfa2..4af7633 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* 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 "simgrid/simix.h"
 
 #include "src/kernel/context/Context.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_replay.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
-#include "src/mc/mc_replay.h"
-#include "src/mc/mc_record.h"
+#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,
   " Logging specific to MC record/replay facility");
 
-extern "C" {
-char* MC_record_path = nullptr;
-}
+std::string MC_record_path;
 
 namespace simgrid {
 namespace mc {
@@ -67,10 +64,10 @@ void replay(RecordTrace const& trace)
   }
 }
 
-void replay(const char* path_string)
+void replay(std::string path_string)
 {
   simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
-  simgrid::mc::RecordTrace trace = simgrid::mc::parseRecordTrace(path_string);
+  simgrid::mc::RecordTrace trace = simgrid::mc::parseRecordTrace(path_string.c_str());
   simgrid::mc::replay(trace);
   simgrid::mc::processes_time.clear();
 }
@@ -80,15 +77,15 @@ RecordTrace parseRecordTrace(const char* data)
   RecordTrace res;
   XBT_INFO("path=%s", data);
   if (data == nullptr || data[0] == '\0')
-    throw std::runtime_error("Could not parse record path");
+    throw std::invalid_argument("Could not parse record path");
 
   const char* current = data;
   while (*current) {
 
     simgrid::mc::Transition item;
-    int count = sscanf(current, "%u/%u", &item.pid, &item.argument);
+    int count = sscanf(current, "%d/%d", &item.pid, &item.argument);
     if(count != 2 && count != 1)
-      throw std::runtime_error("Could not parse record path");
+      throw std::invalid_argument("Could not parse record path");
     res.push_back(item);
 
     // Find next chunk:
similarity index 90%
rename from src/mc/mc_record.h
rename to src/mc/mc_record.hpp
index 56a3410..c9cb094 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"
@@ -34,13 +34,10 @@ XBT_PRIVATE std::string traceToString(simgrid::mc::RecordTrace const& trace);
 XBT_PRIVATE void dumpRecordPath();
 
 XBT_PRIVATE void replay(RecordTrace const& trace);
-XBT_PRIVATE void replay(const char* trace);
-
+XBT_PRIVATE void replay(std::string 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
similarity index 76%
rename from src/mc/mc_replay.h
rename to src/mc/mc_replay.hpp
index fa295af..c4c2dd8 100644 (file)
@@ -7,20 +7,18 @@
 #define SIMGRID_MC_REPLAY_H
 
 #include "xbt/base.h"
-
-SG_BEGIN_DECL()
+#include <string>
 
 /** Replay path (if any) in string representation
  *
  *  This is using the format generated by traceToString().
  */
-XBT_PUBLIC_DATA(char*) MC_record_path;
+XBT_PUBLIC_DATA(std::string) MC_record_path;
 
 /** Whether the replay mode is enabled */
-static inline int MC_record_replay_is_active() {
-  return MC_record_path != 0;
+static inline int MC_record_replay_is_active()
+{
+  return not MC_record_path.empty();
 }
 
-SG_END_DECL()
-
 #endif
index 8879e90..c07f4ff 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;
@@ -160,16 +160,11 @@ bool request_depend(smx_simcall_t r1, smx_simcall_t r2)
     if (synchro1->src_buff == synchro2->src_buff
         && synchro1->dst_buff == synchro2->dst_buff)
       return false;
-    else if (synchro1->src_buff != nullptr
-        && synchro1->dst_buff != nullptr
-        && synchro2->src_buff != nullptr
-        && synchro2->dst_buff != nullptr
-        && synchro1->dst_buff != synchro2->src_buff
-        && synchro1->dst_buff != synchro2->dst_buff
-        && synchro2->dst_buff != synchro1->src_buff)
+    if (synchro1->src_buff != nullptr && synchro1->dst_buff != nullptr && synchro2->src_buff != nullptr &&
+        synchro2->dst_buff != nullptr && synchro1->dst_buff != synchro2->src_buff &&
+        synchro1->dst_buff != synchro2->dst_buff && synchro2->dst_buff != synchro1->src_buff)
       return false;
-    else
-      return true;
+    return true;
   default:
     return true;
   }
@@ -210,6 +205,8 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
   case simgrid::mc::RequestType::internal:
     use_remote_comm = false;
     break;
+  default:
+    THROW_IMPOSSIBLE;
   }
 
   const char* type = nullptr;
@@ -235,8 +232,6 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
 
   case SIMCALL_COMM_IRECV: {
     size_t* remote_size = simcall_comm_irecv__get__dst_buff_size(req);
-
-    // size_t size = size_pointer ? *size_pointer : 0;
     size_t size = 0;
     if (remote_size)
       mc_model_checker->process().read_bytes(&size, sizeof(size),
@@ -329,7 +324,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
       read_element(mc_model_checker->process(),
         &remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
         sizeof(remote_sync));
-      char* p = pointer_to_string(&*remote_sync);
+      char* p = pointer_to_string(remote_sync.get());
       args = bprintf("comm=%s (%d of %lu)",
         p, value + 1, xbt_dynar_length(&comms));
       xbt_free(p);
@@ -412,10 +407,9 @@ bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
     remote_act = simcall_comm_wait__getraw__comm(req);
     break;
 
-  case SIMCALL_COMM_WAITANY: {
+  case SIMCALL_COMM_WAITANY:
     read_element(mc_model_checker->process(), &remote_act, remote(simcall_comm_waitany__getraw__comms(req)), idx,
                  sizeof(remote_act));
-    }
     break;
 
   case SIMCALL_COMM_TESTANY:
@@ -475,7 +469,7 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
       label = simgrid::xbt::string_printf("[(%lu)] iRecv", issuer->pid);
     break;
 
-  case SIMCALL_COMM_WAIT: {
+  case SIMCALL_COMM_WAIT:
     if (value == -1) {
       if (issuer->host)
         label = simgrid::xbt::string_printf("[(%lu)%s] WaitTimeout", issuer->pid, MC_smx_actor_get_host_name(issuer));
@@ -501,7 +495,6 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
                     dst_proc ? dst_proc->pid : 0);
     }
     break;
-  }
 
   case SIMCALL_COMM_TEST: {
     simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_test__getraw__comm(req);
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 cd22b6b..8be69df 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 {
@@ -97,7 +97,6 @@ void RemoteClient::refresh_simix()
   static_assert(sizeof(simix_global) == sizeof(simgrid::simix::Global*),
     "Bad size for simix_global");
 
-  // simix_global_p = REMOTE(simix_global.get());
   RemotePtr<simgrid::simix::Global> simix_global_p =
     this->read_variable<simgrid::simix::Global*>("simix_global");
 
@@ -161,8 +160,8 @@ const char* MC_smx_actor_get_host_name(smx_actor_t actor)
   */
   union fake_host {
     simgrid::s4u::Host host;
-    fake_host() {}
-    ~fake_host() {}
+    fake_host() { /* Nothing to do*/}
+    ~fake_host() { /* Nothing to do*/}
   };
   fake_host foo;
   const size_t offset = (char*)&foo.host.getName() - (char*)&foo.host;
@@ -185,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 e365f98..69a2a5b 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/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;
 }
@@ -156,6 +156,8 @@ int MC_snapshot_memcmp(
   return MC_snapshot_region_memcmp(addr1, region1, addr2, region2, size);
 }
 
+} // extern "C"
+
 namespace simgrid {
 namespace mc {
 
@@ -192,18 +194,16 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size,
 }
 }
 
-}
-
 #ifdef SIMGRID_TEST
 
-#include <string.h>
-#include <stdlib.h>
+#include <cstdlib>
+#include <cstring>
 
 #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 55%
rename from src/mc/mc_snapshot.h
rename to src/mc/mc_snapshot.hpp
index 03a47e5..12325d1 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,44 +24,35 @@ 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::NoData:
-  default:
-    xbt_die("Storage type not supported");
-
-  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];
+    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);
     }
+    default: // includes StorageType::NoData
+      xbt_die("Storage type not supported");
   }
 }
 
-XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(
-  const void* addr, const simgrid::mc::Snapshot *snapshot, int process_index);
-
+XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgrid::mc::Snapshot* snapshot,
+                                                   int process_index);
 }
 
 // ***** MC Snapshot
@@ -71,22 +62,20 @@ XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(
  *  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, *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, *fd_infos_t;
+};
 
-/** Information about a given stack frame
- *
- */
-typedef struct s_mc_stack_frame {
+/** Information about a given stack frame */
+struct s_mc_stack_frame_t {
   /** Instruction pointer */
   unw_word_t ip;
   /** Stack pointer */
@@ -95,23 +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, *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, *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 {
@@ -120,10 +112,10 @@ 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;
-public: // To be private
+  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;
   std::size_t heap_bytes_used;
   std::vector<std::unique_ptr<s_mc_mem_region_t>> snapshot_regions;
@@ -133,10 +125,9 @@ public: // To be private
   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;
 };
-
 }
 }
 
@@ -152,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;
 }
 
@@ -208,39 +190,32 @@ 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);
-      } else {
-        // The memory spans several pages:
-        return MC_region_read_fragmented(region, target, addr, size);
+        return mc_translate_address_region_chunked((uintptr_t)addr, region);
       }
+      // Otherwise, 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 94ef188..3fce2df 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 <assert.h>
+#include <cassert>
 
 #include <boost/range/algorithm.hpp>
 
 
 #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;
 
@@ -26,14 +26,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc, "Logging specific to MC (state)");
 namespace simgrid {
 namespace mc {
 
-State::State(unsigned long state_number)
+State::State(unsigned long state_number) : num(state_number)
 {
   this->internal_comm.clear();
   std::memset(&this->internal_req, 0, sizeof(this->internal_req));
   std::memset(&this->executed_req, 0, sizeof(this->executed_req));
 
   actorStates.resize(MC_smx_get_maxpid());
-  num = state_number;
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
     system_state = simgrid::mc::take_snapshot(num);
@@ -46,8 +45,7 @@ State::State(unsigned long state_number)
 
 std::size_t State::interleaveSize() const
 {
-  return boost::range::count_if(this->actorStates,
-    [](simgrid::mc::ProcessState const& p) { return p.isTodo(); });
+  return boost::range::count_if(this->actorStates, [](simgrid::mc::ProcessState const& p) { return p.isTodo(); });
 }
 
 Transition State::getTransition() const
@@ -67,12 +65,10 @@ Transition State::getTransition() const
  *  - which simcall can currently be executed (like a comm where the other partner is already known)
  * Once we returned the last enabled transition of a process, it is marked done.
  *
- * Things can get muddled with the WAITANY and TESTANY simcalls, that are rewritten
- * on the fly to a bunch of WAIT (resp TEST) transitions using the transition.argument
- * field to remember what was the last returned sub-transition.
+ * Things can get muddled with the WAITANY and TESTANY simcalls, that are rewritten on the fly to a bunch of WAIT
+ * (resp TEST) transitions using the transition.argument field to remember what was the last returned sub-transition.
  */
-static inline smx_simcall_t MC_state_get_request_for_process(
-  simgrid::mc::State* state, smx_actor_t actor)
+static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State* state, smx_actor_t actor)
 {
   /* reset the outgoing transition */
   simgrid::mc::ProcessState* procstate = &state->actorStates[actor->pid];
@@ -85,80 +81,74 @@ static inline smx_simcall_t MC_state_get_request_for_process(
 
   smx_simcall_t req = nullptr;
   switch (actor->simcall.call) {
-      case SIMCALL_COMM_WAITANY:
-        state->transition.argument = -1;
-        while (procstate->times_considered <
-              read_length(mc_model_checker->process(),
-                remote(simcall_comm_waitany__get__comms(&actor->simcall)))) {
-          if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall,
-              procstate->times_considered++)) {
-            state->transition.argument = procstate->times_considered - 1;
-            break;
-          }
+    case SIMCALL_COMM_WAITANY:
+      state->transition.argument = -1;
+      while (procstate->times_considered <
+             read_length(mc_model_checker->process(), remote(simcall_comm_waitany__get__comms(&actor->simcall)))) {
+        if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall, procstate->times_considered++)) {
+          state->transition.argument = procstate->times_considered - 1;
+          break;
         }
-
-        if (procstate->times_considered >=
-            simgrid::mc::read_length(mc_model_checker->process(),
-              simgrid::mc::remote(simcall_comm_waitany__get__comms(&actor->simcall))))
-          procstate->setDone();
-        if (state->transition.argument != -1)
-          req = &actor->simcall;
-        break;
-
-      case SIMCALL_COMM_TESTANY: {
-        unsigned start_count = procstate->times_considered;
-        state->transition.argument = -1;
-        while (procstate->times_considered <
-                simcall_comm_testany__get__count(&actor->simcall))
-          if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall,
-              procstate->times_considered++)) {
-            state->transition.argument = procstate->times_considered - 1;
-            break;
-          }
-
-        if (procstate->times_considered >=
-            simcall_comm_testany__get__count(&actor->simcall))
-          procstate->setDone();
-
-        if (state->transition.argument != -1 || start_count == 0)
-           req = &actor->simcall;
-
-        break;
       }
 
-      case SIMCALL_COMM_WAIT: {
-        simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> remote_act =
-            remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(&actor->simcall)));
-        simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_act;
-        mc_model_checker->process().read(temp_act, remote_act);
-        simgrid::kernel::activity::CommImpl* act = temp_act.getBuffer();
-        if (act->src_proc && act->dst_proc)
-          state->transition.argument = 0;
-        else if (act->src_proc == nullptr && act->type == SIMIX_COMM_READY
-              && act->detached == 1)
-          state->transition.argument = 0;
-        else
-          state->transition.argument = -1;
+      if (procstate->times_considered >=
+          simgrid::mc::read_length(mc_model_checker->process(),
+                                   simgrid::mc::remote(simcall_comm_waitany__get__comms(&actor->simcall))))
         procstate->setDone();
+      if (state->transition.argument != -1)
         req = &actor->simcall;
-        break;
-      }
+      break;
+
+    case SIMCALL_COMM_TESTANY: {
+      unsigned start_count       = procstate->times_considered;
+      state->transition.argument = -1;
+      while (procstate->times_considered < simcall_comm_testany__get__count(&actor->simcall))
+        if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall, procstate->times_considered++)) {
+          state->transition.argument = procstate->times_considered - 1;
+          break;
+        }
+
+      if (procstate->times_considered >= simcall_comm_testany__get__count(&actor->simcall))
+        procstate->setDone();
 
-      case SIMCALL_MC_RANDOM: {
-        int min_value = simcall_mc_random__get__min(&actor->simcall);
-        state->transition.argument = procstate->times_considered + min_value;
-        procstate->times_considered++;
-        if (state->transition.argument == simcall_mc_random__get__max(&actor->simcall))
-          procstate->setDone();
+      if (state->transition.argument != -1 || start_count == 0)
         req = &actor->simcall;
-        break;
-      }
 
-      default:
-        procstate->setDone();
+      break;
+    }
+
+    case SIMCALL_COMM_WAIT: {
+      simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> remote_act =
+          remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(&actor->simcall)));
+      simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_act;
+      mc_model_checker->process().read(temp_act, remote_act);
+      simgrid::kernel::activity::CommImpl* act = temp_act.getBuffer();
+      if (act->src_proc && act->dst_proc)
         state->transition.argument = 0;
-        req = &actor->simcall;
-        break;
+      else if (act->src_proc == nullptr && act->type == SIMIX_COMM_READY && act->detached == 1)
+        state->transition.argument = 0;
+      else
+        state->transition.argument = -1;
+      procstate->setDone();
+      req = &actor->simcall;
+      break;
+    }
+
+    case SIMCALL_MC_RANDOM: {
+      int min_value              = simcall_mc_random__get__min(&actor->simcall);
+      state->transition.argument = procstate->times_considered + min_value;
+      procstate->times_considered++;
+      if (state->transition.argument == simcall_mc_random__get__max(&actor->simcall))
+        procstate->setDone();
+      req = &actor->simcall;
+      break;
+    }
+
+    default:
+      procstate->setDone();
+      state->transition.argument = 0;
+      req                        = &actor->simcall;
+      break;
   }
   if (not req)
     return nullptr;
@@ -168,9 +158,8 @@ static inline smx_simcall_t MC_state_get_request_for_process(
   // Fetch the data of the request and translate it:
   state->internal_req = *req;
 
-  /* The waitany and testany request are transformed into a wait or test request
-   * over the corresponding communication action so it can be treated later by
-   * the dependence function. */
+  /* The waitany and testany request are transformed into a wait or test request over the corresponding communication
+   * action so it can be treated later by the dependence function. */
   switch (req->call) {
   case SIMCALL_COMM_WAITANY: {
     state->internal_req.call = SIMCALL_COMM_WAIT;
similarity index 78%
rename from src/mc/mc_state.h
rename to src/mc/mc_state.hpp
index d6ee814..d14e7fd 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;
 
@@ -134,13 +125,12 @@ struct XBT_PRIVATE State {
   std::vector<std::vector<simgrid::mc::PatternCommunication>> incomplete_comm_pattern;
   std::vector<unsigned> communicationIndices;
 
-  State(unsigned long state_number);
+  explicit State(unsigned long state_number);
 
   std::size_t interleaveSize() const;
   void addInterleavingSet(smx_actor_t actor) { this->actorStates[actor->pid].consider(); }
   Transition getTransition() const;
 };
-
 }
 }
 
index 6b2d206..b85172e 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
@@ -11,7 +11,7 @@
 // We need this for the register indices:
 // #define _GNU_SOURCE
 
-#include <string.h>
+#include <cstring>
 
 // On x86_64, libunwind unw_context_t has the same layout as ucontext_t:
 #include <sys/types.h>
@@ -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;
@@ -251,15 +251,12 @@ void UnwindContext::initialize(simgrid::mc::RemoteClient* process, unw_context_t
   // We don't really need support for FR registers as they are caller saved
   // and probably never use those fields as libunwind-x86_64 does not read
   // FP registers from the unw_context_t
-  // but we fix the pointer in order to avoid dangling pointers:
-  // context->context_.uc_mcontext.fpregs = &(context->context.__fpregs_mem);
-
   // Let's ignore this and see what happens:
   this->unwindContext_.uc_mcontext.fpregs = nullptr;
 # endif
 #else
   // Do we need to do any fixup like this?
-  #error Target CPU type is not handled.
+error Target CPU type is not handled.
 #endif
 }
 
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 f9115be..3614cc3 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
@@ -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
@@ -28,7 +28,7 @@
  */
 struct _UPT_info {
   pid_t pid;
-  // Other things;
+  // Other things...
 };
 
 /** Get the PID of a `libunwind-ptrace` context
@@ -36,7 +36,7 @@ struct _UPT_info {
 static inline
 pid_t _UPT_getpid(void* arg)
 {
-  struct _UPT_info* info = (_UPT_info*) arg;
+  _UPT_info* info = static_cast<_UPT_info*>(arg);
   return info->pid;
 }
 
index 257ebb4..1cd7efb 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
@@ -22,7 +22,7 @@ void read_element(AddressSpace const& as,
   s_xbt_dynar_t d;
   as.read_bytes(&d, sizeof(d), addr);
   if (i >= d.used)
-    xbt_die("Out of bound index %zi/%lu", i, d.used);
+    xbt_die("Out of bound index %zu/%lu", i, d.used);
   if (len != d.elmsize)
     xbt_die("Bad size in simgrid::mc::read_element");
   as.read_bytes(local, len, remote(xbt_dynar_get_ptr(&d, i)));
index 6c4000d..b655b61 100644 (file)
@@ -1,10 +1,10 @@
-/* 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <errno.h>
+#include <cerrno>
 #include <unistd.h>
 
 #include <sys/socket.h>
@@ -29,11 +29,10 @@ Channel::~Channel()
 int Channel::send(const void* message, size_t size) const
 {
   XBT_DEBUG("Send %s", MC_message_type_name(*(e_mc_message_type*)message));
-  while (::send(this->socket_, message, size, 0) == -1)
-    if (errno == EINTR)
-      continue;
-    else
+  while (::send(this->socket_, message, size, 0) == -1) {
+    if (errno != EINTR)
       return errno;
+  }
   return 0;
 }
 
index c3fb006..4553718 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
@@ -19,7 +19,7 @@ namespace mc {
 /** A channel for exchanging messages between model-checker and model-checked
  *
  *  This abstracts away the way the messages are transferred. Currently, they
- *  are sent over a (connected) `SOCK_DGRAM` socket.
+ *  are sent over a (connected) `SOCK_SEQPACKET` socket.
  */
 class Channel {
   int socket_ = -1;
@@ -50,7 +50,7 @@ public:
   int send(const void* message, size_t size) const;
   int send(e_mc_message_type type) const
   {
-    s_mc_message message = {type};
+    s_mc_message_t message = {type};
     return this->send(&message, sizeof(message));
   }
   /** @brief Send a message; returns 0 on success or errno on failure */
index 9bfc523..291d359 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");
 
@@ -61,7 +61,7 @@ Client* Client::initialize()
   socklen_t socklen = sizeof(type);
   if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &socklen) != 0)
     xbt_die("Could not check socket type");
-  if (type != SOCK_DGRAM)
+  if (type != SOCK_SEQPACKET)
     xbt_die("Unexpected socket type %i", type);
   XBT_DEBUG("Model-checked application found expected socket type");
 
@@ -83,12 +83,12 @@ Client* Client::initialize()
   return instance_.get();
 }
 
-void Client::handleDeadlockCheck(mc_message_t* msg)
+void Client::handleDeadlockCheck(s_mc_message_t* msg)
 {
   bool deadlock = false;
   if (not simix_global->process_list.empty()) {
     deadlock = true;
-    for (auto kv : simix_global->process_list)
+    for (auto const& kv : simix_global->process_list)
       if (simgrid::mc::actor_is_enabled(kv.second)) {
         deadlock = false;
         break;
@@ -96,10 +96,10 @@ void Client::handleDeadlockCheck(mc_message_t* msg)
   }
 
   // Send result:
-  mc_message_int_t answer{MC_MESSAGE_DEADLOCK_CHECK_REPLY, deadlock};
+  s_mc_message_int_t answer{MC_MESSAGE_DEADLOCK_CHECK_REPLY, deadlock};
   xbt_assert(channel_.send(answer) == 0, "Could not send response");
 }
-void Client::handleContinue(mc_message_t* msg)
+void Client::handleContinue(s_mc_message_t* msg)
 {
   /* Nothing to do */
 }
@@ -121,7 +121,7 @@ void Client::handleRestore(s_mc_message_restore_t* message)
 void Client::handleActorEnabled(s_mc_message_actor_enabled_t* msg)
 {
   bool res = simgrid::mc::actor_is_enabled(SIMIX_process_from_PID(msg->aid));
-  s_mc_message_int answer{MC_MESSAGE_ACTOR_ENABLED_REPLY, res};
+  s_mc_message_int_t answer{MC_MESSAGE_ACTOR_ENABLED_REPLY, res};
   channel_.send(answer);
 }
 
@@ -136,37 +136,37 @@ void Client::handleMessages()
     if (received_size < 0)
       xbt_die("Could not receive commands from the model-checker");
 
-    mc_message_t* message = (mc_message_t*)message_buffer;
+    s_mc_message_t* message = (s_mc_message_t*)message_buffer;
     switch (message->type) {
 
       case MC_MESSAGE_DEADLOCK_CHECK:
-        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zu != %zu)",
-                   received_size, sizeof(mc_message_t));
+        xbt_assert(received_size == sizeof(s_mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zd != %zu)",
+                   received_size, sizeof(s_mc_message_t));
         handleDeadlockCheck(message);
         break;
 
       case MC_MESSAGE_CONTINUE:
-        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zu != %zu)",
-                   received_size, sizeof(mc_message_t));
+        xbt_assert(received_size == sizeof(s_mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zd != %zu)",
+                   received_size, sizeof(s_mc_message_t));
         handleContinue(message);
         return;
 
       case MC_MESSAGE_SIMCALL_HANDLE:
         xbt_assert(received_size == sizeof(s_mc_message_simcall_handle_t),
-                   "Unexpected size for SIMCALL_HANDLE (%zu != %zu)", received_size,
+                   "Unexpected size for SIMCALL_HANDLE (%zd != %zu)", received_size,
                    sizeof(s_mc_message_simcall_handle_t));
         handleSimcall((s_mc_message_simcall_handle_t*)message_buffer);
         break;
 
       case MC_MESSAGE_RESTORE:
-        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zu != %zu)",
-                   received_size, sizeof(mc_message_t));
+        xbt_assert(received_size == sizeof(s_mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zd != %zu)",
+                   received_size, sizeof(s_mc_message_t));
         handleRestore((s_mc_message_restore_t*)message_buffer);
         break;
 
       case MC_MESSAGE_ACTOR_ENABLED:
         xbt_assert(received_size == sizeof(s_mc_message_actor_enabled_t),
-                   "Unexpected size for ACTOR_ENABLED (%zu != %zu)", received_size,
+                   "Unexpected size for ACTOR_ENABLED (%zd != %zu)", received_size,
                    sizeof(s_mc_message_actor_enabled_t));
         handleActorEnabled((s_mc_message_actor_enabled_t*)message_buffer);
         break;
index 7770b65..dc10fd8 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
@@ -28,18 +28,17 @@ namespace mc {
  */
 class XBT_PUBLIC() Client {
 private:
-  bool active_ = false;
   Channel channel_;
   static std::unique_ptr<Client> instance_;
 
 public:
   Client();
-  explicit Client(int fd) : active_(true), channel_(fd) {}
+  explicit Client(int fd) : channel_(fd) {}
   void handleMessages();
 
 private:
-  void handleDeadlockCheck(mc_message_t* msg);
-  void handleContinue(mc_message_t* msg);
+  void handleDeadlockCheck(s_mc_message_t* msg);
+  void handleContinue(s_mc_message_t* msg);
   void handleSimcall(s_mc_message_simcall_handle_t* message);
   void handleRestore(s_mc_message_restore_t* msg);
   void handleActorEnabled(s_mc_message_actor_enabled_t* msg);
index f96e1e5..0172d70 100644 (file)
@@ -5,17 +5,19 @@
 
 #define _FILE_OFFSET_BITS 64 /* needed for pread_whole to work as expected on 32bits */
 
-#include <assert.h>
-#include <errno.h>
-#include <stddef.h>
-#include <stdint.h>
+#include <algorithm>
+#include <cassert>
+#include <cerrno>
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <vector>
 
 #include <sys/ptrace.h>
 
 #include <cstdio>
 
 #include <fcntl.h>
-#include <regex.h>
 #include <sys/mman.h> // PROT_*
 #include <sys/types.h>
 #include <unistd.h>
 #include <libunwind.h>
 
 #include "xbt/base.h"
+#include "xbt/file.hpp"
 #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"
@@ -44,16 +47,13 @@ using simgrid::mc::remote;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_process, mc, "MC process information");
 
-// ***** Helper stuff
-
 namespace simgrid {
 namespace mc {
 
-#define SO_RE "\\.so[\\.0-9]*$"
-#define VERSION_RE "-[\\.0-9-]*$"
+// ***** Helper stuff
 
 // List of library which memory segments are not considered:
-static const char* const filtered_libraries[] = {
+static const std::vector<std::string> filtered_libraries = {
 #ifdef __linux__
     "ld",
 #elif defined __FreeBSD__
@@ -98,43 +98,34 @@ static const char* const filtered_libraries[] = {
     "libunwind-ptrace",
     "libz"};
 
-static bool is_simgrid_lib(const char* libname)
+static bool is_simgrid_lib(const std::string& libname)
 {
-  return not strcmp(libname, "libsimgrid");
+  return libname == "libsimgrid";
 }
 
-static bool is_filtered_lib(const char* libname)
+static bool is_filtered_lib(const std::string& libname)
 {
-  for (const char* filtered_lib : filtered_libraries)
-    if (strcmp(libname, filtered_lib) == 0)
-      return true;
-  return false;
+  return std::find(begin(filtered_libraries), end(filtered_libraries), libname) != end(filtered_libraries);
 }
 
-struct s_mc_memory_map_re {
-  regex_t so_re;
-  regex_t version_re;
-};
-
-static char* get_lib_name(const char* pathname, struct s_mc_memory_map_re* res)
+static std::string get_lib_name(const std::string& pathname)
 {
-  char* map_basename = xbt_basename(pathname);
-
-  regmatch_t match;
-  if (regexec(&res->so_re, map_basename, 1, &match, 0)) {
-    free(map_basename);
-    return nullptr;
-  }
-
-  char* libname = strndup(map_basename, match.rm_so);
-  free(map_basename);
-  map_basename = nullptr;
-
-  // Strip the version suffix:
-  if (libname && not regexec(&res->version_re, libname, 1, &match, 0)) {
-    char* temp = libname;
-    libname    = strndup(temp, match.rm_so);
-    free(temp);
+  constexpr char digits[]  = ".0123456789";
+  std::string map_basename = simgrid::xbt::Path(pathname).getBasename();
+  std::string libname;
+
+  size_t pos = map_basename.rfind(".so");
+  if (pos != std::string::npos && map_basename.find_first_not_of(digits, pos + 3) == std::string::npos) {
+    // strip the extension (matching regex "\.so[.0-9]*$")
+    libname.assign(map_basename, 0, pos);
+
+    // strip the version suffix (matching regex "-[.0-9-]*$")
+    while (true) {
+      pos = libname.rfind('-');
+      if (pos == std::string::npos || libname.find_first_not_of(digits, pos + 1) != std::string::npos)
+        break;
+      libname.erase(pos);
+    }
   }
 
   return libname;
@@ -227,7 +218,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 +253,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,11 +285,6 @@ void RemoteClient::init_memory_map_info()
   this->binary_info     = nullptr;
   this->libsimgrid_info = nullptr;
 
-  struct 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");
-
   std::vector<simgrid::xbt::VmMap> const& maps = this->memory_map_;
 
   const char* current_name = nullptr;
@@ -334,13 +319,10 @@ void RemoteClient::init_memory_map_info()
       continue;
 
     const bool is_executable = not i;
-    char* libname            = nullptr;
+    std::string libname;
     if (not is_executable) {
-      libname = get_lib_name(pathname, &res);
-      if (not libname)
-        continue;
+      libname = get_lib_name(pathname);
       if (is_filtered_lib(libname)) {
-        free(libname);
         continue;
       }
     }
@@ -350,14 +332,10 @@ void RemoteClient::init_memory_map_info()
     this->object_infos.push_back(info);
     if (is_executable)
       this->binary_info = info;
-    else if (libname && is_simgrid_lib(libname))
+    else if (is_simgrid_lib(libname))
       this->libsimgrid_info = info;
-    free(libname);
   }
 
-  regfree(&res.so_re);
-  regfree(&res.version_re);
-
   // Resolve time (including across different objects):
   for (auto const& object_info : this->object_infos)
     postProcessObjectInformation(this, object_info.get());
@@ -427,7 +405,7 @@ void RemoteClient::read_variable(const char* name, void* target, size_t size) co
   simgrid::mc::Variable* var = this->find_variable(name);
   xbt_assert(var->address, "No simple location for this variable");
   xbt_assert(var->type->full_type, "Partial type for %s, cannot check size", name);
-  xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zi, was %zi)", name,
+  xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zu, was %zu)", name,
              size, (size_t)var->type->full_type->byte_size);
   this->read_bytes(target, size, remote(var->address));
 }
@@ -437,7 +415,6 @@ std::string RemoteClient::read_string(RemotePtr<char> address) const
   if (not address)
     return {};
 
-  // TODO, use std::vector with .data() in C++17 to avoid useless copies
   std::vector<char> res(128);
   off_t off = 0;
 
@@ -608,10 +585,7 @@ void RemoteClient::unignore_heap(void* address, size_t size)
   while (start <= end) {
     cursor       = (start + end) / 2;
     auto& region = ignored_heap_[cursor];
-    if (region.address == address) {
-      ignored_heap_.erase(ignored_heap_.begin() + cursor);
-      return;
-    } else if (region.address < address)
+    if (region.address < address)
       start = cursor + 1;
     else if ((char*)region.address <= ((char*)address + size)) {
       ignored_heap_.erase(ignored_heap_.begin() + cursor);
@@ -671,17 +645,16 @@ void RemoteClient::dumpStack()
 
   _UPT_destroy(context);
   unw_destroy_addr_space(as);
-  return;
 }
 
 bool RemoteClient::actor_is_enabled(aid_t pid)
 {
-  s_mc_message_actor_enabled msg{MC_MESSAGE_ACTOR_ENABLED, pid};
+  s_mc_message_actor_enabled_t msg{MC_MESSAGE_ACTOR_ENABLED, pid};
   process()->getChannel().send(msg);
   char buff[MC_MESSAGE_LENGTH];
   ssize_t received = process()->getChannel().receive(buff, MC_MESSAGE_LENGTH, true);
-  xbt_assert(received == sizeof(s_mc_message_int), "Unexpected size in answer to ACTOR_ENABLED");
-  return ((mc_message_int_t*)buff)->value;
+  xbt_assert(received == sizeof(s_mc_message_int_t), "Unexpected size in answer to ACTOR_ENABLED");
+  return ((s_mc_message_int_t*)buff)->value;
 }
 }
 }
index 2fc8586..1f3809e 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"
@@ -122,10 +122,7 @@ public:
   }
 
   std::string read_string(RemotePtr<char> address) const;
-  std::string read_string(RemotePtr<char> address, std::size_t len) const
-  {
-    return AddressSpace::read_string(address, len);
-  }
+  using AddressSpace::read_string;
 
   // Write memory:
   void write_bytes(const void* buffer, size_t len, RemotePtr<void> address);
@@ -226,7 +223,6 @@ private:
   void refresh_malloc_info();
   void refresh_simix();
 
-private:
   pid_t pid_ = -1;
   Channel channel_;
   bool running_ = false;
@@ -239,17 +235,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 +279,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 951b60c..d92eb7a 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
@@ -38,13 +38,16 @@ private:
   T buffer;
 
 public:
-  Remote() {}
-  ~Remote() {}
-  Remote(T& p) { std::memcpy(&buffer, &p, sizeof(buffer)); }
-  Remote(Remote const& that) { std::memcpy(&buffer, &that.buffer, sizeof(buffer)); }
+  Remote() { /* Nothing to do */}
+  ~Remote() { /* Nothing to do */}
+  Remote(T const& p) { std::memcpy(static_cast<void*>(&buffer), static_cast<const void*>(&p), sizeof(buffer)); }
+  Remote(Remote const& that)
+  {
+    std::memcpy(static_cast<void*>(&buffer), static_cast<const void*>(&that.buffer), sizeof(buffer));
+  }
   Remote& operator=(Remote const& that)
   {
-    std::memcpy(&buffer, &that.buffer, sizeof(buffer));
+    std::memcpy(static_cast<void*>(&buffer), static_cast<const void*>(&that.buffer), sizeof(buffer));
     return *this;
   }
   T* getBuffer() { return &buffer; }
index 74bec4e..6567377 100644 (file)
@@ -1,13 +1,13 @@
-/* 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <cerrno>
 #include <cstddef> // std::size_t
-#include <errno.h>
-#include <stdio.h> // perror
-#include <string.h>
+#include <cstdio>  // perror
+#include <cstring>
 
 #include <sys/socket.h>
 #include <sys/types.h>
index bac7981..3aa610a 100644 (file)
@@ -27,7 +27,7 @@ SG_BEGIN_DECL()
 
 // ***** Messages
 
-typedef enum {
+enum e_mc_message_type {
   MC_MESSAGE_NONE,
   MC_MESSAGE_CONTINUE,
   MC_MESSAGE_IGNORE_HEAP,
@@ -44,14 +44,14 @@ typedef enum {
   MC_MESSAGE_RESTORE,
   MC_MESSAGE_ACTOR_ENABLED,
   MC_MESSAGE_ACTOR_ENABLED_REPLY
-} e_mc_message_type;
+};
 
 #define MC_MESSAGE_LENGTH 512
 
 /** Basic structure for a MC message
  *
  *  The current version of the client/server protocol sends C structures over `AF_LOCAL`
- *  `SOCK_DGRAM` sockets. This means that the protocol is ABI/architecture specific:
+ *  `SOCK_SEQPACKET` sockets. This means that the protocol is ABI/architecture specific:
  *  we currently can't model-check a x86 process from a x86_64 process.
  *
  *  Moreover the protocol is not stable. The same version of the library should be used
@@ -59,69 +59,60 @@ typedef enum {
  */
 
 /* Basic structure: all message start with a message type */
-struct s_mc_message {
-  e_mc_message_type type;
+struct s_mc_message_t {
+  enum e_mc_message_type type;
 };
-typedef struct s_mc_message mc_message_t;
 
-struct s_mc_message_int {
-  e_mc_message_type type;
+struct s_mc_message_int_t {
+  enum e_mc_message_type type;
   uint64_t value;
 };
-typedef struct s_mc_message_int mc_message_int_t;
 
 /* Client->Server */
-struct s_mc_message_ignore_heap {
-  e_mc_message_type type;
+struct s_mc_message_ignore_heap_t {
+  enum e_mc_message_type type;
   int block;
   int fragment;
   void* address;
   size_t size;
 };
-typedef struct s_mc_message_ignore_heap s_mc_message_ignore_heap_t;
 
-struct s_mc_message_ignore_memory {
-  e_mc_message_type type;
+struct s_mc_message_ignore_memory_t {
+  enum e_mc_message_type type;
   uint64_t addr;
   size_t size;
 };
-typedef struct s_mc_message_ignore_memory s_mc_message_ignore_memory_t;
 
-struct s_mc_message_stack_region {
-  e_mc_message_type type;
+struct s_mc_message_stack_region_t {
+  enum e_mc_message_type type;
   s_stack_region_t stack_region;
 };
-typedef struct s_mc_message_stack_region s_mc_message_stack_region_t;
 
-struct s_mc_message_register_symbol {
-  e_mc_message_type type;
+struct s_mc_message_register_symbol_t {
+  enum e_mc_message_type type;
   char name[128];
   int (*callback)(void*);
   void* data;
 };
-typedef struct s_mc_message_register_symbol s_mc_message_register_symbol_t;
 
 /* Server -> client */
-struct s_mc_message_simcall_handle {
-  e_mc_message_type type;
+struct s_mc_message_simcall_handle_t {
+  enum e_mc_message_type type;
   unsigned long pid;
   int value;
 };
-typedef struct s_mc_message_simcall_handle s_mc_message_simcall_handle_t;
 
-struct s_mc_message_restore {
-  e_mc_message_type type;
+struct s_mc_message_restore_t {
+  enum e_mc_message_type type;
   int index;
 };
-typedef struct s_mc_message_restore s_mc_message_restore_t;
 
-struct s_mc_message_actor_enabled {
-  e_mc_message_type type;
+struct s_mc_message_actor_enabled_t {
+  enum e_mc_message_type type;
   aid_t aid; // actor ID
 };
-typedef struct s_mc_message_actor_enabled s_mc_message_actor_enabled_t;
 
-XBT_PRIVATE const char* MC_message_type_name(e_mc_message_type type);
+XBT_PRIVATE const char* MC_message_type_name(enum e_mc_message_type type);
 
 SG_END_DECL()
 
index 21a1355..a596982 100644 (file)
@@ -4,41 +4,29 @@
  * 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");
 
-char *instr_process_id (msg_process_t proc, char *str, int len)
+std::string instr_pid(msg_process_t proc)
 {
-  return instr_process_id_2(proc->getCname(), proc->getPid(), str, len);
+  return std::string(proc->getCname()) + "-" + std::to_string(proc->getPid());
 }
 
-char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len)
-{
-  snprintf (str, len, "%s-%d", process_name, process_pid);
-  return str;
-}
-
-/*
- * Instrumentation functions to trace MSG processes (msg_process_t)
- */
-void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, msg_host_t new_host)
+void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host)
 {
   if (TRACE_msg_process_is_enabled()){
     static long long int counter = 0;
 
-    char key[INSTR_DEFAULT_STR_SIZE];
-    snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
-
-    int len = INSTR_DEFAULT_STR_SIZE;
-    char str[INSTR_DEFAULT_STR_SIZE];
+    std::string key = std::to_string(counter);
+    counter++;
 
     //start link
-    container_t msg = PJ_container_get (instr_process_id(process, str, len));
-    type_t type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
-    new StartLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    container_t msg                = simgrid::instr::Container::byName(instr_pid(process));
+    simgrid::instr::LinkType* link = simgrid::instr::Container::getRoot()->getLink("MSG_PROCESS_LINK");
+    link->startEvent(msg, "M", key);
 
     //destroy existing container of this process
     TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process));
@@ -47,40 +35,33 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, m
     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 ("MSG_PROCESS_LINK", PJ_type_get_root());
-    new EndLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    msg = simgrid::instr::Container::byName(instr_pid(process));
+    link->endEvent(msg, "M", key);
   }
 }
 
-void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host)
+void TRACE_msg_process_create(std::string process_name, int process_pid, msg_host_t host)
 {
   if (TRACE_msg_process_is_enabled()){
-    int len = INSTR_DEFAULT_STR_SIZE;
-    char str[INSTR_DEFAULT_STR_SIZE];
-
-    container_t host_container = PJ_container_get(host->getCname());
-    PJ_container_new(instr_process_id_2(process_name, process_pid, str, len), INSTR_MSG_PROCESS, host_container);
+    container_t host_container = simgrid::instr::Container::byName(host->getName());
+    new simgrid::instr::Container(process_name + "-" + std::to_string(process_pid), "MSG_PROCESS", host_container);
   }
 }
 
-void TRACE_msg_process_destroy (const char *process_name, int process_pid)
+void TRACE_msg_process_destroy(std::string process_name, int process_pid)
 {
   if (TRACE_msg_process_is_enabled()) {
-    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(process_name + "-" + std::to_string(process_pid));
     if (process) {
-      PJ_container_remove_from_parent (process);
-      PJ_container_free (process);
+      process->removeFromParent();
+      delete process;
     }
   }
 }
 
 void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process)
 {
-  if (TRACE_msg_process_is_enabled() && status==SMX_EXIT_FAILURE){
+  if (TRACE_msg_process_is_enabled() && status == SMX_EXIT_FAILURE) {
     //kill means that this process no longer exists, let's destroy it
     TRACE_msg_process_destroy(process->getCname(), process->getPid());
   }
@@ -88,50 +69,24 @@ void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t proc
 
 void TRACE_msg_process_suspend(msg_process_t process)
 {
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = PJ_value_get ("suspend", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(process))->getState("MSG_PROCESS_STATE")->pushEvent("suspend");
 }
 
 void TRACE_msg_process_resume(msg_process_t process)
 {
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    new PopStateEvent (MSG_get_clock(), process_container, type);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(process))->getState("MSG_PROCESS_STATE")->popEvent();
 }
 
 void TRACE_msg_process_sleep_in(msg_process_t process)
 {
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = PJ_value_get ("sleep", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(process))->getState("MSG_PROCESS_STATE")->pushEvent("sleep");
 }
 
 void TRACE_msg_process_sleep_out(msg_process_t process)
 {
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    new PopStateEvent (MSG_get_clock(), process_container, type);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(process))->getState("MSG_PROCESS_STATE")->popEvent();
 }
index fb58628..93d6fc8 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>
 
@@ -48,29 +48,18 @@ void TRACE_msg_task_execute_start(msg_task_t task)
 {
   XBT_DEBUG("EXEC,in %p, %lld, %s", task, task->counter, task->category);
 
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = PJ_value_get ("task_execute", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(MSG_process_self()))
+        ->getState("MSG_PROCESS_STATE")
+        ->pushEvent("task_execute");
 }
 
 void TRACE_msg_task_execute_end(msg_task_t task)
 {
   XBT_DEBUG("EXEC,out %p, %lld, %s", task, task->counter, task->category);
 
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    new PopStateEvent (MSG_get_clock(), process_container, type);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(MSG_process_self()))->getState("MSG_PROCESS_STATE")->popEvent();
 }
 
 /* MSG_task_destroy related functions */
@@ -88,33 +77,22 @@ void TRACE_msg_task_get_start()
 {
   XBT_DEBUG("GET,in");
 
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = PJ_value_get ("receive", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(MSG_process_self()))
+        ->getState("MSG_PROCESS_STATE")
+        ->pushEvent("receive");
 }
 
-void TRACE_msg_task_get_end(double start_time, msg_task_t task)
+void TRACE_msg_task_get_end(msg_task_t task)
 {
   XBT_DEBUG("GET,out %p, %lld, %s", task, task->counter, task->category);
 
   if (TRACE_msg_process_is_enabled()){
-    int len = INSTR_DEFAULT_STR_SIZE;
-    char str[INSTR_DEFAULT_STR_SIZE];
+    container_t process_container = simgrid::instr::Container::byName(instr_pid(MSG_process_self()));
+    process_container->getState("MSG_PROCESS_STATE")->popEvent();
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    new 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 ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
-    new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+    std::string key = std::string("p") + std::to_string(task->counter);
+    simgrid::instr::Container::getRoot()->getLink("MSG_PROCESS_TASK_LINK")->endEvent(process_container, "SR", key);
   }
 }
 
@@ -124,18 +102,11 @@ int TRACE_msg_task_put_start(msg_task_t task)
   XBT_DEBUG("PUT,in %p, %lld, %s", task, task->counter, task->category);
 
   if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = PJ_value_get ("send", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
-
-    char key[INSTR_DEFAULT_STR_SIZE];
-    snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
-    type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
-    new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+    container_t process_container = simgrid::instr::Container::byName(instr_pid(MSG_process_self()));
+    process_container->getState("MSG_PROCESS_STATE")->pushEvent("send");
+
+    std::string key = std::string("p") + std::to_string(task->counter);
+    simgrid::instr::Container::getRoot()->getLink("MSG_PROCESS_TASK_LINK")->startEvent(process_container, "SR", key);
   }
 
   return 1;
@@ -145,12 +116,6 @@ void TRACE_msg_task_put_end()
 {
   XBT_DEBUG("PUT,out");
 
-  if (TRACE_msg_process_is_enabled()){
-    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));
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    new PopStateEvent (MSG_get_clock(), process_container, type);
-  }
+  if (TRACE_msg_process_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(MSG_process_self()))->getState("MSG_PROCESS_STATE")->popEvent();
 }
index b5d171a..82619ee 100644 (file)
@@ -1,16 +1,16 @@
-/* Copyright (c) 2009-2015. The SimGrid Team. All rights reserved.          */
+/* 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. */
 
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "xbt/replay.hpp"
 
-#include <errno.h>
+#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()
 {
@@ -40,7 +40,7 @@ msg_error_t MSG_action_trace_run(char *path)
     XBT_WARN("Not all actions got consumed. If the simulation ended successfully (without deadlock),"
              " you may want to add new processes to your deployment file.");
 
-    for (auto actions_of : simgrid::xbt::action_queues) {
+    for (auto const& actions_of : simgrid::xbt::action_queues) {
       XBT_WARN("Still %zu actions for %s", actions_of.second->size(), actions_of.first.c_str());
     }
   }
@@ -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 1114b49..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 **************************************/
 
@@ -53,7 +53,7 @@ msg_netzone_t MSG_zone_get_by_name(const char* name)
 
 void MSG_zone_get_sons(msg_netzone_t netzone, xbt_dict_t whereto)
 {
-  for (auto elem : *netzone->getChildren()) {
+  for (auto const& elem : *netzone->getChildren()) {
     xbt_dict_set(whereto, elem->getCname(), static_cast<void*>(elem), nullptr);
   }
 }
@@ -73,8 +73,7 @@ void MSG_zone_get_hosts(msg_netzone_t netzone, xbt_dynar_t whereto)
   /* converts vector to dynar */
   std::vector<simgrid::s4u::Host*> hosts;
   netzone->getHosts(&hosts);
-  for (auto host : hosts)
+  for (auto const& host : hosts)
     xbt_dynar_push(whereto, &host);
 }
-
-SG_END_DECL()
+}
index 011f6f6..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();
@@ -32,7 +32,7 @@ static void _sg_cfg_cb_msg_debug_multiple_use(const char *name)
  */
 void MSG_init_nocheck(int *argc, char **argv) {
 
-  TRACE_global_init(argc, argv);
+  TRACE_global_init();
 
   if (not msg_global) {
 
@@ -113,7 +113,6 @@ static void MSG_exit() {
   if (msg_global==nullptr)
     return;
 
-  TRACE_surf_resource_utilization_release();
   TRACE_end();
   delete msg_global;
   msg_global = nullptr;
@@ -131,5 +130,4 @@ unsigned long int MSG_get_sent_msg()
 {
   return msg_global->sent_msg;
 }
-
-SG_END_DECL()
+}
index 53ea92d..8b72d65 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.
@@ -70,7 +70,7 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
       simdata->compute =
           boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(simcall_execution_parallel_start(
               task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount,
-              simdata->bytes_parallel_amount, 1.0, -1.0, timeout));
+              simdata->bytes_parallel_amount, -1.0, timeout));
       XBT_DEBUG("Parallel execution action created: %p", simdata->compute.get());
     } else {
       simdata->compute = boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(
@@ -259,7 +259,6 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, d
     THROW_UNIMPLEMENTED;
 
   TRACE_msg_task_get_start();
-  double start_time = MSG_get_clock();
 
   /* Sanity check */
   xbt_assert(task, "Null pointer for the task storage");
@@ -270,7 +269,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) {
@@ -291,7 +290,7 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, d
   }
 
   if (ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
-    TRACE_msg_task_get_end(start_time, *task);
+    TRACE_msg_task_get_end(*task);
   }
   return ret;
 }
@@ -907,5 +906,4 @@ const char *MSG_task_get_category (msg_task_t task)
 {
   return task->category;
 }
-
-SG_END_DECL()
+}
index f9d0762..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;
 
@@ -153,7 +152,7 @@ void MSG_host_get_process_list(msg_host_t host, xbt_dynar_t whereto)
  */
 const char *MSG_host_get_property_value(msg_host_t host, const char *name)
 {
-  return static_cast<const char*>(xbt_dict_get_or_null(MSG_host_get_properties(host), name));
+  return host->getProperty(name);
 }
 
 /** \ingroup m_host_management
@@ -165,7 +164,14 @@ const char *MSG_host_get_property_value(msg_host_t host, const char *name)
 xbt_dict_t MSG_host_get_properties(msg_host_t host)
 {
   xbt_assert((host != nullptr), "Invalid parameters (host is nullptr)");
-  return host->getProperties();
+  xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
+  std::map<std::string, std::string>* props = host->getProperties();
+  if (props == nullptr)
+    return nullptr;
+  for (auto const& elm : *props) {
+    xbt_dict_set(as_dict, elm.first.c_str(), xbt_strdup(elm.second.c_str()), nullptr);
+  }
+  return as_dict;
 }
 
 /** \ingroup m_host_management
@@ -177,7 +183,7 @@ xbt_dict_t MSG_host_get_properties(msg_host_t host)
  */
 void MSG_host_set_property_value(msg_host_t host, const char* name, char* value)
 {
-  xbt_dict_set(MSG_host_get_properties(host), name, value, nullptr);
+  host->setProperty(name, value);
 }
 
 /** @ingroup m_host_management
@@ -255,10 +261,9 @@ xbt_dict_t MSG_host_get_storage_content(msg_host_t host)
 {
   xbt_assert((host != nullptr), "Invalid parameters");
   xbt_dict_t contents = xbt_dict_new_homogeneous(nullptr);
-  for (auto elm : host->getMountedStorages())
+  for (auto const& elm : host->getMountedStorages())
     xbt_dict_set(contents, elm.first.c_str(), MSG_storage_get_content(elm.second), nullptr);
 
   return contents;
 }
-
-SG_END_DECL()
+}
index 1913d3b..1024125 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.
@@ -73,7 +73,8 @@ void MSG_file_dump (msg_file_t fd){
            "\t\tStorage Id: '%s'\n"
            "\t\tStorage Type: '%s'\n"
            "\t\tFile Descriptor Id: %d",
-           fd->getPath(), fd->size(), fd->mount_point.c_str(), fd->storageId, fd->storage_type, fd->desc_id);
+           fd->getPath(), fd->size(), fd->mount_point_.c_str(), fd->localStorage->getCname(),
+           fd->localStorage->getType(), fd->desc_id);
 }
 
 /** \ingroup msg_file
@@ -91,9 +92,9 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size)
     return 0;
 
   /* Find the host where the file is physically located and read it */
-  msg_storage_t storage_src           = simgrid::s4u::Storage::byName(fd->storageId);
+  msg_storage_t storage_src           = fd->localStorage;
   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 */
@@ -132,7 +133,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
     return 0;
 
   /* Find the host where the file is physically located (remote or local)*/
-  msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId);
+  msg_storage_t storage_src = fd->localStorage;
   msg_host_t attached_host  = storage_src->getHost();
 
   if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) {
@@ -157,8 +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 offset     = fd->tell();
-  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;
 }
 
@@ -274,7 +275,7 @@ msg_error_t MSG_file_move (msg_file_t fd, const char* fullpath)
 msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpath)
 {
   /* Find the host where the file is physically located and read it */
-  msg_storage_t storage_src = simgrid::s4u::Storage::byName(file->storageId);
+  msg_storage_t storage_src = file->localStorage;
   msg_host_t src_host       = storage_src->getHost();
   MSG_file_seek(file, 0, SEEK_SET);
   sg_size_t read_size = file->read(file->size());
@@ -284,7 +285,7 @@ msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpa
   msg_host_t dst_host;
   size_t longest_prefix_length = 0;
 
-  for (auto elm : host->getMountedStorages()) {
+  for (auto const& elm : host->getMountedStorages()) {
     std::string mount_point = std::string(fullpath).substr(0, elm.first.size());
     if (mount_point == elm.first && elm.first.length() > longest_prefix_length) {
       /* The current mount name is found in the full path and is bigger than the previous*/
@@ -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
@@ -388,7 +389,14 @@ sg_size_t MSG_storage_get_used_size(msg_storage_t storage)
 xbt_dict_t MSG_storage_get_properties(msg_storage_t storage)
 {
   xbt_assert((storage != nullptr), "Invalid parameters (storage is nullptr)");
-  return storage->getProperties();
+  xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
+  std::map<std::string, std::string>* props = storage->getProperties();
+  if (props == nullptr)
+    return nullptr;
+  for (auto const& elm : *props) {
+    xbt_dict_set(as_dict, elm.first.c_str(), xbt_strdup(elm.second.c_str()), nullptr);
+  }
+  return as_dict;
 }
 
 /** \ingroup msg_storage_management
@@ -432,7 +440,7 @@ xbt_dynar_t MSG_storages_as_dynar()
 {
   std::map<std::string, simgrid::s4u::Storage*>* storage_map = simgrid::s4u::allStorages();
   xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),nullptr);
-  for (auto s : *storage_map)
+  for (auto const& s : *storage_map)
     xbt_dynar_push(res, &(s.second));
   delete storage_map;
   return res;
@@ -470,14 +478,15 @@ 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_dict = xbt_dict_new_homogeneous(&free);
+  // 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 entry : *content) {
-    sg_size_t* psize = static_cast<sg_size_t*>(malloc(sizeof(sg_size_t)));
+  for (auto const& entry : *content) {
+    sg_size_t* psize = new sg_size_t;
     *psize           = entry.second;
-    xbt_dict_set(content_dict, entry.first.c_str(), psize, nullptr);
+    xbt_dict_set(content_as_dict, entry.first.c_str(), psize, nullptr);
   }
-  return content_dict;
+  return content_as_dict;
 }
 
 /** \ingroup msg_storage_management
@@ -502,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 62%
rename from src/msg/msg_private.h
rename to src/msg/msg_private.hpp
index 9734130..62b4285 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"
 
@@ -12,6 +12,8 @@
 #include "src/kernel/activity/ExecImpl.hpp"
 #include "xbt/Extendable.hpp"
 
+#include <atomic>
+
 /**************** datatypes **********************************/
 /**************************** Host Extension *********************************/
 namespace simgrid {
@@ -19,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 *************************************/
 
@@ -70,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))
   {
@@ -88,22 +86,26 @@ 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 */
-  unsigned long int 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);
+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_f_pvoid_t process_data_cleanup;
-} s_MSG_Global_t;
+};
 typedef s_MSG_Global_t* MSG_Global_t;
 
-SG_BEGIN_DECL()
+XBT_PRIVATE std::string instr_pid(msg_process_t proc);
+XBT_PRIVATE void TRACE_msg_process_create(std::string process_name, int process_pid, msg_host_t host);
+XBT_PRIVATE void TRACE_msg_process_destroy(std::string process_name, int process_pid);
+
+extern "C" {
 
 XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
 
 /*************************************************************/
 XBT_PRIVATE void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_proc);
 XBT_PRIVATE smx_actor_t MSG_process_create_from_SIMIX(const char* name, std::function<void()> code, void* data,
-                                                      sg_host_t host, xbt_dict_t properties,
+                                                      sg_host_t host, std::map<std::string, std::string>* properties,
                                                       smx_actor_t parent_process);
 XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(smx_activity_t comm, void* buff, size_t buff_size);
 
@@ -112,31 +114,26 @@ 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_end(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 void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, 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_change_host(msg_process_t process, msg_host_t new_host);
 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 2cabc47..8af7ea5 100644 (file)
@@ -3,13 +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.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup m_process_management
  *
@@ -39,7 +40,7 @@ void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_actor)
     simcall_process_set_data(smx_actor, nullptr);
   }
 
-  TRACE_msg_process_destroy(smx_actor->name.c_str(), smx_actor->pid);
+  TRACE_msg_process_destroy(smx_actor->name, smx_actor->pid);
   // free the data if a function was provided
   if (msg_actor && msg_actor->data && msg_global->process_data_cleanup) {
     msg_global->process_data_cleanup(msg_actor->data);
@@ -51,7 +52,8 @@ void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_actor)
 
 /* This function creates a MSG process. It has the prototype enforced by SIMIX_function_register_process_create */
 smx_actor_t MSG_process_create_from_SIMIX(const char* name, std::function<void()> code, void* data, sg_host_t host,
-                                          xbt_dict_t properties, smx_actor_t parent_process)
+                                          std::map<std::string, std::string>* properties,
+                                          smx_actor_t /*parent_process*/)
 {
   msg_process_t p = MSG_process_create_from_stdfunc(name, std::move(code), data, host, properties);
   return p == nullptr ? nullptr : p->getImpl();
@@ -123,17 +125,24 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
   if (code)
     function = simgrid::xbt::wrapMain(code, argc, static_cast<const char* const*>(argv));
 
-  msg_process_t res = MSG_process_create_from_stdfunc(name, std::move(function), data, host, properties);
+  std::map<std::string, std::string> props;
+  xbt_dict_cursor_t cursor = nullptr;
+  char* key;
+  char* value;
+  xbt_dict_foreach (properties, cursor, key, value)
+    props[key] = value;
+  xbt_dict_free(&properties);
+
+  msg_process_t res = MSG_process_create_from_stdfunc(name, std::move(function), data, host, &props);
   for (int i = 0; i != argc; ++i)
     xbt_free(argv[i]);
   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,
-                                              xbt_dict_t properties)
+                                              std::map<std::string, std::string>* properties)
 {
   xbt_assert(code != nullptr && host != nullptr, "Invalid parameters: host and code params must not be nullptr");
   simgrid::msg::ActorExt* msgExt = new simgrid::msg::ActorExt(data);
@@ -149,7 +158,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
  *
@@ -161,10 +170,16 @@ SG_BEGIN_DECL()
 msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host, xbt_dict_t properties)
 {
   xbt_assert(host != nullptr, "Invalid parameters: host and code params must not be nullptr");
+  std::map<std::string, std::string> props;
+  xbt_dict_cursor_t cursor = nullptr;
+  char* key;
+  char* value;
+  xbt_dict_foreach (properties, cursor, key, value)
+    props[key] = value;
+  xbt_dict_free(&properties);
 
   /* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
-  smx_actor_t process =
-      SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->getCname(), properties, nullptr);
+  smx_actor_t process = SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->getCname(), &props, nullptr);
   if (not process)
     xbt_die("Could not attach");
   simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
@@ -189,7 +204,7 @@ void MSG_process_detach()
  */
 void MSG_process_kill(msg_process_t process)
 {
-  simcall_process_kill(process->getImpl());
+  process->kill();
 }
 
 /**
@@ -211,7 +226,7 @@ msg_error_t MSG_process_join(msg_process_t process, double timeout){
  */
 msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
 {
-  TRACE_msg_process_change_host(process, MSG_process_get_host(process), host);
+  TRACE_msg_process_change_host(process, host);
   process->migrate(host);
   return MSG_OK;
 }
@@ -290,7 +305,12 @@ msg_process_t MSG_process_from_PID(int PID)
 
 /** @brief returns a list of all currently existing processes */
 xbt_dynar_t MSG_processes_as_dynar() {
-  return SIMIX_processes_as_dynar();
+  xbt_dynar_t res = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
+  for (auto const& kv : simix_global->process_list) {
+    smx_actor_t actor = kv.second;
+    xbt_dynar_push(res, &actor);
+  }
+  return res;
 }
 
 /** @brief Return the current number MSG processes. */
@@ -355,7 +375,7 @@ const char *MSG_process_get_name(msg_process_t process)
  */
 const char *MSG_process_get_property_value(msg_process_t process, const char *name)
 {
-  return (char*) xbt_dict_get_or_null(MSG_process_get_properties(process), name);
+  return process->getProperty(name);
 }
 
 /** \ingroup m_process_management
@@ -366,7 +386,15 @@ const char *MSG_process_get_property_value(msg_process_t process, const char *na
 xbt_dict_t MSG_process_get_properties(msg_process_t process)
 {
   xbt_assert(process != nullptr, "Invalid parameter: First argument must not be nullptr");
-  return simcall_process_get_properties(process->getImpl());
+  xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
+  std::map<std::string, std::string>* props =
+      simgrid::simix::kernelImmediate([process] { return process->getImpl()->getProperties(); });
+  if (props == nullptr)
+    return nullptr;
+  for (auto const& elm : *props) {
+    xbt_dict_set(as_dict, elm.first.c_str(), xbt_strdup(elm.second.c_str()), nullptr);
+  }
+  return as_dict;
 }
 
 /** \ingroup m_process_management
@@ -464,14 +492,14 @@ void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) {
  * If the flag is set to 1, the process will be automatically restarted when its host comes back up.
  */
 XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart) {
-  simcall_process_auto_restart_set(process->getImpl(), auto_restart);
+  process->setAutoRestart(auto_restart);
 }
 /**
  * \ingroup m_process_management
  * \brief Restarts a process from the beginning.
  */
 XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process) {
-  return simcall_process_restart(process->getImpl())->ciface();
+  return process->restart();
 }
 
 /** @ingroup m_process_management
@@ -479,7 +507,7 @@ XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process) {
  */
 XBT_PUBLIC(void) MSG_process_daemonize(msg_process_t process)
 {
-  simgrid::simix::kernelImmediate([process]() { process->getImpl()->daemonize(); });
+  process->daemonize();
 }
 
 /** @ingroup m_process_management
@@ -496,5 +524,4 @@ XBT_PUBLIC(void) MSG_process_unref(msg_process_t process)
 {
   intrusive_ptr_release(process);
 }
-
-SG_END_DECL()
+}
index bf625ec..15c3ef8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. 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
@@ -6,7 +6,8 @@
 
 #include "xbt/ex.hpp"
 
-#include "msg_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)");
@@ -18,7 +19,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_synchro, msg, "Logging specific to MSG (sync
 
 /** @brief creates a semaphore object of the given initial capacity */
 msg_sem_t MSG_sem_init(int initial_value) {
-  return simcall_sem_init(initial_value);
+  return simgrid::simix::kernelImmediate([initial_value] { return SIMIX_sem_init(initial_value); });
 }
 
 /** @brief locks on a semaphore object */
@@ -41,11 +42,11 @@ msg_error_t MSG_sem_acquire_timeout(msg_sem_t sem, double timeout) {
 
 /** @brief releases the semaphore object */
 void MSG_sem_release(msg_sem_t sem) {
-  simcall_sem_release(sem);
+  simgrid::simix::kernelImmediate([sem] { SIMIX_sem_release(sem); });
 }
 
 int MSG_sem_get_capacity(msg_sem_t sem) {
-  return simcall_sem_get_capacity(sem);
+  return simgrid::simix::kernelImmediate([sem] { return SIMIX_sem_get_capacity(sem); });
 }
 
 void MSG_sem_destroy(msg_sem_t sem) {
@@ -58,20 +59,20 @@ void MSG_sem_destroy(msg_sem_t sem) {
  * But that's a classical semaphore issue, and SimGrid's semaphore are not different to usual ones here.
  */
 int MSG_sem_would_block(msg_sem_t sem) {
-  return simcall_sem_would_block(sem);
+  return simgrid::simix::kernelImmediate([sem] { return SIMIX_sem_would_block(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           = new s_msg_bar_t;
   bar->expected_processes = count;
   bar->arrived_processes  = 0;
   bar->mutex              = xbt_mutex_init();
@@ -83,14 +84,14 @@ msg_bar_t MSG_barrier_init(unsigned int count) {
 void MSG_barrier_destroy(msg_bar_t bar) {
   xbt_mutex_destroy(bar->mutex);
   xbt_cond_destroy(bar->cond);
-  xbt_free(bar);
+  delete bar;
 }
 
 /** @brief Performs a barrier already initialized */
 int MSG_barrier_wait(msg_bar_t bar) {
   xbt_mutex_acquire(bar->mutex);
   bar->arrived_processes++;
-  XBT_DEBUG("waiting %p %d/%d", bar, bar->arrived_processes, bar->expected_processes);
+  XBT_DEBUG("waiting %p %u/%u", bar, bar->arrived_processes, bar->expected_processes);
   if (bar->arrived_processes == bar->expected_processes) {
     xbt_cond_broadcast(bar->cond);
     xbt_mutex_release(bar->mutex);
index 42a69af..86ece99 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:");
@@ -49,7 +50,7 @@ void simdata_task::reportMultipleUse() const
  */
 msg_task_t MSG_task_create(const char *name, double flop_amount, double message_size, void *data)
 {
-  msg_task_t task = xbt_new(s_msg_task_t, 1);
+  msg_task_t task        = new s_msg_task_t;
   simdata_task_t simdata = new s_simdata_task_t();
   task->simdata = simdata;
 
@@ -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;
 }
@@ -198,7 +203,7 @@ msg_error_t MSG_task_destroy(msg_task_t task)
 
   /* free main structures */
   delete task->simdata;
-  xbt_free(task);
+  delete task;
 
   return MSG_OK;
 }
@@ -223,11 +228,29 @@ msg_error_t MSG_task_cancel(msg_task_t task)
 }
 
 /** \ingroup m_task_management
- * \brief Returns the remaining amount of flops needed to execute a task #msg_task_t.
+ * \brief Returns a value in ]0,1[ that represent the task remaining work
+ *    to do: starts at 1 and goes to 0. Returns 0 if not started or finished.
  *
- * Once a task has been processed, this amount is set to 0. If you want, you can reset this value with
- * #MSG_task_set_flops_amount before restarting the task.
+ * It works for either parallel or sequential tasks.
+ * TODO: Improve this function by returning 1 if the task has not started
  */
+double MSG_task_get_remaining_work_ratio(msg_task_t task) {
+
+  xbt_assert((task != nullptr), "Cannot get information from a nullptr task");
+  if (task->simdata->compute) {
+    // Task in progress
+    return task->simdata->compute->remains();
+
+  //} else if ((MSG_task_get_flops_amount(task) == 0 and task->simdata->flops_parallel_amount == nullptr) //this is a sequential task
+  //    or (task->simdata->flops_parallel_amount != nullptr and task->simdata->flops_parallel_amount == 0)) {
+  //  // Task finished
+  //  return 1;
+  } else {
+    // Task not started or finished
+    return 0;
+  }
+}
+
 double MSG_task_get_flops_amount(msg_task_t task) {
   if (task->simdata->compute) {
     return task->simdata->compute->remains();
@@ -236,6 +259,18 @@ double MSG_task_get_flops_amount(msg_task_t task) {
   }
 }
 
+/** \ingroup m_task_management
+ * \brief Returns the initial amount of flops needed to execute a task #msg_task_t.
+ *
+ * Once a task has been processed, this amount is set to 0. If you want, you can reset this value with
+ * #MSG_task_set_flops_amount before restarting the task.
+ *
+ * Warning: Only work for simple task, not parallel task.
+ */
+double MSG_task_get_initial_flops_amount(msg_task_t task) {
+  return task->simdata->flops_amount;
+}
+
 /** \ingroup m_task_management
  * \brief set the computation amount needed to process a task #msg_task_t.
  *
@@ -304,5 +339,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 2eb403d..00d1d02 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
 
 #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"
+#include "xbt/string.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
-struct dirty_page {
-  double prev_clock;
-  double prev_remaining;
-  msg_task_t task;
+struct s_dirty_page {
+  double prev_clock     = 0.0;
+  double prev_remaining = 0.0;
+  msg_task_t task       = nullptr;
 };
-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");
 
@@ -115,12 +115,14 @@ msg_vm_t MSG_vm_create(msg_host_t pm, const char* name, int coreAmount, int rams
 
   msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount);
   s_vm_params_t params;
-  memset(&params, 0, sizeof(params));
-  params.ramsize = static_cast<sg_size_t>(ramsize) * 1024 * 1024;
-  params.devsize = 0;
-  params.skip_stage2 = 0;
+  params.ncpus        = 0;
+  params.ramsize      = static_cast<sg_size_t>(ramsize) * 1024 * 1024;
+  params.overcommit   = 0;
+  params.devsize      = 0;
+  params.skip_stage1  = 0;
+  params.skip_stage2  = 0;
   params.max_downtime = 0.03;
-  params.mig_speed = static_cast<double>(mig_netspeed) * 1024 * 1024; // mig_speed
+  params.mig_speed    = static_cast<double>(mig_netspeed) * 1024 * 1024; // mig_speed
   params.dp_intensity = static_cast<double>(dp_intensity) / 100;
   params.dp_cap       = params.ramsize * 0.9; // assume working set memory is 90% of ramsize
 
@@ -171,9 +173,9 @@ 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);
-    PJ_container_free(container);
+    container_t container = simgrid::instr::Container::byName(vm->getName());
+    container->removeFromParent();
+    delete container;
   }
 }
 
@@ -184,39 +186,11 @@ void MSG_vm_destroy(msg_vm_t vm)
  */
 void MSG_vm_start(msg_vm_t vm)
 {
-  simgrid::simix::kernelImmediate([vm]() {
-    simgrid::vm::VmHostExt::ensureVmExtInstalled();
-
-    simgrid::s4u::Host* pm = vm->pimpl_vm_->getPm();
-    if (pm->extension<simgrid::vm::VmHostExt>() == nullptr)
-      pm->extension_set(new simgrid::vm::VmHostExt());
-
-    long pm_ramsize   = pm->extension<simgrid::vm::VmHostExt>()->ramsize;
-    int pm_overcommit = pm->extension<simgrid::vm::VmHostExt>()->overcommit;
-    long vm_ramsize   = vm->getRamsize();
-
-    if (pm_ramsize && not pm_overcommit) { /* Only verify that we don't overcommit on need */
-      /* Retrieve the memory occupied by the VMs on that host. Yep, we have to traverse all VMs of all hosts for that */
-      long total_ramsize_of_vms = 0;
-      for (simgrid::s4u::VirtualMachine* ws_vm : simgrid::vm::VirtualMachineImpl::allVms_)
-        if (pm == ws_vm->pimpl_vm_->getPm())
-          total_ramsize_of_vms += ws_vm->pimpl_vm_->getRamsize();
-
-      if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
-        XBT_WARN("cannnot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
-                 vm->getCname(), pm->getCname(), vm_ramsize, pm_ramsize - total_ramsize_of_vms, pm_ramsize);
-        THROWF(vm_error, 0, "Memory shortage on host '%s', VM '%s' cannot be started", pm->getCname(), vm->getCname());
-      }
-    }
-
-    vm->pimpl_vm_->setState(SURF_VM_STATE_RUNNING);
-  });
-
+  vm->start();
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
-    type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
-    val_t value              = PJ_value_get_or_new("start", "0 0 1", type); // start is blue
-    new PushStateEvent(MSG_get_clock(), vm_container, type, value);
+    simgrid::instr::StateType* state = simgrid::instr::Container::byName(vm->getName())->getState("MSG_VM_STATE");
+    state->addEntityValue("start", "0 0 1"); // start is blue
+    state->pushEvent("start");
   }
 }
 
@@ -229,27 +203,27 @@ void MSG_vm_start(msg_vm_t vm)
  */
 void MSG_vm_shutdown(msg_vm_t vm)
 {
-  smx_actor_t issuer=SIMIX_process_self();
+  smx_actor_t issuer = SIMIX_process_self();
   simgrid::simix::kernelImmediate([vm, issuer]() { vm->pimpl_vm_->shutdown(issuer); });
 
-  // Make sure that the processes in the VM are killed in this scheduling round before processing
-  // (eg with the VM destroy)
+  // Make sure that processes in the VM are killed in this scheduling round before processing (eg with the VM destroy)
   MSG_process_sleep(0.);
 }
 
-static inline char *get_mig_process_tx_name(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
+static std::string get_mig_process_tx_name(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
 {
-  return bprintf("__pr_mig_tx:%s(%s-%s)", vm->getCname(), src_pm->getCname(), dst_pm->getCname());
+  return std::string("__pr_mig_tx:") + vm->getCname() + "(" + src_pm->getCname() + "-" + dst_pm->getCname() + ")";
 }
 
-static inline char *get_mig_process_rx_name(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
+static std::string get_mig_process_rx_name(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
 {
-  return bprintf("__pr_mig_rx:%s(%s-%s)", vm->getCname(), src_pm->getCname(), dst_pm->getCname());
+  return std::string("__pr_mig_rx:") + vm->getCname() + "(" + src_pm->getCname() + "-" + dst_pm->getCname() + ")";
 }
 
-static inline char *get_mig_task_name(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm, int stage)
+static std::string get_mig_task_name(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm, int stage)
 {
-  return bprintf("__task_mig_stage%d:%s(%s-%s)", stage, vm->getCname(), src_pm->getCname(), dst_pm->getCname());
+  return std::string("__task_mig_stage") + std::to_string(stage) + ":" + vm->getCname() + "(" + src_pm->getCname() +
+         "-" + dst_pm->getCname() + ")";
 }
 
 struct migration_session {
@@ -259,9 +233,9 @@ struct migration_session {
 
   /* The miration_rx process uses mbox_ctl to let the caller of do_migration()
    * know the completion of the migration. */
-  char *mbox_ctl;
+  std::string mbox_ctl;
   /* The migration_rx and migration_tx processes use mbox to transfer migration data. */
-  char *mbox;
+  std::string mbox;
 };
 
 static int migration_rx_fun(int argc, char *argv[])
@@ -269,28 +243,26 @@ 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;
 
-  char *finalize_task_name = get_mig_task_name(ms->vm, ms->src_pm, ms->dst_pm, 3);
+  std::string finalize_task_name = get_mig_task_name(ms->vm, ms->src_pm, ms->dst_pm, 3);
   while (not received_finalize) {
     msg_task_t task = nullptr;
-    int ret         = MSG_task_recv(&task, ms->mbox);
+    int ret         = MSG_task_recv(&task, ms->mbox.c_str());
 
     if (ret != MSG_OK) {
       // An error occurred, clean the code and return
       // The owner did not change, hence the task should be only destroyed on the other side
-      xbt_free(finalize_task_name);
       return 0;
     }
 
-    if (strcmp(task->name, finalize_task_name) == 0)
+    if (finalize_task_name == task->name)
       received_finalize = 1;
 
     MSG_task_destroy(task);
   }
-  xbt_free(finalize_task_name);
 
   // Here Stage 1, 2  and 3 have been performed.
   // Hence complete the migration
@@ -319,34 +291,30 @@ static int migration_rx_fun(int argc, char *argv[])
 
   if (TRACE_msg_vm_is_enabled()) {
     static long long int counter = 0;
-    char key[INSTR_DEFAULT_STR_SIZE];
-    snprintf(key, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
+    std::string key              = std::to_string(counter);
     counter++;
 
     // start link
-    container_t msg = PJ_container_get(vm->getCname());
-    type_t type     = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
-    new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    container_t msg = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Container::getRoot()->getLink("MSG_VM_LINK")->startEvent(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);
-    PJ_container_free(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
-    PJ_container_new(vm->getCname(), INSTR_MSG_VM, PJ_container_get(ms->dst_pm->getCname()));
+    new simgrid::instr::Container(vm->getCname(), "MSG_VM", simgrid::instr::Container::byName(ms->dst_pm->getName()));
 
     // end link
-    msg  = PJ_container_get(vm->getCname());
-    type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
-    new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    msg  = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Container::getRoot()->getLink("MSG_VM_LINK")->endEvent(msg, "M", key);
   }
 
   // Inform the SRC that the migration has been correctly performed
-  char *task_name = get_mig_task_name(ms->vm, ms->src_pm, ms->dst_pm, 4);
-  msg_task_t task = MSG_task_create(task_name, 0, 0, nullptr);
-  msg_error_t ret = MSG_task_send(task, ms->mbox_ctl);
-  // xbt_assert(ret == MSG_OK);
+  std::string task_name = get_mig_task_name(ms->vm, ms->src_pm, ms->dst_pm, 4);
+  msg_task_t task       = MSG_task_create(task_name.c_str(), 0, 0, nullptr);
+  msg_error_t ret       = MSG_task_send(task, ms->mbox_ctl.c_str());
   if(ret == MSG_HOST_FAILURE){
     // The DST has crashed, this is a problem has the VM since we are not sure whether SRC is considering that the VM
     // has been correctly migrated on the DST node
@@ -356,7 +324,6 @@ static int migration_rx_fun(int argc, char *argv[])
     // The SRC has crashed, this is not a problem has the VM has been correctly migrated on the DST node
     MSG_task_destroy(task);
   }
-  xbt_free(task_name);
 
   XBT_DEBUG("mig: rx_done");
   return 0;
@@ -368,9 +335,9 @@ static void start_dirty_page_tracking(msg_vm_t vm)
   if (vm->pimpl_vm_->dp_objs.empty())
     return;
 
-  for (auto elm : vm->pimpl_vm_->dp_objs) {
+  for (auto const& elm : vm->pimpl_vm_->dp_objs) {
     dirty_page_t dp    = elm.second;
-    double remaining = MSG_task_get_flops_amount(dp->task);
+    double remaining = MSG_task_get_remaining_work_ratio(dp->task);
     dp->prev_clock = MSG_get_clock();
     dp->prev_remaining = remaining;
     XBT_DEBUG("%s@%s remaining %f", elm.first.c_str(), vm->getCname(), remaining);
@@ -382,12 +349,12 @@ static void stop_dirty_page_tracking(msg_vm_t vm)
   vm->pimpl_vm_->dp_enabled = 0;
 }
 
-static double get_computed(const char* key, msg_vm_t vm, dirty_page_t dp, double remaining, double clock)
+static double get_computed(const std::string& key, msg_vm_t vm, dirty_page_t dp, double remaining, double clock)
 {
   double computed = dp->prev_remaining - remaining;
   double duration = clock - dp->prev_clock;
 
-  XBT_DEBUG("%s@%s: computed %f ops (remaining %f -> %f) in %f secs (%f -> %f)", key, vm->getCname(), computed,
+  XBT_DEBUG("%s@%s: computed %f ops (remaining %f -> %f) in %f secs (%f -> %f)", key.c_str(), vm->getCname(), computed,
             dp->prev_remaining, remaining, duration, dp->prev_clock, clock);
 
   return computed;
@@ -397,14 +364,13 @@ static double lookup_computed_flop_counts(msg_vm_t vm, int stage_for_fancy_debug
 {
   double total = 0;
 
-  for (auto elm : vm->pimpl_vm_->dp_objs) {
-    const char* key  = elm.first.c_str();
+  for (auto const& elm : vm->pimpl_vm_->dp_objs) {
+    const std::string& key = elm.first;
     dirty_page_t dp  = elm.second;
-    double remaining = MSG_task_get_flops_amount(dp->task);
+    double remaining       = MSG_task_get_remaining_work_ratio(dp->task);
 
     double clock = MSG_get_clock();
 
-    // total += calc_updated_pages(key, vm, dp, remaining, clock);
     total += get_computed(key, vm, dp, remaining, clock);
 
     dp->prev_remaining = remaining;
@@ -430,19 +396,18 @@ void MSG_host_add_task(msg_host_t host, msg_task_t task)
   if (vm == nullptr)
     return;
 
-  double remaining = MSG_task_get_flops_amount(task);
-  char *key = bprintf("%s-%p", task->name, task);
+  double remaining = MSG_task_get_initial_flops_amount(task);
+  std::string key  = simgrid::xbt::string_printf("%s-%p", task->name, task);
 
-  dirty_page_t dp = xbt_new0(s_dirty_page, 1);
+  dirty_page_t dp = new s_dirty_page;
   dp->task = task;
   if (vm->pimpl_vm_->dp_enabled) {
     dp->prev_clock = MSG_get_clock();
     dp->prev_remaining = remaining;
   }
   vm->pimpl_vm_->dp_objs.insert({key, dp});
-  XBT_DEBUG("add %s on %s (remaining %f, dp_enabled %d)", key, host->getCname(), remaining, vm->pimpl_vm_->dp_enabled);
-
-  xbt_free(key);
+  XBT_DEBUG("add %s on %s (remaining %f, dp_enabled %d)", key.c_str(), host->getCname(), remaining,
+            vm->pimpl_vm_->dp_enabled);
 }
 
 void MSG_host_del_task(msg_host_t host, msg_task_t task)
@@ -451,46 +416,44 @@ void MSG_host_del_task(msg_host_t host, msg_task_t task)
   if (vm == nullptr)
     return;
 
-  char *key = bprintf("%s-%p", task->name, task);
+  std::string key = simgrid::xbt::string_printf("%s-%p", task->name, task);
   dirty_page_t dp = nullptr;
-  if (vm->pimpl_vm_->dp_objs.find(key) != vm->pimpl_vm_->dp_objs.end())
-    dp = vm->pimpl_vm_->dp_objs.at(key);
+  auto dp_obj     = vm->pimpl_vm_->dp_objs.find(key);
+  if (dp_obj != vm->pimpl_vm_->dp_objs.end())
+    dp = dp_obj->second;
   xbt_assert(dp && dp->task == task);
 
   /* If we are in the middle of dirty page tracking, we record how much computation has been done until now, and keep
    * the information for the lookup_() function that will called soon. */
   if (vm->pimpl_vm_->dp_enabled) {
-    double remaining = MSG_task_get_flops_amount(task);
+    double remaining = MSG_task_get_remaining_work_ratio(task);
     double clock = MSG_get_clock();
-    // double updated = calc_updated_pages(key, host, dp, remaining, clock);
     double updated = get_computed(key, vm, dp, remaining, clock); // was host instead of vm
 
     vm->pimpl_vm_->dp_updated_by_deleted_tasks += updated;
   }
 
   vm->pimpl_vm_->dp_objs.erase(key);
-  xbt_free(dp);
+  delete dp;
 
-  XBT_DEBUG("del %s on %s", key, host->getCname());
-  xbt_free(key);
+  XBT_DEBUG("del %s on %s", key.c_str(), host->getCname());
 }
 
-static sg_size_t send_migration_data(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm, sg_size_t size, char* mbox,
-                                     int stage, int stage2_round, double mig_speed, double timeout)
+static sg_size_t send_migration_data(msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm, sg_size_t size,
+                                     const std::string& mbox, int stage, int stage2_round, double mig_speed,
+                                     double timeout)
 {
   sg_size_t sent = 0;
-  char *task_name = get_mig_task_name(vm, src_pm, dst_pm, stage);
-  msg_task_t task = MSG_task_create(task_name, 0, static_cast<double>(size), nullptr);
+  std::string task_name = get_mig_task_name(vm, src_pm, dst_pm, stage);
+  msg_task_t task       = MSG_task_create(task_name.c_str(), 0, static_cast<double>(size), nullptr);
 
   double clock_sta = MSG_get_clock();
 
   msg_error_t ret;
   if (mig_speed > 0)
-    ret = MSG_task_send_with_timeout_bounded(task, mbox, timeout, mig_speed);
+    ret = MSG_task_send_with_timeout_bounded(task, mbox.c_str(), timeout, mig_speed);
   else
-    ret = MSG_task_send(task, mbox);
-
-  xbt_free(task_name);
+    ret = MSG_task_send(task, mbox.c_str());
 
   if (ret == MSG_OK) {
     sent = size;
@@ -530,8 +493,6 @@ static sg_size_t get_updated_size(double computed, double dp_rate, double dp_cap
   double updated_size = computed * dp_rate;
   XBT_DEBUG("updated_size %f dp_rate %f", updated_size, dp_rate);
   if (updated_size > dp_cap) {
-    // XBT_INFO("mig-stage2.%d: %f bytes updated, but cap it with the working set size %f", stage2_round, updated_size,
-    //          dp_cap);
     updated_size = dp_cap;
   }
 
@@ -543,7 +504,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;
@@ -742,40 +703,32 @@ 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);
-  ms->vm = vm;
-  ms->src_pm = src_pm;
-  ms->dst_pm = dst_pm;
+  migration_session ms;
+  ms.vm     = vm;
+  ms.src_pm = src_pm;
+  ms.dst_pm = dst_pm;
 
   /* We have two mailboxes. mbox is used to transfer migration data between source and destination PMs. mbox_ctl is used
    * to detect the completion of a migration. The names of these mailboxes must not conflict with others. */
-  ms->mbox_ctl = bprintf("__mbox_mig_ctl:%s(%s-%s)", vm->getCname(), src_pm->getCname(), dst_pm->getCname());
-  ms->mbox     = bprintf("__mbox_mig_src_dst:%s(%s-%s)", vm->getCname(), src_pm->getCname(), dst_pm->getCname());
+  ms.mbox_ctl =
+      simgrid::xbt::string_printf("__mbox_mig_ctl:%s(%s-%s)", vm->getCname(), src_pm->getCname(), dst_pm->getCname());
+  ms.mbox = simgrid::xbt::string_printf("__mbox_mig_src_dst:%s(%s-%s)", vm->getCname(), src_pm->getCname(),
+                                        dst_pm->getCname());
 
-  char *pr_rx_name = get_mig_process_rx_name(vm, src_pm, dst_pm);
-  char *pr_tx_name = get_mig_process_tx_name(vm, src_pm, dst_pm);
+  std::string pr_rx_name = get_mig_process_rx_name(vm, src_pm, dst_pm);
+  std::string pr_tx_name = get_mig_process_tx_name(vm, src_pm, dst_pm);
 
-  char** argv = xbt_new(char*, 2);
-  argv[0]     = pr_rx_name;
-  argv[1]     = nullptr;
-  MSG_process_create_with_arguments(pr_rx_name, migration_rx_fun, ms, dst_pm, 1, argv);
+  MSG_process_create(pr_rx_name.c_str(), migration_rx_fun, &ms, dst_pm);
 
-  argv        = xbt_new(char*, 2);
-  argv[0]     = pr_tx_name;
-  argv[1]     = nullptr;
-  MSG_process_create_with_arguments(pr_tx_name, migration_tx_fun, ms, src_pm, 1, argv);
+  MSG_process_create(pr_tx_name.c_str(), migration_tx_fun, &ms, src_pm);
 
   /* wait until the migration have finished or on error has occurred */
   XBT_DEBUG("wait for reception of the final ACK (i.e. migration has been correctly performed");
   msg_task_t task = nullptr;
-  msg_error_t ret = MSG_task_receive(&task, ms->mbox_ctl);
+  msg_error_t ret = MSG_task_receive(&task, ms.mbox_ctl.c_str());
 
   vm->pimpl_vm_->isMigrating = false;
 
-  xbt_free(ms->mbox_ctl);
-  xbt_free(ms->mbox);
-  xbt_free(ms);
-
   if (ret == MSG_HOST_FAILURE) {
     // Note that since the communication failed, the owner did not change and the task should be destroyed on the
     // other side. Hence, just throw the execption
@@ -791,9 +744,7 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
            vm->getCname());
   }
 
-  char* expected_task_name = get_mig_task_name(vm, src_pm, dst_pm, 4);
-  xbt_assert(strcmp(task->name, expected_task_name) == 0);
-  xbt_free(expected_task_name);
+  xbt_assert(get_mig_task_name(vm, src_pm, dst_pm, 4) == task->name);
   MSG_task_destroy(task);
 }
 
@@ -813,10 +764,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());
-    type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
-    val_t value              = PJ_value_get_or_new("suspend", "1 0 0", type); // suspend is red
-    new PushStateEvent(MSG_get_clock(), vm_container, type, value);
+    simgrid::instr::StateType* state = simgrid::instr::Container::byName(vm->getName())->getState("MSG_VM_STATE");
+    state->addEntityValue("suspend", "1 0 0"); // suspend is red
+    state->pushEvent("suspend");
   }
 }
 
@@ -829,11 +779,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());
-    type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
-    new PopStateEvent(MSG_get_clock(), vm_container, type);
-  }
+  if (TRACE_msg_vm_is_enabled())
+    simgrid::instr::Container::byName(vm->getName())->getState("MSG_VM_STATE")->popEvent();
 }
 
 /** @brief Get the physical host of a given VM.
@@ -874,5 +821,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 a3b4a0a..1a1f03a 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
@@ -6,7 +6,9 @@
 
 #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"
+
+#include <xbt/asserts.h> // xbt_log_no_loc
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf, "Logging specific to the SURF VM module");
 
@@ -41,8 +43,24 @@ std::deque<s4u::VirtualMachine*> VirtualMachineImpl::allVms_;
  * The total CPU share these processes get is smaller than that of the VM process gets on a host operating system.
  * FIXME: add a configuration flag for this
  */
-// const double virt_overhead = 0.95;
-const double virt_overhead = 1;
+const double virt_overhead = 1; // 0.95
+
+static void hostStateChange(s4u::Host& host)
+{
+  if (host.isOff()) { // just turned off.
+    std::vector<s4u::VirtualMachine*> trash;
+    /* Find all VMs living on that host */
+    for (s4u::VirtualMachine* const& vm : VirtualMachineImpl::allVms_)
+      if (vm->getPm() == &host)
+        trash.push_back(vm);
+    for (s4u::VirtualMachine* vm : trash)
+      vm->pimpl_vm_->shutdown(SIMIX_process_self());
+  }
+}
+VMModel::VMModel()
+{
+  s4u::Host::onStateChange.connect(hostStateChange);
+}
 
 double VMModel::nextOccuringEvent(double now)
 {
@@ -71,19 +89,17 @@ double VMModel::nextOccuringEvent(double now)
    **/
 
   /* iterate for all virtual machines */
-  for (s4u::VirtualMachine* ws_vm : VirtualMachineImpl::allVms_) {
+  for (s4u::VirtualMachine* const& ws_vm : VirtualMachineImpl::allVms_) {
     surf::Cpu* cpu = ws_vm->pimpl_cpu;
     xbt_assert(cpu, "cpu-less host");
 
-    double solved_value = ws_vm->pimpl_vm_->action_->getVariable()
-                              ->value; // this is X1 in comment above, what this VM got in the sharing on the PM
+    double solved_value = ws_vm->pimpl_vm_->action_->getVariable()->get_value(); // this is X1 in comment above, what
+                                                                                 // this VM got in the sharing on the PM
     XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->getCname(), ws_vm->pimpl_vm_->getPm()->getCname());
 
-    // TODO: check lmm_update_constraint_bound() works fine instead of the below manual substitution.
-    // cpu_cas01->constraint->bound = solved_value;
     xbt_assert(cpu->model() == surf_cpu_model_vm);
-    lmm_system_t vcpu_system = cpu->model()->getMaxminSystem();
-    lmm_update_constraint_bound(vcpu_system, cpu->constraint(), virt_overhead * solved_value);
+    surf::lmm_system_t vcpu_system = cpu->model()->getMaxminSystem();
+    vcpu_system->update_constraint_bound(cpu->constraint(), virt_overhead * solved_value);
   }
 
   /* 2. Calculate resource share at the virtual machine layer. */
@@ -114,8 +130,6 @@ VirtualMachineImpl::VirtualMachineImpl(simgrid::s4u::VirtualMachine* piface, sim
   XBT_VERB("Create VM(%s)@PM(%s)", piface->getCname(), hostPM_->getCname());
 }
 
-extern "C" int
-    xbt_log_no_loc; /* ugly pimpl to ensure that the debug info in the known issue below don't break the test */
 /** @brief A physical host does not disappear in the current SimGrid code, but a VM may disappear during a simulation */
 VirtualMachineImpl::~VirtualMachineImpl()
 {
@@ -160,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));
@@ -192,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();
   }
 
@@ -224,7 +238,7 @@ void VirtualMachineImpl::shutdown(smx_actor_t issuer)
         THROW_IMPOSSIBLE;
         break;
     }
-    XBT_VERB("Shuting down the VM %s even if it's not running but %s", piface_->getCname(), stateName);
+    XBT_VERB("Shutting down the VM %s even if it's not running but %s", piface_->getCname(), stateName);
   }
 
   xbt_swag_t process_list = piface_->extension<simgrid::simix::Host>()->process_list;
@@ -233,7 +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", smx_process->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 1063bf1..771747b 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. */
 #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 {
 
-/***********
- * Classes *
- ***********/
-
-class XBT_PRIVATE VMModel;
-XBT_PUBLIC_CLASS VirtualMachineImpl; // Made visible to the Java plugin
-
 /*************
  * Callbacks *
  *************/
@@ -93,10 +86,6 @@ public:
   int dp_enabled                     = 0;
   double dp_updated_by_deleted_tasks = 0;
 
-protected:
-  simgrid::s4u::Host* hostPM_;
-
-public:
   e_surf_vm_state_t getState();
   void setState(e_surf_vm_state_t state);
   static std::deque<s4u::VirtualMachine*> allVms_;
@@ -105,10 +94,9 @@ public:
   bool isMigrating = false;
 
 private:
+  simgrid::s4u::Host* hostPM_;
   s_vm_params_t params_;
   int coreAmount_;
-
-protected:
   e_surf_vm_state_t vmState_ = SURF_VM_STATE_CREATED;
 };
 
@@ -119,8 +107,9 @@ protected:
  * @brief SURF VM model interface class
  * @details A model is an object which handle the interactions between its Resources and its Actions
  */
-class VMModel : public surf::HostModel {
+class XBT_PRIVATE VMModel : public surf::HostModel {
 public:
+  VMModel();
   void ignoreEmptyVmInPmLMM() override{};
 
   double nextOccuringEvent(double now) override;
index c874d48..3dd17c2 100644 (file)
@@ -1,11 +1,12 @@
-/* Copyright (c) 2015-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-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/plugins/vm/VirtualMachineImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/plugins/vm/VmHostExt.hpp"
+#include "src/simix/smx_host_private.hpp"
 #include "src/surf/cpu_cas01.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines");
@@ -31,8 +32,8 @@ 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());
-    PJ_container_new(name, INSTR_MSG_VM, host_container);
+    container_t host_container = simgrid::instr::Container::byName(pm->getName());
+    new simgrid::instr::Container(name, "MSG_VM", host_container);
   }
 }
 
@@ -54,6 +55,38 @@ VirtualMachine::~VirtualMachine()
   pimpl_netpoint = nullptr;
 }
 
+void VirtualMachine::start()
+{
+  simgrid::simix::kernelImmediate([this]() {
+    simgrid::vm::VmHostExt::ensureVmExtInstalled();
+
+    simgrid::s4u::Host* pm = this->pimpl_vm_->getPm();
+    if (pm->extension<simgrid::vm::VmHostExt>() == nullptr)
+      pm->extension_set(new simgrid::vm::VmHostExt());
+
+    long pm_ramsize   = pm->extension<simgrid::vm::VmHostExt>()->ramsize;
+    int pm_overcommit = pm->extension<simgrid::vm::VmHostExt>()->overcommit;
+    long vm_ramsize   = this->getRamsize();
+
+    if (pm_ramsize && not pm_overcommit) { /* Only verify that we don't overcommit on need */
+      /* Retrieve the memory occupied by the VMs on that host. Yep, we have to traverse all VMs of all hosts for that */
+      long total_ramsize_of_vms = 0;
+      for (simgrid::s4u::VirtualMachine* const& ws_vm : simgrid::vm::VirtualMachineImpl::allVms_)
+        if (pm == ws_vm->pimpl_vm_->getPm())
+          total_ramsize_of_vms += ws_vm->pimpl_vm_->getRamsize();
+
+      if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
+        XBT_WARN("cannnot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
+                 this->getCname(), pm->getCname(), vm_ramsize, pm_ramsize - total_ramsize_of_vms, pm_ramsize);
+        THROWF(vm_error, 0, "Memory shortage on host '%s', VM '%s' cannot be started", pm->getCname(),
+               this->getCname());
+      }
+    }
+
+    this->pimpl_vm_->setState(SURF_VM_STATE_RUNNING);
+  });
+}
+
 bool VirtualMachine::isMigrating()
 {
   return pimpl_vm_ && pimpl_vm_->isMigrating;
@@ -80,7 +113,7 @@ void VirtualMachine::getParameters(vm_params_t params)
 /** @brief Sets the params of that VM/PM */
 void VirtualMachine::setParameters(vm_params_t params)
 {
-  simgrid::simix::kernelImmediate([&]() { pimpl_vm_->setParams(params); });
+  simgrid::simix::kernelImmediate([this, params] { pimpl_vm_->setParams(params); });
 }
 
 } // namespace simgrid
index 3d8a38e..1553bb9 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>
 
@@ -62,7 +62,7 @@ void Actor::join() {
 }
 
 void Actor::setAutoRestart(bool autorestart) {
-  simcall_process_auto_restart_set(pimpl_,autorestart);
+  simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; });
 }
 
 void Actor::onExit(int_f_pvoid_pvoid_t fun, void* data)
@@ -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()
@@ -134,7 +134,7 @@ void Actor::kill(aid_t pid)
 {
   smx_actor_t process = SIMIX_process_from_PID(pid);
   if(process != nullptr) {
-    simcall_process_kill(process);
+    simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); });
   } else {
     std::ostringstream oss;
     oss << "kill: ("<< pid <<") - No such process" << std::endl;
@@ -147,7 +147,9 @@ smx_actor_t Actor::getImpl() {
 }
 
 void Actor::kill() {
-  simcall_process_kill(pimpl_);
+  smx_actor_t process = SIMIX_process_self();
+  simgrid::simix::kernelImmediate(
+      [this, process] { SIMIX_process_kill(pimpl_, (pimpl_ == simix_global->maestro_process) ? pimpl_ : process); });
 }
 
 // ***** Static functions *****
@@ -174,14 +176,17 @@ void Actor::killAll(int resetPid)
 /** Retrieve the property value (or nullptr if not set) */
 const char* Actor::getProperty(const char* key)
 {
-  return (char*)xbt_dict_get_or_null(simcall_process_get_properties(pimpl_), key);
+  return simgrid::simix::kernelImmediate([this, key] { return pimpl_->getProperty(key); });
 }
 
 void Actor::setProperty(const char* key, const char* value)
 {
-  simgrid::simix::kernelImmediate([this, key, value] {
-    xbt_dict_set(simcall_process_get_properties(pimpl_), key, (char*)value, (void_f_pvoid_t) nullptr);
-  });
+  simgrid::simix::kernelImmediate([this, key, value] { pimpl_->setProperty(key, value); });
+}
+
+Actor* Actor::restart()
+{
+  return simgrid::simix::kernelImmediate([this]() { return pimpl_->restart(); });
 }
 
 // ***** this_actor *****
@@ -222,31 +227,38 @@ void execute(double flops)
   simcall_execution_wait(s);
 }
 
-void* recv(MailboxPtr chan) {
+void execute(double flops,double priority)
+{
+  smx_activity_t s = simcall_execution_start(nullptr,flops,1 / priority/*priority*/,0./*bound*/);
+  simcall_execution_wait(s);
+}
+
+void* recv(MailboxPtr chan) // deprecated
+{
   return chan->get();
 }
 
-void* recv(MailboxPtr chan, double timeout)
+void* recv(MailboxPtr chan, double timeout) // deprecated
 {
   return chan->get(timeout);
 }
 
-void send(MailboxPtr chan, void* payload, double simulatedSize)
+void send(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
 {
   chan->put(payload, simulatedSize);
 }
 
-void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
+void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout) // deprecated
 {
   chan->put(payload, simulatedSize, timeout);
 }
 
-CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
+CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
 {
   return chan->put_async(payload, simulatedSize);
 }
 
-CommPtr irecv(MailboxPtr chan, void** data)
+CommPtr irecv(MailboxPtr chan, void** data) // deprecated
 {
   return chan->get_async(data);
 }
@@ -263,7 +275,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()
@@ -290,7 +307,8 @@ bool isSuspended()
 
 void kill()
 {
-  simcall_process_kill(SIMIX_process_self());
+  smx_actor_t process = SIMIX_process_self();
+  simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); });
 }
 
 void onExit(int_f_pvoid_pvoid_t fun, void* data)
index abc76c9..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"
@@ -82,53 +82,42 @@ void Comm::start() {
   }
   state_ = started;
 }
+
+/** @brief Block the calling actor until the communication is finished */
 void Comm::wait() {
-  xbt_assert(state_ == started || state_ == inited || state_ == finished);
-
-  if (state_ == finished)
-    return;
-
-  if (state_ == started)
-    simcall_comm_wait(pimpl_, -1/*timeout*/);
-  else { // state_ == inited. Save a simcall and do directly a blocking send/recv
-    if (srcBuff_ != nullptr) {
-      simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_,
-          srcBuff_, srcBuffSize_,
-          matchFunction_, copyDataFunction_,
-          userData_, -1 /*timeout*/);
-    } else {
-      simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_,
-          matchFunction_, copyDataFunction_,
-          userData_, -1/*timeout*/, rate_);
-    }
-  }
-  state_ = finished;
+  this->wait(-1);
 }
 
+/** @brief Block the calling actor until the communication is finished, or until timeout
+ *
+ * On timeout, an exception is thrown.
+ *
+ * @param timeout the amount of seconds to wait for the comm termination.
+ *                Negative values denote infinite wait times. 0 as a timeout returns immediately. */
 void Comm::wait(double timeout) {
-  xbt_assert(state_ == started || state_ == inited || state_ == finished);
-
-  if (state_ == finished)
-    return;
-
-  if (state_ == started) {
-    simcall_comm_wait(pimpl_, timeout);
-    state_ = finished;
-    return;
-  }
-
-  // It's not started yet. Do it in one simcall
-  if (srcBuff_ != nullptr) {
-    simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_,
-        srcBuff_, srcBuffSize_,
-        matchFunction_, copyDataFunction_,
-        userData_, timeout);
-  } else { // Receiver
-    simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_,
-        matchFunction_, copyDataFunction_,
-        userData_, timeout, rate_);
+  switch (state_) {
+    case finished:
+      return;
+
+    case inited: // It's not started yet. Do it in one simcall
+      if (srcBuff_ != nullptr) {
+        simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_,
+                          copyDataFunction_, userData_, timeout);
+      } else { // Receiver
+        simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_,
+                          userData_, timeout, rate_);
+      }
+      state_ = finished;
+      return;
+
+    case started:
+      simcall_comm_wait(pimpl_, timeout);
+      state_ = finished;
+      return;
+
+    default:
+      THROW_IMPOSSIBLE;
   }
-  state_ = finished;
 }
 
 void Comm::detach()
index 0e983e8..886cc33 100644 (file)
@@ -17,7 +17,7 @@
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.h" // routing_platf. FIXME:KILLME. SOON
+#include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON
 
 XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
 
@@ -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(argc, argv);
+  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()
@@ -88,9 +90,19 @@ size_t Engine::getHostCount()
 /** @brief Fills the passed list with all hosts found in the platform */
 void Engine::getHostList(std::vector<Host*>* list)
 {
-  for (auto kv : host_list)
+  for (auto const& kv : host_list)
     list->push_back(kv.second);
 }
+/** @brief Returns the amount of links in the platform */
+size_t Engine::getLinkCount()
+{
+  return simgrid::surf::LinkImpl::linksCount();
+}
+/** @brief Fills the passed list with all hosts found in the platform */
+void Engine::getLinkList(std::vector<Link*>* list)
+{
+  simgrid::surf::LinkImpl::linksList(list);
+}
 
 void Engine::run() {
   if (MC_is_active()) {
@@ -110,7 +122,7 @@ static s4u::NetZone* netzoneByNameRecursive(s4u::NetZone* current, const char* n
   if (not strcmp(current->getCname(), name))
     return current;
 
-  for (auto elem : *(current->getChildren())) {
+  for (auto const& elem : *(current->getChildren())) {
     simgrid::s4u::NetZone* tmp = netzoneByNameRecursive(elem, name);
     if (tmp != nullptr) {
       return tmp;
@@ -126,30 +138,30 @@ NetZone* Engine::getNetzoneByNameOrNull(const char* name)
 }
 
 /** @brief Retrieve the netpoint of the given name (or nullptr if not found) */
-simgrid::kernel::routing::NetPoint* Engine::getNetpointByNameOrNull(const char* name)
+simgrid::kernel::routing::NetPoint* Engine::getNetpointByNameOrNull(std::string name)
 {
-  if (pimpl->netpoints_.find(name) == pimpl->netpoints_.end())
-    return nullptr;
-  return pimpl->netpoints_.at(name);
+  auto netp = pimpl->netpoints_.find(name);
+  return netp == pimpl->netpoints_.end() ? nullptr : netp->second;
 }
+
 /** @brief Fill the provided vector with all existing netpoints */
 void Engine::getNetpointList(std::vector<simgrid::kernel::routing::NetPoint*>* list)
 {
-  for (auto kv : pimpl->netpoints_)
+  for (auto const& kv : pimpl->netpoints_)
     list->push_back(kv.second);
 }
 /** @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 043f6d5..a78e0f9 100644 (file)
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
-#include "src/surf/FileImpl.hpp"
 #include "src/surf/HostImpl.hpp"
 
+#include <algorithm>
+#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/join.hpp>
+#include <boost/algorithm/string/split.hpp>
+#include <fstream>
+
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_file,"S4U files");
 
 namespace simgrid {
 namespace s4u {
+simgrid::xbt::Extension<s4u::Storage, FileSystemStorageExt> FileSystemStorageExt::EXTENSION_ID;
 
-File::File(const char* fullpath, void* userdata) : File(fullpath, Host::current(), userdata){};
+File::File(std::string fullpath, void* userdata) : File(fullpath, Host::current(), userdata){};
 
-File::File(const char* fullpath, sg_host_t host, void* userdata) : path_(fullpath), userdata_(userdata)
+File::File(std::string fullpath, sg_host_t host, void* userdata) : fullpath_(fullpath), userdata_(userdata)
 {
   // this cannot fail because we get a xbt_die if the mountpoint does not exist
   Storage* st                  = nullptr;
   size_t longest_prefix_length = 0;
-  std::string path;
-  XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath, host->getCname());
+  XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath.c_str(), host->getCname());
 
-  for (auto mnt : host->getMountedStorages()) {
+  for (auto const& mnt : host->getMountedStorages()) {
     XBT_DEBUG("See '%s'", mnt.first.c_str());
-    mount_point = std::string(fullpath).substr(0, mnt.first.size());
+    mount_point_ = fullpath.substr(0, mnt.first.length());
 
-    if (mount_point == mnt.first && mnt.first.length() > longest_prefix_length) {
+    if (mount_point_ == mnt.first && mnt.first.length() > longest_prefix_length) {
       /* The current mount name is found in the full path and is bigger than the previous*/
       longest_prefix_length = mnt.first.length();
       st                    = mnt.second;
     }
   }
   if (longest_prefix_length > 0) { /* Mount point found, split fullpath into mount_name and path+filename*/
-    mount_point = std::string(fullpath).substr(0, longest_prefix_length);
-    path        = std::string(fullpath).substr(longest_prefix_length, strlen(fullpath));
+    mount_point_ = fullpath.substr(0, longest_prefix_length);
+    path_        = fullpath.substr(longest_prefix_length, fullpath.length());
   } else
-    xbt_die("Can't find mount point for '%s' on '%s'", fullpath, host->getCname());
-
-  pimpl_ =
-      simgrid::simix::kernelImmediate([this, st, path] { return new simgrid::surf::FileImpl(st, path, mount_point); });
-  storage_type = st->getType();
-  storageId    = st->getName();
-}
-
-File::~File()
-{
-  simgrid::simix::kernelImmediate([this] { delete pimpl_; });
+    xbt_die("Can't find mount point for '%s' on '%s'", fullpath.c_str(), host->getCname());
+
+  localStorage = st;
+
+  XBT_DEBUG("\tOpen file '%s'", path_.c_str());
+  std::map<std::string, sg_size_t>* content = localStorage->getContent();
+  // if file does not exist create an empty file
+  auto sz = content->find(path_);
+  if (sz != content->end()) {
+    size_ = sz->second;
+  } else {
+    size_ = 0;
+    content->insert({path_, size_});
+    XBT_DEBUG("File '%s' was not found, file created.", path_.c_str());
+  }
 }
 
 sg_size_t File::read(sg_size_t size)
 {
-  return simcall_file_read(pimpl_, size);
+  XBT_DEBUG("READ %s on disk '%s'", getPath(), localStorage->getCname());
+  // if the current position is close to the end of the file, we may not be able to read the requested size
+  sg_size_t read_size = localStorage->read(std::min(size, size_ - current_position_));
+  current_position_ += read_size;
+  return read_size;
 }
 
 sg_size_t File::write(sg_size_t size)
 {
-  return simcall_file_write(pimpl_, size);
+  XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", getPath(), localStorage->getCname(), size, size_);
+  // If the storage is full before even starting to write
+  if (localStorage->getSizeUsed() >= localStorage->getSize())
+    return 0;
+  /* Substract the part of the file that might disappear from the used sized on the storage element */
+  localStorage->decrUsedSize(size_ - current_position_);
+
+  sg_size_t write_size = localStorage->write(size);
+  localStorage->incrUsedSize(write_size);
+
+  current_position_ += write_size;
+  size_ = current_position_;
+
+  localStorage->getContent()->erase(path_);
+  localStorage->getContent()->insert({path_, size_});
+
+  return write_size;
 }
 
 sg_size_t File::size()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->size(); });
+  return size_;
 }
 
-void File::seek(sg_offset_t pos)
+void File::seek(sg_offset_t offset)
 {
-  simgrid::simix::kernelImmediate([this, pos] { pimpl_->seek(pos, SEEK_SET); });
+  current_position_ = offset;
 }
 
-void File::seek(sg_offset_t pos, int origin)
+void File::seek(sg_offset_t offset, int origin)
 {
-  simgrid::simix::kernelImmediate([this, pos, origin] { pimpl_->seek(pos, origin); });
+  switch (origin) {
+    case SEEK_SET:
+      current_position_ = offset;
+      break;
+    case SEEK_CUR:
+      current_position_ += offset;
+      break;
+    case SEEK_END:
+      current_position_ = size_ + offset;
+      break;
+    default:
+      break;
+  }
 }
 
 sg_size_t File::tell()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->tell(); });
+  return current_position_;
 }
 
-void File::move(const char* fullpath)
+void File::move(std::string fullpath)
 {
-  simgrid::simix::kernelImmediate([this, fullpath] { pimpl_->move(fullpath); });
+  /* Check if the new full path is on the same mount point */
+  if (not strncmp(mount_point_.c_str(), fullpath.c_str(), mount_point_.length())) {
+    std::map<std::string, sg_size_t>* content = localStorage->getContent();
+    auto sz = content->find(path_);
+    if (sz != content->end()) { // src file exists
+      sg_size_t new_size = sz->second;
+      content->erase(path_);
+      std::string path = fullpath.substr(mount_point_.length(), fullpath.length());
+      content->insert({path.c_str(), new_size});
+      XBT_DEBUG("Move file from %s to %s, size '%llu'", path_.c_str(), fullpath.c_str(), new_size);
+    } else {
+      XBT_WARN("File %s doesn't exist", path_.c_str());
+    }
+  } else {
+    XBT_WARN("New full path %s is not on the same mount point: %s.", fullpath.c_str(), mount_point_.c_str());
+  }
 }
 
 int File::unlink()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->unlink(); });
+  /* Check if the file is on local storage */
+  if (localStorage->getContent()->find(path_) == localStorage->getContent()->end()) {
+    XBT_WARN("File %s is not on disk %s. Impossible to unlink", path_.c_str(), localStorage->getCname());
+    return -1;
+  } else {
+    XBT_DEBUG("UNLINK %s on disk '%s'", path_.c_str(), localStorage->getCname());
+    localStorage->decrUsedSize(size_);
+
+    // Remove the file from storage
+    localStorage->getContent()->erase(fullpath_);
+
+    return 0;
+  }
+}
+
+FileSystemStorageExt::FileSystemStorageExt(simgrid::s4u::Storage* ptr)
+{
+  content_ = parseContent(ptr->getImpl()->content_name);
+}
+
+FileSystemStorageExt::~FileSystemStorageExt()
+{
+  delete content_;
+}
+
+std::map<std::string, sg_size_t>* FileSystemStorageExt::parseContent(std::string filename)
+{
+  if (filename.empty())
+    return nullptr;
+
+  std::map<std::string, sg_size_t>* parse_content = new std::map<std::string, sg_size_t>();
+
+  std::ifstream* fs = surf_ifsopen(filename);
+
+  std::string line;
+  std::vector<std::string> tokens;
+  do {
+    std::getline(*fs, line);
+    boost::trim(line);
+    if (line.length() > 0) {
+      boost::split(tokens, line, boost::is_any_of(" \t"), boost::token_compress_on);
+      xbt_assert(tokens.size() == 2, "Parse error in %s: %s", filename.c_str(), line.c_str());
+      sg_size_t size = std::stoull(tokens.at(1));
+
+      usedSize_ += size;
+      parse_content->insert({tokens.front(), size});
+    }
+  } while (not fs->eof());
+  delete fs;
+  return parse_content;
+}
+}
+}
+
+using simgrid::s4u::FileSystemStorageExt;
+
+static void onStorageCreation(simgrid::s4u::Storage& st)
+{
+  st.extension_set(new FileSystemStorageExt(&st));
+}
+
+static void onStorageDestruction(simgrid::s4u::Storage& st)
+{
+  delete st.extension<FileSystemStorageExt>();
+}
+
+/* **************************** Public interface *************************** */
+SG_BEGIN_DECL()
+
+void sg_storage_file_system_init()
+{
+
+  if (FileSystemStorageExt::EXTENSION_ID.valid())
+    return;
+
+  FileSystemStorageExt::EXTENSION_ID = simgrid::s4u::Storage::extension_create<FileSystemStorageExt>();
+
+  simgrid::s4u::Storage::onCreation.connect(&onStorageCreation);
+  simgrid::s4u::Storage::onDestruction.connect(&onStorageDestruction);
 }
 
-}} // namespace simgrid::s4u
+SG_END_DECL()
index a1520f9..f173821 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"
@@ -87,9 +87,8 @@ Host* Host::by_name_or_null(const char* name)
 }
 Host* Host::by_name_or_null(std::string name)
 {
-  if (host_list.find(name) == host_list.end())
-    return nullptr;
-  return host_list.at(name);
+  auto host = host_list.find(name);
+  return host == host_list.end() ? nullptr : host->second;
 }
 
 Host *Host::current(){
@@ -154,32 +153,30 @@ void Host::actorList(std::vector<ActorPtr>* whereto)
  * walk through the routing components tree and find a route between hosts
  * by calling each "get_route" function in each routing component.
  */
-void Host::routeTo(Host* dest, std::vector<Link*>* links, double* latency)
+void Host::routeTo(Host* dest, std::vector<Link*>& links, double* latency)
 {
   std::vector<surf::LinkImpl*> linkImpls;
-  this->routeTo(dest, &linkImpls, latency);
-  for (surf::LinkImpl* l : linkImpls)
-    links->push_back(&l->piface_);
+  this->routeTo(dest, linkImpls, latency);
+  for (surf::LinkImpl* const& l : linkImpls)
+    links.push_back(&l->piface_);
 }
 
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
-void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>* links, double* latency)
+void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>& links, double* latency)
 {
   simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
   if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
     XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", getCname(), dest->getCname(),
                (latency == nullptr ? -1 : *latency));
-    for (auto link : *links)
-      XBT_CDEBUG(surf_route, "Link %s", link->cname());
+    for (auto const& link : links)
+      XBT_CDEBUG(surf_route, "Link %s", link->getCname());
   }
 }
 
 /** Get the properties assigned to a host */
-xbt_dict_t Host::getProperties()
+std::map<std::string, std::string>* Host::getProperties()
 {
-  return simgrid::simix::kernelImmediate([this] {
-    return this->pimpl_->getProperties();
-  });
+  return simgrid::simix::kernelImmediate([this] { return this->pimpl_->getProperties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
@@ -188,7 +185,7 @@ const char* Host::getProperty(const char* key)
   return this->pimpl_->getProperty(key);
 }
 
-void Host::setProperty(const char* key, const char* value)
+void Host::setProperty(std::string key, std::string value)
 {
   simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
@@ -251,12 +248,21 @@ std::unordered_map<std::string, Storage*> const& Host::getMountedStorages()
 {
   if (mounts == nullptr) {
     mounts = new std::unordered_map<std::string, Storage*>();
-    for (auto m : this->pimpl_->storage_) {
+    for (auto const& m : this->pimpl_->storage_) {
       mounts->insert({m.first, &m.second->piface_});
     }
   }
   return *mounts;
 }
 
+void Host::execute(double flops)
+{
+  Host* host_list[1]   = {this};
+  double flops_list[1] = {flops};
+  smx_activity_t s     = simcall_execution_parallel_start(nullptr /*name*/, 1, host_list, flops_list,
+                                                      nullptr /*comm_sizes */, -1.0, -1 /*timeout*/);
+  simcall_execution_wait(s);
+}
+
 } // namespace simgrid
 } // namespace s4u
index 24561ff..dcac704 100644 (file)
@@ -9,6 +9,7 @@
 #include "simgrid/sg_config.h"
 #include "simgrid/simix.hpp"
 #include "src/surf/network_interface.hpp"
+#include "surf/maxmin.hpp"
 #include "xbt/log.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_link, s4u, "Logging specific to the S4U links");
@@ -21,7 +22,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 +83,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()
 {
@@ -106,6 +115,11 @@ int Link::sharingPolicy()
   return this->pimpl_->sharingPolicy();
 }
 
+double Link::getUsage()
+{
+  return this->pimpl_->constraint()->get_usage();
+}
+
 void Link::turnOn()
 {
   simgrid::simix::kernelImmediate([this]() {
@@ -149,6 +163,15 @@ void Link::setLatencyTrace(tmgr_trace_t trace)
   });
 }
 
+const char* Link::getProperty(const char* key)
+{
+  return this->pimpl_->getProperty(key);
+}
+void Link::setProperty(std::string key, std::string value)
+{
+  simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
+}
+
 /*************
  * Callbacks *
  *************/
index b53d652..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)
@@ -53,9 +58,7 @@ smx_activity_t Mailbox::front()
 }
 
 void Mailbox::setReceiver(ActorPtr actor) {
-  simix::kernelImmediate([this, actor]() {
-    this->pimpl_->setReceiver(actor);
-  });
+  simix::kernelImmediate([this, actor]() { this->pimpl_->setReceiver(actor); });
 }
 
 /** @brief get the receiver (process associated to the mailbox) */
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 33dbf91..52e4014 100644 (file)
@@ -18,12 +18,12 @@ namespace s4u {
 
 simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                           kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                          std::vector<surf::LinkImpl*>* link_list)>
+                          std::vector<surf::LinkImpl*>& link_list)>
     NetZone::onRouteCreation;
 simgrid::xbt::signal<void(NetZone&)> NetZone::onCreation;
 simgrid::xbt::signal<void(NetZone&)> NetZone::onSeal;
 
-NetZone::NetZone(NetZone* father, const char* name) : father_(father), name_(xbt_strdup(name))
+NetZone::NetZone(NetZone* father, std::string name) : father_(father), name_(name)
 {
   children_ = new std::vector<NetZone*>();
 }
@@ -35,10 +35,9 @@ void NetZone::seal()
 
 NetZone::~NetZone()
 {
-  for (auto nz : *children_)
+  for (auto const& nz : *children_)
     delete nz;
   delete children_;
-  xbt_free(name_);
 }
 
 std::unordered_map<std::string, std::string>* NetZone::getProperties()
@@ -64,9 +63,9 @@ std::vector<NetZone*>* NetZone::getChildren()
 {
   return children_;
 }
-char* NetZone::getCname()
+const char* NetZone::getCname() const
 {
-  return name_;
+  return name_.c_str();
 }
 NetZone* NetZone::getFather()
 {
@@ -75,8 +74,8 @@ NetZone* NetZone::getFather()
 
 void NetZone::getHosts(std::vector<s4u::Host*>* whereto)
 {
-  for (auto card : vertices_) {
-    s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name());
+  for (auto const& card : vertices_) {
+    s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->getName());
     if (host != nullptr)
       whereto->push_back(host);
   }
@@ -90,7 +89,7 @@ int NetZone::addComponent(kernel::routing::NetPoint* elm)
 
 void NetZone::addRoute(sg_platf_route_cbarg_t /*route*/)
 {
-  xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_);
+  xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_.c_str());
 }
 }
 }; // namespace simgrid::s4u
index 74770d9..9123343 100644 (file)
@@ -3,26 +3,31 @@
 /* This program is 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/StorageImpl.hpp"
+#include "simgrid/s4u/File.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
+#include "src/surf/StorageImpl.hpp"
 #include <unordered_map>
 
 namespace simgrid {
+namespace xbt {
+template class Extendable<simgrid::s4u::Storage>;
+}
+
 namespace s4u {
 
 std::map<std::string, Storage*>* allStorages()
 {
   std::unordered_map<std::string, surf::StorageImpl*>* map = surf::StorageImpl::storagesMap();
   std::map<std::string, Storage*>* res                     = new std::map<std::string, Storage*>;
-  for (auto s : *map)
+  for (auto const& s : *map)
     res->insert({s.first, &(s.second->piface_)}); // Convert each entry into its interface
 
   return res;
 }
 
-Storage* Storage::byName(const char* name)
+Storage* Storage::byName(std::string name)
 {
   surf::StorageImpl* res = surf::StorageImpl::byName(name);
   if (res == nullptr)
@@ -30,9 +35,14 @@ Storage* Storage::byName(const char* name)
   return &res->piface_;
 }
 
-const char* Storage::getName()
+const std::string& Storage::getName() const
+{
+  return pimpl_->getName();
+}
+
+const char* Storage::getCname() const
 {
-  return pimpl_->cname();
+  return pimpl_->getCname();
 }
 
 const char* Storage::getType()
@@ -47,12 +57,27 @@ Host* Storage::getHost()
 
 sg_size_t Storage::getSizeFree()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->getFreeSize(); });
+  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
+
+  return pimpl_->getSize() - file_system->getUsedSize();
 }
 
 sg_size_t Storage::getSizeUsed()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->getUsedSize(); });
+  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
+  return file_system->getUsedSize();
+}
+
+void Storage::decrUsedSize(sg_size_t size)
+{
+  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
+  file_system->decrUsedSize(size);
+}
+
+void Storage::incrUsedSize(sg_size_t size)
+{
+  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
+  file_system->incrUsedSize(size);
 }
 
 sg_size_t Storage::getSize()
@@ -60,24 +85,35 @@ sg_size_t Storage::getSize()
   return pimpl_->getSize();
 }
 
-xbt_dict_t Storage::getProperties()
+std::map<std::string, std::string>* Storage::getProperties()
 {
   return simgrid::simix::kernelImmediate([this] { return pimpl_->getProperties(); });
 }
 
-const char* Storage::getProperty(const char* key)
+const char* Storage::getProperty(std::string key)
 {
   return this->pimpl_->getProperty(key);
 }
 
-void Storage::setProperty(const char* key, const char* value)
+void Storage::setProperty(std::string key, std::string value)
 {
   simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 
 std::map<std::string, sg_size_t>* Storage::getContent()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->getContent(); });
+  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
+  return file_system->getContent();
+}
+
+sg_size_t Storage::read(sg_size_t size)
+{
+  return simcall_storage_read(pimpl_, size);
+}
+
+sg_size_t Storage::write(sg_size_t size)
+{
+  return simcall_storage_write(pimpl_, size);
 }
 
 /*************
index e5e368a..85c4f99 100644 (file)
@@ -25,7 +25,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 0
+#define YY_FLEX_SUBMINOR_VERSION 1
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -50,7 +50,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types. 
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -67,7 +67,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -104,25 +104,13 @@ typedef unsigned int flex_uint32_t;
 
 #endif /* ! FLEXINT_H */
 
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else  /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif  /* defined (__STDC__) */
-#endif  /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
 #define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
 #else
-#define yyconst
+#define yynoreturn
 #endif
 
 /* Returned upon end-of-file. */
@@ -183,7 +171,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 typedef size_t yy_size_t;
 #endif
 
-extern yy_size_t dax_leng;
+extern unsigned int dax_leng;
 
 extern FILE *dax_in, *dax_out;
 
@@ -212,92 +200,92 @@ extern FILE *dax_in, *dax_out;
                     if ( *p == '\n' )\
                         --dax_lineno;\
             }while(0)
-
+    
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
-  do \
-    { \
-    /* Undo effects of setting up dax_text. */ \
+       do \
+               { \
+               /* Undo effects of setting up dax_text. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-    *yy_cp = (yy_hold_char); \
-    YY_RESTORE_YY_MORE_OFFSET \
-    (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-    YY_DO_BEFORE_ACTION; /* set up dax_text again */ \
-    } \
-  while ( 0 )
+               *yy_cp = (yy_hold_char); \
+               YY_RESTORE_YY_MORE_OFFSET \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+               YY_DO_BEFORE_ACTION; /* set up dax_text again */ \
+               } \
+       while ( 0 )
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
-  {
-  FILE *yy_input_file;
-
-  char *yy_ch_buf;    /* input buffer */
-  char *yy_buf_pos;    /* current position in input buffer */
-
-  /* Size of input buffer in bytes, not including room for EOB
-   * characters.
-   */
-  int yy_buf_size;
-
-  /* Number of characters read into yy_ch_buf, not including EOB
-   * characters.
-   */
-  int yy_n_chars;
-
-  /* Whether we "own" the buffer - i.e., we know we created it,
-   * and can realloc() it to grow it, and should free() it to
-   * delete it.
-   */
-  int yy_is_our_buffer;
-
-  /* Whether this is an "interactive" input source; if so, and
-   * if we're using stdio for input, then we want to use getc()
-   * instead of fread(), to make sure we stop fetching input after
-   * each newline.
-   */
-  int yy_is_interactive;
-
-  /* Whether we're considered to be at the beginning of a line.
-   * If so, '^' rules will be active on the next match, otherwise
-   * not.
-   */
-  int yy_at_bol;
+       {
+       FILE *yy_input_file;
+
+       char *yy_ch_buf;                /* input buffer */
+       char *yy_buf_pos;               /* current position in input buffer */
+
+       /* Size of input buffer in bytes, not including room for EOB
+        * characters.
+        */
+       int yy_buf_size;
+
+       /* Number of characters read into yy_ch_buf, not including EOB
+        * characters.
+        */
+       int yy_n_chars;
+
+       /* Whether we "own" the buffer - i.e., we know we created it,
+        * and can realloc() it to grow it, and should free() it to
+        * delete it.
+        */
+       int yy_is_our_buffer;
+
+       /* Whether this is an "interactive" input source; if so, and
+        * if we're using stdio for input, then we want to use getc()
+        * instead of fread(), to make sure we stop fetching input after
+        * each newline.
+        */
+       int yy_is_interactive;
+
+       /* Whether we're considered to be at the beginning of a line.
+        * If so, '^' rules will be active on the next match, otherwise
+        * not.
+        */
+       int yy_at_bol;
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
 
-  /* Whether to try to fill the input buffer when we reach the
-   * end of it.
-   */
-  int yy_fill_buffer;
+       /* Whether to try to fill the input buffer when we reach the
+        * end of it.
+        */
+       int yy_fill_buffer;
 
-  int yy_buffer_status;
+       int yy_buffer_status;
 
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
-  /* When an EOF's been seen but there's still some text to process
-   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-   * shouldn't try reading from the input source any more.  We might
-   * still have a bunch of tokens to match, though, because of
-   * possible backing-up.
-   *
-   * When we actually see the EOF, we change the status to "new"
-   * (via dax_restart()), so that the user can continue scanning by
-   * just pointing dax_in at a new input file.
-   */
+       /* When an EOF's been seen but there's still some text to process
+        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+        * shouldn't try reading from the input source any more.  We might
+        * still have a bunch of tokens to match, though, because of
+        * possible backing-up.
+        *
+        * When we actually see the EOF, we change the status to "new"
+        * (via dax_restart()), so that the user can continue scanning by
+        * just pointing dax_in at a new input file.
+        */
 #define YY_BUFFER_EOF_PENDING 2
 
-  };
+       };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -316,13 +304,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when dax_text is formed. */
 static char yy_hold_char;
-static int yy_n_chars;    /* number of characters read into yy_ch_buf */
-yy_size_t dax_leng;
+static int yy_n_chars;         /* number of characters read into yy_ch_buf */
+unsigned int dax_leng;
 
 /* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;    /* whether we need to initialize */
-static int yy_start = 0;  /* start state number */
+static char *yy_c_buf_p = NULL;
+static int yy_init = 0;                /* whether we need to initialize */
+static int yy_start = 0;       /* start state number */
 
 /* Flag which is used to allow dax_wrap()'s to do buffer switches
  * instead of setting up a fresh dax_in.  A bit of a hack ...
@@ -345,7 +333,7 @@ static void dax__init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
 YY_BUFFER_STATE dax__scan_buffer (char *base,yy_size_t size  );
 YY_BUFFER_STATE dax__scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE dax__scan_bytes (yyconst char *bytes,yy_size_t len  );
+YY_BUFFER_STATE dax__scan_bytes (yyconst char *bytes,int len  );
 
 void *dax_alloc (yy_size_t  );
 void *dax_realloc (void *,yy_size_t  );
@@ -354,24 +342,24 @@ void dax_free (void *  );
 #define yy_new_buffer dax__create_buffer
 
 #define yy_set_interactive(is_interactive) \
-  { \
-  if ( ! YY_CURRENT_BUFFER ){ \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){ \
         dax_ensure_buffer_stack (); \
-    YY_CURRENT_BUFFER_LVALUE =    \
+               YY_CURRENT_BUFFER_LVALUE =    \
             dax__create_buffer(dax_in,YY_BUF_SIZE ); \
-  } \
-  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-  }
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+       }
 
 #define yy_set_bol(at_bol) \
-  { \
-  if ( ! YY_CURRENT_BUFFER ){\
+       { \
+       if ( ! YY_CURRENT_BUFFER ){\
         dax_ensure_buffer_stack (); \
-    YY_CURRENT_BUFFER_LVALUE =    \
+               YY_CURRENT_BUFFER_LVALUE =    \
             dax__create_buffer(dax_in,YY_BUF_SIZE ); \
-  } \
-  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-  }
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+       }
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
@@ -382,7 +370,7 @@ void dax_free (void *  );
 
 typedef unsigned char YY_CHAR;
 
-FILE *dax_in = (FILE *) 0, *dax_out = (FILE *) 0;
+FILE *dax_in = NULL, *dax_out = NULL;
 
 typedef int yy_state_type;
 
@@ -399,30 +387,27 @@ extern char *dax_text;
 static yy_state_type yy_get_previous_state (void );
 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
 static int yy_get_next_buffer (void );
-#if defined(__GNUC__) && __GNUC__ >= 3
-__attribute__((__noreturn__))
-#endif
-static void yy_fatal_error (yyconst char msg[]  );
+static void yynoreturn yy_fatal_error (yyconst char* msg  );
 
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up dax_text.
  */
 #define YY_DO_BEFORE_ACTION \
-  (yytext_ptr) = yy_bp; \
-  dax_leng = (size_t) (yy_cp - yy_bp); \
-  (yy_hold_char) = *yy_cp; \
-  *yy_cp = '\0'; \
-  (yy_c_buf_p) = yy_cp;
+       (yytext_ptr) = yy_bp; \
+       dax_leng = (int) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
+       *yy_cp = '\0'; \
+       (yy_c_buf_p) = yy_cp;
 
 #define YY_NUM_RULES 140
 #define YY_END_OF_BUFFER 141
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
-  {
-  flex_int32_t yy_verify;
-  flex_int32_t yy_nxt;
-  };
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
 static yyconst flex_int16_t yy_accept[775] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -1237,13 +1222,13 @@ static yyconst flex_int16_t yy_chk[2195] =
 /* Table of booleans, true if rule could match eol. */
 static yyconst flex_int32_t yy_rule_can_match_eol[141] =
     {   0,
-0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
-    0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1,
-    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 
+    0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 
+    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 
     0,     };
 
 static yy_state_type yy_last_accepting_state;
@@ -1266,13 +1251,13 @@ char *dax_text;
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  * FleXML is Copyright (C) 2003-2013 Martin Quinson.  All rights reserved.
  * (1.9.6).
- *
+ * 
  * There are two, intertwined parts to this program, part A and part B.
  *
  * Part A
  * ------
- *
- * Some parts, here collectively called "Part A", are found in the
+ * 
+ * Some parts, here collectively called "Part A", are found in the 
  * FleXML package.  They are Copyright (C) 1999-2005 Kristoffer Rose
  * and Copyright (C) 2003-2013 Martin Quinson. All rights reserved.
  *
@@ -1290,20 +1275,20 @@ char *dax_text;
  * Notice that these are explicit rights granted to you for files
  * generated by the FleXML system.  For your rights in connection with
  * the FleXML system itself please consult the GNU General Public License.
- *
+ * 
  * Part B
  * ------
- *
- * The other parts, here collectively called "Part B", and which came
- * from the DTD used by FleXML to generate this program, can be
+ * 
+ * The other parts, here collectively called "Part B", and which came 
+ * from the DTD used by FleXML to generate this program, can be 
  * distributed (or not, as the case may be) under the terms of whoever
- * wrote them, provided these terms respect and obey the two conditions
+ * wrote them, provided these terms respect and obey the two conditions 
  * above under the heading "Part A".
  *
  * The author of and contributors to FleXML specifically disclaim
- * any copyright interest in "Part B", unless "Part B" was written
+ * any copyright interest in "Part B", unless "Part B" was written 
  * by the author of or contributors to FleXML.
- *
+ * 
  */
 
 /* Version strings. */
@@ -1316,7 +1301,7 @@ const char dax__flexml_version[] = "1.9.6";
 #include <assert.h>
 #include <stdarg.h>
 #include <ctype.h>
-
+     
 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
 # ifndef __STRICT_ANSI__
 #  include <io.h>
@@ -1325,7 +1310,7 @@ const char dax__flexml_version[] = "1.9.6";
 #else
 # include <unistd.h>
 #endif
-
+     
 #ifndef FLEXML_INDEXSTACKSIZE
 #define FLEXML_INDEXSTACKSIZE 1000
 #endif
@@ -1420,23 +1405,23 @@ short int dax__uses_type_isset;
 
 /* XML state. */
 #ifdef FLEX_DEBUG
-# define ENTER(state)  debug_enter(state,#state)
-# define LEAVE    debug_leave()
-# define SET(state)  debug_set(state,#state)
+# define ENTER(state)  debug_enter(state,#state)
+# define LEAVE         debug_leave()
+# define SET(state)    debug_set(state,#state)
   static void debug_enter(int, const char*);
   static void debug_leave(void);
   static void debug_set(int, const char*);
 #else
-# define ENTER(state)  (yy_push_state(state))
-# define LEAVE    (yy_pop_state())
-# define SET(state)  BEGIN(state)
+# define ENTER(state)  (yy_push_state(state))
+# define LEAVE         (yy_pop_state())
+# define SET(state)    BEGIN(state)
 #endif
 
 /* Generic actions. */
-#define SKIP  /*skip*/
+#define SKIP   /*skip*/
 #define SUCCEED        CLEANUP; return 0
 
-#define FAIL  return fail
+#define FAIL   return fail
 static int fail(const char*, ...);
 
 enum {flexml_max_err_msg_size = 512};
@@ -1473,12 +1458,12 @@ static int inext = 1;
 static int ck_blimit()
 {
      if (bnext >= blimit) {
-   blimit += FLEXML_BUFFERSTACKSIZE + 2;
-   {
-       char *temp = (char *) realloc(dax__bufferstack, blimit);
-       assert(temp);
-       dax__bufferstack = temp;
-   }
+        blimit += FLEXML_BUFFERSTACKSIZE + 2;
+        {
+            char *temp = (char *) realloc(dax__bufferstack, blimit);
+            assert(temp);
+            dax__bufferstack = temp;
+        }
      }
      return 0;
 }
@@ -1487,12 +1472,12 @@ static int ck_blimit()
 static int ck_ilimit()
 {
      if (inext >= ilimit) {
-   ilimit += FLEXML_INDEXSTACKSIZE + 2;
-   {
-       int *temp = (int *) realloc(indexstack, ilimit);
-       assert(temp);
-       indexstack = temp;
-   }
+        ilimit += FLEXML_INDEXSTACKSIZE + 2;
+        {
+            int *temp = (int *) realloc(indexstack, ilimit);
+            assert(temp);
+            indexstack = temp;
+        }
      }
      return 0;
 }
@@ -1506,16 +1491,16 @@ static void dax__bufferliteral(char c, int* pp, const char* text)
       assert(s && e && s <= e);
       ++s;
       while (s < e) {
-   if (isspace(*s)) {
-      BUFFERPUTC(' ');
-      do ++s; while (s < e && isspace(*s));
-   } else
-     BUFFERPUTC(*s++);
+        if (isspace(*s)) {
+           BUFFERPUTC(' ');
+           do ++s; while (s < e && isspace(*s));
+        } else
+          BUFFERPUTC(*s++);
       }
    } else {
       const char *s = text;
       while (*s)
-  BUFFERPUTC(*s++);
+       BUFFERPUTC(*s++);
    }
    BUFFERDONE;
 }
@@ -1525,7 +1510,7 @@ static void pushbuffer(int p)
 {
     ck_ilimit();
     indexstack[inext++] = p;
-    indexstack[inext++] = bnext;
+    indexstack[inext++] = bnext;    
 }
 
 static int popbuffer(void)
@@ -1549,18 +1534,18 @@ static int popbuffer(void)
 /* Miscellaneous. */
 /* Parser states (flex `exclusive start conditions'):
  *
- * PROLOG  the XML prolog of the document before <?xml...>
- * DOCTYPE  the XML prolog of the document after <?xml...>
- * EPILOG  after the root element
- * INCOMMENT  inside an XML comment <!--....-->
- * INPI    inside an XML PI <?...?>
- * VALUE1  inside a '...'-delimited literal
- * VALUE2  inside a "..."-delimited literal
- * CDATA  inside a <![CDATA[...] ]> section.
- * ROOT_<tag>  expect root element <tag>
- * AL_<tag>  inside the attribute list for <tag>
- * IN_<tag>  inside a <tag> with element contents (ready for end tag)
- * IMPOSSIBLE  dummy to permit disabling rules; must be last
+ * PROLOG      the XML prolog of the document before <?xml...>
+ * DOCTYPE     the XML prolog of the document after <?xml...>
+ * EPILOG      after the root element
+ * INCOMMENT   inside an XML comment <!--....-->
+ * INPI                inside an XML PI <?...?>
+ * VALUE1      inside a '...'-delimited literal
+ * VALUE2      inside a "..."-delimited literal
+ * CDATA       inside a <![CDATA[...] ]> section.
+ * ROOT_<tag>  expect root element <tag>
+ * AL_<tag>    inside the attribute list for <tag>
+ * IN_<tag>    inside a <tag> with element contents (ready for end tag)
+ * IMPOSSIBLE  dummy to permit disabling rules; must be last
  */
 
 /* State names. */
@@ -1642,7 +1627,7 @@ FILE *dax_get_out (void );
 
 void dax_set_out  (FILE * _out_str  );
 
-yy_size_t dax_get_leng (void );
+                       int dax_get_leng (void );
 
 char *dax_get_text (void );
 
@@ -1663,7 +1648,7 @@ extern int dax_wrap (void );
 #endif
 
 #ifndef YY_NO_UNPUT
-
+    
 #endif
 
 #ifndef yytext_ptr
@@ -1687,11 +1672,11 @@ static int input (void );
         static int yy_start_stack_ptr = 0;
         static int yy_start_stack_depth = 0;
         static int *yy_start_stack = NULL;
-
+    
     static void yy_push_state (int _new_state );
-
+    
     static void yy_pop_state (void );
-
+    
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
 #ifdef __ia64__
@@ -1707,7 +1692,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO do { if (fwrite( dax_text, dax_leng, 1, dax_out )) {} } while (0)
+#define ECHO do { if (fwrite( dax_text, (size_t) dax_leng, 1, dax_out )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -1715,33 +1700,33 @@ static int input (void );
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-    { \
-    int c = '*'; \
-    size_t n; \
-    for ( n = 0; n < max_size && \
-           (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \
-      buf[n] = (char) c; \
-    if ( c == '\n' ) \
-      buf[n++] = (char) c; \
-    if ( c == EOF && ferror( dax_in ) ) \
-      YY_FATAL_ERROR( "input in flex scanner failed" ); \
-    result = n; \
-    } \
-  else \
-    { \
-    errno=0; \
-    while ( (result = fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \
-      { \
-      if( errno != EINTR) \
-        { \
-        YY_FATAL_ERROR( "input in flex scanner failed" ); \
-        break; \
-        } \
-      errno=0; \
-      clearerr(dax_in); \
-      } \
-    }\
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+               { \
+               int c = '*'; \
+               ssize_t n; \
+               for ( n = 0; n < max_size && \
+                            (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \
+                       buf[n] = (char) c; \
+               if ( c == '\n' ) \
+                       buf[n++] = (char) c; \
+               if ( c == EOF && ferror( dax_in ) ) \
+                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
+               result = n; \
+               } \
+       else \
+               { \
+               errno=0; \
+               while ( (result = (int) fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(dax_in); \
+                       } \
+               }\
 \
 
 #endif
@@ -1790,43 +1775,43 @@ extern int dax_lex (void);
 #endif
 
 #define YY_RULE_SETUP \
-  YY_USER_ACTION
+       YY_USER_ACTION
 
 /** The main scanner function which does all the work.
  */
 YY_DECL
 {
-  yy_state_type yy_current_state;
-  char *yy_cp, *yy_bp;
-  int yy_act;
-
-  if ( !(yy_init) )
-    {
-    (yy_init) = 1;
+       yy_state_type yy_current_state;
+       char *yy_cp, *yy_bp;
+       int yy_act;
+    
+       if ( !(yy_init) )
+               {
+               (yy_init) = 1;
 
 #ifdef YY_USER_INIT
-    YY_USER_INIT;
+               YY_USER_INIT;
 #endif
 
-    if ( ! (yy_start) )
-      (yy_start) = 1;  /* first start state */
+               if ( ! (yy_start) )
+                       (yy_start) = 1; /* first start state */
 
-    if ( ! dax_in )
-      dax_in = stdin;
+               if ( ! dax_in )
+                       dax_in = stdin;
 
-    if ( ! dax_out )
-      dax_out = stdout;
+               if ( ! dax_out )
+                       dax_out = stdout;
 
-    if ( ! YY_CURRENT_BUFFER ) {
-      dax_ensure_buffer_stack ();
-      YY_CURRENT_BUFFER_LVALUE =
-        dax__create_buffer(dax_in,YY_BUF_SIZE );
-    }
+               if ( ! YY_CURRENT_BUFFER ) {
+                       dax_ensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               dax__create_buffer(dax_in,YY_BUF_SIZE );
+               }
 
-    dax__load_buffer_state( );
-    }
+               dax__load_buffer_state( );
+               }
 
-  {
+       {
 
  /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
  SET(PROLOG);
@@ -1890,146 +1875,146 @@ YY_DECL
 
  /* COMMENTS and PIs: handled uniformly for efficiency. */
 
-  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
-    {
-    yy_cp = (yy_c_buf_p);
+       while ( /*CONSTCOND*/1 )                /* loops until end-of-file is reached */
+               {
+               yy_cp = (yy_c_buf_p);
 
-    /* Support of dax_text. */
-    *yy_cp = (yy_hold_char);
+               /* Support of dax_text. */
+               *yy_cp = (yy_hold_char);
 
-    /* yy_bp points to the position in yy_ch_buf of the start of
-     * the current run.
-     */
-    yy_bp = yy_cp;
+               /* yy_bp points to the position in yy_ch_buf of the start of
+                * the current run.
+                */
+               yy_bp = yy_cp;
 
-    yy_current_state = (yy_start);
+               yy_current_state = (yy_start);
 yy_match:
-    do
-      {
-      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
-      if ( yy_accept[yy_current_state] )
-        {
-        (yy_last_accepting_state) = yy_current_state;
-        (yy_last_accepting_cpos) = yy_cp;
-        }
-      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-        {
-        yy_current_state = (int) yy_def[yy_current_state];
-        if ( yy_current_state >= 775 )
-          yy_c = yy_meta[(unsigned int) yy_c];
-        }
-      yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-      ++yy_cp;
-      }
-    while ( yy_base[yy_current_state] != 2135 );
+               do
+                       {
+                       YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+                       if ( yy_accept[yy_current_state] )
+                               {
+                               (yy_last_accepting_state) = yy_current_state;
+                               (yy_last_accepting_cpos) = yy_cp;
+                               }
+                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                               {
+                               yy_current_state = (int) yy_def[yy_current_state];
+                               if ( yy_current_state >= 775 )
+                                       yy_c = yy_meta[(unsigned int) yy_c];
+                               }
+                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+                       ++yy_cp;
+                       }
+               while ( yy_base[yy_current_state] != 2135 );
 
 yy_find_action:
-    yy_act = yy_accept[yy_current_state];
-    if ( yy_act == 0 )
-      { /* have to back up */
-      yy_cp = (yy_last_accepting_cpos);
-      yy_current_state = (yy_last_accepting_state);
-      yy_act = yy_accept[yy_current_state];
-      }
-
-    YY_DO_BEFORE_ACTION;
-
-    if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-      {
-      yy_size_t yyl;
-      for ( yyl = 0; yyl < dax_leng; ++yyl )
-        if ( dax_text[yyl] == '\n' )
-
+               yy_act = yy_accept[yy_current_state];
+               if ( yy_act == 0 )
+                       { /* have to back up */
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
+                       yy_act = yy_accept[yy_current_state];
+                       }
+
+               YY_DO_BEFORE_ACTION;
+
+               if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+                       {
+                       unsigned int yyl;
+                       for ( yyl = 0; yyl < dax_leng; ++yyl )
+                               if ( dax_text[yyl] == '\n' )
+                                       
     dax_lineno++;
 ;
-      }
+                       }
 
-do_action:  /* This label is used only to access EOF actions. */
+do_action:     /* This label is used only to access EOF actions. */
 
-    switch ( yy_act )
-  { /* beginning of action switch */
-      case 0: /* must back up */
-      /* undo the effects of YY_DO_BEFORE_ACTION */
-      *yy_cp = (yy_hold_char);
-      yy_cp = (yy_last_accepting_cpos);
-      yy_current_state = (yy_last_accepting_state);
-      goto yy_find_action;
+               switch ( yy_act )
+       { /* beginning of action switch */
+                       case 0: /* must back up */
+                       /* undo the effects of YY_DO_BEFORE_ACTION */
+                       *yy_cp = (yy_hold_char);
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
+                       goto yy_find_action;
 
 case 1:
 YY_RULE_SETUP
 ENTER(INCOMMENT);
-  YY_BREAK
+       YY_BREAK
 case 2:
 YY_RULE_SETUP
 ENTER(INPI);
-  YY_BREAK
+       YY_BREAK
 
 case 3:
 YY_RULE_SETUP
 LEAVE;
-  YY_BREAK
+       YY_BREAK
 case 4:
 case 5:
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
 SKIP;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(INCOMMENT):
 FAIL("EOF in comment.");
-  YY_BREAK
+       YY_BREAK
 
 case 7:
 YY_RULE_SETUP
 LEAVE;
-  YY_BREAK
+       YY_BREAK
 case 8:
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
 SKIP;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(INPI):
 FAIL("EOF in PI (processing instruction).");
-  YY_BREAK
+       YY_BREAK
 
 /* SPACES: skipped uniformly */
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
 SKIP;
-  YY_BREAK
+       YY_BREAK
 /* PROLOG: determine root element and process it. */
 
 case 11:
 /* rule 11 can match eol */
 YY_RULE_SETUP
-SET(ROOT_dax__adag);
-  YY_BREAK
+SET(ROOT_dax__adag); 
+       YY_BREAK
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
 FAIL("Bad declaration %s.",dax_text);
-  YY_BREAK
+       YY_BREAK
 
 case 13:
 /* rule 13 can match eol */
 YY_RULE_SETUP
 SET(ROOT_dax__adag);
-  YY_BREAK
+       YY_BREAK
 case 14:
 /* rule 14 can match eol */
 YY_RULE_SETUP
 FAIL("Bad declaration %s.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case 15:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in prolog.", dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(PROLOG):
 case YY_STATE_EOF(DOCTYPE):
 FAIL("EOF in prolog.");
-  YY_BREAK
+       YY_BREAK
 
 /* RULES DERIVED FROM DTD. */
 /* <!-- Small DTD for DAX files. -->  */
@@ -2037,7 +2022,7 @@ case 16:
 /* rule 16 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <adag> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 17:
 /* rule 17 can match eol */
 YY_RULE_SETUP
@@ -2064,114 +2049,114 @@ YY_RULE_SETUP
   dax__adag_xsi_c_schemaLocation_isset = 0;
   ENTER(AL_dax__adag); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 18:
 /* rule 18 can match eol */
 YY_RULE_SETUP
 if (dax__adag_childCount_isset != 0) {FAIL("Multiple definition of attribute childCount in <dax__adag>");} dax__adag_childCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_childCount);
-  YY_BREAK
+       YY_BREAK
 case 19:
 /* rule 19 can match eol */
 YY_RULE_SETUP
 if (dax__adag_childCount_isset != 0) {FAIL("Multiple definition of attribute childCount in <dax__adag>");}  dax__adag_childCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_childCount);
-  YY_BREAK
+       YY_BREAK
 case 20:
 /* rule 20 can match eol */
 YY_RULE_SETUP
 if (dax__adag_count_isset != 0) {FAIL("Multiple definition of attribute count in <dax__adag>");} dax__adag_count_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_count);
-  YY_BREAK
+       YY_BREAK
 case 21:
 /* rule 21 can match eol */
 YY_RULE_SETUP
 if (dax__adag_count_isset != 0) {FAIL("Multiple definition of attribute count in <dax__adag>");}  dax__adag_count_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_count);
-  YY_BREAK
+       YY_BREAK
 case 22:
 /* rule 22 can match eol */
 YY_RULE_SETUP
 if (dax__adag_fileCount_isset != 0) {FAIL("Multiple definition of attribute fileCount in <dax__adag>");} dax__adag_fileCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_fileCount);
-  YY_BREAK
+       YY_BREAK
 case 23:
 /* rule 23 can match eol */
 YY_RULE_SETUP
 if (dax__adag_fileCount_isset != 0) {FAIL("Multiple definition of attribute fileCount in <dax__adag>");}  dax__adag_fileCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_fileCount);
-  YY_BREAK
+       YY_BREAK
 case 24:
 /* rule 24 can match eol */
 YY_RULE_SETUP
 if (dax__adag_index_isset != 0) {FAIL("Multiple definition of attribute index in <dax__adag>");} dax__adag_index_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_index);
-  YY_BREAK
+       YY_BREAK
 case 25:
 /* rule 25 can match eol */
 YY_RULE_SETUP
 if (dax__adag_index_isset != 0) {FAIL("Multiple definition of attribute index in <dax__adag>");}  dax__adag_index_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_index);
-  YY_BREAK
+       YY_BREAK
 case 26:
 /* rule 26 can match eol */
 YY_RULE_SETUP
 if (dax__adag_jobCount_isset != 0) {FAIL("Multiple definition of attribute jobCount in <dax__adag>");} dax__adag_jobCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_jobCount);
-  YY_BREAK
+       YY_BREAK
 case 27:
 /* rule 27 can match eol */
 YY_RULE_SETUP
 if (dax__adag_jobCount_isset != 0) {FAIL("Multiple definition of attribute jobCount in <dax__adag>");}  dax__adag_jobCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_jobCount);
-  YY_BREAK
+       YY_BREAK
 case 28:
 /* rule 28 can match eol */
 YY_RULE_SETUP
 if (dax__adag_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__adag>");} dax__adag_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_name);
-  YY_BREAK
+       YY_BREAK
 case 29:
 /* rule 29 can match eol */
 YY_RULE_SETUP
 if (dax__adag_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__adag>");}  dax__adag_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_name);
-  YY_BREAK
+       YY_BREAK
 case 30:
 /* rule 30 can match eol */
 YY_RULE_SETUP
 if (dax__adag_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__adag>");} dax__adag_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_version);
-  YY_BREAK
+       YY_BREAK
 case 31:
 /* rule 31 can match eol */
 YY_RULE_SETUP
 if (dax__adag_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__adag>");}  dax__adag_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_version);
-  YY_BREAK
+       YY_BREAK
 case 32:
 /* rule 32 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in <dax__adag>");} dax__adag_xmlns_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns);
-  YY_BREAK
+       YY_BREAK
 case 33:
 /* rule 33 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in <dax__adag>");}  dax__adag_xmlns_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns);
-  YY_BREAK
+       YY_BREAK
 case 34:
 /* rule 34 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in <dax__adag>");} dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns_c_xsi);
-  YY_BREAK
+       YY_BREAK
 case 35:
 /* rule 35 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in <dax__adag>");}  dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns_c_xsi);
-  YY_BREAK
+       YY_BREAK
 case 36:
 /* rule 36 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in <dax__adag>");} dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation);
-  YY_BREAK
+       YY_BREAK
 case 37:
 /* rule 37 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in <dax__adag>");}  dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation);
-  YY_BREAK
+       YY_BREAK
 case 38:
 YY_RULE_SETUP
 {
   LEAVE; STag_dax__adag();dax__pcdata_ix = 0; ENTER(S_dax__adag);
  }
-  YY_BREAK
+       YY_BREAK
 case 39:
 YY_RULE_SETUP
 {
@@ -2180,18 +2165,18 @@ YY_RULE_SETUP
    case ROOT_dax__adag: SET(EPILOG); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 40:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of adag element.", dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 41:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `adag' element start tag.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_dax__adag):
 FAIL("EOF in attribute list of `adag' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 42:
 /* rule 42 can match eol */
@@ -2204,29 +2189,29 @@ YY_RULE_SETUP
    case ROOT_dax__adag: SET(EPILOG); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 43:
 /* rule 43 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</adag>' expected.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case 44:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</adag>' expected.",dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_dax__adag):
 case YY_STATE_EOF(S_dax__adag):
 case YY_STATE_EOF(S_dax__adag_1):
 case YY_STATE_EOF(S_dax__adag_3):
 case YY_STATE_EOF(S_dax__adag_5):
 FAIL("Premature EOF: `</adag>' expected.");
-  YY_BREAK
+       YY_BREAK
 
 case 45:
 /* rule 45 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <child> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 46:
 /* rule 46 can match eol */
 YY_RULE_SETUP
@@ -2235,25 +2220,25 @@ YY_RULE_SETUP
   dax__child_ref_isset = 0;
   ENTER(AL_dax__child); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 47:
 /* rule 47 can match eol */
 YY_RULE_SETUP
 if (dax__child_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__child>");} dax__child_ref_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__child_ref);
-  YY_BREAK
+       YY_BREAK
 case 48:
 /* rule 48 can match eol */
 YY_RULE_SETUP
 if (dax__child_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__child>");}  dax__child_ref_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__child_ref);
-  YY_BREAK
+       YY_BREAK
 case 49:
 YY_RULE_SETUP
 {
   if (!AX_dax__child_ref) FAIL("Required attribute `ref' not set for `child' element.");
   LEAVE; STag_dax__child();dax__pcdata_ix = 0; ENTER(S_dax__child);
  }
-  YY_BREAK
+       YY_BREAK
 case 50:
 YY_RULE_SETUP
 {
@@ -2263,18 +2248,18 @@ YY_RULE_SETUP
    case S_dax__adag: case S_dax__adag_1: case S_dax__adag_3: case S_dax__adag_4: case S_dax__adag_5: SET(S_dax__adag_5); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 51:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of child element.", dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 52:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `child' element start tag.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_dax__child):
 FAIL("EOF in attribute list of `child' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 53:
 /* rule 53 can match eol */
@@ -2287,27 +2272,27 @@ YY_RULE_SETUP
    case S_dax__adag: case S_dax__adag_1: case S_dax__adag_3: case S_dax__adag_4: case S_dax__adag_5: SET(S_dax__adag_5); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 54:
 /* rule 54 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</child>' expected.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case 55:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</child>' expected.",dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_dax__child):
 case YY_STATE_EOF(S_dax__child):
 case YY_STATE_EOF(S_dax__child_2):
 FAIL("Premature EOF: `</child>' expected.");
-  YY_BREAK
+       YY_BREAK
 
 case 56:
 /* rule 56 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <job> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 57:
 /* rule 57 can match eol */
 YY_RULE_SETUP
@@ -2326,68 +2311,68 @@ YY_RULE_SETUP
   dax__job_version_isset = 0;
   ENTER(AL_dax__job); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 58:
 /* rule 58 can match eol */
 YY_RULE_SETUP
 if (dax__job_id_isset != 0) {FAIL("Multiple definition of attribute id in <dax__job>");} dax__job_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_id);
-  YY_BREAK
+       YY_BREAK
 case 59:
 /* rule 59 can match eol */
 YY_RULE_SETUP
 if (dax__job_id_isset != 0) {FAIL("Multiple definition of attribute id in <dax__job>");}  dax__job_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_id);
-  YY_BREAK
+       YY_BREAK
 case 60:
 /* rule 60 can match eol */
 YY_RULE_SETUP
 if (dax__job_level_isset != 0) {FAIL("Multiple definition of attribute level in <dax__job>");} dax__job_level_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_level);
-  YY_BREAK
+       YY_BREAK
 case 61:
 /* rule 61 can match eol */
 YY_RULE_SETUP
 if (dax__job_level_isset != 0) {FAIL("Multiple definition of attribute level in <dax__job>");}  dax__job_level_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_level);
-  YY_BREAK
+       YY_BREAK
 case 62:
 /* rule 62 can match eol */
 YY_RULE_SETUP
 if (dax__job_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__job>");} dax__job_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_name);
-  YY_BREAK
+       YY_BREAK
 case 63:
 /* rule 63 can match eol */
 YY_RULE_SETUP
 if (dax__job_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__job>");}  dax__job_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_name);
-  YY_BREAK
+       YY_BREAK
 case 64:
 /* rule 64 can match eol */
 YY_RULE_SETUP
 if (dax__job_namespace_isset != 0) {FAIL("Multiple definition of attribute namespace in <dax__job>");} dax__job_namespace_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_namespace);
-  YY_BREAK
+       YY_BREAK
 case 65:
 /* rule 65 can match eol */
 YY_RULE_SETUP
 if (dax__job_namespace_isset != 0) {FAIL("Multiple definition of attribute namespace in <dax__job>");}  dax__job_namespace_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_namespace);
-  YY_BREAK
+       YY_BREAK
 case 66:
 /* rule 66 can match eol */
 YY_RULE_SETUP
 if (dax__job_runtime_isset != 0) {FAIL("Multiple definition of attribute runtime in <dax__job>");} dax__job_runtime_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_runtime);
-  YY_BREAK
+       YY_BREAK
 case 67:
 /* rule 67 can match eol */
 YY_RULE_SETUP
 if (dax__job_runtime_isset != 0) {FAIL("Multiple definition of attribute runtime in <dax__job>");}  dax__job_runtime_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_runtime);
-  YY_BREAK
+       YY_BREAK
 case 68:
 /* rule 68 can match eol */
 YY_RULE_SETUP
 if (dax__job_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__job>");} dax__job_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_version);
-  YY_BREAK
+       YY_BREAK
 case 69:
 /* rule 69 can match eol */
 YY_RULE_SETUP
 if (dax__job_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__job>");}  dax__job_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_version);
-  YY_BREAK
+       YY_BREAK
 case 70:
 YY_RULE_SETUP
 {
@@ -2396,7 +2381,7 @@ YY_RULE_SETUP
   if (!AX_dax__job_runtime) FAIL("Required attribute `runtime' not set for `job' element.");
   LEAVE; STag_dax__job();dax__pcdata_ix = 0; ENTER(S_dax__job);
  }
-  YY_BREAK
+       YY_BREAK
 case 71:
 YY_RULE_SETUP
 {
@@ -2408,18 +2393,18 @@ YY_RULE_SETUP
    case S_dax__adag: case S_dax__adag_2: case S_dax__adag_3: SET(S_dax__adag_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 72:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of job element.", dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 73:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `job' element start tag.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_dax__job):
 FAIL("EOF in attribute list of `job' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 74:
 /* rule 74 can match eol */
@@ -2432,27 +2417,27 @@ YY_RULE_SETUP
    case S_dax__adag: case S_dax__adag_2: case S_dax__adag_3: SET(S_dax__adag_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 75:
 /* rule 75 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</job>' expected.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case 76:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</job>' expected.",dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_dax__job):
 case YY_STATE_EOF(S_dax__job):
 case YY_STATE_EOF(S_dax__job_2):
 FAIL("Premature EOF: `</job>' expected.");
-  YY_BREAK
+       YY_BREAK
 
 case 77:
 /* rule 77 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <parent> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 78:
 /* rule 78 can match eol */
 YY_RULE_SETUP
@@ -2461,25 +2446,25 @@ YY_RULE_SETUP
   dax__parent_ref_isset = 0;
   ENTER(AL_dax__parent); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 79:
 /* rule 79 can match eol */
 YY_RULE_SETUP
 if (dax__parent_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__parent>");} dax__parent_ref_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__parent_ref);
-  YY_BREAK
+       YY_BREAK
 case 80:
 /* rule 80 can match eol */
 YY_RULE_SETUP
 if (dax__parent_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__parent>");}  dax__parent_ref_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__parent_ref);
-  YY_BREAK
+       YY_BREAK
 case 81:
 YY_RULE_SETUP
 {
   if (!AX_dax__parent_ref) FAIL("Required attribute `ref' not set for `parent' element.");
   LEAVE; STag_dax__parent();dax__pcdata_ix = 0; ENTER(E_dax__parent);
  }
-  YY_BREAK
+       YY_BREAK
 case 82:
 YY_RULE_SETUP
 {
@@ -2489,18 +2474,18 @@ YY_RULE_SETUP
    case S_dax__child: case S_dax__child_1: case S_dax__child_2: SET(S_dax__child_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 83:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of parent element.", dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 84:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `parent' element start tag.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_dax__parent):
 FAIL("EOF in attribute list of `parent' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 85:
 /* rule 85 can match eol */
@@ -2513,19 +2498,19 @@ YY_RULE_SETUP
    case S_dax__child: case S_dax__child_1: case S_dax__child_2: SET(S_dax__child_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 86:
 /* rule 86 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</parent>' expected.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case 87:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</parent>' expected.",dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_dax__parent):
 FAIL("Premature EOF: `</parent>' expected.");
-  YY_BREAK
+       YY_BREAK
 
 /* <!-- ignored -->
   * <!-- ignored -->  */
@@ -2533,7 +2518,7 @@ case 88:
 /* rule 88 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <uses> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 89:
 /* rule 89 can match eol */
 YY_RULE_SETUP
@@ -2554,94 +2539,94 @@ YY_RULE_SETUP
   dax__uses_type_isset = 0;
   ENTER(AL_dax__uses); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 90:
 /* rule 90 can match eol */
 YY_RULE_SETUP
 if (dax__uses_file_isset != 0) {FAIL("Multiple definition of attribute file in <dax__uses>");} dax__uses_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_file);
-  YY_BREAK
+       YY_BREAK
 case 91:
 /* rule 91 can match eol */
 YY_RULE_SETUP
 if (dax__uses_file_isset != 0) {FAIL("Multiple definition of attribute file in <dax__uses>");}  dax__uses_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_file);
-  YY_BREAK
+       YY_BREAK
 case 92:
 /* rule 92 can match eol */
 case 93:
 /* rule 93 can match eol */
 YY_RULE_SETUP
 A_dax__uses_link = A_dax__uses_link_input;
-  YY_BREAK
+       YY_BREAK
 case 94:
 /* rule 94 can match eol */
 case 95:
 /* rule 95 can match eol */
 YY_RULE_SETUP
 A_dax__uses_link = A_dax__uses_link_output;
-  YY_BREAK
+       YY_BREAK
 case 96:
 /* rule 96 can match eol */
 case 97:
 /* rule 97 can match eol */
 YY_RULE_SETUP
 A_dax__uses_optional = A_dax__uses_optional_false;
-  YY_BREAK
+       YY_BREAK
 case 98:
 /* rule 98 can match eol */
 case 99:
 /* rule 99 can match eol */
 YY_RULE_SETUP
 A_dax__uses_optional = A_dax__uses_optional_true;
-  YY_BREAK
+       YY_BREAK
 case 100:
 /* rule 100 can match eol */
 case 101:
 /* rule 101 can match eol */
 YY_RULE_SETUP
 A_dax__uses_register = A_dax__uses_register_false;
-  YY_BREAK
+       YY_BREAK
 case 102:
 /* rule 102 can match eol */
 case 103:
 /* rule 103 can match eol */
 YY_RULE_SETUP
 A_dax__uses_register = A_dax__uses_register_true;
-  YY_BREAK
+       YY_BREAK
 case 104:
 /* rule 104 can match eol */
 YY_RULE_SETUP
 if (dax__uses_size_isset != 0) {FAIL("Multiple definition of attribute size in <dax__uses>");} dax__uses_size_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_size);
-  YY_BREAK
+       YY_BREAK
 case 105:
 /* rule 105 can match eol */
 YY_RULE_SETUP
 if (dax__uses_size_isset != 0) {FAIL("Multiple definition of attribute size in <dax__uses>");}  dax__uses_size_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_size);
-  YY_BREAK
+       YY_BREAK
 case 106:
 /* rule 106 can match eol */
 case 107:
 /* rule 107 can match eol */
 YY_RULE_SETUP
 A_dax__uses_transfer = A_dax__uses_transfer_false;
-  YY_BREAK
+       YY_BREAK
 case 108:
 /* rule 108 can match eol */
 case 109:
 /* rule 109 can match eol */
 YY_RULE_SETUP
 A_dax__uses_transfer = A_dax__uses_transfer_true;
-  YY_BREAK
+       YY_BREAK
 case 110:
 /* rule 110 can match eol */
 YY_RULE_SETUP
 if (dax__uses_type_isset != 0) {FAIL("Multiple definition of attribute type in <dax__uses>");} dax__uses_type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_type);
-  YY_BREAK
+       YY_BREAK
 case 111:
 /* rule 111 can match eol */
 YY_RULE_SETUP
 if (dax__uses_type_isset != 0) {FAIL("Multiple definition of attribute type in <dax__uses>");}  dax__uses_type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_type);
-  YY_BREAK
+       YY_BREAK
 case 112:
 YY_RULE_SETUP
 {
@@ -2649,7 +2634,7 @@ YY_RULE_SETUP
   if (!AX_dax__uses_size) FAIL("Required attribute `size' not set for `uses' element.");
   LEAVE; STag_dax__uses();dax__pcdata_ix = 0; ENTER(E_dax__uses);
  }
-  YY_BREAK
+       YY_BREAK
 case 113:
 YY_RULE_SETUP
 {
@@ -2660,18 +2645,18 @@ YY_RULE_SETUP
    case S_dax__job: case S_dax__job_1: case S_dax__job_2: SET(S_dax__job_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 114:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of uses element.", dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 115:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `uses' element start tag.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_dax__uses):
 FAIL("EOF in attribute list of `uses' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 116:
 /* rule 116 can match eol */
@@ -2684,29 +2669,29 @@ YY_RULE_SETUP
    case S_dax__job: case S_dax__job_1: case S_dax__job_2: SET(S_dax__job_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 117:
 /* rule 117 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</uses>' expected.",dax_text);
-  YY_BREAK
+       YY_BREAK
 case 118:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</uses>' expected.",dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_dax__uses):
 FAIL("Premature EOF: `</uses>' expected.");
-  YY_BREAK
+       YY_BREAK
 
 /* EPILOG: after the root element. */
 
 case 119:
 YY_RULE_SETUP
 {SET(PROLOG); yyless(0); CLEANUP; return -1;}
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(EPILOG):
 SUCCEED;
-  YY_BREAK
+       YY_BREAK
 
 /* CHARACTER DATA. */
 
@@ -2714,32 +2699,32 @@ SUCCEED;
 case 120:
 YY_RULE_SETUP
 BUFFERPUTC('&');
-  YY_BREAK
+       YY_BREAK
 case 121:
 YY_RULE_SETUP
 BUFFERPUTC('<');
-  YY_BREAK
+       YY_BREAK
 case 122:
 YY_RULE_SETUP
 BUFFERPUTC('>');
-  YY_BREAK
+       YY_BREAK
 case 123:
 YY_RULE_SETUP
 BUFFERPUTC('\'');
-  YY_BREAK
+       YY_BREAK
 case 124:
 YY_RULE_SETUP
 BUFFERPUTC('"');
-  YY_BREAK
+       YY_BREAK
 /* Character entities. */
 case 125:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)atoi(dax_text+2));
-  YY_BREAK
+       YY_BREAK
 case 126:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)strtol(dax_text+3,NULL,16));
-  YY_BREAK
+       YY_BREAK
 
 case 127:
 /* rule 127 can match eol */
@@ -2751,55 +2736,55 @@ case 130:
 /* rule 130 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC('\n');
-  YY_BREAK
+       YY_BREAK
 
 case 131:
 YY_RULE_SETUP
 ENTER(CDATA);
-  YY_BREAK
+       YY_BREAK
 case 132:
 YY_RULE_SETUP
 FAIL("Unexpected `]""]>' in character data.");
-  YY_BREAK
+       YY_BREAK
 
 case 133:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(VALUE1):
 FAIL("EOF in literal (\"'\" expected).");
-  YY_BREAK
+       YY_BREAK
 
 case 134:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(VALUE2):
 FAIL("EOF in literal (`\"' expected).");
-  YY_BREAK
+       YY_BREAK
 
 case 135:
 /* rule 135 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC(dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 136:
 YY_RULE_SETUP
 FAIL("Spurious `%c' in character data.",dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 
 case 137:
 YY_RULE_SETUP
 LEAVE;
-  YY_BREAK
-/* "]""]"    BUFFERPUTC(dax_text[0]); BUFFERPUTC(dax_text[1]); */
+       YY_BREAK
+/* "]""]"              BUFFERPUTC(dax_text[0]); BUFFERPUTC(dax_text[1]); */
 case 138:
 YY_RULE_SETUP
 BUFFERPUTC(dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(CDATA):
 FAIL("EOF in CDATA section.");
-  YY_BREAK
+       YY_BREAK
 
 /* Impossible rules to avoid warnings from flex(1). */
 /* Ideally, this should be replaced by code in flexml.pl that
@@ -2809,12 +2794,12 @@ case 139:
 /* rule 139 can match eol */
 YY_RULE_SETUP
 FAIL("Syntax error on character `%c'.", dax_text[0]);
-  YY_BREAK
+       YY_BREAK
 
 case 140:
 YY_RULE_SETUP
 ECHO;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(ROOT_dax__adag):
 case YY_STATE_EOF(S_dax__adag_2):
@@ -2822,332 +2807,332 @@ case YY_STATE_EOF(S_dax__adag_4):
 case YY_STATE_EOF(S_dax__child_1):
 case YY_STATE_EOF(S_dax__job_1):
 case YY_STATE_EOF(IMPOSSIBLE):
-  yyterminate();
-
-  case YY_END_OF_BUFFER:
-    {
-    /* Amount of text matched not including the EOB char. */
-    int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-    *yy_cp = (yy_hold_char);
-    YY_RESTORE_YY_MORE_OFFSET
-
-    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-      {
-      /* We're scanning a new file or input source.  It's
-       * possible that this happened because the user
-       * just pointed dax_in at a new source and called
-       * dax_lex().  If so, then we have to assure
-       * consistency between YY_CURRENT_BUFFER and our
-       * globals.  Here is the right place to do so, because
-       * this is the first action (other than possibly a
-       * back-up) that will match for the new input source.
-       */
-      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-      YY_CURRENT_BUFFER_LVALUE->yy_input_file = dax_in;
-      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-      }
-
-    /* Note that here we test for yy_c_buf_p "<=" to the position
-     * of the first EOB in the buffer, since yy_c_buf_p will
-     * already have been incremented past the NUL character
-     * (since all states make transitions on EOB to the
-     * end-of-buffer state).  Contrast this with the test
-     * in input().
-     */
-    if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-      { /* This was really a NUL. */
-      yy_state_type yy_next_state;
-
-      (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-      yy_current_state = yy_get_previous_state(  );
-
-      /* Okay, we're now positioned to make the NUL
-       * transition.  We couldn't have
-       * yy_get_previous_state() go ahead and do it
-       * for us because it doesn't know how to deal
-       * with the possibility of jamming (and we don't
-       * want to build jamming into it because then it
-       * will run more slowly).
-       */
-
-      yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-      yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-      if ( yy_next_state )
-        {
-        /* Consume the NUL. */
-        yy_cp = ++(yy_c_buf_p);
-        yy_current_state = yy_next_state;
-        goto yy_match;
-        }
-
-      else
-        {
-        yy_cp = (yy_c_buf_p);
-        goto yy_find_action;
-        }
-      }
-
-    else switch ( yy_get_next_buffer(  ) )
-      {
-      case EOB_ACT_END_OF_FILE:
-        {
-        (yy_did_buffer_switch_on_eof) = 0;
-
-        if ( dax_wrap( ) )
-          {
-          /* Note: because we've taken care in
-           * yy_get_next_buffer() to have set up
-           * dax_text, we can now set up
-           * yy_c_buf_p so that if some total
-           * hoser (like flex itself) wants to
-           * call the scanner after we return the
-           * YY_NULL, it'll still work - another
-           * YY_NULL will get returned.
-           */
-          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-          yy_act = YY_STATE_EOF(YY_START);
-          goto do_action;
-          }
-
-        else
-          {
-          if ( ! (yy_did_buffer_switch_on_eof) )
-            YY_NEW_FILE;
-          }
-        break;
-        }
-
-      case EOB_ACT_CONTINUE_SCAN:
-        (yy_c_buf_p) =
-          (yytext_ptr) + yy_amount_of_matched_text;
-
-        yy_current_state = yy_get_previous_state(  );
-
-        yy_cp = (yy_c_buf_p);
-        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-        goto yy_match;
-
-      case EOB_ACT_LAST_MATCH:
-        (yy_c_buf_p) =
-        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-        yy_current_state = yy_get_previous_state(  );
-
-        yy_cp = (yy_c_buf_p);
-        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-        goto yy_find_action;
-      }
-    break;
-    }
-
-  default:
-    YY_FATAL_ERROR(
-      "fatal flex scanner internal error--no action found" );
-  } /* end of action switch */
-    } /* end of scanning one token */
-  } /* end of user's declarations */
+       yyterminate();
+
+       case YY_END_OF_BUFFER:
+               {
+               /* Amount of text matched not including the EOB char. */
+               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+               /* Undo the effects of YY_DO_BEFORE_ACTION. */
+               *yy_cp = (yy_hold_char);
+               YY_RESTORE_YY_MORE_OFFSET
+
+               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+                       {
+                       /* We're scanning a new file or input source.  It's
+                        * possible that this happened because the user
+                        * just pointed dax_in at a new source and called
+                        * dax_lex().  If so, then we have to assure
+                        * consistency between YY_CURRENT_BUFFER and our
+                        * globals.  Here is the right place to do so, because
+                        * this is the first action (other than possibly a
+                        * back-up) that will match for the new input source.
+                        */
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = dax_in;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+                       }
+
+               /* Note that here we test for yy_c_buf_p "<=" to the position
+                * of the first EOB in the buffer, since yy_c_buf_p will
+                * already have been incremented past the NUL character
+                * (since all states make transitions on EOB to the
+                * end-of-buffer state).  Contrast this with the test
+                * in input().
+                */
+               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       { /* This was really a NUL. */
+                       yy_state_type yy_next_state;
+
+                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+                       yy_current_state = yy_get_previous_state(  );
+
+                       /* Okay, we're now positioned to make the NUL
+                        * transition.  We couldn't have
+                        * yy_get_previous_state() go ahead and do it
+                        * for us because it doesn't know how to deal
+                        * with the possibility of jamming (and we don't
+                        * want to build jamming into it because then it
+                        * will run more slowly).
+                        */
+
+                       yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+                       if ( yy_next_state )
+                               {
+                               /* Consume the NUL. */
+                               yy_cp = ++(yy_c_buf_p);
+                               yy_current_state = yy_next_state;
+                               goto yy_match;
+                               }
+
+                       else
+                               {
+                               yy_cp = (yy_c_buf_p);
+                               goto yy_find_action;
+                               }
+                       }
+
+               else switch ( yy_get_next_buffer(  ) )
+                       {
+                       case EOB_ACT_END_OF_FILE:
+                               {
+                               (yy_did_buffer_switch_on_eof) = 0;
+
+                               if ( dax_wrap( ) )
+                                       {
+                                       /* Note: because we've taken care in
+                                        * yy_get_next_buffer() to have set up
+                                        * dax_text, we can now set up
+                                        * yy_c_buf_p so that if some total
+                                        * hoser (like flex itself) wants to
+                                        * call the scanner after we return the
+                                        * YY_NULL, it'll still work - another
+                                        * YY_NULL will get returned.
+                                        */
+                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+                                       yy_act = YY_STATE_EOF(YY_START);
+                                       goto do_action;
+                                       }
+
+                               else
+                                       {
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
+                                       }
+                               break;
+                               }
+
+                       case EOB_ACT_CONTINUE_SCAN:
+                               (yy_c_buf_p) =
+                                       (yytext_ptr) + yy_amount_of_matched_text;
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_match;
+
+                       case EOB_ACT_LAST_MATCH:
+                               (yy_c_buf_p) =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_find_action;
+                       }
+               break;
+               }
+
+       default:
+               YY_FATAL_ERROR(
+                       "fatal flex scanner internal error--no action found" );
+       } /* end of action switch */
+               } /* end of scanning one token */
+       } /* end of user's declarations */
 } /* end of dax_lex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
  * Returns a code representing an action:
- *  EOB_ACT_LAST_MATCH -
- *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *  EOB_ACT_END_OF_FILE - end of file
+ *     EOB_ACT_LAST_MATCH -
+ *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *     EOB_ACT_END_OF_FILE - end of file
  */
 static int yy_get_next_buffer (void)
 {
-      char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-  char *source = (yytext_ptr);
-  yy_size_t number_to_move, i;
-  int ret_val;
-
-  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-    YY_FATAL_ERROR(
-    "fatal flex scanner internal error--end of buffer missed" );
-
-  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-    { /* Don't try to fill the buffer, so this is an EOF. */
-    if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-      {
-      /* We matched a single character, the EOB, so
-       * treat this as a final EOF.
-       */
-      return EOB_ACT_END_OF_FILE;
-      }
-
-    else
-      {
-      /* We matched some text prior to the EOB, first
-       * process it.
-       */
-      return EOB_ACT_LAST_MATCH;
-      }
-    }
-
-  /* Try to read more data. */
-
-  /* First move last chars to start of buffer. */
-  number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-  for ( i = 0; i < number_to_move; ++i )
-    *(dest++) = *(source++);
-
-  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-    /* don't do the read, it's not guaranteed to return an EOF,
-     * just force an EOF
-     */
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-  else
-    {
-      yy_size_t num_to_read =
-      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-    while ( num_to_read <= 0 )
-      { /* Not enough room in the buffer - grow it. */
-
-      /* just a shorter name for the current buffer */
-      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
-
-      int yy_c_buf_p_offset =
-        (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-      if ( b->yy_is_our_buffer )
-        {
-        yy_size_t new_size = b->yy_buf_size * 2;
-
-        if ( new_size <= 0 )
-          b->yy_buf_size += b->yy_buf_size / 8;
-        else
-          b->yy_buf_size *= 2;
-
-        b->yy_ch_buf = (char *)
-          /* Include room in for 2 EOB chars. */
-          dax_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-        }
-      else
-        /* Can't grow it, we don't own it. */
-        b->yy_ch_buf = 0;
-
-      if ( ! b->yy_ch_buf )
-        YY_FATAL_ERROR(
-        "fatal error - scanner input buffer overflow" );
-
-      (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-            number_to_move - 1;
-
-      }
-
-    if ( num_to_read > YY_READ_BUF_SIZE )
-      num_to_read = YY_READ_BUF_SIZE;
-
-    /* Read in more data. */
-    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-      (yy_n_chars), num_to_read );
-
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-    }
-
-  if ( (yy_n_chars) == 0 )
-    {
-    if ( number_to_move == YY_MORE_ADJ )
-      {
-      ret_val = EOB_ACT_END_OF_FILE;
-      dax_restart(dax_in  );
-      }
-
-    else
-      {
-      ret_val = EOB_ACT_LAST_MATCH;
-      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-        YY_BUFFER_EOF_PENDING;
-      }
-    }
-
-  else
-    ret_val = EOB_ACT_CONTINUE_SCAN;
-
-  if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-    /* Extend the array by 50%, plus the number we really need. */
-    int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dax_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-  }
+       char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       char *source = (yytext_ptr);
+       int number_to_move, i;
+       int ret_val;
+
+       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+               YY_FATAL_ERROR(
+               "fatal flex scanner internal error--end of buffer missed" );
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+               { /* Don't try to fill the buffer, so this is an EOF. */
+               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+                       {
+                       /* We matched a single character, the EOB, so
+                        * treat this as a final EOF.
+                        */
+                       return EOB_ACT_END_OF_FILE;
+                       }
+
+               else
+                       {
+                       /* We matched some text prior to the EOB, first
+                        * process it.
+                        */
+                       return EOB_ACT_LAST_MATCH;
+                       }
+               }
+
+       /* Try to read more data. */
+
+       /* First move last chars to start of buffer. */
+       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
+
+       for ( i = 0; i < number_to_move; ++i )
+               *(dest++) = *(source++);
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+               /* don't do the read, it's not guaranteed to return an EOF,
+                * just force an EOF
+                */
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+       else
+               {
+                       int num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+               while ( num_to_read <= 0 )
+                       { /* Not enough room in the buffer - grow it. */
+
+                       /* just a shorter name for the current buffer */
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
+
+                       int yy_c_buf_p_offset =
+                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+                       if ( b->yy_is_our_buffer )
+                               {
+                               int new_size = b->yy_buf_size * 2;
+
+                               if ( new_size <= 0 )
+                                       b->yy_buf_size += b->yy_buf_size / 8;
+                               else
+                                       b->yy_buf_size *= 2;
+
+                               b->yy_ch_buf = (char *)
+                                       /* Include room in for 2 EOB chars. */
+                                       dax_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+                               }
+                       else
+                               /* Can't grow it, we don't own it. */
+                               b->yy_ch_buf = NULL;
+
+                       if ( ! b->yy_ch_buf )
+                               YY_FATAL_ERROR(
+                               "fatal error - scanner input buffer overflow" );
+
+                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+                                               number_to_move - 1;
+
+                       }
+
+               if ( num_to_read > YY_READ_BUF_SIZE )
+                       num_to_read = YY_READ_BUF_SIZE;
+
+               /* Read in more data. */
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), num_to_read );
+
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       if ( (yy_n_chars) == 0 )
+               {
+               if ( number_to_move == YY_MORE_ADJ )
+                       {
+                       ret_val = EOB_ACT_END_OF_FILE;
+                       dax_restart(dax_in  );
+                       }
+
+               else
+                       {
+                       ret_val = EOB_ACT_LAST_MATCH;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+                               YY_BUFFER_EOF_PENDING;
+                       }
+               }
+
+       else
+               ret_val = EOB_ACT_CONTINUE_SCAN;
+
+       if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+               /* Extend the array by 50%, plus the number we really need. */
+               int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dax_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+       }
+
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
-  (yy_n_chars) += number_to_move;
-  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-  return ret_val;
+       return ret_val;
 }
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
     static yy_state_type yy_get_previous_state (void)
 {
-  yy_state_type yy_current_state;
-  char *yy_cp;
-
-  yy_current_state = (yy_start);
-
-  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-    {
-    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-    if ( yy_accept[yy_current_state] )
-      {
-      (yy_last_accepting_state) = yy_current_state;
-      (yy_last_accepting_cpos) = yy_cp;
-      }
-    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-      {
-      yy_current_state = (int) yy_def[yy_current_state];
-      if ( yy_current_state >= 775 )
-        yy_c = yy_meta[(unsigned int) yy_c];
-      }
-    yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-    }
-
-  return yy_current_state;
+       yy_state_type yy_current_state;
+       char *yy_cp;
+    
+       yy_current_state = (yy_start);
+
+       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+               {
+               YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+               if ( yy_accept[yy_current_state] )
+                       {
+                       (yy_last_accepting_state) = yy_current_state;
+                       (yy_last_accepting_cpos) = yy_cp;
+                       }
+               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                       {
+                       yy_current_state = (int) yy_def[yy_current_state];
+                       if ( yy_current_state >= 775 )
+                               yy_c = yy_meta[(unsigned int) yy_c];
+                       }
+               yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+               }
+
+       return yy_current_state;
 }
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
- *  next_state = yy_try_NUL_trans( current_state );
+ *     next_state = yy_try_NUL_trans( current_state );
  */
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
 {
-  int yy_is_jam;
-      char *yy_cp = (yy_c_buf_p);
-
-  YY_CHAR yy_c = 1;
-  if ( yy_accept[yy_current_state] )
-    {
-    (yy_last_accepting_state) = yy_current_state;
-    (yy_last_accepting_cpos) = yy_cp;
-    }
-  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-    {
-    yy_current_state = (int) yy_def[yy_current_state];
-    if ( yy_current_state >= 775 )
-      yy_c = yy_meta[(unsigned int) yy_c];
-    }
-  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-  yy_is_jam = (yy_current_state == 774);
-
-    return yy_is_jam ? 0 : yy_current_state;
+       int yy_is_jam;
+       char *yy_cp = (yy_c_buf_p);
+
+       YY_CHAR yy_c = 1;
+       if ( yy_accept[yy_current_state] )
+               {
+               (yy_last_accepting_state) = yy_current_state;
+               (yy_last_accepting_cpos) = yy_cp;
+               }
+       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+               {
+               yy_current_state = (int) yy_def[yy_current_state];
+               if ( yy_current_state >= 775 )
+                       yy_c = yy_meta[(unsigned int) yy_c];
+               }
+       yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+       yy_is_jam = (yy_current_state == 774);
+
+               return yy_is_jam ? 0 : yy_current_state;
 }
 
 #ifndef YY_NO_UNPUT
@@ -3162,185 +3147,185 @@ static int yy_get_next_buffer (void)
 #endif
 
 {
-  int c;
-
-  *(yy_c_buf_p) = (yy_hold_char);
-
-  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-    {
-    /* yy_c_buf_p now points to the character we want to return.
-     * If this occurs *before* the EOB characters, then it's a
-     * valid NUL; if not, then we've hit the end of the buffer.
-     */
-    if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-      /* This was really a NUL. */
-      *(yy_c_buf_p) = '\0';
-
-    else
-      { /* need more input */
-      yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
-      ++(yy_c_buf_p);
-
-      switch ( yy_get_next_buffer(  ) )
-        {
-        case EOB_ACT_LAST_MATCH:
-          /* This happens because yy_g_n_b()
-           * sees that we've accumulated a
-           * token and flags that we need to
-           * try matching the token before
-           * proceeding.  But for input(),
-           * there's no matching to consider.
-           * So convert the EOB_ACT_LAST_MATCH
-           * to EOB_ACT_END_OF_FILE.
-           */
-
-          /* Reset buffer status. */
-          dax_restart(dax_in );
-
-          /*FALLTHROUGH*/
-
-        case EOB_ACT_END_OF_FILE:
-          {
-          if ( dax_wrap( ) )
-            return EOF;
-
-          if ( ! (yy_did_buffer_switch_on_eof) )
-            YY_NEW_FILE;
+       int c;
+    
+       *(yy_c_buf_p) = (yy_hold_char);
+
+       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+               {
+               /* yy_c_buf_p now points to the character we want to return.
+                * If this occurs *before* the EOB characters, then it's a
+                * valid NUL; if not, then we've hit the end of the buffer.
+                */
+               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       /* This was really a NUL. */
+                       *(yy_c_buf_p) = '\0';
+
+               else
+                       { /* need more input */
+                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       ++(yy_c_buf_p);
+
+                       switch ( yy_get_next_buffer(  ) )
+                               {
+                               case EOB_ACT_LAST_MATCH:
+                                       /* This happens because yy_g_n_b()
+                                        * sees that we've accumulated a
+                                        * token and flags that we need to
+                                        * try matching the token before
+                                        * proceeding.  But for input(),
+                                        * there's no matching to consider.
+                                        * So convert the EOB_ACT_LAST_MATCH
+                                        * to EOB_ACT_END_OF_FILE.
+                                        */
+
+                                       /* Reset buffer status. */
+                                       dax_restart(dax_in );
+
+                                       /*FALLTHROUGH*/
+
+                               case EOB_ACT_END_OF_FILE:
+                                       {
+                                       if ( dax_wrap( ) )
+                                               return 0;
+
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
 #ifdef __cplusplus
-          return yyinput();
+                                       return yyinput();
 #else
-          return input();
+                                       return input();
 #endif
-          }
+                                       }
 
-        case EOB_ACT_CONTINUE_SCAN:
-          (yy_c_buf_p) = (yytext_ptr) + offset;
-          break;
-        }
-      }
-    }
-
-  c = *(unsigned char *) (yy_c_buf_p);  /* cast for 8-bit char's */
-  *(yy_c_buf_p) = '\0';  /* preserve dax_text */
-  (yy_hold_char) = *++(yy_c_buf_p);
+                               case EOB_ACT_CONTINUE_SCAN:
+                                       (yy_c_buf_p) = (yytext_ptr) + offset;
+                                       break;
+                               }
+                       }
+               }
 
-  if ( c == '\n' )
+       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
+       *(yy_c_buf_p) = '\0';   /* preserve dax_text */
+       (yy_hold_char) = *++(yy_c_buf_p);
 
+       if ( c == '\n' )
+               
     dax_lineno++;
 ;
 
-  return c;
+       return c;
 }
-#endif  /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
- *
+ * 
  * @note This function does not reset the start condition to @c INITIAL .
  */
     void dax_restart  (FILE * input_file )
 {
-
-  if ( ! YY_CURRENT_BUFFER ){
+    
+       if ( ! YY_CURRENT_BUFFER ){
         dax_ensure_buffer_stack ();
-    YY_CURRENT_BUFFER_LVALUE =
+               YY_CURRENT_BUFFER_LVALUE =
             dax__create_buffer(dax_in,YY_BUF_SIZE );
-  }
+       }
 
-  dax__init_buffer(YY_CURRENT_BUFFER,input_file );
-  dax__load_buffer_state( );
+       dax__init_buffer(YY_CURRENT_BUFFER,input_file );
+       dax__load_buffer_state( );
 }
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
- *
+ * 
  */
     void dax__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
-
-  /* TODO. We should be able to replace this entire function body
-   * with
-   *    dax_pop_buffer_state();
-   *    dax_push_buffer_state(new_buffer);
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              dax_pop_buffer_state();
+        *              dax_push_buffer_state(new_buffer);
      */
-  dax_ensure_buffer_stack ();
-  if ( YY_CURRENT_BUFFER == new_buffer )
-    return;
-
-  if ( YY_CURRENT_BUFFER )
-    {
-    /* Flush out information for old buffer. */
-    *(yy_c_buf_p) = (yy_hold_char);
-    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-    }
-
-  YY_CURRENT_BUFFER_LVALUE = new_buffer;
-  dax__load_buffer_state( );
-
-  /* We don't actually know whether we did this switch during
-   * EOF (dax_wrap()) processing, but the only time this flag
-   * is looked at is after dax_wrap() is called, so it's safe
-   * to go ahead and always set it.
-   */
-  (yy_did_buffer_switch_on_eof) = 1;
+       dax_ensure_buffer_stack ();
+       if ( YY_CURRENT_BUFFER == new_buffer )
+               return;
+
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       dax__load_buffer_state( );
+
+       /* We don't actually know whether we did this switch during
+        * EOF (dax_wrap()) processing, but the only time this flag
+        * is looked at is after dax_wrap() is called, so it's safe
+        * to go ahead and always set it.
+        */
+       (yy_did_buffer_switch_on_eof) = 1;
 }
 
 static void dax__load_buffer_state  (void)
 {
-      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-  dax_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-  (yy_hold_char) = *(yy_c_buf_p);
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       dax_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
 }
 
 /** Allocate and initialize an input buffer state.
  * @param file A readable stream.
  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ * 
  * @return the allocated buffer state.
  */
     YY_BUFFER_STATE dax__create_buffer  (FILE * file, int  size )
 {
-  YY_BUFFER_STATE b;
-
-  b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state )  );
-  if ( ! b )
-    YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
+       YY_BUFFER_STATE b;
+    
+       b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
 
-  b->yy_buf_size = (yy_size_t)size;
+       b->yy_buf_size = (yy_size_t)size;
 
-  /* yy_ch_buf has to be 2 characters longer than the size given because
-   * we need to put in 2 end-of-buffer characters.
-   */
-  b->yy_ch_buf = (char *) dax_alloc(b->yy_buf_size + 2  );
-  if ( ! b->yy_ch_buf )
-    YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
+       /* yy_ch_buf has to be 2 characters longer than the size given because
+        * we need to put in 2 end-of-buffer characters.
+        */
+       b->yy_ch_buf = (char *) dax_alloc(b->yy_buf_size + 2  );
+       if ( ! b->yy_ch_buf )
+               YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
 
-  b->yy_is_our_buffer = 1;
+       b->yy_is_our_buffer = 1;
 
-  dax__init_buffer(b,file );
+       dax__init_buffer(b,file );
 
-  return b;
+       return b;
 }
 
 /** Destroy the buffer.
  * @param b a buffer created with dax__create_buffer()
- *
+ * 
  */
     void dax__delete_buffer (YY_BUFFER_STATE  b )
 {
+    
+       if ( ! b )
+               return;
 
-  if ( ! b )
-    return;
-
-  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
-  if ( b->yy_is_our_buffer )
-    dax_free((void *) b->yy_ch_buf  );
+       if ( b->yy_is_our_buffer )
+               dax_free((void *) b->yy_ch_buf  );
 
-  dax_free((void *) b  );
+       dax_free((void *) b  );
 }
 
 /* Initializes or reinitializes a buffer.
@@ -3350,12 +3335,12 @@ static void dax__load_buffer_state  (void)
     static void dax__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
 {
-  int oerrno = errno;
+       int oerrno = errno;
+    
+       dax__flush_buffer(b );
 
-  dax__flush_buffer(b );
-
-  b->yy_input_file = file;
-  b->yy_fill_buffer = 1;
+       b->yy_input_file = file;
+       b->yy_fill_buffer = 1;
 
     /* If b is the current buffer, then dax__init_buffer was _probably_
      * called from dax_restart() or through yy_get_next_buffer.
@@ -3367,87 +3352,87 @@ static void dax__load_buffer_state  (void)
     }
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
-  errno = oerrno;
+    
+       errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ * 
  */
     void dax__flush_buffer (YY_BUFFER_STATE  b )
 {
-      if ( ! b )
-    return;
+       if ( ! b )
+               return;
 
-  b->yy_n_chars = 0;
+       b->yy_n_chars = 0;
 
-  /* We always need two end-of-buffer characters.  The first causes
-   * a transition to the end-of-buffer state.  The second causes
-   * a jam in that state.
-   */
-  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+       /* We always need two end-of-buffer characters.  The first causes
+        * a transition to the end-of-buffer state.  The second causes
+        * a jam in that state.
+        */
+       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
-  b->yy_buf_pos = &b->yy_ch_buf[0];
+       b->yy_buf_pos = &b->yy_ch_buf[0];
 
-  b->yy_at_bol = 1;
-  b->yy_buffer_status = YY_BUFFER_NEW;
+       b->yy_at_bol = 1;
+       b->yy_buffer_status = YY_BUFFER_NEW;
 
-  if ( b == YY_CURRENT_BUFFER )
-    dax__load_buffer_state( );
+       if ( b == YY_CURRENT_BUFFER )
+               dax__load_buffer_state( );
 }
 
 /** Pushes the new state onto the stack. The new state becomes
  *  the current state. This function will allocate the stack
  *  if necessary.
  *  @param new_buffer The new state.
- *
+ *  
  */
 void dax_push_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-      if (new_buffer == NULL)
-    return;
+       if (new_buffer == NULL)
+               return;
 
-  dax_ensure_buffer_stack();
+       dax_ensure_buffer_stack();
 
-  /* This block is copied from dax__switch_to_buffer. */
-  if ( YY_CURRENT_BUFFER )
-    {
-    /* Flush out information for old buffer. */
-    *(yy_c_buf_p) = (yy_hold_char);
-    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-    }
+       /* This block is copied from dax__switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
 
-  /* Only push if top exists. Otherwise, replace top. */
-  if (YY_CURRENT_BUFFER)
-    (yy_buffer_stack_top)++;
-  YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
-  /* copied from dax__switch_to_buffer. */
-  dax__load_buffer_state( );
-  (yy_did_buffer_switch_on_eof) = 1;
+       /* copied from dax__switch_to_buffer. */
+       dax__load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
 }
 
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
- *
+ *  
  */
 void dax_pop_buffer_state (void)
 {
-      if (!YY_CURRENT_BUFFER)
-    return;
+       if (!YY_CURRENT_BUFFER)
+               return;
 
-  dax__delete_buffer(YY_CURRENT_BUFFER );
-  YY_CURRENT_BUFFER_LVALUE = NULL;
-  if ((yy_buffer_stack_top) > 0)
-    --(yy_buffer_stack_top);
+       dax__delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
 
-  if (YY_CURRENT_BUFFER) {
-    dax__load_buffer_state( );
-    (yy_did_buffer_switch_on_eof) = 1;
-  }
+       if (YY_CURRENT_BUFFER) {
+               dax__load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
+       }
 }
 
 /* Allocates the stack if it does not exist.
@@ -3455,205 +3440,205 @@ void dax_pop_buffer_state (void)
  */
 static void dax_ensure_buffer_stack (void)
 {
-  yy_size_t num_to_alloc;
-
-  if (!(yy_buffer_stack)) {
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
 
-    /* First allocation is just for 2 elements, since we don't know if this
-     * scanner will even need a stack. We use 2 instead of 1 to avoid an
-     * immediate realloc on the next call.
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
          */
-    num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
-    (yy_buffer_stack) = (struct yy_buffer_state**)dax_alloc
-                (num_to_alloc * sizeof(struct yy_buffer_state*)
-                );
-    if ( ! (yy_buffer_stack) )
-      YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
-
-    memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
-    (yy_buffer_stack_max) = num_to_alloc;
-    (yy_buffer_stack_top) = 0;
-    return;
-  }
-
-  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-    /* Increase the buffer to prepare for a possible push. */
-    yy_size_t grow_size = 8 /* arbitrary grow size */;
-
-    num_to_alloc = (yy_buffer_stack_max) + grow_size;
-    (yy_buffer_stack) = (struct yy_buffer_state**)dax_realloc
-                ((yy_buffer_stack),
-                num_to_alloc * sizeof(struct yy_buffer_state*)
-                );
-    if ( ! (yy_buffer_stack) )
-      YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
-
-    /* zero only the new slots.*/
-    memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-    (yy_buffer_stack_max) = num_to_alloc;
-  }
+      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+               (yy_buffer_stack) = (struct yy_buffer_state**)dax_alloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
+
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
+       }
+
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+               /* Increase the buffer to prepare for a possible push. */
+               yy_size_t grow_size = 8 /* arbitrary grow size */;
+
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)dax_realloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
+
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
 }
 
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
- *
+ * 
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE dax__scan_buffer  (char * base, yy_size_t  size )
 {
-  YY_BUFFER_STATE b;
-
-  if ( size < 2 ||
-       base[size-2] != YY_END_OF_BUFFER_CHAR ||
-       base[size-1] != YY_END_OF_BUFFER_CHAR )
-    /* They forgot to leave room for the EOB's. */
-    return 0;
-
-  b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state )  );
-  if ( ! b )
-    YY_FATAL_ERROR( "out of dynamic memory in dax__scan_buffer()" );
-
-  b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
-  b->yy_buf_pos = b->yy_ch_buf = base;
-  b->yy_is_our_buffer = 0;
-  b->yy_input_file = 0;
-  b->yy_n_chars = b->yy_buf_size;
-  b->yy_is_interactive = 0;
-  b->yy_at_bol = 1;
-  b->yy_fill_buffer = 0;
-  b->yy_buffer_status = YY_BUFFER_NEW;
-
-  dax__switch_to_buffer(b  );
-
-  return b;
+       YY_BUFFER_STATE b;
+    
+       if ( size < 2 ||
+            base[size-2] != YY_END_OF_BUFFER_CHAR ||
+            base[size-1] != YY_END_OF_BUFFER_CHAR )
+               /* They forgot to leave room for the EOB's. */
+               return NULL;
+
+       b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in dax__scan_buffer()" );
+
+       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
+       b->yy_buf_pos = b->yy_ch_buf = base;
+       b->yy_is_our_buffer = 0;
+       b->yy_input_file = NULL;
+       b->yy_n_chars = b->yy_buf_size;
+       b->yy_is_interactive = 0;
+       b->yy_at_bol = 1;
+       b->yy_fill_buffer = 0;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       dax__switch_to_buffer(b  );
+
+       return b;
 }
 
 /** Setup the input buffer state to scan a string. The next call to dax_lex() will
  * scan from a @e copy of @a str.
  * @param yystr a NUL-terminated string to scan
- *
+ * 
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
  *       dax__scan_bytes() instead.
  */
 YY_BUFFER_STATE dax__scan_string (yyconst char * yystr )
 {
-
-  return dax__scan_bytes(yystr,strlen(yystr) );
+    
+       return dax__scan_bytes(yystr,(int) strlen(yystr) );
 }
 
 /** Setup the input buffer state to scan the given bytes. The next call to dax_lex() will
  * scan from a @e copy of @a bytes.
  * @param yybytes the byte buffer to scan
  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- *
+ * 
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE dax__scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
-{
-  YY_BUFFER_STATE b;
-  char *buf;
-  yy_size_t n;
-  yy_size_t i;
-
-  /* Get memory for full buffer, including space for trailing EOB's. */
-  n = _yybytes_len + 2;
-  buf = (char *) dax_alloc(n  );
-  if ( ! buf )
-    YY_FATAL_ERROR( "out of dynamic memory in dax__scan_bytes()" );
-
-  for ( i = 0; i < _yybytes_len; ++i )
-    buf[i] = yybytes[i];
-
-  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-  b = dax__scan_buffer(buf,n );
-  if ( ! b )
-    YY_FATAL_ERROR( "bad buffer in dax__scan_bytes()" );
-
-  /* It's okay to grow etc. this buffer, and we should throw it
-   * away when we're done.
-   */
-  b->yy_is_our_buffer = 1;
-
-  return b;
+YY_BUFFER_STATE dax__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+{
+       YY_BUFFER_STATE b;
+       char *buf;
+       yy_size_t n;
+       int i;
+    
+       /* Get memory for full buffer, including space for trailing EOB's. */
+       n = (yy_size_t) (_yybytes_len + 2);
+       buf = (char *) dax_alloc(n  );
+       if ( ! buf )
+               YY_FATAL_ERROR( "out of dynamic memory in dax__scan_bytes()" );
+
+       for ( i = 0; i < _yybytes_len; ++i )
+               buf[i] = yybytes[i];
+
+       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+       b = dax__scan_buffer(buf,n );
+       if ( ! b )
+               YY_FATAL_ERROR( "bad buffer in dax__scan_bytes()" );
+
+       /* It's okay to grow etc. this buffer, and we should throw it
+        * away when we're done.
+        */
+       b->yy_is_our_buffer = 1;
+
+       return b;
 }
 
     static void yy_push_state (int  _new_state )
 {
-      if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
-    {
-    yy_size_t new_size;
+       if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
+               {
+               yy_size_t new_size;
 
-    (yy_start_stack_depth) += YY_START_STACK_INCR;
-    new_size = (yy_start_stack_depth) * sizeof( int );
+               (yy_start_stack_depth) += YY_START_STACK_INCR;
+               new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int );
 
-    if ( ! (yy_start_stack) )
-      (yy_start_stack) = (int *) dax_alloc(new_size  );
+               if ( ! (yy_start_stack) )
+                       (yy_start_stack) = (int *) dax_alloc(new_size  );
 
-    else
-      (yy_start_stack) = (int *) dax_realloc((void *) (yy_start_stack),new_size  );
+               else
+                       (yy_start_stack) = (int *) dax_realloc((void *) (yy_start_stack),new_size  );
 
-    if ( ! (yy_start_stack) )
-      YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
-    }
+               if ( ! (yy_start_stack) )
+                       YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
+               }
 
-  (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
+       (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
 
-  BEGIN(_new_state);
+       BEGIN(_new_state);
 }
 
     static void yy_pop_state  (void)
 {
-      if ( --(yy_start_stack_ptr) < 0 )
-    YY_FATAL_ERROR( "start-condition stack underflow" );
+       if ( --(yy_start_stack_ptr) < 0 )
+               YY_FATAL_ERROR( "start-condition stack underflow" );
 
-  BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
+       BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
 }
 
 #ifndef YY_EXIT_FAILURE
 #define YY_EXIT_FAILURE 2
 #endif
 
-static void yy_fatal_error (yyconst char* msg )
+static void yynoreturn yy_fatal_error (yyconst char* msg )
 {
-      (void) fprintf( stderr, "%s\n", msg );
-  exit( YY_EXIT_FAILURE );
+                       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
 }
 
 /* Redefine yyless() so it works in section 3 code. */
 
 #undef yyless
 #define yyless(n) \
-  do \
-    { \
-    /* Undo effects of setting up dax_text. */ \
+       do \
+               { \
+               /* Undo effects of setting up dax_text. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-    dax_text[dax_leng] = (yy_hold_char); \
-    (yy_c_buf_p) = dax_text + yyless_macro_arg; \
-    (yy_hold_char) = *(yy_c_buf_p); \
-    *(yy_c_buf_p) = '\0'; \
-    dax_leng = yyless_macro_arg; \
-    } \
-  while ( 0 )
+               dax_text[dax_leng] = (yy_hold_char); \
+               (yy_c_buf_p) = dax_text + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               dax_leng = yyless_macro_arg; \
+               } \
+       while ( 0 )
 
 /* Accessor  methods (get/set functions) to struct members. */
 
 /** Get the current line number.
- *
+ * 
  */
 int dax_get_lineno  (void)
 {
-
+    
     return dax_lineno;
 }
 
 /** Get the input stream.
- *
+ * 
  */
 FILE *dax_get_in  (void)
 {
@@ -3661,7 +3646,7 @@ FILE *dax_get_in  (void)
 }
 
 /** Get the output stream.
- *
+ * 
  */
 FILE *dax_get_out  (void)
 {
@@ -3669,15 +3654,15 @@ FILE *dax_get_out  (void)
 }
 
 /** Get the length of the current token.
- *
+ * 
  */
-yy_size_t dax_get_leng  (void)
+int dax_get_leng  (void)
 {
         return dax_leng;
 }
 
 /** Get the current token.
- *
+ * 
  */
 
 char *dax_get_text  (void)
@@ -3687,18 +3672,18 @@ char *dax_get_text  (void)
 
 /** Set the current line number.
  * @param _line_number line number
- *
+ * 
  */
 void dax_set_lineno (int  _line_number )
 {
-
+    
     dax_lineno = _line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param _in_str A readable stream.
- *
+ * 
  * @see dax__switch_to_buffer
  */
 void dax_set_in (FILE *  _in_str )
@@ -3729,11 +3714,11 @@ static int yy_init_globals (void)
 
     /* We do not touch dax_lineno unless the option is enabled. */
     dax_lineno =  1;
-
-    (yy_buffer_stack) = 0;
+    
+    (yy_buffer_stack) = NULL;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = (char *) 0;
+    (yy_c_buf_p) = NULL;
     (yy_init) = 0;
     (yy_start) = 0;
 
@@ -3746,8 +3731,8 @@ static int yy_init_globals (void)
     dax_in = stdin;
     dax_out = stdout;
 #else
-    dax_in = (FILE *) 0;
-    dax_out = (FILE *) 0;
+    dax_in = NULL;
+    dax_out = NULL;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -3759,17 +3744,17 @@ static int yy_init_globals (void)
 /* dax_lex_destroy is for both reentrant and non-reentrant scanners. */
 int dax_lex_destroy  (void)
 {
-
+    
     /* Pop the buffer stack, destroying each element. */
-  while(YY_CURRENT_BUFFER){
-    dax__delete_buffer(YY_CURRENT_BUFFER  );
-    YY_CURRENT_BUFFER_LVALUE = NULL;
-    dax_pop_buffer_state();
-  }
+       while(YY_CURRENT_BUFFER){
+               dax__delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               dax_pop_buffer_state();
+       }
 
-  /* Destroy the stack itself. */
-  dax_free((yy_buffer_stack) );
-  (yy_buffer_stack) = NULL;
+       /* Destroy the stack itself. */
+       dax_free((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
 
     /* Destroy the start condition stack. */
         dax_free((yy_start_stack)  );
@@ -3789,45 +3774,45 @@ int dax_lex_destroy  (void)
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
 {
-
-  int i;
-  for ( i = 0; i < n; ++i )
-    s1[i] = s2[i];
+               
+       int i;
+       for ( i = 0; i < n; ++i )
+               s1[i] = s2[i];
 }
 #endif
 
 #ifdef YY_NEED_STRLEN
 static int yy_flex_strlen (yyconst char * s )
 {
-  int n;
-  for ( n = 0; s[n]; ++n )
-    ;
+       int n;
+       for ( n = 0; s[n]; ++n )
+               ;
 
-  return n;
+       return n;
 }
 #endif
 
 void *dax_alloc (yy_size_t  size )
 {
-      return (void *) malloc( size );
+                       return malloc(size);
 }
 
 void *dax_realloc  (void * ptr, yy_size_t  size )
 {
-
-  /* The cast to (char *) in the following accommodates both
-   * implementations that use char* generic pointers, and those
-   * that use void* generic pointers.  It works with the latter
-   * because both ANSI C and C++ allow castless assignment from
-   * any pointer type to void*, and deal with argument conversions
-   * as though doing an assignment.
-   */
-  return (void *) realloc( (char *) ptr, size );
+               
+       /* The cast to (char *) in the following accommodates both
+        * implementations that use char* generic pointers, and those
+        * that use void* generic pointers.  It works with the latter
+        * because both ANSI C and C++ allow castless assignment from
+        * any pointer type to void*, and deal with argument conversions
+        * as though doing an assignment.
+        */
+       return realloc(ptr, size);
 }
 
 void dax_free (void * ptr )
 {
-      free( (char *) ptr );  /* see dax_realloc() for (char *) cast */
+                       free( (char *) ptr );   /* see dax_realloc() for (char *) cast */
 }
 
 #define YYTABLES_NAME "yytables"
@@ -3836,8 +3821,8 @@ void dax_free (void * ptr )
 int dax__element_context(int i)
 {
   return (0<i && i<yy_start_stack_depth
-    ? yy_start_stack[yy_start_stack_ptr - i]
-    : 0);
+         ? yy_start_stack[yy_start_stack_ptr - i]
+         : 0);
 }
 
 #ifdef FLEX_DEBUG
@@ -3876,7 +3861,7 @@ static void debug_enter(int state, const char* statename) {
 static void debug_leave(void) {
     if (dax__flex_debug) {
         print_yy_stack("--LEAVE : ");
-  print_dax__bufferstack();
+       print_dax__bufferstack();
     }
   yy_pop_state();
 }
@@ -3891,7 +3876,7 @@ static void cleanup(void)
 {
     if (dax__statenames) {
         free(dax__statenames);
-  dax__statenames = NULL;
+       dax__statenames = NULL;
     }
     free(dax__bufferstack);
     dax__bufferstack = NULL;
@@ -3905,13 +3890,13 @@ static int fail(const char* fmt, ...)
     int chars_left, used;
     va_list ap; va_start(ap, fmt);
 #ifdef FLEXML_yylineno
-    used = sprintf(flexml_err_msg,
-       "Invalid XML (XML input line %d, state %d): ",
-       dax_lineno, YY_START);
+    used = snprintf(flexml_err_msg,flexml_max_err_msg_size,
+                  "Invalid XML (XML input line %d, state %d): ",
+                  dax_lineno, YY_START);
 #else
-    used = sprintf(flexml_err_msg,
-       "Invalid XML (state %d): ",
-       YY_START);
+    used = snprintf(flexml_err_msg,flexml_max_err_msg_size,
+                  "Invalid XML (state %d): ",
+                  YY_START);
 #endif
     chars_left = flexml_max_err_msg_size - used - 1;
     vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
index b300c56..5552c33 100644 (file)
@@ -4,13 +4,13 @@
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  * FleXML is Copyright (C) 2003-2013 Martin Quinson.  All rights reserved.
  * (1.9.6).
- *
+ * 
  * There are two, intertwined parts to this program, part A and part B.
  *
  * Part A
  * ------
- *
- * Some parts, here collectively called "Part A", are found in the
+ * 
+ * Some parts, here collectively called "Part A", are found in the 
  * FleXML package.  They are Copyright (C) 1999-2005 Kristoffer Rose
  * and Copyright (C) 2003-2013 Martin Quinson. All rights reserved.
  *
  * Notice that these are explicit rights granted to you for files
  * generated by the FleXML system.  For your rights in connection with
  * the FleXML system itself please consult the GNU General Public License.
- *
+ * 
  * Part B
  * ------
- *
- * The other parts, here collectively called "Part B", and which came
- * from the DTD used by FleXML to generate this program, can be
+ * 
+ * The other parts, here collectively called "Part B", and which came 
+ * from the DTD used by FleXML to generate this program, can be 
  * distributed (or not, as the case may be) under the terms of whoever
- * wrote them, provided these terms respect and obey the two conditions
+ * wrote them, provided these terms respect and obey the two conditions 
  * above under the heading "Part A".
  *
  * The author of and contributors to FleXML specifically disclaim
- * any copyright interest in "Part B", unless "Part B" was written
+ * any copyright interest in "Part B", unless "Part B" was written 
  * by the author of or contributors to FleXML.
- *
+ * 
  */
 
 #ifndef _FLEXML_dax_H
index e642431..eb18b68 100644 (file)
@@ -1,55 +1,50 @@
-/* Copyright (c) 2009-2016. The SimGrid Team.
+/* 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. */
 
+#include "simdag_private.hpp"
 #include "simgrid/simdag.h"
-#include "xbt/misc.h"
+#include "xbt/file.hpp"
 #include "xbt/log.h"
-#include "xbt/str.h"
-#include "xbt/file.h" /* xbt_basename() */
-#include "simdag_private.hpp"
+#include "xbt/misc.h"
+#include <map>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_daxparse, sd, "Parsing DAX files");
 
 extern "C" {
-  #undef CLEANUP
-  #include "dax_dtd.h"
-  #define register /* g++ don't like register, so don't say it */
-  #include "dax_dtd.c"
-  #undef register
+#include "dax_dtd.h"
+#include "dax_dtd.c"
 }
 
 /* Ensure that transfer tasks have unique names even though a file is used several times */
-
 void uniq_transfer_task_name(SD_task_t task)
 {
   SD_task_t child = *(task->successors->begin());
   SD_task_t parent = *(task->predecessors->begin());
 
-  char *new_name = bprintf("%s_%s_%s", SD_task_get_name(parent), SD_task_get_name(task), SD_task_get_name(child));
-
-  SD_task_set_name(task, new_name);
+  std::string new_name =
+      std::string(SD_task_get_name(parent)) + "_" + SD_task_get_name(task) + "_" + SD_task_get_name(child);
 
-  free(new_name);
+  SD_task_set_name(task, new_name.c_str());
 }
 
 static bool children_are_marked(SD_task_t task){
-  for (SD_task_t it : *task->successors)
+  for (SD_task_t const& it : *task->successors)
     if (it->marked == 0)
       return false;
-  for (SD_task_t it : *task->outputs)
+  for (SD_task_t const& it : *task->outputs)
     if (it->marked == 0)
       return false;
   return true;
 }
 
 static bool parents_are_marked(SD_task_t task){
-  for (SD_task_t it : *task->predecessors)
+  for (SD_task_t const& it : *task->predecessors)
     if (it->marked == 0)
       return false;
-  for (SD_task_t it : *task->inputs)
+  for (SD_task_t const& it : *task->inputs)
     if (it->marked == 0)
       return false;
   return true;
@@ -69,17 +64,17 @@ bool acyclic_graph_detail(xbt_dynar_t dag){
   }
   while (not current.empty()) {
     std::vector<SD_task_t> next;
-    for (auto t: current){
+    for (auto const& t : current) {
       //Mark task
       t->marked = 1;
-      for (SD_task_t input : *t->inputs){
+      for (SD_task_t const& input : *t->inputs) {
         input->marked=1;
         // Inputs are communication, hence they can have only one predecessor
         SD_task_t input_pred = *(input->predecessors->begin());
         if (children_are_marked(input_pred))
           next.push_back(input_pred);
       }
-      for (SD_task_t pred : *t->predecessors) {
+      for (SD_task_t const& pred : *t->predecessors) {
         if (children_are_marked(pred))
           next.push_back(pred);
       }
@@ -110,22 +105,22 @@ bool acyclic_graph_detail(xbt_dynar_t dag){
     while (not current.empty()) {
       std::vector<SD_task_t> next;
       //test if the current iteration is done
-      for (auto t: current){
+      for (auto const& t : current) {
         t->marked = 1;
-        for (SD_task_t output : *t->outputs) {
+        for (SD_task_t const& output : *t->outputs) {
           output->marked = 1;
           // outputs are communication, hence they can have only one successor
           SD_task_t output_succ = *(output->successors->begin());
           if (parents_are_marked(output_succ))
             next.push_back(output_succ);
         }
-        for (SD_task_t succ : *t->successors) {
+        for (SD_task_t const& succ : *t->successors) {
           if (parents_are_marked(succ))
             next.push_back(succ);
         }
-        current.clear();
-        current = next;
       }
+      current.clear();
+      current = next;
     }
 
     all_marked = true;
@@ -142,8 +137,8 @@ bool acyclic_graph_detail(xbt_dynar_t dag){
 static YY_BUFFER_STATE input_buffer;
 
 static xbt_dynar_t result;
-static xbt_dict_t jobs;
-static xbt_dict_t files;
+static std::map<std::string, SD_task_t> jobs;
+static std::map<std::string, SD_task_t> files;
 static SD_task_t current_job;
 static SD_task_t root_task;
 static SD_task_t end_task;
@@ -159,18 +154,14 @@ static void dax_task_free(void *task)
  */
 xbt_dynar_t SD_daxload(const char *filename)
 {
-  xbt_dict_cursor_t cursor;
   SD_task_t file;
-  char *name;
-  FILE *in_file = fopen(filename, "r");
+  FILE* in_file = fopen(filename, "r");
   xbt_assert(in_file, "Unable to open \"%s\"\n", filename);
   input_buffer = dax__create_buffer(in_file, 10);
   dax__switch_to_buffer(input_buffer);
   dax_lineno = 1;
 
   result = xbt_dynar_new(sizeof(SD_task_t), dax_task_free);
-  files = xbt_dict_new_homogeneous(&dax_task_free);
-  jobs = xbt_dict_new_homogeneous(nullptr);
   root_task = SD_task_create_comp_seq("root", nullptr, 0);
   /* by design the root task is always SCHEDULABLE */
   SD_task_set_state(root_task, SD_SCHEDULABLE);
@@ -184,7 +175,6 @@ xbt_dynar_t SD_daxload(const char *filename)
   dax__delete_buffer(input_buffer);
   fclose(in_file);
   dax_lex_destroy();
-  xbt_dict_free(&jobs);
 
   /* And now, post-process the files.
    * We want a file task per pair of computation tasks exchanging the file. Duplicate on need
@@ -192,25 +182,26 @@ xbt_dynar_t SD_daxload(const char *filename)
    * Files not consumed in the system are said to be consumed by end task (bottom of DAG).
    */
 
-  xbt_dict_foreach(files, cursor, name, file) {
+  for (auto const& elm : files) {
+    file = elm.second;
     SD_task_t newfile;
     if (file->predecessors->empty()) {
-      for (SD_task_t it : *file->successors) {
+      for (SD_task_t const& it : *file->successors) {
         newfile = SD_task_create_comm_e2e(file->name, nullptr, file->amount);
         SD_task_dependency_add(nullptr, nullptr, root_task, newfile);
         SD_task_dependency_add(nullptr, nullptr, newfile, it);
         xbt_dynar_push(result, &newfile);
       }
     } else if (file->successors->empty()) {
-      for (SD_task_t it : *file->predecessors){
+      for (SD_task_t const& it : *file->predecessors) {
         newfile = SD_task_create_comm_e2e(file->name, nullptr, file->amount);
         SD_task_dependency_add(nullptr, nullptr, it, newfile);
         SD_task_dependency_add(nullptr, nullptr, newfile, end_task);
         xbt_dynar_push(result, &newfile);
       }
     } else {
-      for (SD_task_t it : *file->predecessors) {
-        for (SD_task_t it2 : *file->successors) {
+      for (SD_task_t const& it : *file->predecessors) {
+        for (SD_task_t const& it2 : *file->successors) {
           if (it == it2) {
             XBT_WARN ("File %s is produced and consumed by task %s."
                       "This loop dependency will prevent the execution of the task.", file->name, it->name);
@@ -228,7 +219,8 @@ xbt_dynar_t SD_daxload(const char *filename)
   xbt_dynar_push(result, &end_task);
 
   /* Free previous copy of the files */
-  xbt_dict_free(&files);
+  for (auto const& elm : files)
+    SD_task_destroy(elm.second);
   unsigned int cpt;
   xbt_dynar_foreach(result, cpt, file) {
     if (SD_task_get_kind(file) == SD_TASK_COMM_E2E) {
@@ -249,9 +241,8 @@ xbt_dynar_t SD_daxload(const char *filename)
   }
 
   if (not acyclic_graph_detail(result)) {
-    char* base = xbt_basename(filename);
-    XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", base);
-    free(base);
+    std::string base = simgrid::xbt::Path(filename).getBasename();
+    XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", base.c_str());
     xbt_dynar_foreach(result, cpt, file)
       SD_task_destroy(file);
     xbt_dynar_free_container(&result);
@@ -263,36 +254,49 @@ xbt_dynar_t SD_daxload(const char *filename)
 
 void STag_dax__adag()
 {
-  XBT_ATTRIB_UNUSED double version;
-  version = xbt_str_parse_double(A_dax__adag_version, "Parse error: %s is not a double");
-
-  xbt_assert(version == 2.1, "Expected version 2.1 in <adag> tag, got %f. Fix the parser or your file", version);
+  try {
+    double version = std::stod(std::string(A_dax__adag_version));
+    xbt_assert(version == 2.1, "Expected version 2.1 in <adag> tag, got %f. Fix the parser or your file", version);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Parse error: ") + A_dax__adag_version + " is not a double");
+  }
 }
 
 void STag_dax__job()
 {
-  double runtime = xbt_str_parse_double(A_dax__job_runtime, "Parse error: %s is not a double");
-  char *name = bprintf("%s@%s", A_dax__job_id, A_dax__job_name);
-  runtime *= 4200000000.;       /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
-  XBT_DEBUG("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
-  current_job = SD_task_create_comp_seq(name, nullptr, runtime);
-  xbt_dict_set(jobs, A_dax__job_id, current_job, nullptr);
-  free(name);
-  xbt_dynar_push(result, &current_job);
+  try {
+    double runtime = std::stod(std::string(A_dax__job_runtime));
+
+    std::string name = std::string(A_dax__job_id) + "@" + A_dax__job_name;
+    runtime *= 4200000000.; /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
+    XBT_DEBUG("See <job id=%s runtime=%s %.0f>", A_dax__job_id, A_dax__job_runtime, runtime);
+    current_job = SD_task_create_comp_seq(name.c_str(), nullptr, runtime);
+    jobs.insert({A_dax__job_id, current_job});
+    xbt_dynar_push(result, &current_job);
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Parse error: ") + A_dax__job_runtime + " is not a double");
+  }
 }
 
 void STag_dax__uses()
 {
-  double size = xbt_str_parse_double(A_dax__uses_size, "Parse error: %s is not a double");
-  int is_input = (A_dax__uses_link == A_dax__uses_link_input);
+  double size;
+  try {
+    size = std::stod(std::string(A_dax__uses_size));
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Parse error: ") + A_dax__uses_size + " is not a double");
+  }
+  bool is_input = (A_dax__uses_link == A_dax__uses_link_input);
 
   XBT_DEBUG("See <uses file=%s %s>",A_dax__uses_file,(is_input?"in":"out"));
-  SD_task_t file = static_cast<SD_task_t>(xbt_dict_get_or_null(files, A_dax__uses_file));
-  if (file == nullptr) {
+  auto it = files.find(A_dax__uses_file);
+  SD_task_t file;
+  if (it == files.end()) {
     file = SD_task_create_comm_e2e(A_dax__uses_file, nullptr, size);
     sd_global->initial_tasks->erase(file);
-    xbt_dict_set(files, A_dax__uses_file, file, nullptr);
+    files[A_dax__uses_file] = file;
   } else {
+    file = it->second;
     if (file->amount < size || file->amount > size) {
       XBT_WARN("Ignore file %s size redefinition from %.0f to %.0f", A_dax__uses_file, SD_task_get_amount(file), size);
     }
@@ -310,9 +314,13 @@ void STag_dax__uses()
 static SD_task_t current_child;
 void STag_dax__child()
 {
-  current_child = static_cast<SD_task_t>(xbt_dict_get_or_null(jobs, A_dax__child_ref));
-  xbt_assert(current_child != nullptr,"Parse error on line %d: Asked to add dependencies to the non-existent %s task",
-             dax_lineno, A_dax__child_ref);
+  auto job = jobs.find(A_dax__child_ref);
+  if (job != jobs.end()) {
+    current_child = job->second;
+  } else {
+    throw std::out_of_range(std::string("Parse error on line ") + std::to_string(dax_lineno) +
+                            ": Asked to add dependencies to the non-existent " + A_dax__child_ref + "task");
+  }
 }
 
 void ETag_dax__child()
@@ -322,11 +330,16 @@ void ETag_dax__child()
 
 void STag_dax__parent()
 {
-  SD_task_t parent = static_cast<SD_task_t>(xbt_dict_get_or_null(jobs, A_dax__parent_ref));
-  xbt_assert(parent != nullptr, "Parse error on line %d: Asked to add a dependency from %s to %s, but %s does not exist",
-             dax_lineno, current_child->name, A_dax__parent_ref, A_dax__parent_ref);
-  SD_task_dependency_add(nullptr, nullptr, parent, current_child);
-  XBT_DEBUG("Control-flow dependency from %s to %s", current_child->name, parent->name);
+  auto job = jobs.find(A_dax__parent_ref);
+  if (job != jobs.end()) {
+    SD_task_t parent = job->second;
+    SD_task_dependency_add(nullptr, nullptr, parent, current_child);
+    XBT_DEBUG("Control-flow dependency from %s to %s", current_child->name, parent->name);
+  } else {
+    throw std::out_of_range(std::string("Parse error on line ") + std::to_string(dax_lineno) +
+                            ": Asked to add a dependency from " + current_child->name + " to " + A_dax__parent_ref +
+                            ", but " + A_dax__parent_ref + " does not exist");
+  }
 }
 
 void ETag_dax__adag()
index 619fcb1..b4f8b3b 100644 (file)
@@ -7,8 +7,8 @@
 #include "simdag_private.hpp"
 #include "simgrid/simdag.h"
 #include "src/internal_config.h"
-#include "xbt/file.h"
-#include <string.h>
+#include "xbt/file.hpp"
+#include <cstring>
 #include <unordered_map>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
@@ -62,8 +62,8 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched
   SD_task_t root;
   SD_task_t end;
   SD_task_t task;
-  xbt_dynar_t computer = nullptr;
-  xbt_dict_cursor_t dict_cursor;
+  std::vector<SD_task_t>* computer;
+  std::unordered_map<std::string, std::vector<SD_task_t>*> computers;
   bool schedule_success = true;
 
   std::unordered_map<std::string, SD_task_t> jobs;
@@ -71,8 +71,6 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched
 
   Agraph_t * dag_dot = agread(in_file, NIL(Agdisc_t *));
 
-  xbt_dict_t computers = xbt_dict_new_homogeneous(nullptr);
-
   /* Create all the nodes */
   Agnode_t *node = nullptr;
   for (node = agfstnode(dag_dot); node; node = agnxtnode(dag_dot, node)) {
@@ -105,24 +103,26 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched
         if ((performer != -1 && order != -1) && performer < static_cast<int>(sg_host_count())) {
           /* required parameters are given and less performers than hosts are required */
           XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'", task->name, performer, order);
-          computer = static_cast<xbt_dynar_t> (xbt_dict_get_or_null(computers, char_performer));
-          if(computer == nullptr){
-            computer = xbt_dynar_new(sizeof(SD_task_t), nullptr);
-            xbt_dict_set(computers, char_performer, computer, nullptr);
+          auto comp = computers.find(char_performer);
+          if (comp != computers.end()) {
+            computer = comp->second;
+          } else {
+            computer = new std::vector<SD_task_t>;
+            computers.insert({char_performer, computer});
           }
-
-          if(static_cast<unsigned int>(order) < xbt_dynar_length(computer)){
-            SD_task_t *task_test = (SD_task_t *)xbt_dynar_get_ptr(computer,order);
-            if(*task_test && *task_test != task){
+          if (static_cast<unsigned int>(order) < computer->size()) {
+            SD_task_t task_test = computer->at(order);
+            if (task_test && task_test != task) {
               /* the user gave the same order to several tasks */
               schedule_success = false;
               XBT_VERB("Task '%s' wants to start on performer '%s' at the same position '%s' as task '%s'",
-                       (*task_test)->name, char_performer, char_order, task->name);
+                       task_test->name, char_performer, char_order, task->name);
               continue;
             }
-          }
-          /* the parameter seems to be ok */
-          xbt_dynar_set_as(computer, order, SD_task_t, task);
+          } else
+            computer->resize(order);
+
+          computer->insert(computer->begin() + order, task);
         } else {
           /* one of required parameters is not given */
           schedule_success = false;
@@ -211,38 +211,35 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched
   fclose(in_file);
 
   if(schedule){
-    char *computer_name;
     if (schedule_success) {
-      const sg_host_t *workstations = sg_host_list ();
-      xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
+      sg_host_t* workstations = sg_host_list();
+      for (auto const& elm : computers) {
         SD_task_t previous_task = nullptr;
-        xbt_dynar_foreach(computer, i, task){
+        for (auto const& task : *elm.second) {
           /* add dependency between the previous and the task to avoid parallel execution */
           if(task){
             if (previous_task && not SD_task_dependency_exists(previous_task, task))
               SD_task_dependency_add(nullptr, nullptr, previous_task, task);
 
-            SD_task_schedulel(task, 1, workstations[atoi(computer_name)]);
+            SD_task_schedulel(task, 1, workstations[atoi(elm.first.c_str())]);
             previous_task = task;
           }
         }
-        xbt_dynar_free(&computer);
+        delete elm.second;
       }
+      xbt_free(workstations);
     } else {
       XBT_WARN("The scheduling is ignored");
-      xbt_dict_foreach(computers,dict_cursor,computer_name,computer)
-        xbt_dynar_free(&computer);
+      for (auto const& elm : computers)
+        delete elm.second;
       xbt_dynar_free(&result);
       result = nullptr;
     }
   }
 
-  xbt_dict_free(&computers);
-
   if (result && not acyclic_graph_detail(result)) {
-    char* base = xbt_basename(filename);
-    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", base);
-    free(base);
+    std::string base = simgrid::xbt::Path(filename).getBasename();
+    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", base.c_str());
     xbt_dynar_free(&result);
     result = nullptr;
   }
index 805dd0e..88656c0 100644 (file)
@@ -55,7 +55,7 @@ std::set<SD_task_t>* simulate(double how_long){
       total_time += elapsed_time;
 
     /* let's see which tasks are done */
-    for (const auto& model : *all_existing_models) {
+    for (auto const& model : *all_existing_models) {
       surf_action_t action = surf_model_extract_done_action_set(model);
       while (action != nullptr) {
         SD_task_t task = static_cast<SD_task_t>(action->getData());
@@ -67,7 +67,7 @@ std::set<SD_task_t>* simulate(double how_long){
           sd_global->return_set->insert(task);
 
         /* remove the dependencies after this task */
-        for (const auto& succ : *task->successors) {
+        for (auto const& succ : *task->successors) {
           succ->predecessors->erase(task);
           succ->inputs->erase(task);
           XBT_DEBUG("Release dependency on %s: %zu remain(s). Becomes schedulable if %zu=0", SD_task_get_name(succ),
@@ -84,7 +84,7 @@ std::set<SD_task_t>* simulate(double how_long){
         }
         task->successors->clear();
 
-        for (const auto& output : *task->outputs) {
+        for (auto const& output : *task->outputs) {
           output->start_time = task->finish_time;
           output->predecessors->erase(task);
           if (SD_task_get_state(output) == SD_SCHEDULED)
@@ -119,7 +119,7 @@ std::set<SD_task_t>* simulate(double how_long){
 
   if (not sd_global->watch_point_reached && how_long < 0 && not sd_global->initial_tasks->empty()) {
     XBT_WARN("Simulation is finished but %zu tasks are still not done", sd_global->initial_tasks->size());
-    for (const auto& t : *sd_global->initial_tasks)
+    for (auto const& t : *sd_global->initial_tasks)
       XBT_WARN("%s is in %s state", SD_task_get_name(t), __get_state_name(SD_task_get_state(t)));
   }
 
@@ -173,7 +173,7 @@ void SD_init_nocheck(int *argc, char **argv)
  * Do --help on any simgrid binary to see the list of currently existing configuration variables, and
  * see Section @ref options.
  *
- * Example: SD_config("host/model","default");
+ * Example: SD_config("host/model","default")
  */
 void SD_config(const char *key, const char *value){
   xbt_assert(sd_global,"ERROR: Please call SD_init() before using SD_config()");
@@ -231,7 +231,7 @@ void SD_simulate(double how_long)
 void SD_simulate_with_update(double how_long, xbt_dynar_t changed_tasks_dynar)
 {
   std::set<SD_task_t> *changed_tasks = simgrid::sd::simulate(how_long);
-  for (const auto& task : *changed_tasks)
+  for (auto const& task : *changed_tasks)
     xbt_dynar_push(changed_tasks_dynar, &task);
 }
 
index 0dee8e1..42b7142 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)");
 
@@ -336,9 +337,9 @@ xbt_dynar_t SD_task_get_parents(SD_task_t task)
 {
   xbt_dynar_t parents = xbt_dynar_new(sizeof(SD_task_t), nullptr);
 
-  for (auto it : *task->predecessors)
+  for (auto const& it : *task->predecessors)
     xbt_dynar_push(parents, &it);
-  for (auto it : *task->inputs)
+  for (auto const& it : *task->inputs)
     xbt_dynar_push(parents, &it);
 
   return parents;
@@ -353,9 +354,9 @@ xbt_dynar_t SD_task_get_children(SD_task_t task)
 {
   xbt_dynar_t children = xbt_dynar_new(sizeof(SD_task_t), nullptr);
 
-  for (auto it : *task->successors)
+  for (auto const& it : *task->successors)
     xbt_dynar_push(children, &it);
-  for (auto it : *task->outputs)
+  for (auto const& it : *task->outputs)
     xbt_dynar_push(children, &it);
 
   return children;
@@ -380,7 +381,7 @@ int SD_task_get_workstation_count(SD_task_t task)
  */
 sg_host_t *SD_task_get_workstation_list(SD_task_t task)
 {
-  return &(*(task->allocation))[0];
+  return task->allocation->data();
 }
 
 /**
@@ -480,18 +481,18 @@ void SD_task_dump(SD_task_t task)
   XBT_INFO("  - Dependencies to satisfy: %zu", task->inputs->size()+ task->predecessors->size());
   if ((task->inputs->size()+ task->predecessors->size()) > 0) {
     XBT_INFO("  - pre-dependencies:");
-    for (auto it : *task->predecessors)
+    for (auto const& it : *task->predecessors)
       XBT_INFO("    %s", it->name);
 
-    for (auto it: *task->inputs)
+    for (auto const& it : *task->inputs)
       XBT_INFO("    %s", it->name);
   }
   if ((task->outputs->size() + task->successors->size()) > 0) {
     XBT_INFO("  - post-dependencies:");
 
-    for (auto it : *task->successors)
+    for (auto const& it : *task->successors)
       XBT_INFO("    %s", it->name);
-    for (auto it : *task->outputs)
+    for (auto const& it : *task->outputs)
       XBT_INFO("    %s", it->name);
   }
 }
@@ -514,9 +515,9 @@ void SD_task_dotty(SD_task_t task, void *out)
     xbt_die("Unknown task type!");
   }
   fprintf(fout, "];\n");
-  for (auto it : *task->predecessors)
+  for (auto const& it : *task->predecessors)
     fprintf(fout, " T%p -> T%p;\n", it, task);
-  for (auto it : *task->inputs)
+  for (auto const& it : *task->inputs)
     fprintf(fout, " T%p -> T%p;\n", it, 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 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);
 
@@ -885,7 +882,8 @@ void SD_task_build_MxN_1D_block_matrix(SD_task_t task, int src_nb, int dst_nb){
       XBT_VERB("(%d->%d): (%.2f, %.2f)-> (%.2f, %.2f)", i, j, src_start, src_end, dst_start, dst_end);
       task->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
       if ((src_end > dst_start) && (dst_end > src_start)) { /* There is something to send */
-        task->bytes_amount[i*(src_nb+dst_nb)+src_nb+j] = MIN(src_end, dst_end)- MAX(src_start, dst_start);
+        task->bytes_amount[i * (src_nb + dst_nb) + src_nb + j] =
+            std::min(src_end, dst_end) - std::max(src_start, dst_start);
         XBT_VERB("==> %.2f", task->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]);
       }
     }
@@ -926,7 +924,7 @@ void SD_task_schedulev(SD_task_t task, int count, const sg_host_t * list)
   SD_task_do_schedule(task);
 
   /* Iterate over all inputs and outputs to say where I am located (and start them if runnable) */
-  for (auto input : *task->inputs){
+  for (auto const& input : *task->inputs) {
     int src_nb = input->allocation->size();
     int dst_nb = count;
     if (input->allocation->empty())
@@ -945,7 +943,7 @@ void SD_task_schedulev(SD_task_t task, int count, const sg_host_t * list)
     }
   }
 
-  for (auto output : *task->outputs){
+  for (auto const& output : *task->outputs) {
     int src_nb = count;
     int dst_nb = output->allocation->size();
     if (output->allocation->empty())
@@ -973,12 +971,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 58d88e7..13d55f4 100644 (file)
@@ -1,14 +1,14 @@
-/* Copyright (c) 2006-2015. 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid/simdag.h"
+#include "surf/surf.hpp"
 #include <set>
 #include <string>
 #include <vector>
-#include "simgrid/simdag.h"
-#include "surf/surf.h"
 
 #ifndef SIMDAG_PRIVATE_HPP
 #define SIMDAG_PRIVATE_HPP
@@ -21,6 +21,7 @@ namespace sd{
 class Global {
 public:
   explicit Global();
+  Global(const Global&) = delete;
   ~Global();
   bool watch_point_reached;      /* has a task just reached a watch point? */
   std::set<SD_task_t> *initial_tasks;
@@ -33,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;
@@ -62,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);
@@ -70,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 1deab79..51da4ba 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"
 
@@ -37,12 +37,12 @@ void sg_host_exit()
    * the tests.
    */
   std::vector<std::string> names = std::vector<std::string>();
-  for (auto kv : simgrid::s4u::host_list)
+  for (auto const& kv : simgrid::s4u::host_list)
     names.push_back(kv.second->getName());
 
   std::sort(names.begin(), names.end());
 
-  for (auto name : names)
+  for (auto const& name : names)
     simgrid::s4u::host_list.at(name)->destroy();
 
   // host_list.clear(); This would be sufficient if the dict would contain smart_ptr. It's now useless
@@ -97,7 +97,7 @@ xbt_dynar_t sg_hosts_as_dynar()
 {
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),nullptr);
 
-  for (auto kv : simgrid::s4u::host_list) {
+  for (auto const& kv : simgrid::s4u::host_list) {
     simgrid::s4u::Host* host = kv.second;
     if (host && host->pimpl_netpoint && host->pimpl_netpoint->isHost())
       xbt_dynar_push(res, &host);
@@ -123,10 +123,10 @@ void sg_host_user_destroy(sg_host_t host) {
 xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host){
   xbt_assert((host != nullptr), "Invalid parameters");
   xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
-  for (auto elm : host->getMountedStorages()) {
+  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;
@@ -136,7 +136,7 @@ xbt_dynar_t sg_host_get_attached_storage_list(sg_host_t host){
   std::vector<const char*>* storage_vector = new std::vector<const char*>();
   xbt_dynar_t storage_dynar = xbt_dynar_new(sizeof(const char*), nullptr);
   host->getAttachedStorages(storage_vector);
-  for (auto name : *storage_vector)
+  for (auto const& name : *storage_vector)
     xbt_dynar_push(storage_dynar, &name);
   delete storage_vector;
   return storage_dynar;
@@ -180,7 +180,14 @@ void sg_host_set_pstate(sg_host_t host,int pstate) {
 
 /** @brief Get the properties of an host */
 xbt_dict_t sg_host_get_properties(sg_host_t host) {
-  return host->getProperties();
+  xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
+  std::map<std::string, std::string>* props = host->getProperties();
+  if (props == nullptr)
+    return nullptr;
+  for (auto const& elm : *props) {
+    xbt_dict_set(as_dict, elm.first.c_str(), xbt_strdup(elm.second.c_str()), nullptr);
+  }
+  return as_dict;
 }
 
 /** \ingroup m_host_management
@@ -192,8 +199,14 @@ xbt_dict_t sg_host_get_properties(sg_host_t host) {
 */
 const char *sg_host_get_property_value(sg_host_t host, const char *name)
 {
-  return (const char*) xbt_dict_get_or_null(sg_host_get_properties(host), name);
+  return host->getProperty(name);
+}
+
+void sg_host_set_property_value(sg_host_t host, const char* name, const char* value)
+{
+  host->setProperty(name, value);
 }
+
 /**
  * \brief Find a route between two hosts
  *
@@ -204,8 +217,8 @@ const char *sg_host_get_property_value(sg_host_t host, const char *name)
 void sg_host_route(sg_host_t from, sg_host_t to, xbt_dynar_t links)
 {
   std::vector<simgrid::s4u::Link*> vlinks;
-  from->routeTo(to, &vlinks, nullptr);
-  for (auto link : vlinks)
+  from->routeTo(to, vlinks, nullptr);
+  for (auto const& link : vlinks)
     xbt_dynar_push(links, &link);
 }
 /**
@@ -218,7 +231,7 @@ double sg_host_route_latency(sg_host_t from, sg_host_t to)
 {
   std::vector<simgrid::s4u::Link*> vlinks;
   double res = 0;
-  from->routeTo(to, &vlinks, &res);
+  from->routeTo(to, vlinks, &res);
   return res;
 }
 /**
@@ -232,8 +245,8 @@ double sg_host_route_bandwidth(sg_host_t from, sg_host_t to)
   double min_bandwidth = -1.0;
 
   std::vector<simgrid::s4u::Link*> vlinks;
-  from->routeTo(to, &vlinks, nullptr);
-  for (auto link : vlinks) {
+  from->routeTo(to, vlinks, nullptr);
+  for (auto const& link : vlinks) {
     double bandwidth = link->bandwidth();
     if (bandwidth < min_bandwidth || min_bandwidth < 0.0)
       min_bandwidth = bandwidth;
@@ -244,21 +257,15 @@ double sg_host_route_bandwidth(sg_host_t from, sg_host_t to)
 /** @brief Displays debugging information about a host */
 void sg_host_dump(sg_host_t host)
 {
-  xbt_dict_t props;
-
   XBT_INFO("Displaying host %s", host->getCname());
   XBT_INFO("  - speed: %.0f", host->getSpeed());
   XBT_INFO("  - available speed: %.2f", sg_host_get_available_speed(host));
-  props = host->getProperties();
+  std::map<std::string, std::string>* props = host->getProperties();
 
-  if (not xbt_dict_is_empty(props)) {
+  if (not props->empty()) {
     XBT_INFO("  - properties:");
-    xbt_dict_cursor_t cursor = nullptr;
-    char* key;
-    char* data;
-
-    xbt_dict_foreach(props,cursor,key,data) {
-      XBT_INFO("    %s->%s",key,data);
+    for (auto const& elm : *props) {
+      XBT_INFO("    %s->%s", elm.first.c_str(), elm.second.c_str());
     }
   }
 }
index c3c0666..281feaa 100644 (file)
@@ -1,28 +1,26 @@
-/* Copyright (c) 2009-2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* 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. */
 
-/* sg_config: configuration infrastructure for the simulation world       */
+/* sg_config: configuration infrastructure for the simulation world         */
 
-#include "xbt/misc.h"
+#include "simgrid/sg_config.h"
+#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.hpp"
+#include "src/surf/surf_interface.hpp"
+#include "surf/maxmin.hpp"
+#include "surf/surf.hpp"
 #include "xbt/config.h"
 #include "xbt/config.hpp"
 #include "xbt/log.h"
 #include "xbt/mallocator.h"
-#include "xbt/str.h"
+#include "xbt/misc.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 "mc/mc.h"
-#include "simgrid/instr.h"
-#include "src/mc/mc_replay.h"
-#include "src/surf/surf_interface.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf, "About the configuration of SimGrid");
 
@@ -113,11 +111,11 @@ static void _sg_cfg_cb__plugin(const char *name)
 {
   xbt_assert(_sg_cfg_init_status < 2, "Cannot load a plugin after the initialization");
 
-  char *val = xbt_cfg_get_string(name);
-  if (val==nullptr || val[0] == '\0')
+  std::string val = xbt_cfg_get_string(name);
+  if (val.empty())
     return;
 
-  if (not strcmp(val, "help")) {
+  if (val == "help") {
     model_help("plugin", surf_plugin_description);
     sg_cfg_exit_early();
   }
@@ -131,8 +129,8 @@ static void _sg_cfg_cb__host_model(const char *name)
 {
   xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
 
-  char *val = xbt_cfg_get_string(name);
-  if (not strcmp(val, "help")) {
+  std::string val = xbt_cfg_get_string(name);
+  if (val == "help") {
     model_help("host", surf_host_model_description);
     sg_cfg_exit_early();
   }
@@ -146,8 +144,8 @@ static void _sg_cfg_cb__cpu_model(const char *name)
 {
   xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
 
-  char *val = xbt_cfg_get_string(name);
-  if (not strcmp(val, "help")) {
+  std::string val = xbt_cfg_get_string(name);
+  if (val == "help") {
     model_help("CPU", surf_cpu_model_description);
     sg_cfg_exit_early();
   }
@@ -161,8 +159,8 @@ static void _sg_cfg_cb__optimization_mode(const char *name)
 {
   xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
 
-  char *val = xbt_cfg_get_string(name);
-  if (not strcmp(val, "help")) {
+  std::string val = xbt_cfg_get_string(name);
+  if (val == "help") {
     model_help("optimization", surf_optimization_mode_description);
     sg_cfg_exit_early();
   }
@@ -176,8 +174,8 @@ static void _sg_cfg_cb__storage_mode(const char *name)
 {
   xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
 
-  char *val = xbt_cfg_get_string(name);
-  if (not strcmp(val, "help")) {
+  std::string val = xbt_cfg_get_string(name);
+  if (val == "help") {
     model_help("storage", surf_storage_model_description);
     sg_cfg_exit_early();
   }
@@ -190,8 +188,8 @@ static void _sg_cfg_cb__network_model(const char *name)
 {
   xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
 
-  char *val = xbt_cfg_get_string(name);
-  if (not strcmp(val, "help")) {
+  std::string val = xbt_cfg_get_string(name);
+  if (val == "help") {
     model_help("network", surf_network_model_description);
     sg_cfg_exit_early();
   }
@@ -204,8 +202,6 @@ static void _sg_cfg_cb__network_model(const char *name)
 
 static void _sg_cfg_cb_model_check_replay(const char *name) {
   MC_record_path = xbt_cfg_get_string(name);
-  if (MC_record_path[0] == '\0')
-    MC_record_path = nullptr;
 }
 
 #if SIMGRID_HAVE_MC
@@ -251,15 +247,14 @@ static void _sg_cfg_cb_contexts_parallel_threshold(const char *name)
 
 static void _sg_cfg_cb_contexts_parallel_mode(const char *name)
 {
-  const char* mode_name = xbt_cfg_get_string(name);
-  if (not strcmp(mode_name, "posix")) {
+  std::string mode_name = xbt_cfg_get_string(name);
+  if (mode_name == "posix") {
     SIMIX_context_set_parallel_mode(XBT_PARMAP_POSIX);
-  } else if (not strcmp(mode_name, "futex")) {
+  } else if (mode_name == "futex") {
     SIMIX_context_set_parallel_mode(XBT_PARMAP_FUTEX);
-  } else if (not strcmp(mode_name, "busy_wait")) {
+  } else if (mode_name == "busy_wait") {
     SIMIX_context_set_parallel_mode(XBT_PARMAP_BUSY_WAIT);
-  }
-  else {
+  } else {
     xbt_die("Command line setting of the parallel synchronization mode should "
             "be one of \"posix\", \"futex\" or \"busy_wait\"");
   }
@@ -301,7 +296,7 @@ void sg_config_init(int *argc, char **argv)
 
   /* Plugins configuration */
   describe_model(description, descsize, surf_plugin_description, "plugin", "The plugins");
-  xbt_cfg_register_string("plugin", nullptr, &_sg_cfg_cb__plugin, description);
+  xbt_cfg_register_string("plugin", "", &_sg_cfg_cb__plugin, description);
 
   describe_model(description, descsize, surf_cpu_model_description, "model", "The model to use for the CPU");
   xbt_cfg_register_string("cpu/model", "Cas01", &_sg_cfg_cb__cpu_model, description);
@@ -341,11 +336,6 @@ void sg_config_init(int *argc, char **argv)
 
   /* The parameters of network models */
 
-  // real default for "network/sender-gap" is set in network_smpi.cpp:
-  sg_sender_gap = NAN;
-  simgrid::config::bindFlag(sg_sender_gap, {"network/sender-gap", "network/sender_gap"},
-                            "Minimum gap between two overlapping sends");
-
   sg_latency_factor = 13.01; // comes from the default LV08 network model
   simgrid::config::bindFlag(sg_latency_factor, {"network/latency-factor", "network/latency_factor"},
                             "Correction factor to apply to the provided latency (default value set by network model)");
@@ -391,8 +381,8 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register_boolean("model-check/sparse-checkpoint", "no", _mc_cfg_cb_sparse_checkpoint, "Use sparse per-page snapshots.");
     xbt_cfg_register_boolean("model-check/ksm", "no", _mc_cfg_cb_ksm, "Kernel same-page merging");
 
-    xbt_cfg_register_string("model-check/property","", _mc_cfg_cb_property,
-        "Name of the file containing the property, as formated by the ltl2ba program.");
+    xbt_cfg_register_string("model-check/property", "", _mc_cfg_cb_property,
+                            "Name of the file containing the property, as formatted by the ltl2ba program.");
     xbt_cfg_register_boolean("model-check/communications-determinism", "no", _mc_cfg_cb_comms_determinism,
         "Whether to enable the detection of communication determinism");
     xbt_cfg_register_alias("model-check/communications-determinism","model-check/communications_determinism");
@@ -457,7 +447,7 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register_boolean("network/crosstraffic", "yes", _sg_cfg_cb__surf_network_crosstraffic,
         "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)");
 
-    //For smpi/bw_factor and smpi/lat_factor
+    // For smpi/bw-factor and smpi/lat-factor
     // SMPI model can be used without enable_smpi, so keep this out of the ifdef.
     xbt_cfg_register_string("smpi/bw-factor",
         "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;1426:0.608902;732:0.341987;257:0.338112;0:0.812084", nullptr,
@@ -561,13 +551,8 @@ void sg_config_init(int *argc, char **argv)
         "Whether to cleanup SimGrid at exit. Disable it if your code segfaults after its end.");
     xbt_cfg_register_alias("clean-atexit","clean_atexit");
 
-    if (surf_path.empty()) {
-      /* retrieves the current directory of the current process */
-      const char *initial_path = __surf_get_initial_path();
-      xbt_assert((initial_path), "__surf_get_initial_path() failed! Can't resolve current Windows directory");
-
-      xbt_cfg_setdefault_string("path", initial_path);
-    }
+    if (surf_path.empty())
+      xbt_cfg_setdefault_string("path", "./");
 
     _sg_cfg_init_status = 1;
 
index f9b0f73..ed204c9 100644 (file)
@@ -5,12 +5,12 @@
 
 #include <exception>
 #include <functional>
+#include <map>
 #include <string>
 #include <utility>
 
 #include <boost/range/algorithm.hpp>
 
-#include "xbt/dict.h"
 #include "xbt/ex.hpp"
 #include "xbt/functional.hpp"
 #include "xbt/log.h"
 
 #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/mc_replay.hpp"
 #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"
 
@@ -73,14 +73,17 @@ void SIMIX_process_cleanup(smx_actor_t process)
   SIMIX_process_on_exit_runall(process);
 
   /* Unregister from the kill timer if any */
-  if (process->kill_timer != nullptr)
+  if (process->kill_timer != nullptr) {
     SIMIX_timer_remove(process->kill_timer);
+    process->kill_timer = nullptr;
+  }
 
   xbt_os_mutex_acquire(simix_global->mutex);
 
   /* cancel non-blocking communications */
-  smx_activity_t synchro = process->comms.front();
   while (not process->comms.empty()) {
+    smx_activity_t synchro = process->comms.front();
+    process->comms.pop_front();
     simgrid::kernel::activity::CommImplPtr comm =
         boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
@@ -104,8 +107,6 @@ void SIMIX_process_cleanup(smx_actor_t process)
     } else {
       xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro.get());
     }
-    process->comms.pop_front();
-    synchro = process->comms.front();
     comm->cancel();
   }
 
@@ -141,7 +142,6 @@ namespace simix {
 ActorImpl::~ActorImpl()
 {
   delete this->context;
-  xbt_dict_free(&this->properties);
 }
 
 static int dying_daemon(void* exit_status, void* data)
@@ -167,9 +167,9 @@ void ActorImpl::daemonize()
   }
 }
 
-ActorImpl* ActorImpl::restart(ActorImpl* issuer)
+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 ?
@@ -183,17 +183,17 @@ ActorImpl* ActorImpl::restart(ActorImpl* issuer)
   arg.auto_restart = auto_restart;
 
   // kill the old process
-  SIMIX_process_kill(this, issuer);
+  SIMIX_process_kill(this, (this == simix_global->maestro_process) ? this : SIMIX_process_self());
 
   // start the new process
   ActorImpl* actor = simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.host,
-                                                           arg.properties, nullptr);
+                                                           arg.properties.get(), nullptr);
   if (arg.kill_time >= 0)
     simcall_process_set_kill_time(actor, arg.kill_time);
   if (arg.auto_restart)
-    simcall_process_auto_restart_set(actor, arg.auto_restart);
+    actor->auto_restart = arg.auto_restart;
 
-  return actor;
+  return actor->ciface();
 }
 
 smx_activity_t ActorImpl::suspend(ActorImpl* issuer)
@@ -265,8 +265,7 @@ void create_maestro(std::function<void()> code)
   } else {
     if (not simix_global)
       xbt_die("simix is not initialized, please call MSG_init first");
-    maestro->context =
-      simix_global->context_factory->create_maestro(code, maestro);
+    maestro->context = simix_global->context_factory->create_maestro(code, maestro);
   }
 
   maestro->simcall.issuer = maestro;
@@ -292,7 +291,7 @@ void SIMIX_maestro_create(void (*code)(void*), void* data)
  * \return the process created
  */
 smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, void* data, simgrid::s4u::Host* host,
-                                 xbt_dict_t properties, smx_actor_t parent_process)
+                                 std::map<std::string, std::string>* properties, smx_actor_t parent_process)
 {
 
   XBT_DEBUG("Start process %s on host '%s'", name, host->getCname());
@@ -332,7 +331,9 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, v
   process->context = SIMIX_context_new(std::move(code), simix_global->cleanup_process_function, process);
 
   /* Add properties */
-  process->properties = properties;
+  if (properties != nullptr)
+    for (auto const& kv : *properties)
+      process->setProperty(kv.first, kv.second);
 
   /* Make sure that the process is initialized for simix, in case we are called from the Host::onCreation signal */
   if (host->extension<simgrid::simix::Host>() == nullptr)
@@ -345,18 +346,18 @@ 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_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
+  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->getName(), process->pid, process->host);
 
   return process;
 }
 
-smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostname, xbt_dict_t properties,
-                                 smx_actor_t parent_process)
+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)
 {
   // This is mostly a copy/paste from SIMIX_process_new(),
   // it'd be nice to share some code between those two functions.
@@ -365,8 +366,7 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
   XBT_DEBUG("Attach process %s on host '%s'", name, hostname);
 
   if (host->isOff()) {
-    XBT_WARN("Cannot launch process '%s' on failed host '%s'",
-      name, hostname);
+    XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, hostname);
     return nullptr;
   }
 
@@ -398,22 +398,23 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
   XBT_VERB("Create context %s", process->name.c_str());
   if (not simix_global)
     xbt_die("simix is not initialized, please call MSG_init first");
-  process->context = simix_global->context_factory->attach(
-    simix_global->cleanup_process_function, process);
+  process->context = simix_global->context_factory->attach(simix_global->cleanup_process_function, process);
 
   /* Add properties */
-  process->properties = properties;
+  if (properties != nullptr)
+    for (auto const& kv : *properties)
+      process->setProperty(kv.first, kv.second);
 
   /* Add the process to it's host process list */
   xbt_swag_insert(process, host->extension<simgrid::simix::Host>()->process_list);
 
   /* 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_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
+  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->getName(), process->pid, process->host);
 
   auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
   if (not context)
@@ -429,16 +430,10 @@ void SIMIX_process_detach()
   if (not context)
     xbt_die("Not a suitable context");
 
-  simix_global->cleanup_process_function(context->process());
-
-  // Let maestro ignore we are still alive:
-  // xbt_swag_remove(context->process(), simix_global->process_list);
-
-  // TODO, Remove from proces list:
-  //   xbt_swag_remove(process, sg_host_simix(host)->process_list);
-
+  auto process = context->process();
+  simix_global->cleanup_process_function(process);
   context->attach_stop();
-  // delete context;
+  delete process;
 }
 
 /**
@@ -454,15 +449,10 @@ void SIMIX_process_runall()
 {
   SIMIX_context_runall();
 
-  xbt_dynar_t tmp = simix_global->process_that_ran;
-  simix_global->process_that_ran = simix_global->process_to_run;
-  simix_global->process_to_run = tmp;
-  xbt_dynar_reset(simix_global->process_to_run);
+  simix_global->process_to_run.swap(simix_global->process_that_ran);
+  simix_global->process_to_run.clear();
 }
 
-void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_actor_t process) {
-  SIMIX_process_kill(process, simcall->issuer);
-}
 /**
  * \brief Internal function to kill a SIMIX process.
  *
@@ -474,7 +464,7 @@ void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_actor_t process) {
  */
 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;
@@ -516,18 +506,13 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
       xbt_die("Unknown type of activity");
     }
 
-    /*
-    switch (process->waiting_synchro->type) {
-    case SIMIX_SYNC_JOIN:
-      SIMIX_process_sleep_destroy(process->waiting_synchro);
-      break;
-    } */
-
     process->waiting_synchro = nullptr;
   }
-  if (not xbt_dynar_member(simix_global->process_to_run, &(process)) && process != issuer) {
+  if (std::find(begin(simix_global->process_to_run), end(simix_global->process_to_run), process) ==
+          end(simix_global->process_to_run) &&
+      process != issuer) {
     XBT_DEBUG("Inserting %s in the to_run list", process->name.c_str());
-    xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
+    simix_global->process_to_run.push_back(process);
   }
 }
 
@@ -549,9 +534,8 @@ void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const
 
     simgrid::kernel::activity::ExecImplPtr exec =
         boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
-    if (exec != nullptr) {
-      SIMIX_execution_cancel(process->waiting_synchro);
-    }
+    if (exec != nullptr && exec->surf_exec)
+      exec->surf_exec->cancel();
 
     simgrid::kernel::activity::CommImplPtr comm =
         boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro);
@@ -564,9 +548,11 @@ void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const
         boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro);
     if (sleep != nullptr) {
       SIMIX_process_sleep_destroy(process->waiting_synchro);
-      if (not xbt_dynar_member(simix_global->process_to_run, &(process)) && process != SIMIX_process_self()) {
+      if (std::find(begin(simix_global->process_to_run), end(simix_global->process_to_run), process) ==
+              end(simix_global->process_to_run) &&
+          process != SIMIX_process_self()) {
         XBT_DEBUG("Inserting %s in the to_run list", process->name.c_str());
-        xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
+        simix_global->process_to_run.push_back(process);
       }
     }
 
@@ -595,16 +581,12 @@ void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid) {
  */
 void SIMIX_process_killall(smx_actor_t issuer, int reset_pid)
 {
-  for (auto kv : simix_global->process_list)
+  for (auto const& kv : simix_global->process_list)
     if (kv.second != issuer)
       SIMIX_process_kill(kv.second, issuer);
 
   if (reset_pid > 0)
     simix_process_maxpid = reset_pid;
-
-  SIMIX_context_runall();
-
-  SIMIX_process_empty_trash();
 }
 
 void SIMIX_process_change_host(smx_actor_t process, sg_host_t dest)
@@ -667,7 +649,7 @@ const char* SIMIX_process_self_get_name() {
 
 smx_actor_t SIMIX_process_get_by_name(const char* name)
 {
-  for (auto kv : simix_global->process_list)
+  for (auto const& kv : simix_global->process_list)
     if (kv.second->name == name)
       return kv.second;
   return nullptr;
@@ -686,44 +668,19 @@ void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, do
   simcall->issuer->waiting_synchro = sync;
 }
 
-static int SIMIX_process_join_finish(smx_process_exit_status_t status, void* synchro)
-{
-  simgrid::kernel::activity::SleepImpl* sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(synchro);
-
-  if (sleep->surf_sleep) {
-    sleep->surf_sleep->cancel();
-
-    while (not sleep->simcalls.empty()) {
-      smx_simcall_t simcall = sleep->simcalls.front();
-      sleep->simcalls.pop_front();
-      simcall_process_sleep__set__result(simcall, SIMIX_DONE);
-      simcall->issuer->waiting_synchro = nullptr;
-      if (simcall->issuer->suspended) {
-        XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
-        simcall->issuer->suspended = 0;
-        simcall_HANDLER_process_suspend(simcall, simcall->issuer);
-      } else {
-        SIMIX_simcall_answer(simcall);
-      }
-    }
-    sleep->surf_sleep->unref();
-    sleep->surf_sleep = nullptr;
-  }
-  // intrusive_ptr_release(process); // FIXME: We are leaking here. See comment in SIMIX_process_join()
-  return 0;
-}
-
 smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout)
 {
   smx_activity_t res = issuer->sleep(timeout);
   intrusive_ptr_add_ref(res.get());
-  /* We are leaking the process here, but if we don't take the ref, we get a "use after free".
-   * The correct solution would be to derivate the type SynchroSleep into a SynchroProcessJoin,
-   * but the code is not clean enough for now for this.
-   * The C API should first be properly replaced with the C++ one, which is a fair amount of work.
-   */
-  intrusive_ptr_add_ref(process);
-  SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, &*res);
+  SIMIX_process_on_exit(process,
+                        [](void*, void* arg) {
+                          auto sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(arg);
+                          if (sleep->surf_sleep)
+                            sleep->surf_sleep->finish(simgrid::surf::Action::State::done);
+                          intrusive_ptr_release(sleep);
+                          return 0;
+                        },
+                        res.get());
   return res;
 }
 
@@ -755,14 +712,13 @@ void SIMIX_process_sleep_destroy(smx_activity_t synchro)
 /**
  * \brief Calling this function makes the process to yield.
  *
- * Only the current process can call this function, giving back the control to
- * maestro.
+ * Only the current process can call this function, giving back the control to maestro.
  *
  * \param self the current process
  */
 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();
@@ -782,10 +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_timer_get_date(self->kill_timer), self->properties, self->auto_restart);
+      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();
   }
 
@@ -815,40 +772,25 @@ void SIMIX_process_exception_terminate(xbt_ex_t * e)
   xbt_abort();
 }
 
-/**
- * \brief Returns the list of processes to run.
- */
-xbt_dynar_t SIMIX_process_get_runnable()
+/** @brief Returns the list of processes to run. */
+const std::vector<smx_actor_t>& simgrid::simix::process_get_runnable()
 {
   return simix_global->process_to_run;
 }
 
-/**
- * \brief Returns the process from PID.
- */
+/** @brief Returns the process from PID. */
 smx_actor_t SIMIX_process_from_PID(aid_t PID)
 {
-  if (simix_global->process_list.find(PID) == simix_global->process_list.end())
-    return nullptr;
-  return simix_global->process_list.at(PID);
-}
-
-/** @brief returns a dynar containing all currently existing processes */
-xbt_dynar_t SIMIX_processes_as_dynar() {
-  xbt_dynar_t res = xbt_dynar_new(sizeof(smx_actor_t),nullptr);
-  for (auto kv : simix_global->process_list) {
-    smx_actor_t proc = kv.second;
-    xbt_dynar_push(res,&proc);
-  }
-  return res;
+  auto process = simix_global->process_list.find(PID);
+  return process == simix_global->process_list.end() ? nullptr : process->second;
 }
 
 void SIMIX_process_on_exit_runall(smx_actor_t process) {
   smx_process_exit_status_t exit_status = (process->context->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
   while (not process->on_exit.empty()) {
     s_smx_process_exit_fun_t exit_fun = process->on_exit.back();
-    (exit_fun.fun)((void*)exit_status, exit_fun.arg);
     process->on_exit.pop_back();
+    (exit_fun.fun)((void*)exit_status, exit_fun.arg);
   }
 }
 
@@ -862,17 +804,12 @@ void SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *d
 
 /**
  * \brief Sets the auto-restart status of the process.
- * If set to 1, the process will be automatically restarted when its host
- * comes back.
+ * If set to 1, the process will be automatically restarted when its host comes back.
  */
 void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart) {
   process->auto_restart = auto_restart;
 }
 
-smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process) {
-  return process->restart(simcall->issuer);
-}
-
 /** @brief Restart a process, starting it again from the beginning. */
 /**
  * \ingroup simix_process_management
@@ -892,9 +829,8 @@ smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t p
  * \param properties the properties of the process
  * \param auto_restart either it is autorestarting or not.
  */
-extern "C"
-smx_actor_t simcall_process_create(const char* name, xbt_main_func_t code, void* data, sg_host_t host, int argc,
-                                   char** argv, xbt_dict_t properties)
+extern "C" 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)
 {
   if (name == nullptr)
     name = "";
@@ -907,7 +843,7 @@ smx_actor_t simcall_process_create(const char* name, xbt_main_func_t code, void*
 }
 
 smx_actor_t simcall_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
-                                   xbt_dict_t properties)
+                                   std::map<std::string, std::string>* properties)
 {
   if (name == nullptr)
     name = "";
index 6baac2c..06d42dc 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,15 +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 {
 namespace simix {
@@ -27,11 +28,11 @@ public:
   void *data            = nullptr;
   sg_host_t host        = nullptr;
   double kill_time      = 0.0;
-  xbt_dict_t properties = nullptr;
+  std::shared_ptr<std::map<std::string, std::string>> properties;
   bool auto_restart     = false;
 };
 
-class ActorImpl {
+class ActorImpl : public simgrid::surf::PropertyHolder {
 public:
   ActorImpl() : piface_(this) {}
   ~ActorImpl();
@@ -45,7 +46,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 */
 
@@ -59,7 +61,6 @@ public:
   sg_host_t new_host             = nullptr; /* if not null, the host on which the process must migrate to */
   smx_activity_t waiting_synchro = nullptr; /* the current blocking synchro if any */
   std::list<smx_activity_t> comms;          /* the current non-blocking communication synchros */
-  xbt_dict_t properties         = nullptr;
   s_smx_simcall_t simcall;
   void* userdata = nullptr;                      /* kept for compatibility, it should be replaced with moddata */
   std::vector<s_smx_process_exit_fun_t> on_exit; /* list of functions executed when the process dies */
@@ -106,7 +107,7 @@ public:
   void daemonize();
   bool isDaemon() { return daemon; } /** Whether this actor has been daemonized */
   bool isSuspended() { return suspended; }
-  ActorImpl* restart(ActorImpl* issuer);
+  simgrid::s4u::Actor* restart();
   smx_activity_t suspend(ActorImpl* issuer);
   void resume();
   smx_activity_t sleep(double duration);
@@ -121,15 +122,11 @@ 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,
-                          xbt_dict_t properties,
-                          smx_actor_t parent_process);
+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,
+                                             smx_actor_t parent_process);
 
 XBT_PRIVATE void SIMIX_process_runall();
 XBT_PRIVATE void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer);
@@ -145,8 +142,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 f05e1f1..6af4880 100644 (file)
@@ -5,8 +5,7 @@
 /*                                                                            */
 /* This is somehow the "libc" of SimGrid                                      */
 
-/* Copyright (c) 2010-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* 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/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/mc/mc_replay.hpp"
 #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 +34,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 {
@@ -84,8 +83,7 @@ smx_activity_t simcall_execution_start(const char *name,
  * \return A new SIMIX execution synchronization
  */
 smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
-                                                double* flops_amount, double* bytes_amount, double amount, double rate,
-                                                double timeout)
+                                                double* flops_amount, double* bytes_amount, double rate, double timeout)
 {
   /* checking for infinite values */
   for (int i = 0 ; i < host_nb ; ++i) {
@@ -98,11 +96,9 @@ smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, s
     }
   }
 
-  xbt_assert(std::isfinite(amount), "amount is not finite!");
   xbt_assert(std::isfinite(rate), "rate is not finite!");
 
-  return simcall_BODY_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate,
-                                               timeout);
+  return simcall_BODY_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
 }
 
 /**
@@ -114,7 +110,14 @@ smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, s
  */
 void simcall_execution_cancel(smx_activity_t execution)
 {
-  simcall_BODY_execution_cancel(execution);
+  simgrid::simix::kernelImmediate([execution] {
+    XBT_DEBUG("Cancel synchro %p", execution.get());
+    simgrid::kernel::activity::ExecImplPtr exec =
+        boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+
+    if (exec->surf_exec)
+      exec->surf_exec->cancel();
+  });
 }
 
 /**
@@ -129,8 +132,13 @@ void simcall_execution_set_priority(smx_activity_t execution, double priority)
 {
   /* checking for infinite values */
   xbt_assert(std::isfinite(priority), "priority is not finite!");
+  simgrid::simix::kernelImmediate([execution, priority] {
 
-  simcall_BODY_execution_set_priority(execution, priority);
+    simgrid::kernel::activity::ExecImplPtr exec =
+        boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+    if (exec->surf_exec)
+      exec->surf_exec->setSharingWeight(priority);
+  });
 }
 
 /**
@@ -143,7 +151,12 @@ void simcall_execution_set_priority(smx_activity_t execution, double priority)
  */
 void simcall_execution_set_bound(smx_activity_t execution, double bound)
 {
-  simcall_BODY_execution_set_bound(execution, bound);
+  simgrid::simix::kernelImmediate([execution, bound] {
+    simgrid::kernel::activity::ExecImplPtr exec =
+        boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+    if (exec->surf_exec)
+      static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
+  });
 }
 
 /**
@@ -157,19 +170,6 @@ e_smx_state_t simcall_execution_wait(smx_activity_t execution)
   return (e_smx_state_t) simcall_BODY_execution_wait(execution);
 }
 
-/**
- * \ingroup simix_process_management
- * \brief Kills a SIMIX process.
- *
- * This function simply kills a  process.
- *
- * \param process poor victim
- */
-void simcall_process_kill(smx_actor_t process)
-{
-  simcall_BODY_process_kill(process);
-}
-
 /**
  * \ingroup simix_process_management
  * \brief Kills all SIMIX processes.
@@ -241,23 +241,13 @@ 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());
-  process->kill_timer = SIMIX_timer_set(kill_time, [=] {
+  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;
   });
 }
 
-/**
- * \ingroup simix_process_management
- * \brief Return the properties
- *
- * This function returns the properties associated with this process
- */
-xbt_dict_t simcall_process_get_properties(smx_actor_t process)
-{
-  return process->properties;
-}
 /**
  * \ingroup simix_process_management
  * \brief Add an on_exit function
@@ -267,25 +257,7 @@ XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_
 {
   simcall_BODY_process_on_exit(process, fun, data);
 }
-/**
- * \ingroup simix_process_management
- * \brief Sets the process to be auto-restarted or not by SIMIX when its host comes back up.
- * Will restart the process when the host comes back up if auto_restart is set to 1.
- */
-
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart)
-{
-  simcall_BODY_process_auto_restart_set(process, auto_restart);
-}
 
-/**
- * \ingroup simix_process_management
- * \brief Restarts the process, killing it and starting it again from scratch.
- */
-XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process)
-{
-  return (smx_actor_t) simcall_BODY_process_restart(process);
-}
 /**
  * \ingroup simix_process_management
  * \brief Creates a new sleep SIMIX synchro.
@@ -472,7 +444,7 @@ smx_mutex_t simcall_mutex_init()
     fprintf(stderr,"You must run MSG_init before using MSG\n"); // We can't use xbt_die since we may get there before the initialization
     xbt_abort();
   }
-  return simcall_BODY_mutex_init();
+  return simgrid::simix::kernelImmediate([] { return new simgrid::simix::MutexImpl(); });
 }
 
 /**
@@ -533,9 +505,7 @@ void simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex)
  * \ingroup simix_synchro_management
  *
  */
-void simcall_cond_wait_timeout(smx_cond_t cond,
-                                 smx_mutex_t mutex,
-                                 double timeout)
+void simcall_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout)
 {
   xbt_assert(std::isfinite(timeout), "timeout is not finite!");
   simcall_BODY_cond_wait_timeout(cond, mutex, timeout);
@@ -550,33 +520,6 @@ void simcall_cond_broadcast(smx_cond_t cond)
   simcall_BODY_cond_broadcast(cond);
 }
 
-/**
- * \ingroup simix_synchro_management
- *
- */
-smx_sem_t simcall_sem_init(int capacity)
-{
-  return simcall_BODY_sem_init(capacity);
-}
-
-/**
- * \ingroup simix_synchro_management
- *
- */
-void simcall_sem_release(smx_sem_t sem)
-{
-  simcall_BODY_sem_release(sem);
-}
-
-/**
- * \ingroup simix_synchro_management
- *
- */
-int simcall_sem_would_block(smx_sem_t sem)
-{
-  return simcall_BODY_sem_would_block(sem);
-}
-
 /**
  * \ingroup simix_synchro_management
  *
@@ -596,31 +539,14 @@ void simcall_sem_acquire_timeout(smx_sem_t sem, double timeout)
   simcall_BODY_sem_acquire_timeout(sem, timeout);
 }
 
-/**
- * \ingroup simix_synchro_management
- *
- */
-int simcall_sem_get_capacity(smx_sem_t sem)
+sg_size_t simcall_storage_read(surf_storage_t st, sg_size_t size)
 {
-  return simcall_BODY_sem_get_capacity(sem);
+  return simcall_BODY_storage_read(st, size);
 }
 
-/**
- * \ingroup simix_file_management
- *
- */
-sg_size_t simcall_file_read(surf_file_t fd, sg_size_t size)
-{
-  return simcall_BODY_file_read(fd, size);
-}
-
-/**
- * \ingroup simix_file_management
- *
- */
-sg_size_t simcall_file_write(surf_file_t fd, sg_size_t size)
+sg_size_t simcall_storage_write(surf_storage_t st, sg_size_t size)
 {
-  return simcall_BODY_file_write(fd, size);
+  return simcall_BODY_storage_write(st, size);
 }
 
 void simcall_run_kernel(std::function<void()> const& code)
index 396969d..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"
@@ -24,12 +24,13 @@ void SIMIX_simcall_answer(smx_simcall_t simcall)
     XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), (int)simcall->call,
         simcall->issuer->name.c_str(), simcall->issuer);
     simcall->issuer->simcall.call = SIMCALL_NONE;
-/*    This check should be useless and slows everyone. Reactivate if you see something
- *    weird in process scheduling.
- */
-    /*    if(not xbt_dynar_member(simix_global->process_to_run, &(simcall->issuer))) */
-    xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, simcall->issuer);
-/*    else DIE_IMPOSSIBLE; */
+#if 0
+    /* This check should be useless and slows everyone. Reactivate if you see something weird in process scheduling. */
+    if (std::find(begin(simix_global->process_to_run), end(simix_global->process_to_run), simcall->issuer) !=
+        end(simix_global->process_to_run))
+      DIE_IMPOSSIBLE;
+#endif
+    simix_global->process_to_run.push_back(simcall->issuer);
   }
 }
 
similarity index 75%
rename from src/simix/popping_accessors.h
rename to src/simix/popping_accessors.hpp
index 1966f28..020056e 100644 (file)
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
-#include "src/simix/popping_private.h"
-static inline smx_actor_t simcall_process_kill__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_kill__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-
+#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]);
@@ -99,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)
@@ -123,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)
@@ -175,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);
 }
@@ -184,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);
 }
@@ -251,136 +237,44 @@ static inline void simcall_execution_parallel_start__set__bytes_amount(smx_simca
 {
   simgrid::simix::marshal<double*>(simcall->args[4], arg);
 }
-static inline double simcall_execution_parallel_start__get__amount(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<double>(simcall->args[5]);
-}
-static inline double simcall_execution_parallel_start__getraw__amount(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[5]);
-}
-static inline void simcall_execution_parallel_start__set__amount(smx_simcall_t simcall, double arg)
-{
-  simgrid::simix::marshal<double>(simcall->args[5], arg);
-}
 static inline double simcall_execution_parallel_start__get__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[6]);
+  return simgrid::simix::unmarshal<double>(simcall->args[5]);
 }
 static inline double simcall_execution_parallel_start__getraw__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[6]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[5]);
 }
 static inline void simcall_execution_parallel_start__set__rate(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[6], arg);
+  simgrid::simix::marshal<double>(simcall->args[5], arg);
 }
 static inline double simcall_execution_parallel_start__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal<double>(simcall->args[6]);
 }
 static inline double simcall_execution_parallel_start__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args[6]);
 }
 static inline void simcall_execution_parallel_start__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[7], arg);
+  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_cancel__get__execution(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
-}
-static inline simgrid::kernel::activity::ActivityImpl*
-simcall_execution_cancel__getraw__execution(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
-}
-static inline void
-simcall_execution_cancel__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);
-}
-
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_execution_set_priority__get__execution(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
-}
-static inline simgrid::kernel::activity::ActivityImpl*
-simcall_execution_set_priority__getraw__execution(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
-}
-static inline void
-simcall_execution_set_priority__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);
-}
-static inline double simcall_execution_set_priority__get__priority(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<double>(simcall->args[1]);
-}
-static inline double simcall_execution_set_priority__getraw__priority(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
-}
-static inline void simcall_execution_set_priority__set__priority(smx_simcall_t simcall, double arg)
-{
-  simgrid::simix::marshal<double>(simcall->args[1], arg);
-}
-
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_execution_set_bound__get__execution(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
-}
-static inline simgrid::kernel::activity::ActivityImpl*
-simcall_execution_set_bound__getraw__execution(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
-}
-static inline void
-simcall_execution_set_bound__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);
-}
-static inline double simcall_execution_set_bound__get__bound(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<double>(simcall->args[1]);
-}
-static inline double simcall_execution_set_bound__getraw__bound(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
-}
-static inline void simcall_execution_set_bound__set__bound(smx_simcall_t simcall, double arg)
-{
-  simgrid::simix::marshal<double>(simcall->args[1], arg);
-}
-
-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]);
 }
@@ -388,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);
 }
@@ -402,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)
@@ -443,55 +336,6 @@ static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, voi
   simgrid::simix::marshal<void*>(simcall->args[2], arg);
 }
 
-static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_auto_restart_set__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<int>(simcall->args[1]);
-}
-static inline int simcall_process_auto_restart_set__getraw__auto_restart(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
-}
-static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simcall_t simcall, int arg)
-{
-  simgrid::simix::marshal<int>(simcall->args[1], arg);
-}
-
-static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_restart__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline smx_actor_t simcall_process_restart__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->result);
-}
-static inline smx_actor_t simcall_process_restart__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->result);
-}
-static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_actor_t result){
-    simgrid::simix::marshal<smx_actor_t>(simcall->result, result);
-}
-
 static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]);
@@ -540,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);
 }
@@ -549,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);
 }
@@ -809,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);
 }
@@ -818,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);
 }
@@ -1029,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);
 }
@@ -1038,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);
 }
@@ -1076,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]);
 }
@@ -1089,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);
 }
@@ -1107,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]);
 }
@@ -1116,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);
 }
@@ -1129,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]);
 }
@@ -1142,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);
 }
@@ -1167,20 +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 smx_mutex_t simcall_mutex_init__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->result);
-}
-static inline smx_mutex_t simcall_mutex_init__getraw__result(smx_simcall_t simcall)
+static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int result)
 {
-  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->result);
-}
-static inline void simcall_mutex_init__set__result(smx_simcall_t simcall, smx_mutex_t result){
-    simgrid::simix::marshal<smx_mutex_t>(simcall->result, result);
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall)
@@ -1216,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)
@@ -1241,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)
@@ -1333,67 +1157,6 @@ static inline void simcall_cond_broadcast__set__cond(smx_simcall_t simcall, smx_
   simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
 }
 
-static inline unsigned int simcall_sem_init__get__capacity(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<unsigned int>(simcall->args[0]);
-}
-static inline unsigned int simcall_sem_init__getraw__capacity(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<unsigned int>(simcall->args[0]);
-}
-static inline void simcall_sem_init__set__capacity(smx_simcall_t simcall, unsigned int arg)
-{
-  simgrid::simix::marshal<unsigned int>(simcall->args[0], arg);
-}
-static inline smx_sem_t simcall_sem_init__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->result);
-}
-static inline smx_sem_t simcall_sem_init__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->result);
-}
-static inline void simcall_sem_init__set__result(smx_simcall_t simcall, smx_sem_t result){
-    simgrid::simix::marshal<smx_sem_t>(simcall->result, result);
-}
-
-static inline smx_sem_t simcall_sem_release__get__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
-}
-static inline smx_sem_t simcall_sem_release__getraw__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
-}
-static inline void simcall_sem_release__set__sem(smx_simcall_t simcall, smx_sem_t arg)
-{
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
-}
-
-static inline smx_sem_t simcall_sem_would_block__get__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
-}
-static inline smx_sem_t simcall_sem_would_block__getraw__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
-}
-static inline void simcall_sem_would_block__set__sem(smx_simcall_t simcall, smx_sem_t arg)
-{
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
-}
-static inline int simcall_sem_would_block__get__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<int>(simcall->result);
-}
-static inline int simcall_sem_would_block__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
-}
-static inline void simcall_sem_would_block__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
-}
-
 static inline smx_sem_t simcall_sem_acquire__get__sem(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
@@ -1432,100 +1195,78 @@ static inline void simcall_sem_acquire_timeout__set__timeout(smx_simcall_t simca
   simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 
-static inline smx_sem_t simcall_sem_get_capacity__get__sem(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
-}
-static inline smx_sem_t simcall_sem_get_capacity__getraw__sem(smx_simcall_t simcall)
+static inline surf_storage_t simcall_storage_read__get__st(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_storage_t>(simcall->args[0]);
 }
-static inline void simcall_sem_get_capacity__set__sem(smx_simcall_t simcall, smx_sem_t arg)
+static inline surf_storage_t simcall_storage_read__getraw__st(smx_simcall_t simcall)
 {
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
+  return simgrid::simix::unmarshal_raw<surf_storage_t>(simcall->args[0]);
 }
-static inline int simcall_sem_get_capacity__get__result(smx_simcall_t simcall)
+static inline void simcall_storage_read__set__st(smx_simcall_t simcall, surf_storage_t arg)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  simgrid::simix::marshal<surf_storage_t>(simcall->args[0], arg);
 }
-static inline int simcall_sem_get_capacity__getraw__result(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
-}
-static inline void simcall_sem_get_capacity__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
-}
-
-static inline surf_file_t simcall_file_read__get__fd(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
-}
-static inline surf_file_t simcall_file_read__getraw__fd(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
-}
-static inline void simcall_file_read__set__fd(smx_simcall_t simcall, surf_file_t arg)
-{
-  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
-}
-static inline sg_size_t simcall_file_read__get__size(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_read__get__size(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]);
 }
-static inline sg_size_t simcall_file_read__getraw__size(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_read__getraw__size(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->args[1]);
 }
-static inline void simcall_file_read__set__size(smx_simcall_t simcall, sg_size_t arg)
+static inline void simcall_storage_read__set__size(smx_simcall_t simcall, sg_size_t arg)
 {
   simgrid::simix::marshal<sg_size_t>(simcall->args[1], arg);
 }
-static inline sg_size_t simcall_file_read__get__result(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_read__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
 }
-static inline sg_size_t simcall_file_read__getraw__result(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_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_storage_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)
+static inline surf_storage_t simcall_storage_write__get__st(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_storage_t>(simcall->args[0]);
 }
-static inline surf_file_t simcall_file_write__getraw__fd(smx_simcall_t simcall)
+static inline surf_storage_t simcall_storage_write__getraw__st(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_storage_t>(simcall->args[0]);
 }
-static inline void simcall_file_write__set__fd(smx_simcall_t simcall, surf_file_t arg)
+static inline void simcall_storage_write__set__st(smx_simcall_t simcall, surf_storage_t arg)
 {
-  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_storage_t>(simcall->args[0], arg);
 }
-static inline sg_size_t simcall_file_write__get__size(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_write__get__size(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]);
 }
-static inline sg_size_t simcall_file_write__getraw__size(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_write__getraw__size(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->args[1]);
 }
-static inline void simcall_file_write__set__size(smx_simcall_t simcall, sg_size_t arg)
+static inline void simcall_storage_write__set__size(smx_simcall_t simcall, sg_size_t arg)
 {
   simgrid::simix::marshal<sg_size_t>(simcall->args[1], arg);
 }
-static inline sg_size_t simcall_file_write__get__result(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_write__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
 }
-static inline sg_size_t simcall_file_write__getraw__result(smx_simcall_t simcall)
+static inline sg_size_t simcall_storage_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_storage_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)
@@ -1560,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]);
 }
@@ -1573,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);
 }
@@ -1619,52 +1359,28 @@ static inline void simcall_run_blocking__set__code(smx_simcall_t simcall, std::f
 
 /* The prototype of all simcall handlers, automatically generated for you */
 
-XBT_PRIVATE void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_actor_t process);
 XBT_PRIVATE void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid);
 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 smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process);
-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 smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
+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);
 XBT_PRIVATE void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex);
 XBT_PRIVATE void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout);
-XBT_PRIVATE void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem);
-XBT_PRIVATE int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout);
-XBT_PRIVATE int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem);
-XBT_PRIVATE void simcall_HANDLER_file_read(smx_simcall_t simcall, surf_file_t fd, sg_size_t size);
-XBT_PRIVATE void simcall_HANDLER_file_write(smx_simcall_t simcall, surf_file_t fd, sg_size_t size);
+XBT_PRIVATE void simcall_HANDLER_storage_read(smx_simcall_t simcall, surf_storage_t st, sg_size_t size);
+XBT_PRIVATE void simcall_HANDLER_storage_write(smx_simcall_t simcall, surf_storage_t st, sg_size_t size);
 XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
\ No newline at end of file
index 486da23..dd9b622 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,323 +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_kill(smx_actor_t process) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_kill(&SIMIX_process_self()->simcall, process);
-    return simcall<void, smx_actor_t>(SIMCALL_PROCESS_KILL, process);
-  }
-
-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_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_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 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_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 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_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                                        double* bytes_amount, double 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, amount, rate, timeout);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, int, sg_host_t*, double*,
-                   double*, double, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list,
-                                                    flops_amount, bytes_amount, amount, rate, timeout);
-  }
-
-  inline static void
-  simcall_BODY_execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_execution_cancel(execution);
-    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_CANCEL,
-                                                                                        execution);
-  }
-
-  inline static void
-  simcall_BODY_execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
-                                      double priority)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_execution_set_priority(execution, priority);
-    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
-        SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
-  }
-
-  inline static void
-  simcall_BODY_execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
-                                   double bound)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_execution_set_bound(execution, bound);
-    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
-        SIMCALL_EXECUTION_SET_BOUND, execution, bound);
-  }
-
-  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 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_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_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_auto_restart_set(smx_actor_t process, int auto_restart) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_process_auto_restart_set(process, auto_restart);
-    return simcall<void, smx_actor_t, int>(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart);
-  }
+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 smx_actor_t simcall_BODY_process_restart(smx_actor_t process) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_restart(&SIMIX_process_self()->simcall, process);
-    return simcall<smx_actor_t, smx_actor_t>(SIMCALL_PROCESS_RESTART, process);
-  }
+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 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 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 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 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::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::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 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 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 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 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 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 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_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_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 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 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 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 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 smx_mutex_t simcall_BODY_mutex_init() {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_init(&SIMIX_process_self()->simcall);
-    return simcall<smx_mutex_t>(SIMCALL_MUTEX_INIT);
-  }
+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 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 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 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 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 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 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 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 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_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_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 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 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_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_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 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 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 smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_sem_init(capacity);
-    return simcall<smx_sem_t, unsigned int>(SIMCALL_SEM_INIT, capacity);
-  }
+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_sem_release(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_release(&SIMIX_process_self()->simcall, sem);
-    return simcall<void, smx_sem_t>(SIMCALL_SEM_RELEASE, sem);
-  }
+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 int simcall_BODY_sem_would_block(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_would_block(&SIMIX_process_self()->simcall, sem);
-    return simcall<int, smx_sem_t>(SIMCALL_SEM_WOULD_BLOCK, sem);
-  }
+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_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_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_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(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 int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_get_capacity(&SIMIX_process_self()->simcall, sem);
-    return simcall<int, smx_sem_t>(SIMCALL_SEM_GET_CAPACITY, sem);
-  }
+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_storage_read(surf_storage_t st, sg_size_t size)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_storage_read(&SIMIX_process_self()->simcall, st, size);
+  return simcall<sg_size_t, surf_storage_t, sg_size_t>(SIMCALL_STORAGE_READ, st, 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_storage_write(surf_storage_t st, sg_size_t size)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_storage_write(&SIMIX_process_self()->simcall, st, size);
+  return simcall<sg_size_t, surf_storage_t, sg_size_t>(SIMCALL_STORAGE_WRITE, st, 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 eede34f..e2a7c49 100644 (file)
@@ -19,7 +19,6 @@
  */
 typedef enum {
   SIMCALL_NONE,
-  SIMCALL_PROCESS_KILL,
   SIMCALL_PROCESS_KILLALL,
   SIMCALL_PROCESS_CLEANUP,
   SIMCALL_PROCESS_SUSPEND,
@@ -27,13 +26,8 @@ typedef enum {
   SIMCALL_PROCESS_SLEEP,
   SIMCALL_EXECUTION_START,
   SIMCALL_EXECUTION_PARALLEL_START,
-  SIMCALL_EXECUTION_CANCEL,
-  SIMCALL_EXECUTION_SET_PRIORITY,
-  SIMCALL_EXECUTION_SET_BOUND,
   SIMCALL_EXECUTION_WAIT,
   SIMCALL_PROCESS_ON_EXIT,
-  SIMCALL_PROCESS_AUTO_RESTART_SET,
-  SIMCALL_PROCESS_RESTART,
   SIMCALL_COMM_IPROBE,
   SIMCALL_COMM_SEND,
   SIMCALL_COMM_ISEND,
@@ -43,7 +37,6 @@ typedef enum {
   SIMCALL_COMM_WAIT,
   SIMCALL_COMM_TEST,
   SIMCALL_COMM_TESTANY,
-  SIMCALL_MUTEX_INIT,
   SIMCALL_MUTEX_LOCK,
   SIMCALL_MUTEX_TRYLOCK,
   SIMCALL_MUTEX_UNLOCK,
@@ -52,16 +45,13 @@ typedef enum {
   SIMCALL_COND_WAIT,
   SIMCALL_COND_WAIT_TIMEOUT,
   SIMCALL_COND_BROADCAST,
-  SIMCALL_SEM_INIT,
-  SIMCALL_SEM_RELEASE,
-  SIMCALL_SEM_WOULD_BLOCK,
   SIMCALL_SEM_ACQUIRE,
   SIMCALL_SEM_ACQUIRE_TIMEOUT,
-  SIMCALL_SEM_GET_CAPACITY,
-  SIMCALL_FILE_READ,
-  SIMCALL_FILE_WRITE,
+  SIMCALL_STORAGE_READ,
+  SIMCALL_STORAGE_WRITE,
   SIMCALL_MC_RANDOM,
   SIMCALL_SET_CATEGORY,
   SIMCALL_RUN_KERNEL,
-  SIMCALL_RUN_BLOCKING,  NUM_SIMCALLS
+  SIMCALL_RUN_BLOCKING,
+  NUM_SIMCALLS
 } e_smx_simcall_t;
index 0de896d..1d6a4a6 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
@@ -25,7 +25,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
 const char* simcall_names[] = {
     "SIMCALL_NONE",
-    "SIMCALL_PROCESS_KILL",
     "SIMCALL_PROCESS_KILLALL",
     "SIMCALL_PROCESS_CLEANUP",
     "SIMCALL_PROCESS_SUSPEND",
@@ -33,13 +32,8 @@ const char* simcall_names[] = {
     "SIMCALL_PROCESS_SLEEP",
     "SIMCALL_EXECUTION_START",
     "SIMCALL_EXECUTION_PARALLEL_START",
-    "SIMCALL_EXECUTION_CANCEL",
-    "SIMCALL_EXECUTION_SET_PRIORITY",
-    "SIMCALL_EXECUTION_SET_BOUND",
     "SIMCALL_EXECUTION_WAIT",
     "SIMCALL_PROCESS_ON_EXIT",
-    "SIMCALL_PROCESS_AUTO_RESTART_SET",
-    "SIMCALL_PROCESS_RESTART",
     "SIMCALL_COMM_IPROBE",
     "SIMCALL_COMM_SEND",
     "SIMCALL_COMM_ISEND",
@@ -49,7 +43,6 @@ const char* simcall_names[] = {
     "SIMCALL_COMM_WAIT",
     "SIMCALL_COMM_TEST",
     "SIMCALL_COMM_TESTANY",
-    "SIMCALL_MUTEX_INIT",
     "SIMCALL_MUTEX_LOCK",
     "SIMCALL_MUTEX_TRYLOCK",
     "SIMCALL_MUTEX_UNLOCK",
@@ -58,14 +51,10 @@ const char* simcall_names[] = {
     "SIMCALL_COND_WAIT",
     "SIMCALL_COND_WAIT_TIMEOUT",
     "SIMCALL_COND_BROADCAST",
-    "SIMCALL_SEM_INIT",
-    "SIMCALL_SEM_RELEASE",
-    "SIMCALL_SEM_WOULD_BLOCK",
     "SIMCALL_SEM_ACQUIRE",
     "SIMCALL_SEM_ACQUIRE_TIMEOUT",
-    "SIMCALL_SEM_GET_CAPACITY",
-    "SIMCALL_FILE_READ",
-    "SIMCALL_FILE_WRITE",
+    "SIMCALL_STORAGE_READ",
+    "SIMCALL_STORAGE_WRITE",
     "SIMCALL_MC_RANDOM",
     "SIMCALL_SET_CATEGORY",
     "SIMCALL_RUN_KERNEL",
@@ -83,264 +72,159 @@ void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
   if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
     return;
   switch (simcall->call) {
-case SIMCALL_PROCESS_KILL:
-      simcall_HANDLER_process_kill(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
-
 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::unmarshal<double>(simcall->args[7])));
-  SIMIX_simcall_answer(simcall);
-  break;
-
-case SIMCALL_EXECUTION_CANCEL:
-  SIMIX_execution_cancel(
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
-  SIMIX_simcall_answer(simcall);
-  break;
-
-case SIMCALL_EXECUTION_SET_PRIORITY:
-  SIMIX_execution_set_priority(
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
-      simgrid::simix::unmarshal<double>(simcall->args[1]));
-  SIMIX_simcall_answer(simcall);
-  break;
-
-case SIMCALL_EXECUTION_SET_BOUND:
-  SIMIX_execution_set_bound(
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
-      simgrid::simix::unmarshal<double>(simcall->args[1]));
+  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;
-
-case SIMCALL_PROCESS_AUTO_RESTART_SET:
-      SIMIX_process_auto_restart_set(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]));
-      SIMIX_simcall_answer(simcall);
-      break;
-
-case SIMCALL_PROCESS_RESTART:
-      simgrid::simix::marshal<smx_actor_t>(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0])));
-      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_INIT:
-      simgrid::simix::marshal<smx_mutex_t>(simcall->result, simcall_HANDLER_mutex_init(simcall));
-      SIMIX_simcall_answer(simcall);
-      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;
-
-case SIMCALL_SEM_INIT:
-      simgrid::simix::marshal<smx_sem_t>(simcall->result, SIMIX_sem_init(simgrid::simix::unmarshal<unsigned int>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      break;
-
-case SIMCALL_SEM_RELEASE:
-      simcall_HANDLER_sem_release(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
-
-case SIMCALL_SEM_WOULD_BLOCK:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_sem_would_block(simcall, simgrid::simix::unmarshal<smx_sem_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;
-
-case SIMCALL_SEM_GET_CAPACITY:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_sem_get_capacity(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      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]));
+case SIMCALL_STORAGE_READ:
+  simcall_HANDLER_storage_read(simcall, simgrid::simix::unmarshal<surf_storage_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]));
+case SIMCALL_STORAGE_WRITE:
+  simcall_HANDLER_storage_write(simcall, simgrid::simix::unmarshal<surf_storage_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:
@@ -349,6 +233,7 @@ case SIMCALL_RUN_BLOCKING:
           sg_host_get_name(simcall->issuer->host)
           );
       break;
-
+    default:
+      THROW_IMPOSSIBLE;
   }
 }
similarity index 70%
rename from src/simix/popping_private.h
rename to src/simix/popping_private.hpp
index 160e55e..b7d4b5f 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);
 }
@@ -150,8 +143,8 @@ inline void marshal(type<boost::intrusive_ptr<T>>, u_smx_scalar& simcall, boost:
   if (value.get() == nullptr) { // Sometimes we return nullptr in an intrusive_ptr...
     simcall.dp = nullptr;
   } else {
-    intrusive_ptr_add_ref(&*value);
-    simcall.dp = static_cast<void*>(&*value);
+    intrusive_ptr_add_ref(value.get());
+    simcall.dp = static_cast<void*>(value.get());
   }
 }
 template <class T> inline boost::intrusive_ptr<T> unmarshal(type<boost::intrusive_ptr<T>>, u_smx_scalar const& simcall)
@@ -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 69734e4..99e748f 100644 (file)
@@ -35,7 +35,6 @@
 # Last but not the least, you should declare the new simix call in
 # ./include/simgrid/simix.h (otherwise you will get a warning at compile time)
 
-void process_kill(smx_actor_t process);
 void process_killall(int reset_pid);
 void process_cleanup(smx_actor_t process) [[nohandler]];
 void process_suspend(smx_actor_t process) [[block]];
@@ -43,15 +42,10 @@ int  process_join(smx_actor_t process, double timeout) [[block]];
 int  process_sleep(double duration) [[block]];
 
 boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_start(const char* name, double flops_amount, double priority, double bound);
-boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) [[nohandler]];
-void          execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[nohandler]];
-void          execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double priority) [[nohandler]];
-void          execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double bound) [[nohandler]];
+boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate, double timeout) [[nohandler]];
 int           execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[block]];
 
 void          process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
-void          process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]];
-smx_actor_t   process_restart(smx_actor_t process);
 
 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data);
 void           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) [[block]];
@@ -63,7 +57,6 @@ void           comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::Activit
 int            comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm) [[block]];
 int            comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count) [[block]];
 
-smx_mutex_t mutex_init();
 void        mutex_lock(smx_mutex_t mutex) [[block]];
 int         mutex_trylock(smx_mutex_t mutex);
 void        mutex_unlock(smx_mutex_t mutex);
@@ -74,15 +67,11 @@ void       cond_wait(smx_cond_t cond, smx_mutex_t mutex) [[block]];
 void       cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) [[block]];
 void       cond_broadcast(smx_cond_t cond) [[nohandler]];
 
-smx_sem_t sem_init(unsigned int capacity) [[nohandler]];
-void      sem_release(smx_sem_t sem);
-int       sem_would_block(smx_sem_t sem);
 void      sem_acquire(smx_sem_t sem) [[block]];
 void      sem_acquire_timeout(smx_sem_t sem, double timeout) [[block]];
-int       sem_get_capacity(smx_sem_t sem);
 
-sg_size_t   file_read(surf_file_t fd, sg_size_t size) [[block]];
-sg_size_t   file_write(surf_file_t fd, sg_size_t size) [[block]];
+sg_size_t   storage_read(surf_storage_t st, sg_size_t size) [[block]];
+sg_size_t   storage_write(surf_storage_t st, sg_size_t size) [[block]];
 
 int        mc_random(int min, int max);
 void       set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro, const char* category) [[nohandler]];
index 4465a64..f3d123c 100755 (executable)
@@ -22,8 +22,8 @@ class Arg(object):
         return self.type
 
 class Simcall(object):
-    simcalls_BODY = None
-    simcalls_PRE = None
+    simcalls_body = None
+    simcalls_pre = None
 
     def __init__(self, name, handler, res, args, call_kind):
         self.name = name
@@ -34,38 +34,40 @@ class Simcall(object):
 
     def check(self):
         # libsmx.c  simcall_BODY_
-        if self.simcalls_BODY is None:
+        if self.simcalls_body is None:
             f = open('libsmx.cpp')
-            self.simcalls_BODY = set(re.findall(r'simcall_BODY_(.*?)\(', f.read()))
+            self.simcalls_body = set(re.findall(r'simcall_BODY_(.*?)\(', f.read()))
             f.close()
-        if self.name not in self.simcalls_BODY:
+        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
 
         # smx_*.c void simcall_HANDLER_host_on(smx_simcall_t simcall,
         # smx_host_t h)
-        if self.simcalls_PRE is None:
-            self.simcalls_PRE = set()
+        if self.simcalls_pre is None:
+            self.simcalls_pre = set()
             for fn in glob.glob('smx_*') + glob.glob('ActorImpl*') + glob.glob('../mc/*cpp'):
                 f = open(fn)
-                self.simcalls_PRE |= set(re.findall(r'simcall_HANDLER_(.*?)\(', f.read()))
+                self.simcalls_pre |= set(re.findall(r'simcall_HANDLER_(.*?)\(', f.read()))
                 f.close()
         if self.need_handler:
-            if self.name not in self.simcalls_PRE:
+            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
         else:
-            if self.name in self.simcalls_PRE:
+            if self.name in self.simcalls_pre:
                 print ('# ERROR: You have a function called simcall_HANDLER_%s, but that simcall is not using any handler' % self.name)
                 print ('# Either change your simcall definition, or kill that function')
                 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(
@@ -347,20 +349,21 @@ if __name__ == '__main__':
     fd.write('          sg_host_get_name(simcall->issuer->host)\n')
     fd.write('          );\n')
     fd.write('      break;\n')
-    fd.write('\n')
+    fd.write('    default:\n')
+    fd.write('      THROW_IMPOSSIBLE;\n')
     fd.write('  }\n')
     fd.write('}\n')
 
     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 +383,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 5906e9d..8ccd6f3 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>
@@ -79,9 +77,9 @@ static simgrid::config::Flag<std::string> context_factory_name(
   (std::string("Possible values: ")+contexts_list()).c_str(),
   context_factories[0].first);
 
-int smx_context_stack_size;
+unsigned smx_context_stack_size;
 int smx_context_stack_size_was_set = 0;
-int smx_context_guard_size;
+unsigned smx_context_guard_size;
 int smx_context_guard_size_was_set = 0;
 #if HAVE_THREAD_LOCAL_STORAGE
 static XBT_THREAD_LOCAL smx_context_t smx_current_context_parallel;
@@ -107,14 +105,13 @@ void SIMIX_context_mod_init()
 #endif
 
 #if defined(__APPLE__) || defined(__NetBSD__)
-  if (context_factory_name == std::string("thread") &&
-      strcmp(xbt_cfg_get_string("smpi/privatization"), "dlopen") == 0) {
+  if (context_factory_name == "thread" && xbt_cfg_get_string("smpi/privatization") == "dlopen") {
     XBT_WARN("dlopen+thread broken on Apple and BSD. Switching to raw contexts.");
     context_factory_name = "raw";
   }
 #endif
 #if defined(__FreeBSD__)
-  if (context_factory_name == std::string("thread") && strcmp(xbt_cfg_get_string("smpi/privatization"), "no") != 0) {
+  if (context_factory_name == "thread" && xbt_cfg_get_string("smpi/privatization") != "no") {
     XBT_WARN("mmap broken on FreeBSD, but dlopen+thread broken too. Switching to dlopen+raw contexts.");
     context_factory_name = "raw";
   }
index 6fad27e..18bf778 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>
 
@@ -118,23 +118,18 @@ void SIMIX_process_set_function(const char* process_host, const char* process_fu
                                 double process_start_time, double process_kill_time)
 {
   s_sg_platf_process_cbarg_t process;
-  memset(&process,0,sizeof(process));
 
   sg_host_t host = sg_host_by_name(process_host);
   if (not host)
     THROWF(arg_error, 0, "Host '%s' unknown", process_host);
   process.host = process_host;
-
-  process.argc = 1 + xbt_dynar_length(arguments);
-  process.argv    = static_cast<const char**>(xbt_new(const char*, process.argc + 1));
-  process.argv[0] = xbt_strdup(process_function);
+  process.args.push_back(process_function);
   /* add arguments */
   unsigned int i;
   char *arg;
   xbt_dynar_foreach(arguments, i, arg) {
-    process.argv[i + 1] = xbt_strdup(arg);
+    process.args.push_back(arg);
   }
-  process.argv[process.argc] = nullptr;
 
   // Check we know how to handle this function name:
   simgrid::simix::ActorCodeFactory& parse_code = SIMIX_get_actor_code_factory(process_function);
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 f0f8268..ad2d351 100644 (file)
@@ -3,26 +3,29 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <boost/heap/fibonacci_heap.hpp>
 #include <functional>
 #include <memory>
 
-#include <signal.h> /* Signal handling */
-#include <stdlib.h>
 #include "src/internal_config.h"
+#include <csignal> /* Signal handling */
+#include <cstdlib>
 
+#include <xbt/algorithm.hpp>
 #include <xbt/functional.hpp>
+#include <xbt/utility.hpp>
 
 #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/mc/mc_replay.h"
+#include "src/mc/mc_replay.hpp"
 #include "src/surf/StorageImpl.hpp"
 
 #include "src/smpi/include/smpi_process.hpp"
 #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"
-#include <stdlib.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
 
@@ -51,21 +52,27 @@ XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix, "Logging specific to SIMIX (kernel)");
 
 std::unique_ptr<simgrid::simix::Global> simix_global;
-static xbt_heap_t simix_timers = nullptr;
+
+namespace {
+typedef std::pair<double, smx_timer_t> TimerQelt;
+boost::heap::fibonacci_heap<TimerQelt, boost::heap::compare<simgrid::xbt::HeapComparator<TimerQelt>>> simix_timers;
+}
 
 /** @brief Timer datatype */
-typedef struct s_smx_timer {
+class s_smx_timer_t {
   double date = 0.0;
-  simgrid::xbt::Task<void()> callback;
 
-  s_smx_timer()=default;
-  s_smx_timer(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
-} s_smx_timer_t;
+public:
+  decltype(simix_timers)::handle_type handle_;
+  simgrid::xbt::Task<void()> callback;
+  double getDate() { return date; }
+  s_smx_timer_t(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
+};
 
 void (*SMPI_switch_data_segment)(int) = nullptr;
 
 int _sg_do_verbose_exit = 1;
-static void inthandler(int ignored)
+static void inthandler(int)
 {
   if ( _sg_do_verbose_exit ) {
      XBT_INFO("CTRL-C pressed. The current status will be displayed before exit (disable that behavior with option 'verbose-exit').");
@@ -78,13 +85,13 @@ static void inthandler(int ignored)
 }
 
 #ifndef _WIN32
-static void segvhandler(int signum, siginfo_t *siginfo, void *context)
+static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
 {
   if (siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) {
     fprintf(stderr, "Access violation detected.\n"
                     "This probably comes from a programming error in your code, or from a stack\n"
                     "overflow. If you are certain of your code, try increasing the stack size\n"
-                    "   --cfg=contexts/stack-size=XXX (current size is %d KiB).\n"
+                    "   --cfg=contexts/stack-size=XXX (current size is %u KiB).\n"
                     "\n"
                     "If it does not help, this may have one of the following causes:\n"
                     "a bug in SimGrid, a bug in the OS or a bug in a third-party libraries.\n"
@@ -128,8 +135,8 @@ static void install_segvhandler()
     return;
   }
   if (not(old_stack.ss_flags & SS_DISABLE)) {
-    XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zd, flags=%x). Restore it.",
-              old_stack.ss_sp, old_stack.ss_size, old_stack.ss_flags);
+    XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zu, flags=%x). Restore it.", old_stack.ss_sp,
+              old_stack.ss_size, (unsigned)old_stack.ss_flags);
     sigaltstack(&old_stack, nullptr);
   }
 
@@ -155,7 +162,7 @@ static void install_segvhandler()
 /********************************* SIMIX **************************************/
 double SIMIX_timer_next()
 {
-  return xbt_heap_size(simix_timers) > 0 ? xbt_heap_maxkey(simix_timers) : -1.0;
+  return simix_timers.empty() ? -1.0 : simix_timers.top().first;
 }
 
 static void kill_process(smx_actor_t process)
@@ -205,8 +212,6 @@ void SIMIX_global_init(int *argc, char **argv)
     simix_global = std::unique_ptr<simgrid::simix::Global>(new simgrid::simix::Global());
 
     simgrid::simix::ActorImpl proc;
-    simix_global->process_to_run = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
-    simix_global->process_that_ran = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
     simix_global->process_to_destroy = xbt_swag_new(xbt_swag_offset(proc, destroy_hookup));
     simix_global->maestro_process = nullptr;
     simix_global->create_process_function = &SIMIX_process_create;
@@ -236,16 +241,11 @@ 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());
     });
   }
 
-  if (not simix_timers)
-    simix_timers = xbt_heap_new(8, [](void* p) {
-      delete static_cast<smx_timer_t>(p);
-    });
-
   if (xbt_cfg_get_boolean("clean-atexit"))
     atexit(SIMIX_clean);
 
@@ -265,6 +265,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,25 +285,21 @@ void SIMIX_clean()
   }
 #endif
 
-  smx_cleaned = 1;
-  XBT_DEBUG("SIMIX_clean called. Simulation's over.");
-  if (not xbt_dynar_is_empty(simix_global->process_to_run) && 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();
+  SIMIX_process_empty_trash();
 
   /* Exit the SIMIX network module */
   SIMIX_mailbox_exit();
 
-  xbt_heap_free(simix_timers);
-  simix_timers = nullptr;
+  while (not simix_timers.empty()) {
+    delete simix_timers.top().second;
+    simix_timers.pop();
+  }
   /* Free the remaining data structures */
-  xbt_dynar_free(&simix_global->process_to_run);
-  xbt_dynar_free(&simix_global->process_that_ran);
+  simix_global->process_to_run.clear();
+  simix_global->process_that_ran.clear();
   xbt_swag_free(simix_global->process_to_destroy);
   simix_global->process_list.clear();
   simix_global->process_to_destroy = nullptr;
@@ -335,25 +340,12 @@ double SIMIX_get_clock()
   }
 }
 
-static int process_syscall_color(void *p)
-{
-  switch ((*(smx_actor_t *)p)->simcall.call) {
-  case SIMCALL_NONE:
-  case SIMCALL_PROCESS_KILL:
-    return 2;
-  //  case SIMCALL_PROCESS_RESUME:
-  //    return 1;
-  default:
-    return 0;
-  }
-}
-
 /** Wake up all processes waiting for a Surf action to finish */
 static void SIMIX_wake_processes()
 {
   surf_action_t action;
 
-  for(auto model : *all_existing_models) {
+  for (auto const& model : *all_existing_models) {
     XBT_DEBUG("Handling the processes whose action failed (if any)");
     while ((action = surf_model_extract_failed_action_set(model))) {
       XBT_DEBUG("   Handling Action %p",action);
@@ -374,18 +366,18 @@ static void SIMIX_wake_processes()
 static bool SIMIX_execute_timers()
 {
   bool result = false;
-  while (xbt_heap_size(simix_timers) > 0 && SIMIX_get_clock() >= SIMIX_timer_next()) {
+  while (not simix_timers.empty() && SIMIX_get_clock() >= simix_timers.top().first) {
     result = true;
-     //FIXME: make the timers being real callbacks
-     // (i.e. provide dispatchers that read and expand the args)
-     smx_timer_t timer = (smx_timer_t) xbt_heap_pop(simix_timers);
-     try {
-       timer->callback();
-     }
-     catch(...) {
-       xbt_die("Exception throwed ouf of timer callback");
-     }
-     delete timer;
+    // FIXME: make the timers being real callbacks
+    // (i.e. provide dispatchers that read and expand the args)
+    smx_timer_t timer = simix_timers.top().second;
+    simix_timers.pop();
+    try {
+      timer->callback();
+    } catch (...) {
+      xbt_die("Exception thrown ouf of timer callback");
+    }
+    delete timer;
   }
   return result;
 }
@@ -422,7 +414,7 @@ static bool SIMIX_execute_tasks()
  */
 void SIMIX_run()
 {
-  if (MC_record_path) {
+  if (not MC_record_path.empty()) {
     simgrid::mc::replay(MC_record_path);
     return;
   }
@@ -430,19 +422,16 @@ void SIMIX_run()
   double time = 0;
 
   do {
-    XBT_DEBUG("New Schedule Round; size(queue)=%lu", xbt_dynar_length(simix_global->process_to_run));
+    XBT_DEBUG("New Schedule Round; size(queue)=%zu", simix_global->process_to_run.size());
 
     SIMIX_execute_tasks();
 
-    while (not xbt_dynar_is_empty(simix_global->process_to_run)) {
-      XBT_DEBUG("New Sub-Schedule Round; size(queue)=%lu", xbt_dynar_length(simix_global->process_to_run));
+    while (not simix_global->process_to_run.empty()) {
+      XBT_DEBUG("New Sub-Schedule Round; size(queue)=%zu", simix_global->process_to_run.size());
 
       /* Run all processes that are ready to run, possibly in parallel */
       SIMIX_process_runall();
 
-      /* Move all killer processes to the end of the list, because killing a process that have an ongoing simcall is a bad idea */
-      xbt_dynar_three_way_partition(simix_global->process_that_ran, process_syscall_color);
-
       /* answer sequentially and in a fixed arbitrary order all the simcalls that were issued during that sub-round */
 
       /* WARNING, the order *must* be fixed or you'll jeopardize the simulation reproducibility (see RR-7653) */
@@ -498,9 +487,7 @@ void SIMIX_run()
        *   That would thus be a pure waste of time.
        */
 
-      unsigned int iter;
-      smx_actor_t process;
-      xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
+      for (smx_actor_t const& process : simix_global->process_that_ran) {
         if (process->simcall.call != SIMCALL_NONE) {
           SIMIX_simcall_handle(&process->simcall, 0);
         }
@@ -513,14 +500,14 @@ 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 (const auto& dmon : simix_global->daemons) {
-          XBT_DEBUG("Kill %s", dmon->cname());
+        for (auto const& dmon : simix_global->daemons) {
+          XBT_DEBUG("Kill %s", dmon->getCname());
           SIMIX_process_kill(dmon, simix_global->maestro_process);
         }
     }
 
     time = SIMIX_timer_next();
-    if (time > -1.0 || simix_global->process_list.empty() == false) {
+    if (time > -1.0 || not simix_global->process_list.empty()) {
       XBT_DEBUG("Calling surf_solve");
       time = surf_solve(time);
       XBT_DEBUG("Moving time ahead : %g", time);
@@ -540,7 +527,7 @@ void SIMIX_run()
     } while (again);
 
     /* Autorestart all process */
-    for (auto host: host_that_restart) {
+    for (auto const& host : host_that_restart) {
       XBT_INFO("Restart processes on host %s", host->getCname());
       SIMIX_host_autorestart(host);
     }
@@ -549,15 +536,15 @@ void SIMIX_run()
     /* Clean processes to destroy */
     SIMIX_process_empty_trash();
 
-    XBT_DEBUG("### time %f, #processes %zu, #to_run %lu", time, simix_global->process_list.size(),
-              xbt_dynar_length(simix_global->process_to_run));
+    XBT_DEBUG("### time %f, #processes %zu, #to_run %zu", time, simix_global->process_list.size(),
+              simix_global->process_to_run.size());
 
-    if (xbt_dynar_is_empty(simix_global->process_to_run) && not simix_global->process_list.empty())
+    if (simix_global->process_to_run.empty() && not simix_global->process_list.empty())
       simgrid::simix::onDeadlock();
 
-  } while (time > -1.0 || not xbt_dynar_is_empty(simix_global->process_to_run));
+  } while (time > -1.0 || not simix_global->process_to_run.empty());
 
-  if (simix_global->process_list.size() != 0) {
+  if (not simix_global->process_list.empty()) {
 
     TRACE_end();
 
@@ -580,25 +567,26 @@ void SIMIX_run()
 smx_timer_t SIMIX_timer_set(double date, void (*callback)(void*), void *arg)
 {
   smx_timer_t timer = new s_smx_timer_t(date, [callback, arg]() { callback(arg); });
-  xbt_heap_push(simix_timers, timer, date);
+  timer->handle_    = simix_timers.emplace(std::make_pair(date, timer));
   return timer;
 }
 
 smx_timer_t SIMIX_timer_set(double date, simgrid::xbt::Task<void()> callback)
 {
   smx_timer_t timer = new s_smx_timer_t(date, std::move(callback));
-  xbt_heap_push(simix_timers, timer, date);
+  timer->handle_    = simix_timers.emplace(std::make_pair(date, timer));
   return timer;
 }
 
 /** @brief cancels a timer that was added earlier */
 void SIMIX_timer_remove(smx_timer_t timer) {
-  xbt_heap_rm_elm(simix_timers, timer, timer->date);
+  simix_timers.erase(timer->handle_);
+  delete timer;
 }
 
 /** @brief Returns the date at which the timer will trigger (or 0 if nullptr timer) */
 double SIMIX_timer_get_date(smx_timer_t timer) {
-  return timer?timer->date:0;
+  return timer ? timer->getDate() : 0;
 }
 
 /**
@@ -647,7 +635,7 @@ void SIMIX_display_process_status()
   XBT_INFO("%d processes are still running, waiting for something.", nbprocess);
   /*  List the process and their state */
   XBT_INFO("Legend of the following listing: \"Process <pid> (<name>@<host>): <status>\"");
-  for (auto kv : simix_global->process_list) {
+  for (auto const& kv : simix_global->process_list) {
     smx_actor_t process = kv.second;
 
     if (process->waiting_synchro) {
@@ -670,11 +658,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 18e9829..393256f 100644 (file)
@@ -1,14 +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/mc/mc_replay.hpp"
 #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");
 
@@ -27,24 +29,20 @@ namespace simgrid {
 
     Host::~Host()
     {
-      /* Clean Simulator data */
+      /* All processes should be gone when the host is turned off (by the end of the simulation). */
       if (xbt_swag_size(process_list) != 0) {
-        char *msg = xbt_strdup("Shutting down host, but it's not empty:");
-        char *tmp;
+        std::string msg     = std::string("Shutting down host, but it's not empty:");
         smx_actor_t process = nullptr;
 
-        xbt_swag_foreach(process, process_list) {
-          tmp = bprintf("%s\n\t%s", msg, process->name.c_str());
-          free(msg);
-          msg = tmp;
-        }
+        xbt_swag_foreach(process, process_list) msg = msg + "\n\t" + process->name.c_str();
+
         SIMIX_display_process_status();
-        THROWF(arg_error, 0, "%s", msg);
+        THROWF(arg_error, 0, "%s", msg.c_str());
       }
-      for (auto arg : auto_restart_processes)
+      for (auto const& arg : auto_restart_processes)
         delete arg;
       auto_restart_processes.clear();
-      for (auto arg : boot_processes)
+      for (auto const& arg : boot_processes)
         delete arg;
       boot_processes.clear();
       xbt_swag_free(process_list);
@@ -56,14 +54,14 @@ namespace simgrid {
      */
     void Host::turnOn()
     {
-      for (auto arg : boot_processes) {
+      for (auto const& arg : boot_processes) {
         XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->host->getCname());
         smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host,
-                                                                  arg->properties, nullptr);
+                                                                  arg->properties.get(), nullptr);
         if (arg->kill_time >= 0)
           simcall_process_set_kill_time(actor, arg->kill_time);
         if (arg->auto_restart)
-          simcall_process_auto_restart_set(actor, arg->auto_restart);
+          actor->auto_restart = arg->auto_restart;
       }
     }
 
@@ -84,7 +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", 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 {
@@ -115,9 +114,9 @@ const char* sg_host_self_get_name()
  * The processes will only be restarted once, meaning that you will have to register the process
  * again to restart the process again.
  */
-void SIMIX_host_add_auto_restart_process(
-  sg_host_t host, const char *name, std::function<void()> code,
-  void* data, double kill_time, xbt_dict_t properties, int auto_restart)
+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)
 {
   smx_process_arg_t arg = new simgrid::simix::ProcessArg();
   arg->name = name;
@@ -125,12 +124,12 @@ void SIMIX_host_add_auto_restart_process(
   arg->data = data;
   arg->host = host;
   arg->kill_time = kill_time;
-  arg->properties = properties;
+  arg->properties.reset(properties, [](decltype(properties)) {});
   arg->auto_restart = auto_restart;
 
-  if (host->isOff() && not xbt_dict_get_or_null(watched_hosts_lib, host->getCname())) {
-    xbt_dict_set(watched_hosts_lib, host->getCname(), host, nullptr);
-    XBT_DEBUG("Push host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF", host->getCname());
+  if (host->isOff() && watched_hosts.find(host->getCname()) == watched_hosts.end()) {
+    watched_hosts.insert(host->getCname());
+    XBT_DEBUG("Push host %s to watched_hosts because state == SURF_RESOURCE_OFF", host->getCname());
   }
   host->extension<simgrid::simix::Host>()->auto_restart_processes.push_back(arg);
 }
@@ -140,14 +139,14 @@ void SIMIX_host_autorestart(sg_host_t host)
   std::vector<simgrid::simix::ProcessArg*> process_list =
       host->extension<simgrid::simix::Host>()->auto_restart_processes;
 
-  for (auto arg : process_list) {
+  for (auto const& arg : process_list) {
     XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->getCname());
     smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host,
-                                                              arg->properties, nullptr);
+                                                              arg->properties.get(), nullptr);
     if (arg->kill_time >= 0)
       simcall_process_set_kill_time(actor, arg->kill_time);
     if (arg->auto_restart)
-      simcall_process_auto_restart_set(actor, arg->auto_restart);
+      actor->auto_restart = arg->auto_restart;
   }
   process_list.clear();
 }
@@ -186,18 +185,13 @@ SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount,
 
 boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
 SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                               double* bytes_amount, double amount, double rate, double timeout)
+                               double* bytes_amount, double rate, double timeout)
 {
 
   /* alloc structures and initialize */
   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++) {
@@ -207,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) {
@@ -219,32 +216,6 @@ SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_li
   return exec;
 }
 
-void SIMIX_execution_cancel(smx_activity_t synchro)
-{
-  XBT_DEBUG("Cancel synchro %p", synchro.get());
-  simgrid::kernel::activity::ExecImplPtr exec =
-      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
-
-  if (exec->surf_exec)
-    exec->surf_exec->cancel();
-}
-
-void SIMIX_execution_set_priority(smx_activity_t synchro, double priority)
-{
-  simgrid::kernel::activity::ExecImplPtr exec =
-      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
-  if(exec->surf_exec)
-    exec->surf_exec->setSharingWeight(priority);
-}
-
-void SIMIX_execution_set_bound(smx_activity_t synchro, double bound)
-{
-  simgrid::kernel::activity::ExecImplPtr exec =
-      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
-  if(exec->surf_exec)
-    static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
-}
-
 void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro)
 {
   simgrid::kernel::activity::ExecImplPtr exec =
@@ -269,7 +240,7 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchr
 
 void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec)
 {
-  for (smx_simcall_t simcall : exec->simcalls) {
+  for (smx_simcall_t const& simcall : exec->simcalls) {
     switch (exec->state) {
 
       case SIMIX_DONE:
diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h
deleted file mode 100644 (file)
index a642409..0000000
+++ /dev/null
@@ -1,68 +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 SIMIX_HOST_PRIVATE_H
-#define SIMIX_HOST_PRIVATE_H
-
-#include <vector>
-#include <functional>
-
-#include <xbt/base.h>
-#include <xbt/Extendable.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;
-
-    class Host {
-    public:
-      static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
-
-      explicit Host();
-      virtual ~Host();
-
-      xbt_swag_t process_list;
-      std::vector<ProcessArg*> auto_restart_processes;
-      std::vector<ProcessArg*> boot_processes;
-
-      void turnOn();
-    };
-  }
-}
-
-SG_BEGIN_DECL()
-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,
-                                         xbt_dict_t properties,
-                                         int auto_restart);
-
-XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
-XBT_PRIVATE void SIMIX_execution_cancel(smx_activity_t synchro);
-XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
-XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
-
-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 boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount, double priority, double bound);
-XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                               double* bytes_amount, double amount, double rate, double timeout);
-
-#endif
-
diff --git a/src/simix/smx_host_private.hpp b/src/simix/smx_host_private.hpp
new file mode 100644 (file)
index 0000000..5f49d3f
--- /dev/null
@@ -0,0 +1,60 @@
+/* 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 SIMIX_HOST_PRIVATE_HPP
+#define SIMIX_HOST_PRIVATE_HPP
+
+#include <functional>
+#include <map>
+#include <vector>
+
+#include <xbt/Extendable.hpp>
+#include <xbt/base.h>
+
+#include "popping_private.hpp"
+#include "simgrid/simix.h"
+
+#include "ActorImpl.hpp"
+#include "src/kernel/activity/ExecImpl.hpp"
+
+/** @brief Host datatype from SIMIX POV */
+namespace simgrid {
+namespace simix {
+
+class Host {
+public:
+  static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
+
+  explicit Host();
+  virtual ~Host();
+
+  xbt_swag_t process_list;
+  std::vector<ProcessArg*> auto_restart_processes;
+  std::vector<ProcessArg*> boot_processes;
+
+  void turnOn();
+};
+}
+}
+
+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);
+
+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);
+}
+
+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);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
+SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
+                               double* bytes_amount, double rate, double timeout);
+
+#endif
index 9361f1d..39c13a1 100644 (file)
@@ -9,30 +9,28 @@
 
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
-#include "src/surf/FileImpl.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/StorageImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
+#include "smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "smx_private.h"
 
 #include "src/kernel/activity/SynchroIo.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_io, simix, "Logging specific to SIMIX (io)");
 
-//SIMIX FILE READ
-void simcall_HANDLER_file_read(smx_simcall_t simcall, surf_file_t fd, sg_size_t size)
+void simcall_HANDLER_storage_read(smx_simcall_t simcall, surf_storage_t st, sg_size_t size)
 {
-  smx_activity_t synchro = SIMIX_file_read(fd, size);
+  smx_activity_t synchro = SIMIX_storage_read(st, size);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
-smx_activity_t SIMIX_file_read(surf_file_t file, sg_size_t size)
+smx_activity_t SIMIX_storage_read(surf_storage_t st, sg_size_t size)
 {
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
-  synchro->surf_io                           = file->read(size);
+  synchro->surf_io                           = st->read(size);
 
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
@@ -40,18 +38,17 @@ smx_activity_t SIMIX_file_read(surf_file_t file, sg_size_t size)
   return synchro;
 }
 
-//SIMIX FILE WRITE
-void simcall_HANDLER_file_write(smx_simcall_t simcall, surf_file_t fd, sg_size_t size)
+void simcall_HANDLER_storage_write(smx_simcall_t simcall, surf_storage_t st, sg_size_t size)
 {
-  smx_activity_t synchro = SIMIX_file_write(fd, size);
+  smx_activity_t synchro = SIMIX_storage_write(st, size);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
-smx_activity_t SIMIX_file_write(surf_file_t file, sg_size_t size)
+smx_activity_t SIMIX_storage_write(surf_storage_t st, sg_size_t size)
 {
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
-  synchro->surf_io                           = file->write(size);
+  synchro->surf_io                           = st->write(size);
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
 
@@ -68,7 +65,7 @@ void SIMIX_io_destroy(smx_activity_t synchro)
 
 void SIMIX_io_finish(smx_activity_t synchro)
 {
-  for (smx_simcall_t simcall : synchro->simcalls) {
+  for (smx_simcall_t const& simcall : synchro->simcalls) {
     switch (synchro->state) {
       case SIMIX_DONE:
         /* do nothing, synchro done */
similarity index 61%
rename from src/simix/smx_io_private.h
rename to src/simix/smx_io_private.hpp
index db1c66d..79581a8 100644 (file)
@@ -3,16 +3,16 @@
 /* This program 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);
+XBT_PRIVATE smx_activity_t SIMIX_storage_read(surf_storage_t fd, sg_size_t size);
+XBT_PRIVATE smx_activity_t SIMIX_storage_write(surf_storage_t fd, sg_size_t size);
 
 XBT_PRIVATE void SIMIX_io_destroy(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_io_finish(smx_activity_t synchro);
index 7975425..173e0af 100644 (file)
@@ -15,8 +15,8 @@
 #include "mc/mc.h"
 #include "simgrid/s4u/Activity.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
-#include "src/mc/mc_replay.h"
-#include "src/simix/smx_private.h"
+#include "src/mc/mc_replay.hpp"
+#include "src/simix/smx_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 
@@ -84,7 +84,7 @@ XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sr
   simcall_HANDLER_comm_wait(simcall, comm, timeout);
 }
 XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(
-    smx_simcall_t simcall, smx_actor_t src_proc, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
+    smx_simcall_t /*simcall*/, smx_actor_t src_proc, 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*),
     void (*clean_fun)(void*), // used to free the synchro in case of problem after a detached send
     void (*copy_data_fun)(smx_activity_t, void*, size_t), // used to copy data if not default one
@@ -163,8 +163,8 @@ XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t re
   simcall_HANDLER_comm_wait(simcall, comm, timeout);
 }
 
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox,
-                                                      void* dst_buff, size_t* dst_buff_size,
+XBT_PRIVATE smx_activity_t 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,
                                                       void (*copy_data_fun)(smx_activity_t, void*, size_t), void* data,
                                                       double rate)
@@ -315,9 +315,10 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do
   /* otherwise set up a waiting timeout on the right side          */
   if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) {
     SIMIX_comm_finish(synchro);
-  } else { /* if (timeout >= 0) { we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */
+  } else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host
+              fails */
     surf_action_t sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
-    sleep->setData(&*synchro);
+    sleep->setData(synchro.get());
 
     simgrid::kernel::activity::CommImplPtr comm =
         boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
@@ -475,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();
     }
@@ -546,7 +547,6 @@ void SIMIX_comm_finish(smx_activity_t synchro)
         case SIMIX_SRC_HOST_FAILURE:
           if (simcall->issuer == comm->src_proc)
             simcall->issuer->context->iwannadie = 1;
-          //          SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
           else
             SMX_EXCEPTION(simcall->issuer, network_error, 0, "Remote peer failed");
           break;
@@ -554,7 +554,6 @@ void SIMIX_comm_finish(smx_activity_t synchro)
         case SIMIX_DST_HOST_FAILURE:
           if (simcall->issuer == comm->dst_proc)
             simcall->issuer->context->iwannadie = 1;
-          //          SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
           else
             SMX_EXCEPTION(simcall->issuer, network_error, 0, "Remote peer failed");
           break;
@@ -563,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");
@@ -691,7 +690,7 @@ void SIMIX_comm_copy_data(smx_activity_t synchro)
 
   /* Copy at most dst_buff_size bytes of the message to receiver's buffer */
   if (comm->dst_buff_size)
-    buff_size = MIN(buff_size, *(comm->dst_buff_size));
+    buff_size = std::min(buff_size, *(comm->dst_buff_size));
 
   /* Update the receiver's buffer size to the copied amount */
   if (comm->dst_buff_size)
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 63%
rename from src/simix/smx_private.h
rename to src/simix/smx_private.hpp
index a0c713e..a14ab8b 100644 (file)
@@ -3,14 +3,15 @@
 /* This program 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>
 
 /********************************** Simix Global ******************************/
 
@@ -22,8 +23,8 @@ class Global {
 
 public:
   smx_context_factory_t context_factory = nullptr;
-  xbt_dynar_t process_to_run = nullptr;
-  xbt_dynar_t process_that_ran = nullptr;
+  std::vector<smx_actor_t> process_to_run;
+  std::vector<smx_actor_t> process_that_ran;
   std::map<aid_t, smx_actor_t> process_list;
 #if SIMGRID_HAVE_MC
   /* MCer cannot read the std::map above in the remote process, so we copy the info it needs in a dynar.
@@ -36,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;
@@ -48,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;
 
@@ -67,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 6f53958..e25a227 100644 (file)
@@ -1,11 +1,10 @@
-
-/* 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 "smx_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include <xbt/ex.hpp>
@@ -30,7 +29,7 @@ static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout)
   simgrid::kernel::activity::RawImplPtr sync =
       simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
   sync->sleep                          = smx_host->pimpl_cpu->sleep(timeout);
-  sync->sleep->setData(&*sync);
+  sync->sleep->setData(sync.get());
   XBT_OUT();
   return sync;
 }
@@ -80,7 +79,6 @@ void SIMIX_synchro_finish(smx_activity_t synchro)
 
     case SIMIX_FAILED:
         simcall->issuer->context->iwannadie = 1;
-//      SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
       break;
 
     default:
@@ -169,8 +167,8 @@ 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:%ld), not by you.",
-           this->owner->cname(), this->owner->pid);
+    THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%lu), not by you.",
+           this->owner->getCname(), this->owner->pid);
 
   if (xbt_swag_size(this->sleeping) > 0) {
     /*process to wake up */
@@ -204,11 +202,6 @@ void SIMIX_mutex_unref(smx_mutex_t mutex)
     intrusive_ptr_release(mutex);
 }
 
-smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall)
-{
-  return new simgrid::simix::MutexImpl();
-}
-
 // Simcall handlers:
 
 void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex)
@@ -239,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();
@@ -371,14 +364,13 @@ void SIMIX_cond_unref(smx_cond_t cond)
 
 void intrusive_ptr_add_ref(s_smx_cond_t *cond)
 {
-  auto previous = (cond->refcount_)++;
+  auto previous = cond->refcount_.fetch_add(1);
   xbt_assert(previous != 0);
 }
 
 void intrusive_ptr_release(s_smx_cond_t *cond)
 {
-  auto count = --(cond->refcount_);
-  if (count == 0) {
+  if (cond->refcount_.fetch_sub(1) == 1) {
     xbt_assert(xbt_swag_size(cond->sleeping) == 0,
                 "Cannot destroy conditional since someone is still using it");
     xbt_swag_free(cond->sleeping);
@@ -393,7 +385,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();
@@ -409,14 +401,11 @@ 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();
 }
 
-void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem){
-  SIMIX_sem_release(sem);
-}
 /** @brief release the semaphore
  *
  * Unlock a process waiting on the semaphore.
@@ -445,9 +434,6 @@ int SIMIX_sem_would_block(smx_sem_t sem)
   return (sem->value <= 0);
 }
 
-int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem){
-  return SIMIX_sem_get_capacity(sem);
-}
 /** @brief Returns the current capacity of the semaphore */
 int SIMIX_sem_get_capacity(smx_sem_t sem)
 {
@@ -496,6 +482,3 @@ void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, d
   _SIMIX_sem_wait(sem, timeout, simcall->issuer, simcall);
   XBT_OUT();
 }
-int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem) {
-  return SIMIX_sem_would_block(sem);
-}
index 8eb66a5..5846b04 100644 (file)
@@ -31,15 +31,12 @@ public:
   // boost::intrusive_ptr<Mutex> support:
   friend void intrusive_ptr_add_ref(MutexImpl* mutex)
   {
-    // Atomic operation! Do not split in two instructions!
-    XBT_ATTRIB_UNUSED auto previous = (mutex->refcount_)++;
+    XBT_ATTRIB_UNUSED auto previous = mutex->refcount_.fetch_add(1);
     xbt_assert(previous != 0);
   }
   friend void intrusive_ptr_release(MutexImpl* mutex)
   {
-    // Atomic operation! Do not split in two instructions!
-    auto count = --(mutex->refcount_);
-    if (count == 0)
+    if (mutex->refcount_.fetch_sub(1) == 1)
       delete mutex;
   }
 
@@ -52,19 +49,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 ad40a6b..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"
@@ -239,8 +239,8 @@ 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){
-  *ierr = MPI_Win_create_keyval(reinterpret_cast<MPI_Win_copy_attr_function*>(copy_fn),  reinterpret_cast<MPI_Win_delete_attr_function*>(delete_fn),
-         keyval,  extra_state) ;
+  *ierr = MPI_Win_create_keyval(reinterpret_cast<MPI_Win_copy_attr_function*>(copy_fn),
+                                reinterpret_cast<MPI_Win_delete_attr_function*>(delete_fn), keyval, extra_state);
 }
 
 void mpi_win_free_keyval_(int* keyval, int* ierr){
@@ -399,8 +399,9 @@ void mpi_fetch_and_op_( int *origin_addr, int* result_addr, int* datatype, int*
               *target_disp, simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win));
 }
 
-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_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)
+{
   *ierr =  MPI_Compare_and_swap( static_cast<void *>(origin_addr),static_cast<void *>(compare_addr),
               static_cast<void *>(result_addr), simgrid::smpi::Datatype::f2c(*datatype),*target_rank,
               *target_disp, simgrid::smpi::Win::f2c(*win));
@@ -409,20 +410,22 @@ void mpi_compare_and_swap_( int *origin_addr, int* compare_addr, int* result_add
 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){
-  *ierr = MPI_Get_accumulate( static_cast<void *>(origin_addr), *origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),
-                               static_cast<void *>(result_addr), *result_count, simgrid::smpi::Datatype::f2c(*result_datatype), 
-                               *target_rank, *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),   
-                               simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win));
+  *ierr =
+      MPI_Get_accumulate(static_cast<void*>(origin_addr), *origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),
+                         static_cast<void*>(result_addr), *result_count, simgrid::smpi::Datatype::f2c(*result_datatype),
+                         *target_rank, *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),
+                         simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win));
 }
 
 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){
   MPI_Request req;
-  *ierr = MPI_Rget_accumulate( static_cast<void *>(origin_addr), *origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),
-                               static_cast<void *>(result_addr), *result_count, simgrid::smpi::Datatype::f2c(*result_datatype), 
-                               *target_rank, *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),   
-                               simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win), &req);
+  *ierr = MPI_Rget_accumulate(static_cast<void*>(origin_addr), *origin_count,
+                              simgrid::smpi::Datatype::f2c(*origin_datatype), static_cast<void*>(result_addr),
+                              *result_count, simgrid::smpi::Datatype::f2c(*result_datatype), *target_rank, *target_disp,
+                              *target_count, simgrid::smpi::Datatype::f2c(*target_datatype),
+                              simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win), &req);
   if(*ierr == MPI_SUCCESS) {
     *request = req->add_f();
   }
@@ -430,7 +433,6 @@ void mpi_rget_accumulate_(int *origin_addr, int* origin_count, int* origin_datat
 
 //following are automatically generated, and have to be checked
 void mpi_finalized_ (int * flag, int* ierr){
-
  *ierr = MPI_Finalized(flag);
 }
 
@@ -441,7 +443,6 @@ void mpi_init_thread_ (int* required, int *provided, int* ierr){
 }
 
 void mpi_query_thread_ (int *provided, int* ierr){
-
  *ierr = MPI_Query_thread(provided);
 }
 
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 b939d4c..52dcf73 100644 (file)
@@ -3,13 +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 "private.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
-#include "private.h"
 #include "smpi_comm.hpp"
 #include "smpi_datatype_derived.hpp"
 #include "smpi_process.hpp"
 #include "smpi_status.hpp"
+#include "src/simix/ActorImpl.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi, "Logging specific to SMPI (pmpi)");
 
@@ -38,11 +39,9 @@ int PMPI_Init(int *argc, char ***argv)
     smpi_process()->mark_as_initialized();
     int rank = smpi_process()->index();
     TRACE_smpi_init(rank);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("init"));
+    TRACE_smpi_comm_out(rank);
     TRACE_smpi_computing_init(rank);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type = TRACING_INIT;
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
     smpi_bench_begin();
   }
 
@@ -55,14 +54,12 @@ int PMPI_Finalize()
 {
   smpi_bench_end();
   int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_FINALIZE;
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("finalize"));
 
   smpi_process()->finalize();
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
-  TRACE_smpi_finalize(smpi_process()->index());
+  TRACE_smpi_comm_out(rank);
+  TRACE_smpi_finalize(rank);
   return MPI_SUCCESS;
 }
 
@@ -87,7 +84,7 @@ int PMPI_Get_library_version (char *version,int *len){
   return MPI_SUCCESS;
 }
 
-int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided)
+int PMPI_Init_thread(int* argc, char*** argv, int /*required*/, int* provided)
 {
   if (provided != nullptr) {
     *provided = MPI_THREAD_SINGLE;
@@ -115,11 +112,12 @@ int PMPI_Is_thread_main(int *flag)
   }
 }
 
-int PMPI_Abort(MPI_Comm comm, int errorcode)
+int PMPI_Abort(MPI_Comm /*comm*/, int /*errorcode*/)
 {
   smpi_bench_end();
   // FIXME: should kill all processes in comm instead
-  simcall_process_kill(SIMIX_process_self());
+  smx_actor_t process = SIMIX_process_self();
+  simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); });
   return MPI_SUCCESS;
 }
 
@@ -184,7 +182,8 @@ int PMPI_Initialized(int* flag) {
    return MPI_SUCCESS;
 }
 
-int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr){
+int PMPI_Alloc_mem(MPI_Aint size, MPI_Info /*info*/, void* baseptr)
+{
   void *ptr = xbt_malloc(size);
   if(ptr==nullptr)
     return MPI_ERR_NO_MEM;
index 7459567..aaf32c3 100644 (file)
@@ -3,16 +3,15 @@
 /* This program is 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"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
 
-
 /* PMPI User level calls */
 extern "C" { // Obviously, the C MPI interface should use the C linkage
 
@@ -27,24 +26,16 @@ int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm c
   } else if (not datatype->is_valid()) {
     retval = MPI_ERR_ARG;
   } else {
-    int rank        = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int root_traced = comm->group()->index(root);
-
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_BCAST;
-    extra->root            = root_traced;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = datatype->size();
-    extra->send_size = count * dt_size_send;
-    TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
+    int rank        = smpi_process()->index();
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::CollTIData("bcast", comm->group()->index(root), -1.0,
+                                                      datatype->is_basic() ? count : count * datatype->size(), -1,
+                                                      encode_datatype(datatype), ""));
     if (comm->size() > 1)
       simgrid::smpi::Colls::bcast(buf, count, datatype, root, comm);
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -59,10 +50,8 @@ int PMPI_Barrier(MPI_Comm comm)
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_BARRIER;
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    int rank = smpi_process()->index();
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("barrier"));
 
     simgrid::smpi::Colls::barrier(comm);
 
@@ -71,7 +60,7 @@ int PMPI_Barrier(MPI_Comm comm)
 
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -101,29 +90,19 @@ int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbu
       sendtmpcount=0;
       sendtmptype=recvtype;
     }
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int root_traced        = comm->group()->index(root);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_GATHER;
-    extra->root            = root_traced;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(sendtmptype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = sendtmptype->size();
-    extra->send_size = sendtmpcount * dt_size_send;
-    extra->datatype2 = encode_datatype(recvtype, &known);
-    int dt_size_recv = 1;
-    if ((comm->rank() == root) && known == 0)
-      dt_size_recv   = recvtype->size();
-    extra->recv_size = recvcount * dt_size_recv;
-
-    TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
+    int rank               = smpi_process()->index();
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::CollTIData(
+                           "gather", comm->group()->index(root), -1.0,
+                           sendtmptype->is_basic() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
+                           (comm->rank() != root || recvtype->is_basic()) ? recvcount : recvcount * recvtype->size(),
+                           encode_datatype(sendtmptype), encode_datatype(recvtype)));
 
     simgrid::smpi::Colls::gather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm);
 
     retval = MPI_SUCCESS;
-    TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -155,32 +134,23 @@ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recv
       sendtmptype=recvtype;
     }
 
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int root_traced        = comm->group()->index(root);
-    int size               = comm->size();
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_GATHERV;
-    extra->num_processes   = size;
-    extra->root            = root_traced;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(sendtmptype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = sendtype->size();
-    extra->send_size = sendtmpcount * dt_size_send;
-    extra->datatype2 = encode_datatype(recvtype, &known);
-    int dt_size_recv = 1;
-    if (known == 0)
-      dt_size_recv = recvtype->size();
+    int rank         = smpi_process()->index();
+    int dt_size_recv = recvtype->is_basic() ? 1 : recvtype->size();
+
+    std::vector<int>* trace_recvcounts = new std::vector<int>;
     if (comm->rank() == root) {
-      extra->recvcounts = xbt_new(int, size);
-      for (int i = 0; i < size; i++) // copy data to avoid bad free
-        extra->recvcounts[i] = recvcounts[i] * dt_size_recv;
+      for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
+        trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
     }
-    TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::VarCollTIData(
+                           "gatherV", comm->group()->index(root),
+                           sendtmptype->is_basic() ? sendtmpcount : sendtmpcount * sendtmptype->size(), nullptr,
+                           dt_size_recv, trace_recvcounts, encode_datatype(sendtmptype), encode_datatype(recvtype)));
 
     retval = simgrid::smpi::Colls::gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, displs, recvtype, root, comm);
-    TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -190,7 +160,7 @@ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recv
 int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                    void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
 {
-  int retval = 0;
+  int retval = MPI_SUCCESS;
 
   smpi_bench_end();
 
@@ -208,26 +178,16 @@ int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
       sendcount=recvcount;
       sendtype=recvtype;
     }
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_ALLGATHER;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(sendtype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = sendtype->size();
-    extra->send_size = sendcount * dt_size_send;
-    extra->datatype2 = encode_datatype(recvtype, &known);
-    int dt_size_recv = 1;
-    if (known == 0)
-      dt_size_recv   = recvtype->size();
-    extra->recv_size = recvcount * dt_size_recv;
-
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    int rank               = smpi_process()->index();
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::CollTIData("allGather", -1, -1.0,
+                                                      sendtype->is_basic() ? sendcount : sendcount * sendtype->size(),
+                                                      recvtype->is_basic() ? recvcount : recvcount * recvtype->size(),
+                                                      encode_datatype(sendtype), encode_datatype(recvtype)));
 
     simgrid::smpi::Colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
-    retval = MPI_SUCCESS;
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -255,31 +215,21 @@ int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
       sendcount=recvcounts[comm->rank()];
       sendtype=recvtype;
     }
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int i                  = 0;
-    int size               = comm->size();
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_ALLGATHERV;
-    extra->num_processes   = size;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(sendtype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = sendtype->size();
-    extra->send_size = sendcount * dt_size_send;
-    extra->datatype2 = encode_datatype(recvtype, &known);
-    int dt_size_recv = 1;
-    if (known == 0)
-      dt_size_recv    = recvtype->size();
-    extra->recvcounts = xbt_new(int, size);
-    for (i                 = 0; i < size; i++) // copy data to avoid bad free
-      extra->recvcounts[i] = recvcounts[i] * dt_size_recv;
-
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    int rank               = smpi_process()->index();
+    int dt_size_recv       = recvtype->is_basic() ? 1 : recvtype->size();
+
+    std::vector<int>* trace_recvcounts = new std::vector<int>;
+    for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
+      trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::VarCollTIData(
+                           "allGatherV", -1, sendtype->is_basic() ? sendcount : sendcount * sendtype->size(), nullptr,
+                           dt_size_recv, trace_recvcounts, encode_datatype(sendtype), encode_datatype(recvtype)));
 
     simgrid::smpi::Colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
     retval = MPI_SUCCESS;
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -307,27 +257,18 @@ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
       recvtype  = sendtype;
       recvcount = sendcount;
     }
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int root_traced        = comm->group()->index(root);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_SCATTER;
-    extra->root            = root_traced;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(sendtype, &known);
-    int dt_size_send       = 1;
-    if ((comm->rank() == root) && known == 0)
-      dt_size_send   = sendtype->size();
-    extra->send_size = sendcount * dt_size_send;
-    extra->datatype2 = encode_datatype(recvtype, &known);
-    int dt_size_recv = 1;
-    if (known == 0)
-      dt_size_recv   = recvtype->size();
-    extra->recv_size = recvcount * dt_size_recv;
-    TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
+    int rank               = smpi_process()->index();
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::CollTIData(
+                           "scatter", comm->group()->index(root), -1.0,
+                           (comm->rank() != root || sendtype->is_basic()) ? sendcount : sendcount * sendtype->size(),
+                           recvtype->is_basic() ? recvcount : recvcount * recvtype->size(), encode_datatype(sendtype),
+                           encode_datatype(recvtype)));
 
     simgrid::smpi::Colls::scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
     retval = MPI_SUCCESS;
-    TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -353,33 +294,23 @@ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
       recvtype  = sendtype;
       recvcount = sendcounts[comm->rank()];
     }
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int root_traced        = comm->group()->index(root);
-    int size               = comm->size();
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_SCATTERV;
-    extra->num_processes   = size;
-    extra->root            = root_traced;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(sendtype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send = sendtype->size();
+    int rank               = smpi_process()->index();
+    int dt_size_send       = sendtype->is_basic() ? 1 : sendtype->size();
+
+    std::vector<int>* trace_sendcounts = new std::vector<int>;
     if (comm->rank() == root) {
-      extra->sendcounts = xbt_new(int, size);
-      for (int i = 0; i < size; i++) // copy data to avoid bad free
-        extra->sendcounts[i] = sendcounts[i] * dt_size_send;
+      for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
+        trace_sendcounts->push_back(sendcounts[i] * dt_size_send);
     }
-    extra->datatype2 = encode_datatype(recvtype, &known);
-    int dt_size_recv = 1;
-    if (known == 0)
-      dt_size_recv   = recvtype->size();
-    extra->recv_size = recvcount * dt_size_recv;
-    TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
+                                               "scatterV", comm->group()->index(root), dt_size_send, trace_sendcounts,
+                                               recvtype->is_basic() ? recvcount : recvcount * recvtype->size(), nullptr,
+                                               encode_datatype(sendtype), encode_datatype(recvtype)));
 
     retval = simgrid::smpi::Colls::scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
 
-    TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -397,24 +328,17 @@ int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
   } else if (not datatype->is_valid() || op == MPI_OP_NULL) {
     retval = MPI_ERR_ARG;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int root_traced        = comm->group()->index(root);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_REDUCE;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = datatype->size();
-    extra->send_size = count * dt_size_send;
-    extra->root      = root_traced;
-
-    TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
+    int rank               = smpi_process()->index();
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::CollTIData("reduce", comm->group()->index(root), 0,
+                                                      datatype->is_basic() ? count : count * datatype->size(), -1,
+                                                      encode_datatype(datatype), ""));
 
     simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
 
     retval = MPI_SUCCESS;
-    TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -454,17 +378,12 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
       sendtmpbuf = static_cast<char*>(xbt_malloc(count*datatype->get_extent()));
       simgrid::smpi::Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
     }
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_ALLREDUCE;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = datatype->size();
-    extra->send_size = count * dt_size_send;
-
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    int rank               = smpi_process()->index();
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::CollTIData("allReduce", -1, 0,
+                                                      datatype->is_basic() ? count : count * datatype->size(), -1,
+                                                      encode_datatype(datatype), ""));
 
     simgrid::smpi::Colls::allreduce(sendtmpbuf, recvbuf, count, datatype, op, comm);
 
@@ -472,7 +391,7 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
       xbt_free(sendtmpbuf);
 
     retval = MPI_SUCCESS;
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -492,21 +411,15 @@ int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MP
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_SCAN;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = datatype->size();
-    extra->send_size = count * dt_size_send;
-
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    int rank               = smpi_process()->index();
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData(
+                                               "scan", -1, datatype->is_basic() ? count : count * datatype->size(),
+                                               encode_datatype(datatype)));
 
     retval = simgrid::smpi::Colls::scan(sendbuf, recvbuf, count, datatype, op, comm);
 
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -525,25 +438,20 @@ int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_EXSCAN;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = datatype->size();
-    extra->send_size = count * dt_size_send;
+    int rank               = smpi_process()->index();
     void* sendtmpbuf = sendbuf;
     if (sendbuf == MPI_IN_PLACE) {
       sendtmpbuf = static_cast<void*>(xbt_malloc(count * datatype->size()));
       memcpy(sendtmpbuf, recvbuf, count * datatype->size());
     }
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData(
+                                               "exscan", -1, datatype->is_basic() ? count : count * datatype->size(),
+                                               encode_datatype(datatype)));
 
     retval = simgrid::smpi::Colls::exscan(sendtmpbuf, recvbuf, count, datatype, op, comm);
 
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
     if (sendbuf == MPI_IN_PLACE)
       xbt_free(sendtmpbuf);
   }
@@ -566,35 +474,29 @@ int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datat
   } else if (recvcounts == nullptr) {
     retval = MPI_ERR_ARG;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int i                  = 0;
-    int size               = comm->size();
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_REDUCE_SCATTER;
-    extra->num_processes   = size;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send    = datatype->size();
-    extra->send_size  = 0;
-    extra->recvcounts = xbt_new(int, size);
+    int rank               = smpi_process()->index();
+    std::vector<int>* trace_recvcounts = new std::vector<int>;
+    int dt_send_size                   = datatype->is_basic() ? 1 : datatype->size();
     int totalcount    = 0;
-    for (i = 0; i < size; i++) { // copy data to avoid bad free
-      extra->recvcounts[i] = recvcounts[i] * dt_size_send;
+
+    for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free
+      trace_recvcounts->push_back(recvcounts[i] * dt_send_size);
       totalcount += recvcounts[i];
     }
+
     void* sendtmpbuf = sendbuf;
     if (sendbuf == MPI_IN_PLACE) {
       sendtmpbuf = static_cast<void*>(xbt_malloc(totalcount * datatype->size()));
       memcpy(sendtmpbuf, recvbuf, totalcount * datatype->size());
     }
 
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::VarCollTIData("reduceScatter", -1, dt_send_size, nullptr, -1,
+                                                         trace_recvcounts, encode_datatype(datatype), ""));
 
     simgrid::smpi::Colls::reduce_scatter(sendtmpbuf, recvbuf, recvcounts, datatype, op, comm);
     retval = MPI_SUCCESS;
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
 
     if (sendbuf == MPI_IN_PLACE)
       xbt_free(sendtmpbuf);
@@ -621,35 +523,28 @@ int PMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
   } else {
     int count = comm->size();
 
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_REDUCE_SCATTER;
-    extra->num_processes   = count;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send    = datatype->size();
-    extra->send_size  = 0;
-    extra->recvcounts = xbt_new(int, count);
-    for (int i             = 0; i < count; i++) // copy data to avoid bad free
-      extra->recvcounts[i] = recvcount * dt_size_send;
+    int rank               = smpi_process()->index();
+    int dt_send_size                   = datatype->is_basic() ? 1 : datatype->size();
+    std::vector<int>* trace_recvcounts = new std::vector<int>(recvcount * dt_send_size); // copy data to avoid bad free
+
     void* sendtmpbuf       = sendbuf;
     if (sendbuf == MPI_IN_PLACE) {
       sendtmpbuf = static_cast<void*>(xbt_malloc(recvcount * count * datatype->size()));
       memcpy(sendtmpbuf, recvbuf, recvcount * count * datatype->size());
     }
 
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::VarCollTIData("reduceScatter", -1, 0, nullptr, -1, trace_recvcounts,
+                                                         encode_datatype(datatype), ""));
 
-    int* recvcounts = static_cast<int*>(xbt_malloc(count * sizeof(int)));
+    int* recvcounts = new int[count];
     for (int i      = 0; i < count; i++)
       recvcounts[i] = recvcount;
     simgrid::smpi::Colls::reduce_scatter(sendtmpbuf, recvbuf, recvcounts, datatype, op, comm);
-    xbt_free(recvcounts);
+    delete[] recvcounts;
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
 
     if (sendbuf == MPI_IN_PLACE)
       xbt_free(sendtmpbuf);
@@ -670,10 +565,7 @@ int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec
   } else if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_ALLTOALL;
-
+    int rank               = smpi_process()->index();
     void* sendtmpbuf         = static_cast<char*>(sendbuf);
     int sendtmpcount         = sendcount;
     MPI_Datatype sendtmptype = sendtype;
@@ -684,23 +576,16 @@ int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec
       sendtmptype  = recvtype;
     }
 
-    int known        = 0;
-    extra->datatype1 = encode_datatype(sendtmptype, &known);
-    if (known == 0)
-      extra->send_size = sendtmpcount * sendtmptype->size();
-    else
-      extra->send_size = sendtmpcount;
-    extra->datatype2   = encode_datatype(recvtype, &known);
-    if (known == 0)
-      extra->recv_size = recvcount * recvtype->size();
-    else
-      extra->recv_size = recvcount;
-
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+    TRACE_smpi_comm_in(
+        rank, __FUNCTION__,
+        new simgrid::instr::CollTIData("allToAll", -1, -1.0,
+                                       sendtmptype->is_basic() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
+                                       recvtype->is_basic() ? recvcount : recvcount * recvtype->size(),
+                                       encode_datatype(sendtmptype), encode_datatype(recvtype)));
 
     retval = simgrid::smpi::Colls::alltoall(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, comm);
 
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
 
     if (sendbuf == MPI_IN_PLACE)
       xbt_free(sendtmpbuf);
@@ -725,17 +610,12 @@ int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype
              recvdisps == nullptr) {
     retval = MPI_ERR_ARG;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int i                  = 0;
+    int rank               = smpi_process()->index();
     int size               = comm->size();
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_ALLTOALLV;
-    extra->send_size       = 0;
-    extra->recv_size       = 0;
-    extra->recvcounts      = xbt_new(int, size);
-    extra->sendcounts      = xbt_new(int, size);
-    int known              = 0;
-    extra->datatype2       = encode_datatype(recvtype, &known);
+    int send_size                      = 0;
+    int recv_size                      = 0;
+    std::vector<int>* trace_sendcounts = new std::vector<int>;
+    std::vector<int>* trace_recvcounts = new std::vector<int>;
     int dt_size_recv       = recvtype->size();
 
     void* sendtmpbuf         = static_cast<char*>(sendbuf);
@@ -743,9 +623,9 @@ int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype
     int* sendtmpdisps        = senddisps;
     MPI_Datatype sendtmptype = sendtype;
     int maxsize              = 0;
-    for (i = 0; i < size; i++) { // copy data to avoid bad free
-      extra->recv_size += recvcounts[i] * dt_size_recv;
-      extra->recvcounts[i] = recvcounts[i] * dt_size_recv;
+    for (int i = 0; i < size; i++) { // copy data to avoid bad free
+      recv_size += recvcounts[i] * dt_size_recv;
+      trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
       if (((recvdisps[i] + recvcounts[i]) * dt_size_recv) > maxsize)
         maxsize = (recvdisps[i] + recvcounts[i]) * dt_size_recv;
     }
@@ -760,18 +640,20 @@ int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype
       sendtmptype = recvtype;
     }
 
-    extra->datatype1 = encode_datatype(sendtmptype, &known);
     int dt_size_send = sendtmptype->size();
 
-    for (i = 0; i < size; i++) { // copy data to avoid bad free
-      extra->send_size += sendtmpcounts[i] * dt_size_send;
-      extra->sendcounts[i] = sendtmpcounts[i] * dt_size_send;
+    for (int i = 0; i < size; i++) { // copy data to avoid bad free
+      send_size += sendtmpcounts[i] * dt_size_send;
+      trace_sendcounts->push_back(sendtmpcounts[i] * dt_size_send);
     }
-    extra->num_processes = size;
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
+                                               "allToAllV", -1, send_size, trace_sendcounts, recv_size,
+                                               trace_recvcounts, encode_datatype(sendtype), encode_datatype(recvtype)));
+
     retval = simgrid::smpi::Colls::alltoallv(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptype, recvbuf, recvcounts,
                                     recvdisps, recvtype, comm);
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
 
     if (sendbuf == MPI_IN_PLACE) {
       xbt_free(sendtmpbuf);
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 8adeecc..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"
@@ -136,9 +136,8 @@ int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
   } else {
     if (n == 0) {
       *newgroup = group;
-      if (group != MPI_COMM_WORLD->group()
-                && group != MPI_COMM_SELF->group() && group != MPI_GROUP_EMPTY)
-      group->ref();
+      if (group != MPI_COMM_WORLD->group() && group != MPI_COMM_SELF->group() && group != MPI_GROUP_EMPTY)
+        group->ref();
       return MPI_SUCCESS;
     } else if (n == group->size()) {
       *newgroup = MPI_GROUP_EMPTY;
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 71cdf1b..fd9d4a6 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);
 
@@ -20,16 +20,16 @@ int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag
 
   smpi_bench_end();
   if (request == nullptr) {
-      retval = MPI_ERR_ARG;
+    retval = MPI_ERR_ARG;
   } else if (comm == MPI_COMM_NULL) {
-      retval = MPI_ERR_COMM;
+    retval = MPI_ERR_COMM;
   } else if (not datatype->is_valid()) {
     retval = MPI_ERR_TYPE;
   } else if (dst == MPI_PROC_NULL) {
-      retval = MPI_SUCCESS;
+    retval = MPI_SUCCESS;
   } else {
-      *request = simgrid::smpi::Request::send_init(buf, count, datatype, dst, tag, comm);
-      retval = MPI_SUCCESS;
+    *request = simgrid::smpi::Request::send_init(buf, count, datatype, dst, tag, comm);
+    retval   = MPI_SUCCESS;
   }
   smpi_bench_begin();
   if (retval != MPI_SUCCESS && request != nullptr)
@@ -157,25 +157,17 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MP
     retval = MPI_ERR_TAG;
   } else {
 
-    int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int src_traced = comm->group()->index(src);
-
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type = TRACING_IRECV;
-    extra->src = src_traced;
-    extra->dst = rank;
-    int known=0;
-    extra->datatype1 = encode_datatype(datatype, &known);
-    int dt_size_send = 1;
-    if(known==0)
-      dt_size_send = datatype->size();
-    extra->send_size = count*dt_size_send;
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
+    int rank       = smpi_process()->index();
+
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::Pt2PtTIData("Irecv", comm->group()->index(src),
+                                                       datatype->is_basic() ? count : count * datatype->size(),
+                                                       encode_datatype(datatype)));
 
     *request = simgrid::smpi::Request::irecv(buf, count, datatype, src, tag, comm);
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -206,25 +198,19 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MP
   } else if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
   } else {
-    int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int dst_traced = comm->group()->index(dst);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type = TRACING_ISEND;
-    extra->src = rank;
-    extra->dst = dst_traced;
-    int known=0;
-    extra->datatype1 = encode_datatype(datatype, &known);
-    int dt_size_send = 1;
-    if(known==0)
-      dt_size_send = datatype->size();
-    extra->send_size = count*dt_size_send;
-    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
-    TRACE_smpi_send(rank, rank, dst_traced, tag, count*datatype->size());
+    int rank      = smpi_process()->index();
+    int trace_dst = comm->group()->index(dst);
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::Pt2PtTIData("Isend", trace_dst,
+                                                       datatype->is_basic() ? count : count * datatype->size(),
+                                                       encode_datatype(datatype)));
+
+    TRACE_smpi_send(rank, rank, trace_dst, tag, count * datatype->size());
 
     *request = simgrid::smpi::Request::isend(buf, count, datatype, dst, tag, comm);
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -254,25 +240,18 @@ int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, M
   } else if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
   } else {
-    int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-    int dst_traced = comm->group()->index(dst);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type = TRACING_ISSEND;
-    extra->src = rank;
-    extra->dst = dst_traced;
-    int known=0;
-    extra->datatype1 = encode_datatype(datatype, &known);
-    int dt_size_send = 1;
-    if(known==0)
-      dt_size_send = datatype->size();
-    extra->send_size = count*dt_size_send;
-    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
-    TRACE_smpi_send(rank, rank, dst_traced, tag, count*datatype->size());
+    int rank      = smpi_process()->index();
+    int trace_dst = comm->group()->index(dst);
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::Pt2PtTIData("ISsend", trace_dst,
+                                                       datatype->is_basic() ? count : count * datatype->size(),
+                                                       encode_datatype(datatype)));
+    TRACE_smpi_send(rank, rank, trace_dst, tag, count * datatype->size());
 
     *request = simgrid::smpi::Request::issend(buf, count, datatype, dst, tag, comm);
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -301,19 +280,12 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI
   } else if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+    int rank               = smpi_process()->index();
     int src_traced         = comm->group()->index(src);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
-    extra->type            = TRACING_RECV;
-    extra->src             = src_traced;
-    extra->dst             = rank;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0)
-      dt_size_send   = datatype->size();
-    extra->send_size = count * dt_size_send;
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::Pt2PtTIData("recv", src_traced,
+                                                       datatype->is_basic() ? count : count * datatype->size(),
+                                                       encode_datatype(datatype)));
 
     simgrid::smpi::Request::recv(buf, count, datatype, src, tag, comm, status);
     retval = MPI_SUCCESS;
@@ -322,10 +294,10 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI
     if (status != MPI_STATUS_IGNORE) {
       src_traced = comm->group()->index(status->MPI_SOURCE);
       if (not TRACE_smpi_view_internals()) {
-        TRACE_smpi_recv(rank, src_traced, rank, tag);
+        TRACE_smpi_recv(src_traced, rank, tag);
       }
     }
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -351,20 +323,12 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI
   } else if(tag < 0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+    int rank               = smpi_process()->index();
     int dst_traced         = comm->group()->index(dst);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type            = TRACING_SEND;
-    extra->src             = rank;
-    extra->dst             = dst_traced;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if (known == 0) {
-      dt_size_send = datatype->size();
-    }
-    extra->send_size = count*dt_size_send;
-    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::Pt2PtTIData("send", dst_traced,
+                                                       datatype->is_basic() ? count : count * datatype->size(),
+                                                       encode_datatype(datatype)));
     if (not TRACE_smpi_view_internals()) {
       TRACE_smpi_send(rank, rank, dst_traced, tag,count*datatype->size());
     }
@@ -372,7 +336,7 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI
     simgrid::smpi::Request::send(buf, count, datatype, dst, tag, comm);
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -397,34 +361,26 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP
   } else if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
   } else {
-    int rank               = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+    int rank               = smpi_process()->index();
     int dst_traced         = comm->group()->index(dst);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type            = TRACING_SSEND;
-    extra->src             = rank;
-    extra->dst             = dst_traced;
-    int known              = 0;
-    extra->datatype1       = encode_datatype(datatype, &known);
-    int dt_size_send       = 1;
-    if(known == 0) {
-      dt_size_send = datatype->size();
-    }
-    extra->send_size = count*dt_size_send;
-    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
-    TRACE_smpi_send(rank, rank, dst_traced, tag,count*datatype->size());
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::Pt2PtTIData("Ssend", dst_traced,
+                                                       datatype->is_basic() ? count : count * datatype->size(),
+                                                       encode_datatype(datatype)));
+    TRACE_smpi_send(rank, rank, dst_traced, tag, count * datatype->size());
 
     simgrid::smpi::Request::ssend(buf, count, datatype, dst, tag, comm);
     retval = MPI_SUCCESS;
 
-    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
   return retval;
 }
 
-int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void *recvbuf,
-                 int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status * status)
+int PMPI_Sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void* recvbuf,
+                  int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status* status)
 {
   int retval = 0;
 
@@ -447,35 +403,29 @@ int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dst,
   } else if((sendtag<0 && sendtag !=  MPI_ANY_TAG)||(recvtag<0 && recvtag != MPI_ANY_TAG)){
     retval = MPI_ERR_TAG;
   } else {
+    int rank               = smpi_process()->index();
+    int dst_traced         = comm->group()->index(dst);
+    int src_traced         = comm->group()->index(src);
 
-  int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
-  int dst_traced = comm->group()->index(dst);
-  int src_traced = comm->group()->index(src);
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_SENDRECV;
-  extra->src = src_traced;
-  extra->dst = dst_traced;
-  int known=0;
-  extra->datatype1 = encode_datatype(sendtype, &known);
-  int dt_size_send = 1;
-  if(known==0)
-    dt_size_send = sendtype->size();
-  extra->send_size = sendcount*dt_size_send;
-  extra->datatype2 = encode_datatype(recvtype, &known);
-  int dt_size_recv = 1;
-  if(known==0)
-    dt_size_recv = recvtype->size();
-  extra->recv_size = recvcount*dt_size_recv;
-
-  TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__, extra);
-  TRACE_smpi_send(rank, rank, dst_traced, sendtag,sendcount*sendtype->size());
-
-  simgrid::smpi::Request::sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf, recvcount, recvtype, src, recvtag, comm,
-                    status);
-  retval = MPI_SUCCESS;
-
-  TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
-  TRACE_smpi_recv(rank, src_traced, rank, recvtag);
+    // FIXME: Hack the way to trace this one
+    std::vector<int>* dst_hack = new std::vector<int>;
+    std::vector<int>* src_hack = new std::vector<int>;
+    dst_hack->push_back(dst_traced);
+    src_hack->push_back(src_traced);
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::VarCollTIData(
+                           "sendRecv", -1, sendtype->is_basic() ? sendcount : sendcount * sendtype->size(), dst_hack,
+                           recvtype->is_basic() ? recvcount : recvcount * recvtype->size(), src_hack,
+                           encode_datatype(sendtype), encode_datatype(recvtype)));
+
+    TRACE_smpi_send(rank, rank, dst_traced, sendtag, sendcount * sendtype->size());
+
+    simgrid::smpi::Request::sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf, recvcount, recvtype, src,
+                                     recvtag, comm, status);
+    retval = MPI_SUCCESS;
+
+    TRACE_smpi_recv(src_traced, rank, recvtag);
+    TRACE_smpi_comm_out(rank);
   }
 
   smpi_bench_begin();
@@ -495,7 +445,7 @@ int PMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dst,
     void* recvbuf = xbt_new0(char, size);
     retval = MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count, datatype, src, recvtag, comm, status);
     if(retval==MPI_SUCCESS){
-        simgrid::smpi::Datatype::copy(recvbuf, count, datatype, buf, count, datatype);
+      simgrid::smpi::Datatype::copy(recvbuf, count, datatype, buf, count, datatype);
     }
     xbt_free(recvbuf);
 
@@ -516,9 +466,7 @@ int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
   } else {
     int rank = ((*request)->comm() != MPI_COMM_NULL) ? smpi_process()->index() : -1;
 
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type = TRACING_TEST;
-    TRACE_smpi_testing_in(rank, extra);
+    TRACE_smpi_testing_in(rank);
 
     *flag = simgrid::smpi::Request::test(request,status);
 
@@ -613,29 +561,24 @@ int PMPI_Wait(MPI_Request * request, MPI_Status * status)
   } else if (*request == MPI_REQUEST_NULL) {
     retval = MPI_SUCCESS;
   } else {
-
-    int rank = (request!=nullptr && (*request)->comm() != MPI_COMM_NULL) ? smpi_process()->index() : -1;
+    int rank = (*request)->comm() != MPI_COMM_NULL ? smpi_process()->index() : -1;
 
     int src_traced = (*request)->src();
     int dst_traced = (*request)->dst();
     int tag_traced= (*request)->tag();
     MPI_Comm comm = (*request)->comm();
     int is_wait_for_receive = ((*request)->flags() & RECV);
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type = TRACING_WAIT;
-    TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__, extra);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("wait"));
 
     simgrid::smpi::Request::wait(request, status);
     retval = MPI_SUCCESS;
 
     //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
-    TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
     if (is_wait_for_receive) {
       if(src_traced==MPI_ANY_SOURCE)
-        src_traced = (status!=MPI_STATUS_IGNORE) ?
-          comm->group()->rank(status->MPI_SOURCE) :
-          src_traced;
-      TRACE_smpi_recv(rank, src_traced, dst_traced, tag_traced);
+        src_traced = (status != MPI_STATUS_IGNORE) ? comm->group()->rank(status->MPI_SOURCE) : src_traced;
+      TRACE_smpi_recv(src_traced, dst_traced, tag_traced);
     }
   }
 
@@ -648,19 +591,20 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
   if (index == nullptr)
     return MPI_ERR_ARG;
 
+  if (count <= 0)
+    return MPI_SUCCESS;
+
   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=nullptr;
-  if(count>0){
-    savedvals = xbt_new0(savedvalstype, count);
-  }
+  };
+  savedvalstype* savedvals = xbt_new0(savedvalstype, count);
+
   for (int i = 0; i < count; i++) {
     MPI_Request req = requests[i];      //already received requests are no longer valid
     if (req) {
@@ -668,10 +612,7 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
     }
   }
   int rank_traced = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_WAITANY;
-  extra->send_size=count;
-  TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank_traced, __FUNCTION__, new simgrid::instr::CpuTIData("waitAny", static_cast<double>(count)));
 
   *index = simgrid::smpi::Request::waitany(count, requests, status);
 
@@ -682,12 +623,11 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
     int is_wait_for_receive = savedvals[*index].recv;
     if (is_wait_for_receive) {
       if(savedvals[*index].src==MPI_ANY_SOURCE)
-        src_traced = (status != MPI_STATUSES_IGNORE)
-                         ? savedvals[*index].comm->group()->rank(status->MPI_SOURCE)
-                         : savedvals[*index].src;
-      TRACE_smpi_recv(rank_traced, src_traced, dst_traced, savedvals[*index].tag);
+        src_traced = (status != MPI_STATUSES_IGNORE) ? savedvals[*index].comm->group()->rank(status->MPI_SOURCE)
+                                                     : savedvals[*index].src;
+      TRACE_smpi_recv(src_traced, dst_traced, savedvals[*index].tag);
     }
-    TRACE_smpi_ptp_out(rank_traced, src_traced, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank_traced);
   }
   xbt_free(savedvals);
 
@@ -699,14 +639,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++) {
@@ -718,28 +658,25 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
     }
   }
   int rank_traced = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_WAITALL;
-  extra->send_size=count;
-  TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank_traced, __FUNCTION__, new simgrid::instr::CpuTIData("waitAll", static_cast<double>(count)));
 
   int retval = simgrid::smpi::Request::waitall(count, requests, status);
 
   for (int i = 0; i < count; i++) {
     if(savedvals[i].valid){
-    //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
+      // the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
       int src_traced = savedvals[i].src;
       int dst_traced = savedvals[i].dst;
       int is_wait_for_receive = savedvals[i].recv;
       if (is_wait_for_receive) {
         if(src_traced==MPI_ANY_SOURCE)
-        src_traced = (status!=MPI_STATUSES_IGNORE) ?
-                          savedvals[i].comm->group()->rank(status[i].MPI_SOURCE) : savedvals[i].src;
-        TRACE_smpi_recv(rank_traced, src_traced, dst_traced,savedvals[i].tag);
+          src_traced = (status != MPI_STATUSES_IGNORE) ? savedvals[i].comm->group()->rank(status[i].MPI_SOURCE)
+                                                       : savedvals[i].src;
+        TRACE_smpi_recv(src_traced, dst_traced,savedvals[i].tag);
       }
     }
   }
-  TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank_traced);
   xbt_free(savedvals);
 
   smpi_bench_begin();
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..69b7eaa 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);
@@ -338,7 +338,7 @@ int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int out
     return MPI_ERR_TYPE;
   if(comm==MPI_COMM_NULL)
     return MPI_ERR_COMM;
-  return type->pack(inbuf, incount, outbuf,outcount,position, comm);
+  return type->pack(inbuf == MPI_BOTTOM ? nullptr : inbuf, incount, outbuf, outcount, position, comm);
 }
 
 int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
index aa82058..71d64a1 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"
@@ -77,7 +77,8 @@ int PMPI_Win_attach(MPI_Win win, void *base, MPI_Aint size){
   return retval;
 }
 
-int PMPI_Win_detach(MPI_Win win,  void *base){
+int PMPI_Win_detach(MPI_Win win, void* base)
+{
   int retval = 0;
   smpi_bench_end();
   if(win == MPI_WIN_NULL){
@@ -166,9 +167,9 @@ int PMPI_Win_fence( int assert,  MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
   int rank = smpi_process()->index();
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, nullptr);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_fence"));
   retval = win->fence(assert);
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -190,19 +191,21 @@ int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
   } else if ((origin_count < 0 || target_count < 0) ||
              (origin_addr==nullptr && origin_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
+  } else if (((origin_datatype == MPI_DATATYPE_NULL) || (target_datatype == MPI_DATATYPE_NULL)) ||
+            ((not origin_datatype->is_valid()) || (not target_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else {
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
-    int src_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Get", target_rank,
+                                                       origin_datatype->is_basic() ? origin_count : origin_count * origin_datatype->size(),
+                                                       encode_datatype(origin_datatype)));
 
     retval = win->get( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                            target_datatype);
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -225,7 +228,8 @@ int PMPI_Rget( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
   } else if ((origin_count < 0 || target_count < 0) ||
              (origin_addr==nullptr && origin_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
+  } else if (((origin_datatype == MPI_DATATYPE_NULL) || (target_datatype == MPI_DATATYPE_NULL)) ||
+            ((not origin_datatype->is_valid()) || (not target_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else if(request == nullptr){
     retval = MPI_ERR_REQUEST;
@@ -233,13 +237,14 @@ int PMPI_Rget( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
-    int src_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Rget", target_rank,
+                                                       origin_datatype->is_basic() ? origin_count : origin_count * origin_datatype->size(),
+                                                       encode_datatype(origin_datatype)));
 
     retval = win->get( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                            target_datatype, request);
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -261,20 +266,23 @@ int PMPI_Put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
   } else if ((origin_count < 0 || target_count < 0) ||
             (origin_addr==nullptr && origin_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
+  } else if (((origin_datatype == MPI_DATATYPE_NULL) || (target_datatype == MPI_DATATYPE_NULL)) ||
+            ((not origin_datatype->is_valid()) || (not target_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else {
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
     int dst_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Put", dst_traced,
+                                                       origin_datatype->is_basic() ? origin_count : origin_count * origin_datatype->size(),
+                                                       encode_datatype(origin_datatype)));
     TRACE_smpi_send(rank, rank, dst_traced, SMPI_RMA_TAG, origin_count*origin_datatype->size());
 
     retval = win->put( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                            target_datatype);
 
-    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -297,7 +305,8 @@ int PMPI_Rput( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
   } else if ((origin_count < 0 || target_count < 0) ||
             (origin_addr==nullptr && origin_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
+  } else if (((origin_datatype == MPI_DATATYPE_NULL) || (target_datatype == MPI_DATATYPE_NULL)) ||
+            ((not origin_datatype->is_valid()) || (not target_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else if(request == nullptr){
     retval = MPI_ERR_REQUEST;
@@ -306,13 +315,15 @@ int PMPI_Rput( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
     MPI_Group group;
     win->get_group(&group);
     int dst_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Rput", dst_traced,
+                                                       origin_datatype->is_basic() ? origin_count : origin_count * origin_datatype->size(),
+                                                       encode_datatype(origin_datatype)));
     TRACE_smpi_send(rank, rank, dst_traced, SMPI_RMA_TAG, origin_count*origin_datatype->size());
 
     retval = win->put( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                            target_datatype, request);
 
-    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -334,7 +345,8 @@ int PMPI_Accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
   } else if ((origin_count < 0 || target_count < 0) ||
              (origin_addr==nullptr && origin_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
+  } else if (((origin_datatype == MPI_DATATYPE_NULL) || (target_datatype == MPI_DATATYPE_NULL)) ||
+            ((not origin_datatype->is_valid()) || (not target_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
@@ -342,13 +354,13 @@ int PMPI_Accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
-    int src_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
-
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Accumulate", target_rank,
+                                                       origin_datatype->is_basic() ? origin_count : origin_count * origin_datatype->size(),
+                                                       encode_datatype(origin_datatype)));
     retval = win->accumulate( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                                   target_datatype, op);
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -371,7 +383,8 @@ int PMPI_Raccumulate( void *origin_addr, int origin_count, MPI_Datatype origin_d
   } else if ((origin_count < 0 || target_count < 0) ||
              (origin_addr==nullptr && origin_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
+  } else if (((origin_datatype == MPI_DATATYPE_NULL) || (target_datatype == MPI_DATATYPE_NULL)) ||
+            ((not origin_datatype->is_valid()) || (not target_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
@@ -381,13 +394,14 @@ int PMPI_Raccumulate( void *origin_addr, int origin_count, MPI_Datatype origin_d
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
-    int src_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Raccumulate", target_rank,
+                                                       origin_datatype->is_basic() ? origin_count : origin_count * origin_datatype->size(),
+                                                       encode_datatype(origin_datatype)));
 
     retval = win->accumulate( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                                   target_datatype, op, request);
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -411,8 +425,8 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){
              (origin_addr==nullptr && origin_count > 0 && op != MPI_NO_OP) ||
              (result_addr==nullptr && result_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((origin_datatype != MPI_DATATYPE_NULL && not origin_datatype->is_valid()) ||
-             (not target_datatype->is_valid()) || (not result_datatype->is_valid())) {
+  } else if (((target_datatype == MPI_DATATYPE_NULL) || (result_datatype == MPI_DATATYPE_NULL)) ||
+            (((origin_datatype != MPI_DATATYPE_NULL) && (not origin_datatype->is_valid())) || (not target_datatype->is_valid()) || (not result_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
@@ -420,14 +434,15 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
-    int src_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Get_accumulate", target_rank,
+                                                       target_datatype->is_basic() ? target_count : target_count * target_datatype->size(),
+                                                       encode_datatype(target_datatype)));
 
     retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
                                   result_count, result_datatype, target_rank, target_disp,
                                   target_count, target_datatype, op);
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -453,8 +468,8 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request){
              (origin_addr==nullptr && origin_count > 0 && op != MPI_NO_OP) ||
              (result_addr==nullptr && result_count > 0)){
     retval = MPI_ERR_COUNT;
-  } else if ((origin_datatype != MPI_DATATYPE_NULL && not origin_datatype->is_valid()) ||
-             (not target_datatype->is_valid()) || (not result_datatype->is_valid())) {
+  } else if (((target_datatype == MPI_DATATYPE_NULL) || (result_datatype == MPI_DATATYPE_NULL)) ||
+            (((origin_datatype != MPI_DATATYPE_NULL) && (not origin_datatype->is_valid())) || (not target_datatype->is_valid()) || (not result_datatype->is_valid()))) {
     retval = MPI_ERR_TYPE;
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
@@ -464,14 +479,15 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request){
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
-    int src_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Rget_accumulate", target_rank,
+                                                       target_datatype->is_basic() ? target_count : target_count * target_datatype->size(),
+                                                       encode_datatype(target_datatype)));
 
     retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
                                   result_count, result_datatype, target_rank, target_disp,
                                   target_count, target_datatype, op, request);
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -481,9 +497,9 @@ int PMPI_Fetch_and_op(void *origin_addr, void *result_addr, MPI_Datatype dtype,
   return PMPI_Get_accumulate(origin_addr, origin_addr==nullptr?0:1, dtype, result_addr, 1, dtype, target_rank, target_disp, 1, dtype, op, win);
 }
 
-int PMPI_Compare_and_swap(void *origin_addr, void *compare_addr,
-        void *result_addr, MPI_Datatype datatype, int target_rank,
-        MPI_Aint target_disp, MPI_Win win){
+int PMPI_Compare_and_swap(void* origin_addr, void* compare_addr, void* result_addr, MPI_Datatype datatype,
+                          int target_rank, MPI_Aint target_disp, MPI_Win win)
+{
   int retval = 0;
   smpi_bench_end();
   if (win == MPI_WIN_NULL) {
@@ -497,19 +513,19 @@ int PMPI_Compare_and_swap(void *origin_addr, void *compare_addr,
     retval = MPI_ERR_ARG;
   } else if (origin_addr==nullptr || result_addr==nullptr || compare_addr==nullptr){
     retval = MPI_ERR_COUNT;
-  } else if (not datatype->is_valid()) {
+  } else if ((datatype == MPI_DATATYPE_NULL) || (not datatype->is_valid())) {
     retval = MPI_ERR_TYPE;
   } else {
     int rank = smpi_process()->index();
     MPI_Group group;
     win->get_group(&group);
-    int src_traced = group->index(target_rank);
-    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Compare_and_swap", target_rank,
+                                                       datatype->is_basic() ? 1 : datatype->size(),
+                                                       encode_datatype(datatype)));
 
-    retval = win->compare_and_swap( origin_addr, compare_addr, result_addr, datatype,
-                                  target_rank, target_disp);
+    retval = win->compare_and_swap(origin_addr, compare_addr, result_addr, datatype, target_rank, target_disp);
 
-    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -524,9 +540,9 @@ int PMPI_Win_post(MPI_Group group, int assert, MPI_Win win){
     retval = MPI_ERR_GROUP;
   } else {
     int rank = smpi_process()->index();
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_post"));
     retval = win->post(group,assert);
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -541,9 +557,9 @@ int PMPI_Win_start(MPI_Group group, int assert, MPI_Win win){
     retval = MPI_ERR_GROUP;
   } else {
     int rank = smpi_process()->index();
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_start"));
     retval = win->start(group,assert);
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -556,11 +572,11 @@ int PMPI_Win_complete(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int rank = smpi_process()->index();
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_complete"));
 
     retval = win->complete();
 
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -573,11 +589,11 @@ int PMPI_Win_wait(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int rank = smpi_process()->index();
-    TRACE_smpi_collective_in(rank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_wait"));
 
     retval = win->wait();
 
-    TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(rank);
   }
   smpi_bench_begin();
   return retval;
@@ -595,9 +611,9 @@ int PMPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win){
     retval = MPI_SUCCESS;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __func__, new simgrid::instr::NoOpTIData("Win_lock"));
     retval = win->lock(lock_type,rank,assert);
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
@@ -612,9 +628,9 @@ int PMPI_Win_unlock(int rank, MPI_Win win){
     retval = MPI_SUCCESS;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_unlock"));
     retval = win->unlock(rank);
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
@@ -627,9 +643,9 @@ int PMPI_Win_lock_all(int assert, MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_lock_all"));
     retval = win->lock_all(assert);
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
@@ -642,9 +658,9 @@ int PMPI_Win_unlock_all(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_unlock_all"));
     retval = win->unlock_all();
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
@@ -659,9 +675,9 @@ int PMPI_Win_flush(int rank, MPI_Win win){
     retval = MPI_SUCCESS;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush"));
     retval = win->flush(rank);
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
@@ -676,9 +692,9 @@ int PMPI_Win_flush_local(int rank, MPI_Win win){
     retval = MPI_SUCCESS;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush_local"));
     retval = win->flush_local(rank);
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
@@ -691,9 +707,9 @@ int PMPI_Win_flush_all(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush_all"));
     retval = win->flush_all();
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
@@ -706,9 +722,9 @@ int PMPI_Win_flush_local_all(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int myrank = smpi_process()->index();
-    TRACE_smpi_collective_in(myrank, -1, __FUNCTION__, nullptr);
+    TRACE_smpi_comm_in(myrank, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush_local_all"));
     retval = win->flush_local_all();
-    TRACE_smpi_collective_out(myrank, -1, __FUNCTION__);
+    TRACE_smpi_comm_out(myrank);
   }
   smpi_bench_begin();
   return retval;
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..9174ad8 100644 (file)
@@ -6,8 +6,9 @@
 /* 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"
+#include <algorithm>
 
 namespace simgrid{
 namespace smpi{
@@ -48,7 +49,7 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
 
   recvtype->extent(&recvtype_true_lb, &recvtype_true_extent);
 
-  tmp_buf_rl= (void*)smpi_get_tmp_sendbuffer(total_count*(MAX(recvtype_true_extent,recvtype_extent)));
+  tmp_buf_rl = (void*)smpi_get_tmp_sendbuffer(total_count * std::max(recvtype_true_extent, recvtype_extent));
 
   /* adjust for potential negative lower bound in datatype */
   tmp_buf = (void *)((char*)tmp_buf_rl - recvtype_true_lb);
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 3874163..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;
@@ -98,8 +96,7 @@ int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount,
    unsigned int size = comm->size();
    unsigned int rank = comm->rank();
 
-   XBT_DEBUG(
-                "coll:tuned:allgather_ompi_bruck rank %d", rank);
+   XBT_DEBUG("coll:tuned:allgather_ompi_bruck rank %u", rank);
 
    sdtype->extent(&slb, &sext);
 
@@ -127,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) {
 
@@ -171,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..32b2548 100644 (file)
@@ -21,7 +21,9 @@
  *
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
+#include <algorithm>
+
 namespace simgrid{
 namespace smpi{
 int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
@@ -53,7 +55,7 @@ int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
     datatype->extent(&true_lb, &true_extent);
     extent = datatype->get_extent();
 
-    tmp_buf_free= smpi_get_tmp_recvbuffer(count * (MAX(extent, true_extent)));
+    tmp_buf_free = smpi_get_tmp_recvbuffer(count * std::max(extent, true_extent));
 
     /* adjust for potential negative lower bound in datatype */
     tmp_buf = (void *) ((char *) tmp_buf_free - true_lb);
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 062d5cb..9a1def0 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 <math.h>
+#include "../colls_private.hpp"
+#include <cmath>
 
 /*****************************************************************************
 
index bb8ca3d..e8c5347 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 <math.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 e2a0958..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{
 
@@ -98,7 +98,7 @@ Coll_bcast_ompi_split_bintree::bcast ( void* buffer,
     else
       segsize = 1024 << 3;
 
-    XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5d", rank, root, segsize);
+    XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5u", rank, root, segsize);
 
     if (size == 1) {
         return MPI_SUCCESS;
@@ -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 aa797a9..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.
  */
@@ -52,7 +52,10 @@ static int calculate_num_nodes_up_to_level( int fanout, int level )
 {
     /* just use geometric progression formula for sum:
        a^0+a^1+...a^(n-1) = (a^n-1)/(a-1) */
-    return ((pown(fanout,level) - 1)/(fanout - 1));
+  if(fanout > 1)  
+   return ((pown(fanout,level) - 1)/(fanout - 1));
+  else
+   return 0; // is this right ?
 }
 
 /*
@@ -98,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;
@@ -198,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;
@@ -301,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;
@@ -342,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;
@@ -421,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;
@@ -491,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..2ebd387 100644 (file)
  *      See COPYRIGHT in top-level directory.
  */
 
-#include "../colls_private.h"
-
-
-
-
+#include "../colls_private.hpp"
+#include <algorithm>
 
 #define MPIR_Gather_MV2_Direct Coll_gather_ompi_basic_linear::gather
 #define MPIR_Gather_MV2_two_level_Direct Coll_gather_ompi_basic_linear::gather
@@ -227,12 +224,9 @@ int Coll_gather_mvapich2_two_level::gather(void *sendbuf,
         if (local_rank == 0) {
             /* Node leader, allocate tmp_buffer */
             if (rank == root) {
-                tmp_buf = smpi_get_tmp_recvbuffer(recvcnt * MAX(recvtype_extent,
-                            recvtype_true_extent) * local_size);
+              tmp_buf = smpi_get_tmp_recvbuffer(recvcnt * std::max(recvtype_extent, recvtype_true_extent) * local_size);
             } else {
-                tmp_buf = smpi_get_tmp_sendbuffer(sendcnt * MAX(sendtype_extent,
-                            sendtype_true_extent) *
-                        local_size);
+              tmp_buf = smpi_get_tmp_sendbuffer(sendcnt * std::max(sendtype_extent, sendtype_true_extent) * local_size);
             }
             if (tmp_buf == NULL) {
                 mpi_errno = MPI_ERR_OTHER;
@@ -295,10 +289,10 @@ int Coll_gather_mvapich2_two_level::gather(void *sendbuf,
            * is the same as leader_root */
           if (rank == root) {
             leader_gather_buf =
-                smpi_get_tmp_recvbuffer(recvcnt * MAX(recvtype_extent, recvtype_true_extent) * comm_size);
+                smpi_get_tmp_recvbuffer(recvcnt * std::max(recvtype_extent, recvtype_true_extent) * comm_size);
           } else {
             leader_gather_buf =
-                smpi_get_tmp_sendbuffer(sendcnt * MAX(sendtype_extent, sendtype_true_extent) * comm_size);
+                smpi_get_tmp_sendbuffer(sendcnt * std::max(sendtype_extent, sendtype_true_extent) * comm_size);
           }
           if (leader_gather_buf == NULL) {
             mpi_errno = MPI_ERR_OTHER;
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..07abde4 100644 (file)
@@ -4,7 +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 "../colls_private.hpp"
+#include <algorithm>
 
 //#include <star-reduction.c>
 namespace simgrid{
@@ -47,7 +48,7 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count,
   /* If I'm not the root, then my recvbuf may not be valid, therefore
      I have to allocate a temporary one */
   if (rank != root) {
-      recvbuf = (void *) smpi_get_tmp_recvbuffer(count*(MAX(extent,true_extent)));
+      recvbuf = (void*)smpi_get_tmp_recvbuffer(count * std::max(extent, true_extent));
       recvbuf = (void *)((char*)recvbuf - true_lb);
   }
    if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
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..90619c2 100644 (file)
@@ -38,7 +38,9 @@
  *
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
+#include <algorithm>
+
 extern int mv2_reduce_intra_knomial_factor;
 extern int mv2_reduce_inter_knomial_factor;
 
@@ -150,7 +152,7 @@ int Coll_reduce_mvapich2_knomial::reduce (
     is_commutative =  (op==MPI_OP_NULL || op->is_commutative());
 
     if (rank != root) {
-        recvbuf=(void *)smpi_get_tmp_recvbuffer(count*(MAX(extent,true_extent)));
+        recvbuf = (void*)smpi_get_tmp_recvbuffer(count * std::max(extent, true_extent));
         recvbuf = (void *)((char*)recvbuf - true_lb);
     }
 
@@ -177,7 +179,7 @@ int Coll_reduce_mvapich2_knomial::reduce (
         tmp_buf  = static_cast<void**>(xbt_malloc(sizeof(void *)*expected_recv_count));
         requests = static_cast<MPI_Request*>(xbt_malloc(sizeof(MPI_Request)*expected_recv_count));
         for(k=0; k < expected_recv_count; k++ ) {
-            tmp_buf[k] = smpi_get_tmp_sendbuffer(count*(MAX(extent,true_extent)));
+            tmp_buf[k] = smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
             tmp_buf[k] = (void *)((char*)tmp_buf[k] - true_lb);
         }
 
index 6d031e0..7a14eb4 100644 (file)
@@ -35,7 +35,9 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
+#include <algorithm>
+
 #define MV2_INTRA_SHMEM_REDUCE_MSG 2048
 
 #define mv2_g_shmem_coll_max_msg_size (1 << 17)
@@ -117,15 +119,14 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
     datatype->extent(&true_lb,
                                        &true_extent);
     extent =datatype->get_extent();
-    stride = count * MAX(extent, true_extent);
+    stride = count * std::max(extent, true_extent);
 
     if (local_size == total_size) {
         /* First handle the case where there is only one node */
         if (stride <= MV2_INTRA_SHMEM_REDUCE_MSG &&
             is_commutative == 1) {
             if (local_rank == 0 ) {
-                tmp_buf=(void *)smpi_get_tmp_sendbuffer( count *
-                                    (MAX(extent, true_extent)));
+                tmp_buf = (void*)smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
                 tmp_buf = (void *) ((char *) tmp_buf - true_lb);
             }
 
@@ -150,7 +151,7 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
                 out_buf = NULL;
             }
 
-            if (count * (MAX(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE) {
+            if (count * (std::max(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE) {
               mpi_errno = MPIR_Reduce_shmem_MV2(in_buf, out_buf, count, datatype, op, 0, shmem_comm);
             } else {
               mpi_errno = MPIR_Reduce_intra_knomial_wrapper_MV2(in_buf, out_buf, count, datatype, op, 0, shmem_comm);
@@ -189,8 +190,7 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
         }
         leader_comm_size = leader_comm->size();
         leader_comm_rank = leader_comm->rank();
-        tmp_buf=(void *)smpi_get_tmp_sendbuffer(count *
-                            (MAX(extent, true_extent)));
+        tmp_buf          = (void*)smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
         tmp_buf = (void *) ((char *) tmp_buf - true_lb);
     }
     if (sendbuf != MPI_IN_PLACE) {
@@ -214,7 +214,7 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
          *this step*/
         if (MV2_Reduce_intra_function == & MPIR_Reduce_shmem_MV2)
         {
-          if (is_commutative == 1 && (count * (MAX(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE)) {
+          if (is_commutative == 1 && (count * (std::max(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE)) {
             mpi_errno = MV2_Reduce_intra_function(in_buf, out_buf, count, datatype, op, intra_node_root, shmem_comm);
             } else {
                     mpi_errno = MPIR_Reduce_intra_knomial_wrapper_MV2(in_buf, out_buf, count,
index 25d1cb8..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{
@@ -68,7 +68,9 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
         sendtmpbuf = (char *)recvbuf;
     }
 
-    XBT_DEBUG( "coll:tuned:reduce_generic count %d, msg size %ld, segsize %ld, max_requests %d", original_count, (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment, max_outstanding_reqs);
+    XBT_DEBUG("coll:tuned:reduce_generic count %d, msg size %lu, segsize %lu, max_requests %d", original_count,
+              (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment,
+              max_outstanding_reqs);
 
     rank = comm->rank();
 
@@ -259,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 */
@@ -301,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 */
@@ -335,7 +334,7 @@ int Coll_reduce_ompi_chain::reduce( void *sendbuf, void *recvbuf, int count,
     size_t typelng;
     int fanout = comm->size()/2;
 
-    XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5d", comm->rank(), fanout, segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5u", comm->rank(), fanout, segsize);
 
     /**
      * Determine number of segments and number of elements
@@ -386,8 +385,7 @@ int Coll_reduce_ompi_pipeline::reduce( void *sendbuf, void *recvbuf,
         segsize = 64*1024;
     }
 
-    XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5d",
-                 comm->rank(), segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5u", comm->rank(), segsize);
 
     COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
 
@@ -417,8 +415,7 @@ int Coll_reduce_ompi_binary::reduce( void *sendbuf, void *recvbuf,
         // Binary_32K
     segsize = 32*1024;
 
-    XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5d",
-                 comm->rank(), segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5u", comm->rank(), segsize);
 
     COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
 
@@ -459,8 +456,7 @@ int Coll_reduce_ompi_binomial::reduce( void *sendbuf, void *recvbuf,
         segsize = 1024;
     }
 
-    XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5d",
-                 comm->rank(), segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5u", comm->rank(), segsize);
     COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
 
     return smpi_coll_tuned_ompi_reduce_generic( sendbuf, recvbuf, count, datatype,
@@ -491,8 +487,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
 
     rank = comm->rank();
     size = comm->size();
-    XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5d",
-                 rank, segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5u", rank, segsize);
 
     /**
      * Determine number of segments and number of elements
index ac19cd5..5b2f4b2 100644 (file)
@@ -9,9 +9,9 @@
  * but this header must not be removed.
  */
 
-#include "../colls_private.h"
-#include <stdio.h>
-#include <stdlib.h>
+#include "../colls_private.hpp"
+#include <cstdio>
+#include <cstdlib>
 
 #define REDUCE_NEW_ALWAYS 1
 
@@ -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..8061733 100644 (file)
@@ -4,7 +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 "../colls_private.hpp"
+#include <algorithm>
 
 static inline int MPIU_Mirror_permutation(unsigned int x, int bits)
 {
@@ -64,7 +65,7 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf,
         }
 
         /* allocate temporary buffer to store incoming data */
-        tmp_recvbuf = (void*)smpi_get_tmp_recvbuffer(recvcounts[rank]*(MAX(true_extent,extent))+1);
+        tmp_recvbuf = (void*)smpi_get_tmp_recvbuffer(recvcounts[rank] * std::max(true_extent, extent) + 1);
         /* adjust for potential negative lower bound in datatype */
         tmp_recvbuf = (void *)((char*)tmp_recvbuf - true_lb);
 
@@ -295,13 +296,13 @@ int Coll_reduce_scatter_mpich_rdb::reduce_scatter(void *sendbuf, void *recvbuf,
             /* noncommutative and (non-pof2 or block irregular), use recursive doubling. */
 
             /* need to allocate temporary buffer to receive incoming data*/
-            tmp_recvbuf= (void *) smpi_get_tmp_recvbuffer( total_count*(MAX(true_extent,extent)));
+            tmp_recvbuf= (void*)smpi_get_tmp_recvbuffer(total_count * std::max(true_extent, extent));
             /* adjust for potential negative lower bound in datatype */
             tmp_recvbuf = (void *)((char*)tmp_recvbuf - true_lb);
 
             /* need to allocate another temporary buffer to accumulate
                results */
-            tmp_results = (void *)smpi_get_tmp_sendbuffer( total_count*(MAX(true_extent,extent)));
+            tmp_results = (void*)smpi_get_tmp_sendbuffer(total_count * std::max(true_extent, extent));
             /* adjust for potential negative lower bound in datatype */
             tmp_results = (void *)((char*)tmp_results - true_lb);
 
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 b69b56c..9710f2e 100644 (file)
@@ -4,26 +4,21 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <float.h>
-
+#include <cfloat>
 #include <exception>
 
-#include "colls_private.h"
+#include "colls_private.hpp"
 #include "smpi_process.hpp"
 
-
 //attempt to do a quick autotuning version of the collective,
-
 #define TRACE_AUTO_COLL(cat)                                                                                           \
   if (TRACE_is_enabled()) {                                                                                            \
-    type_t type = PJ_type_get_or_null(#cat, PJ_type_get_root());                                                       \
-    if (not type) {                                                                                                    \
-      type = PJ_type_event_new(#cat, PJ_type_get_root());                                                              \
-    }                                                                                                                  \
-    char cont_name[25];                                                                                                \
-    snprintf(cont_name, 25, "rank-%d", smpi_process()->index());                                                       \
-    val_t value = PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type);               \
-    new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, value);                                         \
+    simgrid::instr::EventType* type = simgrid::instr::Container::getRoot()->type_->getOrCreateEventType(#cat);         \
+                                                                                                                       \
+    std::string cont_name = std::string("rank-" + std::to_string(smpi_process()->index()));                            \
+    type->addEntityValue(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0");                                  \
+    new simgrid::instr::NewEvent(SIMIX_get_clock(), simgrid::instr::Container::byName(cont_name), type,                \
+                                 type->getEntityValue(Colls::mpi_coll_##cat##_description[i].name));                   \
   }
 
 #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)                                                                    \
index a0760fe..3606038 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"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI (coll)");
 
-#define COLL_SETTER(cat, ret, args, args2)\
-int (*Colls::cat ) args;\
-void Colls::set_##cat (const char * name){\
-    int id = find_coll_description(mpi_coll_## cat ##_description,\
-                                             name,#cat);\
-    cat = reinterpret_cast<ret (*) args>\
-        (mpi_coll_## cat ##_description[id].coll);\
-    if (cat == nullptr)\
-      xbt_die("Collective "#cat" set to nullptr!");\
-}
+#define COLL_SETTER(cat, ret, args, args2)                                                                             \
+  int(*Colls::cat) args;                                                                                               \
+  void Colls::set_##cat(std::string name)                                                                              \
+  {                                                                                                                    \
+    int id = find_coll_description(mpi_coll_##cat##_description, name, #cat);                                          \
+    cat    = reinterpret_cast<ret(*) args>(mpi_coll_##cat##_description[id].coll);                                     \
+    if (cat == nullptr)                                                                                                \
+      xbt_die("Collective " #cat " set to nullptr!");                                                                  \
+  }
 
-#define SET_COLL(coll)\
-    name = xbt_cfg_get_string("smpi/"#coll);\
-    if (name==nullptr || name[0] == '\0')\
-        name = selector_name;\
-    set_##coll(name);
+#define SET_COLL(coll)                                                                                                 \
+  name = xbt_cfg_get_string("smpi/" #coll);                                                                            \
+  if (name.empty())                                                                                                    \
+    name = selector_name;                                                                                              \
+  set_##coll(name);
 
 namespace simgrid{
 namespace smpi{
@@ -68,30 +67,25 @@ void Colls::coll_help(const char *category, s_mpi_coll_description_t * table)
     XBT_WARN("  %s: %s\n", table[i].name, table[i].description);
 }
 
-int Colls::find_coll_description(s_mpi_coll_description_t * table, const char *name, const char *desc)
+int Colls::find_coll_description(s_mpi_coll_description_t* table, std::string name, const char* desc)
 {
-  char *name_list = nullptr;
   for (int i = 0; table[i].name; i++)
-    if (not strcmp(name, table[i].name)) {
+    if (name == table[i].name) {
       if (strcmp(table[i].name,"default"))
         XBT_INFO("Switch to algorithm %s for collective %s",table[i].name,desc);
       return i;
     }
 
   if (not table[0].name)
-    xbt_die("No collective is valid for '%s'! This is a bug.",name);
-  name_list = xbt_strdup(table[0].name);
-  for (int i = 1; table[i].name; i++) {
-    name_list = static_cast<char*>(xbt_realloc(name_list, strlen(name_list) + strlen(table[i].name) + 3));
-    strncat(name_list, ", ",2);
-    strncat(name_list, table[i].name, strlen(table[i].name));
-  }
-  xbt_die("Collective '%s' is invalid! Valid collectives are: %s.", name, name_list);
+    xbt_die("No collective is valid for '%s'! This is a bug.", name.c_str());
+  std::string name_list = std::string(table[0].name);
+  for (int i = 1; table[i].name; i++)
+    name_list = name_list + ", " + table[i].name;
+
+  xbt_die("Collective '%s' is invalid! Valid collectives are: %s.", name.c_str(), name_list.c_str());
   return -1;
 }
 
-
-
 COLL_APPLY(COLL_SETTER,COLL_GATHER_SIG,"");
 COLL_APPLY(COLL_SETTER,COLL_ALLGATHER_SIG,"");
 COLL_APPLY(COLL_SETTER,COLL_ALLGATHERV_SIG,"");
@@ -106,23 +100,23 @@ COLL_APPLY(COLL_SETTER,COLL_ALLTOALLV_SIG,"");
 
 
 void Colls::set_collectives(){
-    const char* selector_name = static_cast<char*>(xbt_cfg_get_string("smpi/coll-selector"));
-    if (selector_name==nullptr || selector_name[0] == '\0')
-        selector_name = "default";
-
-    const char* name;
-
-    SET_COLL(gather);
-    SET_COLL(allgather);
-    SET_COLL(allgatherv);
-    SET_COLL(allreduce);
-    SET_COLL(alltoall);
-    SET_COLL(alltoallv);
-    SET_COLL(reduce);
-    SET_COLL(reduce_scatter);
-    SET_COLL(scatter);
-    SET_COLL(bcast);
-    SET_COLL(barrier);
+  std::string selector_name = xbt_cfg_get_string("smpi/coll-selector");
+  if (selector_name.empty())
+    selector_name = "default";
+
+  std::string name;
+
+  SET_COLL(gather);
+  SET_COLL(allgather);
+  SET_COLL(allgatherv);
+  SET_COLL(allreduce);
+  SET_COLL(alltoall);
+  SET_COLL(alltoallv);
+  SET_COLL(reduce);
+  SET_COLL(reduce_scatter);
+  SET_COLL(scatter);
+  SET_COLL(bcast);
+  SET_COLL(barrier);
 }
 
 
index d3736cc..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{
@@ -213,6 +213,8 @@ int Coll_reduce_default::reduce(void *sendbuf, void *recvbuf, int count, MPI_Dat
 
   int rank = comm->rank();
   int size = comm->size();
+  if(size==0)
+    return MPI_ERR_COMM;
   //non commutative case, use a working algo from openmpi
   if (op != MPI_OP_NULL && not op->is_commutative()) {
     return Coll_reduce_ompi_basic_linear::reduce(sendtmpbuf, recvbuf, count, datatype, op, root, comm);
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 837584f..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{
@@ -64,7 +64,7 @@ int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount,
           ||nbytes > mv2_alltoall_thresholds_table[conf_index][range].in_place_algo_table[range_threshold].max
       ) {
           tmp_buf = (char *)smpi_get_tmp_sendbuffer( comm_size * recvcount * recvtype_size );
-          mpi_errno = Datatype::copy((char *)recvbuf,
+          Datatype::copy((char *)recvbuf,
               comm_size*recvcount, recvtype,
               (char *)tmp_buf,
               comm_size*recvcount, recvtype);
@@ -622,11 +622,9 @@ int Coll_bcast_mvapich2::bcast(void *buffer,
         {
             shmem_comm = comm->get_intra_comm();
             if (not is_contig || not is_homogeneous) {
-              mpi_errno = MPIR_Bcast_tune_inter_node_helper_MV2(tmp_buf, nbytes, MPI_BYTE, root, comm);
+              MPIR_Bcast_tune_inter_node_helper_MV2(tmp_buf, nbytes, MPI_BYTE, root, comm);
             } else {
-                mpi_errno =
-                    MPIR_Bcast_tune_inter_node_helper_MV2(buffer, count, datatype, root,
-                                                          comm);
+              MPIR_Bcast_tune_inter_node_helper_MV2(buffer, count, datatype, root, comm);
             }
 
             /* We are now done with the inter-node phase */
@@ -797,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();
@@ -847,7 +845,7 @@ int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, i
       while (pof2 < comm_size) pof2 <<= 1;
       if (pof2 == comm_size && is_block_regular) {
           /* noncommutative, pof2 size, and block regular */
-          mpi_errno = MPIR_Reduce_scatter_non_comm_MV2(sendbuf, recvbuf,
+          MPIR_Reduce_scatter_non_comm_MV2(sendbuf, recvbuf,
               recvcnts, datatype,
               op, comm);
       }
@@ -855,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;
 
 }
@@ -1000,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{
index a3667fe..024bb92 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef SMPI_HOST_HPP_
 #define SMPI_HOST_HPP_
 
-#include "src/include/smpi/smpi_utils.hpp"
+#include "smpi_utils.hpp"
 
 #include "simgrid/s4u/Host.hpp"
 #include <string>
 namespace simgrid {
 namespace smpi {
 
-void sg_smpi_host_init();
-static void onHostDestruction(simgrid::s4u::Host& host);
-static void onCreation(simgrid::s4u::Host& host);
-
 class SmpiHost {
 
   private:
diff --git a/src/smpi/include/private.h b/src/smpi/include/private.h
deleted file mode 100644 (file)
index 0b713be..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_start_data_exe; //start of the data+bss segment of the executable
-extern XBT_PRIVATE int smpi_size_data_exe; //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..26c3ea0 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 "include/xbt/config.hpp"
+#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_backup_global_memory_segment();
+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 int smpi_loaded_page;
+extern XBT_PRIVATE int smpi_universe_size;
+XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process();
+}
 
 /**
  * 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 +438,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..99a7377 100644 (file)
@@ -8,14 +8,15 @@
 #ifndef SMPI_COLL_HPP
 #define SMPI_COLL_HPP
 
+#include "private.hpp"
 #include "xbt/base.h"
 
 /** \brief MPI collective description */
 
-#define COLL_DEFS(cat, ret, args, args2)\
-    static void set_##cat(const char* name);\
-    static s_mpi_coll_description_t mpi_coll_##cat##_description[];\
-    static int (*cat ) args;
+#define COLL_DEFS(cat, ret, args, args2)                                                                               \
+  static void set_##cat(std::string name);                                                                             \
+  static s_mpi_coll_description_t mpi_coll_##cat##_description[];                                                      \
+  static int(*cat) args;
 
 #define COLL_SIG(cat, ret, args, args2)\
     static int cat args;
@@ -81,17 +82,16 @@ 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:
     static XBT_PUBLIC(void) coll_help(const char *category, s_mpi_coll_description_t * table);
-    static XBT_PUBLIC(int) find_coll_description(s_mpi_coll_description_t * table, const char *name, const char *desc);
+    static XBT_PUBLIC(int) find_coll_description(s_mpi_coll_description_t* table, std::string name, const char* desc);
     static void set_collectives();
 
     // for each collective type, create the set_* prototype, the description array and the function pointer
index ed621f1..86f00b2 100644 (file)
@@ -58,7 +58,7 @@ class Comm : public F2C, public Keyval{
     static void destroy(MPI_Comm comm);
     void init_smp();
 
-    int add_f();
+    int add_f() override;
     static void free_f(int id);
     static Comm* f2c(int);
 
index 3b1fd7d..2453f10 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{
 
 class Datatype : public F2C, public Keyval{
-  private:
-    char* name_;
-    size_t size_;
-    MPI_Aint lb_;
-    MPI_Aint ub_;
-    int flags_;
-    int refcount_;
-
-  public:
-    static std::unordered_map<int, smpi_key_elem> keyvals_;
-    static int keyval_id_;
-
-    Datatype(int size,MPI_Aint lb, MPI_Aint ub, int flags);
-    Datatype(char* name, int size,MPI_Aint lb, MPI_Aint ub, int flags);
-    Datatype(Datatype *datatype, int* ret);
-    virtual ~Datatype();
-
-    char* name();
-    size_t size();
-    MPI_Aint lb();
-    MPI_Aint ub();
-    int flags();
-    int refcount();
-
-    void ref();
-    static void unref(MPI_Datatype datatype);
-    void commit();
-    bool is_valid();
-    void addflag(int flag);
-    int extent(MPI_Aint * lb, MPI_Aint * extent);
-    MPI_Aint get_extent();
-    void get_name(char* name, int* length);
-    void set_name(char* name);
-    static int copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                    void *recvbuf, int recvcount, MPI_Datatype recvtype);
-    virtual void serialize( void* noncontiguous, void *contiguous,
-                            int count);
-    virtual void unserialize( void* contiguous, void *noncontiguous,
-                              int count, MPI_Op op);
-    static int keyval_create(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state);
-    static int keyval_free(int* keyval);
-    int pack(void* inbuf, int incount, void* outbuf, int outcount, int* position, MPI_Comm comm);
-    int unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Comm comm);
-
-
-    static int create_contiguous(int count, MPI_Datatype old_type, MPI_Aint lb, MPI_Datatype* new_type);
-    static int create_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* new_type);
-    static int create_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type);
-    static int create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type);
-    static int create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type);
-    static int create_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type);
-
-    static Datatype* f2c(int id);
+  char* name_;
+  size_t size_;
+  MPI_Aint lb_;
+  MPI_Aint ub_;
+  int flags_;
+  int refcount_;
+
+public:
+  static std::unordered_map<int, smpi_key_elem> keyvals_;
+  static int keyval_id_;
+
+  Datatype(int size, MPI_Aint lb, MPI_Aint ub, int flags);
+  Datatype(char* name, int size, MPI_Aint lb, MPI_Aint ub, int flags);
+  Datatype(Datatype* datatype, int* ret);
+  virtual ~Datatype();
+
+  char* name();
+  size_t size();
+  MPI_Aint lb();
+  MPI_Aint ub();
+  int flags();
+  int refcount();
+
+  void ref();
+  static void unref(MPI_Datatype datatype);
+  void commit();
+  bool is_valid();
+  bool is_basic();
+  void addflag(int flag);
+  int extent(MPI_Aint* lb, MPI_Aint* extent);
+  MPI_Aint get_extent();
+  void get_name(char* name, int* length);
+  void set_name(char* name);
+  static int copy(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                  MPI_Datatype recvtype);
+  virtual void serialize(void* noncontiguous, void* contiguous, int count);
+  virtual void unserialize(void* contiguous, void* noncontiguous, int count, MPI_Op op);
+  static int keyval_create(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval,
+                           void* extra_state);
+  static int keyval_free(int* keyval);
+  int pack(void* inbuf, int incount, void* outbuf, int outcount, int* position, MPI_Comm comm);
+  int unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Comm comm);
+
+  static int create_contiguous(int count, MPI_Datatype old_type, MPI_Aint lb, MPI_Datatype* new_type);
+  static int create_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* new_type);
+  static int create_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type);
+  static int create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type);
+  static int create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type,
+                             MPI_Datatype* new_type);
+  static int create_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types,
+                           MPI_Datatype* new_type);
+
+  static Datatype* f2c(int id);
 };
 
 }
index b450bd9..9e1f4c8 100644 (file)
@@ -13,91 +13,70 @@ namespace simgrid{
 namespace smpi{
 
 class Type_Contiguous: public Datatype {
-  private:
-    int block_count_;
-    MPI_Datatype old_type_;
-  public:
-    Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type);
-    ~Type_Contiguous();
-    void serialize( void* noncontiguous, void *contiguous,
-                            int count);
-    void unserialize( void* contiguous_vector, void *noncontiguous_vector,
-                              int count, MPI_Op op);
-};
+  int block_count_;
+  MPI_Datatype old_type_;
 
-class Type_Vector: public Datatype{
-  private:
-    int block_count_;
-    int block_length_;
-    int block_stride_;
-    MPI_Datatype old_type_;
-  public:
-    Type_Vector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride, MPI_Datatype old_type);
-    ~Type_Vector();
-    void serialize( void* noncontiguous, void *contiguous,
-                            int count);
-    void unserialize( void* contiguous_vector, void *noncontiguous_vector,
-                              int count, MPI_Op op);
+public:
+  Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type);
+  ~Type_Contiguous();
+  void serialize(void* noncontiguous, void* contiguous, int count);
+  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
 };
 
 class Type_Hvector: public Datatype{
-  private:
-    int block_count_;
-    int block_length_;
-    MPI_Aint block_stride_;
-    MPI_Datatype old_type_;
-  public:
-    Type_Hvector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int block_length, MPI_Aint block_stride, MPI_Datatype old_type);
-    ~Type_Hvector();
-    void serialize( void* noncontiguous, void *contiguous,
-                            int count);
-    void unserialize( void* contiguous_vector, void *noncontiguous_vector,
-                              int count, MPI_Op op);
+  int block_count_;
+  int block_length_;
+  MPI_Aint block_stride_;
+  MPI_Datatype old_type_;
+
+public:
+  Type_Hvector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int block_length, MPI_Aint block_stride,
+               MPI_Datatype old_type);
+  ~Type_Hvector();
+  void serialize(void* noncontiguous, void* contiguous, int count);
+  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
 };
 
-class Type_Indexed: public Datatype{
-  private:
-    int block_count_;
-    int* block_lengths_;
-    int* block_indices_;
-    MPI_Datatype old_type_;
-  public:
-    Type_Indexed(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, int* block_indices, MPI_Datatype old_type);
-    ~Type_Indexed();
-    void serialize( void* noncontiguous, void *contiguous,
-                            int count);
-    void unserialize( void* contiguous_vector, void *noncontiguous_vector,
-                              int count, MPI_Op op);
+class Type_Vector : public Type_Hvector {
+public:
+  Type_Vector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride,
+              MPI_Datatype old_type);
 };
 
 class Type_Hindexed: public Datatype{
-  private:
-    int block_count_;
-    int* block_lengths_;
-    MPI_Aint* block_indices_;
-    MPI_Datatype old_type_;
-  public:
-    Type_Hindexed(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, MPI_Aint* block_indices, MPI_Datatype old_type);
-    ~Type_Hindexed();
-    void serialize( void* noncontiguous, void *contiguous,
-                            int count);
-    void unserialize( void* contiguous_vector, void *noncontiguous_vector,
-                              int count, MPI_Op op);
+  int block_count_;
+  int* block_lengths_;
+  MPI_Aint* block_indices_;
+  MPI_Datatype old_type_;
+
+public:
+  Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths,
+                MPI_Aint* block_indices, MPI_Datatype old_type);
+  Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, int* block_indices,
+                MPI_Datatype old_type, MPI_Aint factor);
+  ~Type_Hindexed();
+  void serialize(void* noncontiguous, void* contiguous, int count);
+  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
+};
+
+class Type_Indexed : public Type_Hindexed {
+public:
+  Type_Indexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, int* block_indices,
+               MPI_Datatype old_type);
 };
 
 class Type_Struct: public Datatype{
-  private:
-    int block_count_;
-    int* block_lengths_;
-    MPI_Aint* block_indices_;
-    MPI_Datatype* old_types_;
-  public:
-    Type_Struct(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, MPI_Aint* block_indices, MPI_Datatype* old_types);
-    ~Type_Struct();
-    void serialize( void* noncontiguous, void *contiguous,
-                            int count);
-    void unserialize( void* contiguous_vector, void *noncontiguous_vector,
-                              int count, MPI_Op op);
+  int block_count_;
+  int* block_lengths_;
+  MPI_Aint* block_indices_;
+  MPI_Datatype* old_types_;
+
+public:
+  Type_Struct(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths,
+              MPI_Aint* block_indices, MPI_Datatype* old_types);
+  ~Type_Struct();
+  void serialize(void* noncontiguous, void* contiguous, int count);
+  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
 };
 
 
index 5b77cab..03d8908 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef SMPI_F2C_HPP_INCLUDED
 #define SMPI_F2C_HPP_INCLUDED
 
-#include "xbt/dict.h"
+#include <unordered_map>
 
 #define KEY_SIZE (sizeof(int) * 2 + 1)
 
@@ -20,27 +20,28 @@ class F2C {
   private:
     // We use a single lookup table for every type.
     // Beware of collisions if id in mpif.h is not unique
-    static xbt_dict_t f2c_lookup_;
+    static std::unordered_map<std::string, F2C*>* f2c_lookup_;
     static int f2c_id_;
   protected:
-    static xbt_dict_t f2c_lookup();
-    static void set_f2c_lookup(xbt_dict_t dict);
+    static std::unordered_map<std::string, F2C*>* f2c_lookup();
+    static void set_f2c_lookup(std::unordered_map<std::string, F2C*>* map);
     static int f2c_id();
     static void f2c_id_increment();
   public:
     static char* get_key(char* key, int id);
     static char* get_key_id(char* key, int id);
     static void delete_lookup();
-    static xbt_dict_t lookup();
+    static std::unordered_map<std::string, F2C*>* lookup();
+
+    virtual ~F2C() = default;
 
     //Override these to handle specific values.
-    int add_f();
+    virtual int add_f();
     static void free_f(int id);
-    int c2f();
+    virtual int c2f();
 
-    //This method should be overriden in all subclasses
-    //to avoid casting the result when calling it.
-    //For the default one, the MPI_*_NULL returned is assumed to be NULL.
+    // This method should be overridden in all subclasses to avoid casting the result when calling it.
+    // For the default one, the MPI_*_NULL returned is assumed to be NULL.
     static F2C* f2c(int id);
 };
 
index 64812ca..1bb4d17 100644 (file)
@@ -8,6 +8,8 @@
 #define SMPI_GROUP_HPP_INCLUDED
 
 #include "smpi_f2c.hpp"
+#include <smpi/smpi.h>
+#include <vector>
 
 namespace simgrid{
 namespace smpi{
@@ -15,14 +17,17 @@ namespace smpi{
 class Group : public F2C{
   private:
     int size_;
-    int *rank_to_index_map_;
-    xbt_dict_t index_to_rank_map_;
+    /* This is actually a map from int to int. We could use
+     * std::map here, but looking up a value there costs O(log(n)).
+     * For a vector, this costs O(1). We hence go with the vector.
+     */
+    std::vector<int> rank_to_index_map_;
+    std::vector<int> index_to_rank_map_;
     int refcount_;
   public:
     explicit Group();
     explicit Group(int size);
     explicit Group(Group* origin);
-    ~Group();
 
     void set_mapping(int index, int rank);
     int index(int rank);
index c8f049b..61eccb2 100644 (file)
@@ -7,21 +7,23 @@
 #ifndef SMPI_INFO_HPP
 #define SMPI_INFO_HPP
 
-#include "smpi_f2c.hpp"
 #include "smpi/smpi.h"
-#include "xbt/dict.h"
+#include "smpi_f2c.hpp"
+#include <string>
+#include <map>
 
 namespace simgrid{
 namespace smpi{
 
 class Info : public F2C{
   private:
-    xbt_dict_t dict_;
-    int refcount_;
+    std::map<std::string, std::string> map_;
+    int refcount_ = 1;
+
   public:
-    explicit Info();
+    Info() = default;
     explicit Info(Info* orig);
-    ~Info();
+    ~Info() = default;
     void ref();
     static void unref(MPI_Info info);
     void set(char *key, char *value);
index bc3e2af..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--;
   }
@@ -109,11 +108,12 @@ template <typename T> int Keyval::attr_get(int keyval, void* attr_value, int* fl
     *flag=0;
     return MPI_SUCCESS;
   }
-  try {
-    *static_cast<void**>(attr_value) = attributes()->at(keyval);
+  const auto& attribs = attributes();
+  auto attr           = attribs->find(keyval);
+  if (attr != attribs->end()) {
+    *static_cast<void**>(attr_value) = attr->second;
     *flag=1;
-  }
-  catch (const std::out_of_range& oor) {
+  } else {
     *flag=0;
   }
   return MPI_SUCCESS;
@@ -139,13 +139,14 @@ template <typename T> int Keyval::attr_put(int keyval, void* attr_value){
 template <typename T> void Keyval::cleanup_attr(){
   if (not attributes()->empty()) {
     int flag=0;
-    for(auto it : attributes_){
-      try{
-        smpi_key_elem elem = T::keyvals_.at(it.first);
+    for (auto const& it : attributes_) {
+      auto elm = T::keyvals_.find(it.first);
+      if (elm != T::keyvals_.end()) {
+        smpi_key_elem elem = elm->second;
         if(elem != nullptr){
           call_deleter<T>((T*)this, elem, it.first,it.second,&flag);
         }
-      }catch(const std::out_of_range& oor) {
+      } else {
         //already deleted, not a problem;
         flag=0;
       }
index f532ec7..0b11c1f 100644 (file)
@@ -7,8 +7,9 @@
 #ifndef SMPI_PROCESS_HPP
 #define SMPI_PROCESS_HPP
 
-#include "src/instr/instr_smpi.h"
+#include "private.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
+#include "src/instr/instr_smpi.hpp"
 #include "xbt/synchro.h"
 
 namespace simgrid{
@@ -36,6 +37,7 @@ class Process {
     int return_value_ = 0;
     smpi_trace_call_location_t trace_call_loc_;
     smx_actor_t process_ = nullptr;
+    smpi_privatization_region_t privatized_region_;
 #if HAVE_PAPI
   /** Contains hardware data as read by PAPI **/
     int papi_event_set_;
@@ -53,8 +55,9 @@ class Process {
     void set_user_data(void *data);
     void *get_user_data();
     smpi_trace_call_location_t* call_location();
+    void set_privatized_region(smpi_privatization_region_t region);
+    smpi_privatization_region_t privatized_region();
     int index();
-    MPI_Comm comm_world();
     smx_mailbox_t mailbox();
     smx_mailbox_t mailbox_small();
     xbt_mutex_t mailboxes_mutex();
@@ -65,6 +68,7 @@ class Process {
     xbt_os_timer_t timer();
     void simulated_start();
     double simulated_elapsed();
+    MPI_Comm comm_world();
     MPI_Comm comm_self();
     MPI_Comm comm_intra();
     void set_comm_intra(MPI_Comm comm);
index 5a11b2d..f6c69ac 100644 (file)
@@ -91,7 +91,7 @@ class Request : public F2C {
     static int match_send(void* a, void* b, simgrid::kernel::activity::CommImpl* ignored);
     static int match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl* ignored);
 
-    int add_f();
+    int add_f() override;
     static void free_f(int id);
     static Request* f2c(int);
 
index d0cb570..9dd8742 100644 (file)
@@ -17,8 +17,10 @@ namespace smpi{
 class Topo {
   public:
     virtual ~Topo()=default;
-  protected:
-  MPI_Comm comm_;
+    MPI_Comm getComm() const { return comm_; }
+    void setComm(MPI_Comm comm) { comm_ = comm; }
+  private:
+    MPI_Comm comm_;
 };
 
 
@@ -46,7 +48,6 @@ class Topo_Cart: public Topo {
 class Topo_Graph: public Topo {
   private:
     int nnodes_;
-    int nedges_;
     int *index_;
     int *edges_;
   public:
@@ -56,13 +57,10 @@ class Topo_Graph: public Topo {
 
 class Topo_Dist_Graph: public Topo {
   private:
-    int indegree_;
     int *in_;
     int *in_weights_;
-    int outdegree_;
     int *out_;
     int *out_weights_;
-    int is_weighted_;
   public:
     Topo_Dist_Graph();
     ~Topo_Dist_Graph();
similarity index 66%
rename from src/include/smpi/smpi_utils.hpp
rename to src/smpi/include/smpi_utils.hpp
index 0f98f38..972e285 100644 (file)
@@ -7,19 +7,19 @@
 #define SMPI_UTILS_HPP
 #include "xbt/base.h"
 #include <cstddef>
+#include <string>
 #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{
-  size_t factor=0;
+struct s_smpi_factor_t {
+  size_t factor = 0;
   std::vector<double> values;
-} s_smpi_factor_t;
+};
+typedef s_smpi_factor_t* smpi_os_factor_t;
+}
 
-SG_END_DECL()
-
-XBT_PUBLIC(std::vector<s_smpi_factor_t>) parse_factor(const char *smpi_coef_string);
+XBT_PUBLIC(std::vector<s_smpi_factor_t>) parse_factor(std::string smpi_coef_string);
 
 #endif
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 6f71391..380c72d 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "SmpiHost.hpp"
 #include "simgrid/s4u/VirtualMachine.hpp"
-#include "smpi/smpi_utils.hpp"
+#include "smpi_utils.hpp"
 
 #include <string>
 #include <vector>
@@ -25,7 +25,7 @@ double SmpiHost::orecv(size_t size)
   // Iterate over all the sections that were specified and find the right value. (fact.factor represents the interval
   // sizes; we want to find the section that has fact.factor <= size and no other such fact.factor <= size)
   // Note: parse_factor() (used before) already sorts the vector we iterate over!
-  for (auto fact : orecv_parsed_values) {
+  for (auto const& fact : orecv_parsed_values) {
     if (size <= fact.factor) { // Values already too large, use the previously computed value of current!
       XBT_DEBUG("or : %zu <= %zu return %.10f", size, fact.factor, current);
       return current;
@@ -48,7 +48,7 @@ double SmpiHost::osend(size_t size)
   // value. (fact.factor represents the interval sizes; we want to find the
   // section that has fact.factor <= size and no other such fact.factor <= size)
   // Note: parse_factor() (used before) already sorts the vector we iterate over!
-  for (auto& fact : osend_parsed_values) {
+  for (auto const& fact : osend_parsed_values) {
     if (size <= fact.factor) { // Values already too large, use the previously computed value of current!
       XBT_DEBUG("os : %zu <= %zu return %.10f", size, fact.factor, current);
       return current;
@@ -71,7 +71,7 @@ double SmpiHost::oisend(size_t size)
   // Iterate over all the sections that were specified and find the right value. (fact.factor represents the interval
   // sizes; we want to find the section that has fact.factor <= size and no other such fact.factor <= size)
   // Note: parse_factor() (used before) already sorts the vector we iterate over!
-  for (auto& fact : oisend_parsed_values) {
+  for (auto const& fact : oisend_parsed_values) {
     if (size <= fact.factor) { // Values already too large, use the previously  computed value of current!
       XBT_DEBUG("ois : %zu <= %zu return %.10f", size, fact.factor, current);
       return current;
@@ -114,23 +114,5 @@ SmpiHost::SmpiHost(simgrid::s4u::Host *ptr) : host(ptr)
 }
 
 SmpiHost::~SmpiHost()=default;
-
-static void onCreation(simgrid::s4u::Host& host)
-{
-}
-
-static void onHostDestruction(simgrid::s4u::Host& host)
-{
-  // Ignore virtual machines
-  if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host))
-    return;
-}
-
-void sg_smpi_host_init()
-{
-  simgrid::s4u::Host::onCreation.connect(&onCreation);
-  simgrid::s4u::Host::onDestruction.connect(&onHostDestruction);
-}
-
 }
 }
index eb3b141..6d219aa 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 "private.h"
 #include "private.hpp"
-#include <ctype.h>
+#include <boost/algorithm/string.hpp>
+#include <cctype>
+#include <cstdarg>
+#include <cwchar>
+#include <deque>
 #include <simgrid/sg_config.h>
-#include <stdarg.h>
-#include <wchar.h>
+#include <string>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_smpi, instr, "Tracing SMPI");
 
-static xbt_dict_t keys;
-
-static const char *smpi_colors[] ={
-    "recv",     "1 0 0",
-    "irecv",    "1 0.52 0.52",
-    "send",     "0 0 1",
-    "isend",    "0.52 0.52 1",
-    "sendrecv", "0 1 1",
-    "wait",     "1 1 0",
-    "waitall",  "0.78 0.78 0",
-    "waitany",  "0.78 0.78 0.58",
-    "test",     "0.52 0.52 0",
-
-    "allgather",     "1 0 0",
-    "allgatherv",    "1 0.52 0.52",
-    "allreduce",     "1 0 1",
-    "alltoall",      "0.52 0 1",
-    "alltoallv",     "0.78 0.52 1",
-    "barrier",       "0 0.78 0.78",
-    "bcast",         "0 0.78 0.39",
-    "gather",        "1 1 0",
-    "gatherv",       "1 1 0.52",
-    "reduce",        "0 1 0",
-    "reducescatter", "0.52 1 0.52",
-    "scan",          "1 0.58 0.23",
-    "exscan",          "1 0.54 0.25",
-    "scatterv",      "0.52 0 0.52",
-    "scatter",       "1 0.74 0.54",
-
-    "computing",     "0 1 1",
-    "sleeping",      "0 0.5 0.5",
-
-    "init",       "0 1 0",
-    "finalize",     "0 1 0",
-
-    "put",       "0.3 1 0",
-    "get",       "0 1 0.3",
-    "accumulate",       "1 0.3 0",
-    "win_fence",       "1 0 0.3",
-    "win_post",       "1 0 0.8",
-    "win_wait",       "1 0.8 0",
-    "win_start",       "0.8 0 1",
-    "win_complete",       "0.8 1 0",
-    nullptr, nullptr,
-};
+static std::unordered_map<std::string, std::deque<std::string>*> keys;
 
-static char *str_tolower (const char *str)
-{
-  char* ret = xbt_strdup(str);
-  int n     = strlen(ret);
-  for (int i = 0; i < n; i++)
-    ret[i] = tolower (str[i]);
-  return ret;
-}
+static const char* smpi_colors[] = {
+    "recv",      "1 0 0",       "irecv",         "1 0.52 0.52",    "send",       "0 0 1",
+    "isend",     "0.52 0.52 1", "sendrecv",      "0 1 1",          "wait",       "1 1 0",
+    "waitall",   "0.78 0.78 0", "waitany",       "0.78 0.78 0.58", "test",       "0.52 0.52 0",
+
+    "allgather", "1 0 0",       "allgatherv",    "1 0.52 0.52",    "allreduce",  "1 0 1",
+    "alltoall",  "0.52 0 1",    "alltoallv",     "0.78 0.52 1",    "barrier",    "0 0.78 0.78",
+    "bcast",     "0 0.78 0.39", "gather",        "1 1 0",          "gatherv",    "1 1 0.52",
+    "reduce",    "0 1 0",       "reducescatter", "0.52 1 0.52",    "scan",       "1 0.58 0.23",
+    "exscan",    "1 0.54 0.25", "scatterv",      "0.52 0 0.52",    "scatter",    "1 0.74 0.54",
+
+    "computing", "0 1 1",       "sleeping",      "0 0.5 0.5",
+
+    "init",      "0 1 0",       "finalize",      "0 1 0",
 
-static const char *instr_find_color (const char *state)
+    "put",       "0.3 1 0",     "get",           "0 1 0.3",        "accumulate", "1 0.3 0",
+    "rput",       "0.3 1 0",     "rget",           "0 1 0.3",        "raccumulate", "1 0.3 0",
+    "compare_and_swap",       "0.3 1 0",     "get_accumulate",           "0 1 0.3",        "rget_accumulate", "1 0.3 0",
+    "win_fence", "1 0 0.3",     "win_post",      "1 0 0.8",        "win_wait",   "1 0.8 0",
+    "win_start", "0.8 0 1",     "win_complete",  "0.8 1 0",        "win_lock", "1 0 0.3",     
+    "win_unlock", "1 0 0.3",     "win_lock_all",      "1 0 0.8",        "win_unlock_all",   "1 0.8 0",
+    "win_flush", "1 0 0.3",     "win_flush_local",      "1 0 0.8",        "win_flush_all",   "1 0.8 0",
+    "win_flush_local_all", "1 0 0.3", ""  , ""
+};
+
+static const char* instr_find_color(const char* state)
 {
-  char* target        = str_tolower(state);
+  std::string target = std::string(state);
+  boost::algorithm::to_lower(target);
   const char* ret     = nullptr;
   unsigned int i      = 0;
   const char* current = smpi_colors[i];
   while (current != nullptr) {
-    if (strcmp (state, current) == 0 //exact match
-        || strstr(target, current) != 0 ){//as substring
-         ret = smpi_colors[i+1];
-         break;
+    if (target == current                          // exact match
+        || strstr(target.c_str(), current) != 0) { // as substring
+      ret = smpi_colors[i + 1];
+      break;
     }
     i+=2;
     current = smpi_colors[i];
   }
-  xbt_free(target);
   return ret;
 }
 
-XBT_PRIVATE char *smpi_container(int rank, char *container, int n)
+XBT_PRIVATE container_t smpi_container(int rank)
 {
-  snprintf(container, n, "rank-%d", rank);
-  return container;
+  return simgrid::instr::Container::byName(std::string("rank-") + std::to_string(rank));
 }
 
-static char *TRACE_smpi_get_key(int src, int dst, int tag, char *key, int n, int send);
-
-static char *TRACE_smpi_put_key(int src, int dst, int tag, char *key, int n, int send)
+static std::string TRACE_smpi_put_key(int src, int dst, int tag, int send)
 {
-  //get the dynar for src#dst
-  char aux[INSTR_DEFAULT_STR_SIZE];
-  snprintf(aux, INSTR_DEFAULT_STR_SIZE, "%d#%d#%d#%d", src, dst, tag, send);
-  xbt_dynar_t d = static_cast<xbt_dynar_t>(xbt_dict_get_or_null(keys, aux));
-
-  if (d == nullptr) {
-    d = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
-    xbt_dict_set(keys, aux, d, nullptr);
-  }
+  // get the deque for src#dst
+  std::string aux =
+      std::to_string(src) + "#" + std::to_string(dst) + "#" + std::to_string(tag) + "#" + std::to_string(send);
+  auto it = keys.find(aux);
+  std::deque<std::string>* d;
+
+  if (it == keys.end()) {
+    d         = new std::deque<std::string>;
+    keys[aux] = d;
+  } else
+    d = it->second;
 
   //generate the key
   static unsigned long long counter = 0;
   counter++;
-  snprintf(key, n, "%d_%d_%d_%llu", src, dst, tag, counter);
+  std::string key =
+      std::to_string(src) + "_" + std::to_string(dst) + "_" + std::to_string(tag) + "_" + std::to_string(counter);
 
   //push it
-  char *a = static_cast<char*> (xbt_strdup(key));
-  xbt_dynar_push_as(d, char *, a);
+  d->push_back(key);
 
   return key;
 }
 
-static char *TRACE_smpi_get_key(int src, int dst, int tag, char *key, int n, int send)
+static std::string TRACE_smpi_get_key(int src, int dst, int tag, int send)
 {
-  char aux[INSTR_DEFAULT_STR_SIZE];
-  snprintf(aux, INSTR_DEFAULT_STR_SIZE, "%d#%d#%d#%d", src, dst, tag, send==1?0:1);
-  xbt_dynar_t d = static_cast<xbt_dynar_t>(xbt_dict_get_or_null(keys, aux));
-
-  // first posted
-  if(xbt_dynar_is_empty(d)){
-      TRACE_smpi_put_key(src, dst, tag, key, n, send);
-      return key;
+  std::string key;
+  std::string aux = std::to_string(src) + "#" + std::to_string(dst) + "#" + std::to_string(tag) + "#" +
+                    std::to_string(send == 1 ? 0 : 1);
+  auto it = keys.find(aux);
+  if (it == keys.end()) {
+    // first posted
+    key = TRACE_smpi_put_key(src, dst, tag, send);
+  } else {
+    key = it->second->front();
+    it->second->pop_front();
   }
-
-  char *s = xbt_dynar_get_as (d, 0, char *);
-  snprintf (key, n, "%s", s);
-  xbt_dynar_remove_at (d, 0, nullptr);
   return key;
 }
 
-static xbt_dict_t process_category;
-
-static void cleanup_extra_data (instr_extra_data extra){
-  if(extra!=nullptr){
-    if(extra->sendcounts!=nullptr)
-      xbt_free(extra->sendcounts);
-    if(extra->recvcounts!=nullptr)
-      xbt_free(extra->recvcounts);
-    xbt_free(extra);
-  }
-}
+static std::unordered_map<smx_actor_t, std::string> process_category;
 
 void TRACE_internal_smpi_set_category (const char *category)
 {
@@ -157,12 +118,8 @@ void TRACE_internal_smpi_set_category (const char *category)
   //declare category
   TRACE_category (category);
 
-  char processid[INSTR_DEFAULT_STR_SIZE];
-  snprintf (processid, INSTR_DEFAULT_STR_SIZE, "%p", SIMIX_process_self());
-  if (xbt_dict_get_or_null (process_category, processid))
-    xbt_dict_remove (process_category, processid);
   if (category != nullptr)
-    xbt_dict_set (process_category, processid, xbt_strdup(category), nullptr);
+    process_category[SIMIX_process_self()] = category;
 }
 
 const char *TRACE_internal_smpi_get_category ()
@@ -170,21 +127,19 @@ const char *TRACE_internal_smpi_get_category ()
   if (not TRACE_smpi_is_enabled())
     return nullptr;
 
-  char processid[INSTR_DEFAULT_STR_SIZE];
-  snprintf (processid, INSTR_DEFAULT_STR_SIZE, "%p", SIMIX_process_self());
-  return static_cast<char*>(xbt_dict_get_or_null (process_category, processid));
+  auto it = process_category.find(SIMIX_process_self());
+  return (it == process_category.end()) ? nullptr : it->second.c_str();
 }
 
 void TRACE_smpi_alloc()
 {
-  keys = xbt_dict_new_homogeneous(xbt_dynar_free_voidp);
-  process_category = xbt_dict_new_homogeneous(xbt_free_f);
+  // for symmetry
 }
 
 void TRACE_smpi_release()
 {
-  xbt_dict_free(&keys);
-  xbt_dict_free(&process_category);
+  for (auto const& elm : keys)
+    delete elm.second;
 }
 
 void TRACE_smpi_init(int rank)
@@ -192,31 +147,29 @@ void TRACE_smpi_init(int rank)
   if (not TRACE_smpi_is_enabled())
     return;
 
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
+  std::string str = std::string("rank-") + std::to_string(rank);
 
   container_t father;
   if (TRACE_smpi_is_grouped()){
-    father = PJ_container_get(sg_host_self_get_name());
+    father = simgrid::instr::Container::byNameOrNull(sg_host_self_get_name());
   }else{
-    father = PJ_container_get_root ();
+    father = simgrid::instr::Container::getRoot();
   }
-  xbt_assert(father!=nullptr,
-      "Could not find a parent for mpi rank %s at function %s", str, __FUNCTION__);
+  xbt_assert(father != nullptr, "Could not find a parent for mpi rank %s at function %s", str.c_str(), __FUNCTION__);
 #if HAVE_PAPI
   container_t container =
 #endif
-      PJ_container_new(str, INSTR_SMPI, father);
+      new simgrid::instr::Container(str, "MPI", father);
 #if HAVE_PAPI
   papi_counter_t counters = smpi_process()->papi_counters();
 
-  for (auto& it : counters) {
+  for (auto const& it : counters) {
     /**
      * Check whether this variable already exists or not. Otherwise, it will be created
      * multiple times but only the last one would be used...
      */
-    if (PJ_type_get_or_null(it.first.c_str(), container->type) == nullptr) {
-      PJ_type_variable_new(it.first.c_str(), nullptr, container->type);
+    if (s_type::getOrNull(it.first.c_str(), container->type_) == nullptr) {
+      Type::variableNew(it.first.c_str(), "", container->type_);
     }
   }
 #endif
@@ -227,179 +180,86 @@ void TRACE_smpi_finalize(int rank)
   if (not TRACE_smpi_is_enabled())
     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);
-  PJ_container_free (container);
-}
-
-void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_extra_data extra)
-{
-  if (not TRACE_smpi_is_enabled()) {
-    cleanup_extra_data(extra);
-    return;
-  }
-
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  const char *color = instr_find_color (operation);
-  val_t value = PJ_value_get_or_new (operation, color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
-}
-
-void TRACE_smpi_collective_out(int rank, int root, const char *operation)
-{
-  if (not TRACE_smpi_is_enabled())
-    return;
-
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-
-  new PopStateEvent (SIMIX_get_clock(), container, type);
+  container_t container = smpi_container(rank);
+  container->removeFromParent();
+  delete container;
 }
 
 void TRACE_smpi_computing_init(int rank)
 {
  //first use, initialize the color in the trace
- if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_computing())
-   return;
-
- char str[INSTR_DEFAULT_STR_SIZE];
- smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
- container_t container = PJ_container_get(str);
- type_t type           = PJ_type_get("MPI_STATE", container->type);
- const char* color     = instr_find_color("computing");
- val_t value           = PJ_value_get_or_new("computing", color, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, value);
+ if (TRACE_smpi_is_enabled() && TRACE_smpi_is_computing())
+   smpi_container(rank)->getState("MPI_STATE")->addEntityValue("computing", instr_find_color("computing"));
 }
 
-void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
+void TRACE_smpi_computing_in(int rank, double amount)
 {
-  //do not forget to set the color first, otherwise this will explode
-  if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_computing()) {
-    cleanup_extra_data(extra);
-    return;
-  }
-
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = PJ_value_get_or_new ("computing", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_computing())
+    smpi_container(rank)
+        ->getState("MPI_STATE")
+        ->pushEvent("computing", new simgrid::instr::CpuTIData("compute", amount));
 }
 
 void TRACE_smpi_computing_out(int rank)
 {
-  if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_computing())
-    return;
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  new PopStateEvent (SIMIX_get_clock(), container, type);
+  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_computing())
+    smpi_container(rank)->getState("MPI_STATE")->popEvent();
 }
 
 void TRACE_smpi_sleeping_init(int rank)
 {
   //first use, initialize the color in the trace
-  if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_sleeping())
-    return;
-
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  const char *color = instr_find_color ("sleeping");
-  val_t value = PJ_value_get_or_new ("sleeping", color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value);
+  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_sleeping())
+    smpi_container(rank)->getState("MPI_STATE")->addEntityValue("sleeping", instr_find_color("sleeping"));
 }
 
-void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
+void TRACE_smpi_sleeping_in(int rank, double duration)
 {
-  //do not forget to set the color first, otherwise this will explode
-  if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_sleeping()) {
-    cleanup_extra_data(extra);
-    return;
-  }
-
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = PJ_value_get_or_new ("sleeping", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_sleeping())
+    smpi_container(rank)
+        ->getState("MPI_STATE")
+        ->pushEvent("sleeping", new simgrid::instr::CpuTIData("sleep", duration));
 }
 
 void TRACE_smpi_sleeping_out(int rank)
 {
-  if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_sleeping())
-    return;
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  new PopStateEvent (SIMIX_get_clock(), container, type);
+  if (TRACE_smpi_is_enabled() && not TRACE_smpi_is_sleeping())
+    smpi_container(rank)->getState("MPI_STATE")->popEvent();
 }
 
-void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
+void TRACE_smpi_testing_in(int rank)
 {
   //do not forget to set the color first, otherwise this will explode
-  if (not TRACE_smpi_is_enabled()) {
-    cleanup_extra_data(extra);
+  if (not TRACE_smpi_is_enabled())
     return;
-  }
 
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = PJ_value_get_or_new ("test", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  simgrid::instr::StateType* state = smpi_container(rank)->getState("MPI_STATE");
+  state->addEntityValue("test");
+  state->pushEvent("test", new simgrid::instr::NoOpTIData("test"));
 }
 
 void TRACE_smpi_testing_out(int rank)
 {
-  if (not TRACE_smpi_is_enabled())
-    return;
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  new PopStateEvent (SIMIX_get_clock(), container, type);
+  if (TRACE_smpi_is_enabled())
+    smpi_container(rank)->getState("MPI_STATE")->popEvent();
 }
 
-void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra)
+void TRACE_smpi_comm_in(int rank, const char* operation, simgrid::instr::TIData* extra)
 {
   if (not TRACE_smpi_is_enabled()) {
-    cleanup_extra_data(extra);
+    delete extra;
     return;
   }
 
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-  const char *color = instr_find_color (operation);
-  val_t value = PJ_value_get_or_new (operation, color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  simgrid::instr::StateType* state = smpi_container(rank)->getState("MPI_STATE");
+  state->addEntityValue(operation, instr_find_color(operation));
+  state->pushEvent(operation, extra);
 }
 
-void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
+void TRACE_smpi_comm_out(int rank)
 {
-  if (not TRACE_smpi_is_enabled())
-    return;
-
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
-
-  new PopStateEvent (SIMIX_get_clock(), container, type);
+  if (TRACE_smpi_is_enabled())
+    smpi_container(rank)->getState("MPI_STATE")->popEvent();
 }
 
 void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
@@ -407,29 +267,19 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
   if (not TRACE_smpi_is_enabled())
     return;
 
-  char key[INSTR_DEFAULT_STR_SIZE] = {0};
-  TRACE_smpi_get_key(src, dst, tag, key, INSTR_DEFAULT_STR_SIZE,1);
+  std::string key = TRACE_smpi_get_key(src, dst, tag, 1);
 
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(src, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
-  XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
-  new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
+  XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key.c_str());
+  simgrid::instr::Container::getRoot()->getLink("MPI_LINK")->startEvent(smpi_container(rank), "PTP", key, size);
 }
 
-void TRACE_smpi_recv(int rank, int src, int dst, int tag)
+void TRACE_smpi_recv(int src, int dst, int tag)
 {
   if (not TRACE_smpi_is_enabled())
     return;
 
-  char key[INSTR_DEFAULT_STR_SIZE] = {0};
-  TRACE_smpi_get_key(src, dst, tag, key, INSTR_DEFAULT_STR_SIZE,0);
+  std::string key = TRACE_smpi_get_key(src, dst, tag, 0);
 
-  char str[INSTR_DEFAULT_STR_SIZE];
-  smpi_container(dst, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
-  XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
-  new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
+  XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key.c_str());
+  simgrid::instr::Container::getRoot()->getLink("MPI_LINK")->endEvent(smpi_container(dst), "PTP", key);
 }
index 0b68ed9..21fe974 100644 (file)
@@ -3,19 +3,19 @@
 /* This program is 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/internal_config.h"
-#include "private.h"
 #include "private.hpp"
 #include "simgrid/modelchecker.h"
-#include "src/mc/mc_replay.h"
-#include "smpi_process.hpp"
 #include "smpi_comm.hpp"
 #include "simgrid/host.h"
+#include "smpi_process.hpp"
+#include "src/internal_config.h"
+#include "src/mc/mc_replay.hpp"
+#include <unordered_map>
 
 #ifndef WIN32
 #include <sys/mman.h>
 #endif
-#include <math.h> // sqrt
+#include <cmath>
 
 #if HAVE_PAPI
 #include <papi.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi, "Logging specific to SMPI (benchmarking)");
 
-
-xbt_dict_t samples = nullptr;         /* Allocated on first use */
-
 double smpi_cpu_threshold = -1;
 double smpi_host_speed;
 
 shared_malloc_type smpi_cfg_shared_malloc = shmalloc_global;
 double smpi_total_benched_time = 0;
-smpi_privatization_region_t smpi_privatization_regions;
-
-void smpi_bench_destroy()
-{
-  xbt_dict_free(&samples);
-}
 
 extern "C" XBT_PUBLIC(void) smpi_execute_flops_(double *flops);
 void smpi_execute_flops_(double *flops)
@@ -64,17 +55,14 @@ void smpi_execute(double duration)
     XBT_DEBUG("Sleep for %g to handle real computation time", duration);
     double flops = duration * smpi_host_speed;
     int rank = smpi_process()->index();
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type=TRACING_COMPUTING;
-    extra->comp_size=flops;
-    TRACE_smpi_computing_in(rank, extra);
+    TRACE_smpi_computing_in(rank, flops);
 
     smpi_execute_flops(flops);
 
     TRACE_smpi_computing_out(rank);
 
   } else {
-    XBT_DEBUG("Real computation took %g while option smpi/cpu_threshold is set to %g => ignore it", duration,
+    XBT_DEBUG("Real computation took %g while option smpi/cpu-threshold is set to %g => ignore it", duration,
               smpi_cpu_threshold);
   }
 }
@@ -97,7 +85,7 @@ void smpi_bench_begin()
     return;
 
 #if HAVE_PAPI
-  if (xbt_cfg_get_string("smpi/papi-events")[0] != '\0') {
+  if (not xbt_cfg_get_string("smpi/papi-events").empty()) {
     int event_set = smpi_process()->papi_event_set();
     // PAPI_start sets everything to 0! See man(3) PAPI_start
     if (PAPI_LOW_LEVEL_INITED == PAPI_is_initialized()) {
@@ -137,8 +125,6 @@ void smpi_bench_end()
     } else {
       for (unsigned int i = 0; i < counter_data.size(); i++) {
         counter_data[i].second += event_values[i];
-        // XBT_DEBUG("[%i] PAPI: Counter %s: Value is now %lli (got increment by %lli\n", smpi_process()->index(),
-        // counter_data[i].first.c_str(), counter_data[i].second, event_values[i]);
       }
     }
   }
@@ -169,14 +155,13 @@ void smpi_bench_end()
 
 #if HAVE_PAPI
   if (xbt_cfg_get_string("smpi/papi-events")[0] != '\0' && TRACE_smpi_is_enabled()) {
-    char container_name[INSTR_DEFAULT_STR_SIZE];
-    smpi_container(smpi_process()->index(), container_name, INSTR_DEFAULT_STR_SIZE);
-    container_t container        = PJ_container_get(container_name);
+    container_t container =
+        new simgrid::instr::Container(std::string("rank-") + std::to_string(smpi_process()->index()));
     papi_counter_t& counter_data = smpi_process()->papi_counters();
 
-    for (auto& pair : counter_data) {
-      new_pajeSetVariable(surf_get_clock(), container,
-                          PJ_type_get(/* countername */ pair.first.c_str(), container->type), pair.second);
+    for (auto const& pair : counter_data) {
+      new simgrid::instr::SetVariableEvent(
+          surf_get_clock(), container, PJ_type_get(/* countername */ pair.first.c_str(), container->type), pair.second);
     }
   }
 #endif
@@ -191,10 +176,7 @@ static unsigned int private_sleep(double secs)
 
   XBT_DEBUG("Sleep for: %lf secs", secs);
   int rank = MPI_COMM_WORLD->rank();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type=TRACING_SLEEPING;
-  extra->sleep_duration=secs;
-  TRACE_smpi_sleeping_in(rank, extra);
+  TRACE_smpi_sleeping_in(rank, secs);
 
   simcall_process_sleep(secs);
 
@@ -215,13 +197,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();
@@ -238,7 +220,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();
@@ -273,7 +255,18 @@ unsigned long long smpi_rastro_timestamp ()
 }
 
 /* ****************************** Functions related to the SMPI_SAMPLE_ macros ************************************/
-typedef struct {
+namespace {
+class SampleLocation : public std::string {
+public:
+  SampleLocation(bool global, const char* file, int line) : std::string(std::string(file) + ":" + std::to_string(line))
+  {
+    if (not global)
+      this->append(":" + std::to_string(smpi_process()->index()));
+  }
+};
+
+class LocalData {
+public:
   double threshold; /* maximal stderr requested (if positive) */
   double relstderr; /* observed stderr so far */
   double mean;      /* mean of benched times, to be used if the block is disabled */
@@ -281,93 +274,85 @@ typedef struct {
   double sum_pow2;  /* sum of the square of the benched times (to compute the stderr) */
   int iters;        /* amount of requested iterations */
   int count;        /* amount of iterations done so far */
-  int benching;     /* 1: we are benchmarking; 0: we have enough data, no bench anymore */
-} local_data_t;
+  bool benching;    /* true: we are benchmarking; false: we have enough data, no bench anymore */
 
-static char *sample_location(int global, const char *file, int line) {
-  if (global) {
-    return bprintf("%s:%d", file, line);
-  } else {
-    return bprintf("%s:%d:%d", file, line, smpi_process()->index());
-  }
+  bool need_more_benchs() const;
+};
 }
 
-static int sample_enough_benchs(local_data_t *data) {
-  int res = data->count >= data->iters;
-  if (data->threshold>0.0) {
-    if (data->count <2)
-      res = 0; // not enough data
-    if (data->relstderr > data->threshold)
-      res = 0; // stderr too high yet
-  }
+std::unordered_map<SampleLocation, LocalData, std::hash<std::string>> samples;
+
+bool LocalData::need_more_benchs() const
+{
+  bool res = (count < iters) || (threshold > 0.0 && (count < 2 ||          // not enough data
+                                                     relstderr > threshold // stderr too high yet
+                                                     ));
   XBT_DEBUG("%s (count:%d iter:%d stderr:%f thres:%f mean:%fs)",
-      (res?"enough benchs":"need more data"), data->count, data->iters, data->relstderr, data->threshold, data->mean);
+            (res ? "need more data" : "enough benchs"), count, iters, relstderr, threshold, mean);
   return res;
 }
 
 void smpi_sample_1(int global, const char *file, int line, int iters, double threshold)
 {
-  char *loc = sample_location(global, file, line);
+  SampleLocation loc(global, file, line);
 
   smpi_bench_end();     /* Take time from previous, unrelated computation into account */
   smpi_process()->set_sampling(1);
 
-  if (samples==nullptr)
-    samples = xbt_dict_new_homogeneous(free);
-
-  local_data_t *data = static_cast<local_data_t *>(xbt_dict_get_or_null(samples, loc));
-  if (data==nullptr) {
-    xbt_assert(threshold>0 || iters>0,
+  auto insert = samples.emplace(loc, LocalData{
+                                         threshold, // threshold
+                                         0.0,       // relstderr
+                                         0.0,       // mean
+                                         0.0,       // sum
+                                         0.0,       // sum_pow2
+                                         iters,     // iters
+                                         0,         // count
+                                         true       // benching (if we have no data, we need at least one)
+                                     });
+  LocalData& data = insert.first->second;
+  if (insert.second) {
+    XBT_DEBUG("XXXXX First time ever on benched nest %s.", loc.c_str());
+    xbt_assert(threshold > 0 || iters > 0,
         "You should provide either a positive amount of iterations to bench, or a positive maximal stderr (or both)");
-    data = static_cast<local_data_t *>( xbt_new(local_data_t, 1));
-    data->count = 0;
-    data->sum = 0.0;
-    data->sum_pow2 = 0.0;
-    data->iters = iters;
-    data->threshold = threshold;
-    data->benching = 1; // If we have no data, we need at least one
-    data->mean = 0;
-    xbt_dict_set(samples, loc, data, nullptr);
-    XBT_DEBUG("XXXXX First time ever on benched nest %s.",loc);
   } else {
-    if (data->iters != iters || data->threshold != threshold) {
+    if (data.iters != iters || data.threshold != threshold) {
       XBT_ERROR("Asked to bench block %s with different settings %d, %f is not %d, %f. "
                 "How did you manage to give two numbers at the same line??",
-                loc, data->iters, data->threshold, iters, threshold);
+                loc.c_str(), data.iters, data.threshold, iters, threshold);
       THROW_IMPOSSIBLE;
     }
 
     // if we already have some data, check whether sample_2 should get one more bench or whether it should emulate
     // the computation instead
-    data->benching = (sample_enough_benchs(data) == 0);
-    XBT_DEBUG("XXXX Re-entering the benched nest %s. %s", loc,
-              (data->benching ? "more benching needed" : "we have enough data, skip computes"));
+    data.benching = data.need_more_benchs();
+    XBT_DEBUG("XXXX Re-entering the benched nest %s. %s", loc.c_str(),
+              (data.benching ? "more benching needed" : "we have enough data, skip computes"));
   }
-  xbt_free(loc);
 }
 
 int smpi_sample_2(int global, const char *file, int line)
 {
-  char *loc = sample_location(global, file, line);
+  SampleLocation loc(global, file, line);
   int res;
 
-  xbt_assert(samples, "Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!");
-  local_data_t *data = static_cast<local_data_t *>(xbt_dict_get(samples, loc));
-  XBT_DEBUG("sample2 %s",loc);
-  xbt_free(loc);
+  XBT_DEBUG("sample2 %s", loc.c_str());
+  auto sample = samples.find(loc);
+  if (sample == samples.end())
+    xbt_die("Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!");
+  LocalData& data = sample->second;
 
-  if (data->benching==1) {
+  if (data.benching) {
     // we need to run a new bench
     XBT_DEBUG("benchmarking: count:%d iter:%d stderr:%f thres:%f; mean:%f",
-        data->count, data->iters, data->relstderr, data->threshold, data->mean);
+              data.count, data.iters, data.relstderr, data.threshold, data.mean);
     res = 1;
   } else {
     // Enough data, no more bench (either we got enough data from previous visits to this benched nest, or we just
     //ran one bench and need to bail out now that our job is done). Just sleep instead
     XBT_DEBUG("No benchmark (either no need, or just ran one): count >= iter (%d >= %d) or stderr<thres (%f<=%f)."
               " apply the %fs delay instead",
-              data->count, data->iters, data->relstderr, data->threshold, data->mean);
-    smpi_execute(data->mean);
+              data.count, data.iters, data.relstderr, data.threshold, data.mean);
+    smpi_execute(data.mean);
     smpi_process()->set_sampling(0);
     res = 0; // prepare to capture future, unrelated computations
   }
@@ -377,63 +362,69 @@ int smpi_sample_2(int global, const char *file, int line)
 
 void smpi_sample_3(int global, const char *file, int line)
 {
-  char *loc = sample_location(global, file, line);
+  SampleLocation loc(global, file, line);
 
-  xbt_assert(samples, "Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!");
-  local_data_t *data = static_cast<local_data_t *>(xbt_dict_get(samples, loc));
-  XBT_DEBUG("sample3 %s",loc);
-  xbt_free(loc);
+  XBT_DEBUG("sample3 %s", loc.c_str());
+  auto sample = samples.find(loc);
+  if (sample == samples.end())
+    xbt_die("Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!");
+  LocalData& data = sample->second;
 
-  if (data->benching==0)
+  if (not data.benching)
     THROW_IMPOSSIBLE;
 
   // ok, benchmarking this loop is over
   xbt_os_threadtimer_stop(smpi_process()->timer());
 
   // update the stats
-  data->count++;
-  double sample = xbt_os_timer_elapsed(smpi_process()->timer());
-  data->sum += sample;
-  data->sum_pow2 += sample * sample;
-  double n = static_cast<double>(data->count);
-  data->mean = data->sum / n;
-  data->relstderr = sqrt((data->sum_pow2 / n - data->mean * data->mean) / n) / data->mean;
-  if (sample_enough_benchs(data)==0) {
-    data->mean = sample; // Still in benching process; We want sample_2 to simulate the exact time of this loop
+  data.count++;
+  double period  = xbt_os_timer_elapsed(smpi_process()->timer());
+  data.sum      += period;
+  data.sum_pow2 += period * period;
+  double n       = static_cast<double>(data.count);
+  data.mean      = data.sum / n;
+  data.relstderr = sqrt((data.sum_pow2 / n - data.mean * data.mean) / n) / data.mean;
+  if (data.need_more_benchs()) {
+    data.mean = period; // Still in benching process; We want sample_2 to simulate the exact time of this loop
     // occurrence before leaving, not the mean over the history
   }
-  XBT_DEBUG("Average mean after %d steps is %f, relative standard error is %f (sample was %f)", data->count,
-      data->mean, data->relstderr, sample);
+  XBT_DEBUG("Average mean after %d steps is %f, relative standard error is %f (sample was %f)",
+            data.count, data.mean, data.relstderr, period);
 
   // That's enough for now, prevent sample_2 to run the same code over and over
-  data->benching = 0;
+  data.benching = false;
 }
 
 extern "C" { /** These functions will be called from the user code **/
-  smpi_trace_call_location_t* smpi_trace_get_call_location() {
-    return smpi_process()->call_location();
-  }
+smpi_trace_call_location_t* smpi_trace_get_call_location()
+{
+  return smpi_process()->call_location();
+}
 
-  void smpi_trace_set_call_location(const char* file, const int line) {
-    smpi_trace_call_location_t* loc = smpi_process()->call_location();
+void smpi_trace_set_call_location(const char* file, const int line)
+{
+  smpi_trace_call_location_t* loc = smpi_process()->call_location();
 
-    loc->previous_filename   = loc->filename;
-    loc->previous_linenumber = loc->linenumber;
-    loc->filename            = file;
-    loc->linenumber          = line;
-  }
+  loc->previous_filename   = loc->filename;
+  loc->previous_linenumber = loc->linenumber;
+  loc->filename            = file;
+  loc->linenumber          = line;
+}
 
-  /**
-   * Required for Fortran bindings
-   */
-  void smpi_trace_set_call_location_(const char* file, int* line) {
-    smpi_trace_set_call_location(file, *line);
-  }
+/** Required for Fortran bindings */
+void smpi_trace_set_call_location_(const char* file, int* line)
+{
+  smpi_trace_set_call_location(file, *line);
+}
 
-  /**
-   * Required for Fortran if -fsecond-underscore is activated
-   */
-  void smpi_trace_set_call_location__(const char* file, int* line) {
-    smpi_trace_set_call_location(file, *line);
-  }
+/** Required for Fortran if -fsecond-underscore is activated */
+void smpi_trace_set_call_location__(const char* file, int* line)
+{
+  smpi_trace_set_call_location(file, *line);
+}
+}
+
+void smpi_bench_destroy()
+{
+  samples.clear();
 }
index 3d88598..d5ef6a5 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>
 
@@ -56,18 +56,23 @@ extern int* index_to_process_data;
  */
 void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_processes)
 {
-  SIMIX_function_register(name, code);
+  if (code != nullptr) { // When started with smpirun, we will not execute a function
+    SIMIX_function_register(name, code);
+  }
 
   static int already_called = 0;
   if (not already_called) {
     already_called = 1;
-    for (auto& item : simgrid::s4u::host_list) {
+    for (auto const& item : simgrid::s4u::host_list) {
       simgrid::s4u::Host* host = item.second;
       host->extension_set(new simgrid::smpi::SmpiHost(host));
     }
   }
 
   Instance instance(name, num_processes, process_count, MPI_COMM_NULL, MSG_barrier_init(num_processes));
+  MPI_Group group     = new simgrid::smpi::Group(instance.size);
+  instance.comm_world = new simgrid::smpi::Comm(group, nullptr);
+  MPI_Attr_put(instance.comm_world, MPI_UNIVERSE_SIZE, reinterpret_cast<void*>(instance.size));
 
   process_count+=num_processes;
 
@@ -84,10 +89,6 @@ void smpi_deployment_register_process(const char* instance_id, int rank, int ind
 
   Instance& instance = smpi_instances.at(instance_id);
 
-  if (instance.comm_world == MPI_COMM_NULL) {
-    MPI_Group group     = new simgrid::smpi::Group(instance.size);
-    instance.comm_world = new simgrid::smpi::Comm(group, nullptr);
-  }
   instance.present_processes++;
   index_to_process_data[index] = instance.index + rank;
   instance.comm_world->group()->set_mapping(index, rank);
@@ -113,11 +114,10 @@ msg_bar_t smpi_deployment_finalization_barrier(const char* instance_id)
 }
 
 void smpi_deployment_cleanup_instances(){
-  for (auto& item : smpi_instances) {
+  for (auto const& item : smpi_instances) {
     Instance instance = item.second;
-    if (instance.comm_world != MPI_COMM_NULL)
-      delete instance.comm_world->group();
-    delete instance.comm_world;
     MSG_barrier_destroy(instance.finalization_barrier);
+    simgrid::smpi::Comm::destroy(instance.comm_world);
   }
+  smpi_instances.clear();
 }
index f83165f..2d0ffd2 100644 (file)
@@ -76,17 +76,16 @@ typedef int integer;
 typedef long int integer;
 #endif
 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 1504bd2..351269c 100644 (file)
@@ -3,27 +3,26 @@
 /* This program is 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>
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <float.h> /* DBL_MAX */
 #include <fstream>
+#include <sys/stat.h>
 
 #if HAVE_SENDFILE
 #include <sys/sendfile.h>
@@ -59,10 +58,23 @@ int smpi_universe_size = 0;
 int* index_to_process_data = nullptr;
 extern double smpi_total_benched_time;
 xbt_os_timer_t global_timer;
+/**
+ * Setting MPI_COMM_WORLD to MPI_COMM_UNINITIALIZED (it's a variable)
+ * is important because the implementation of MPI_Comm checks
+ * "this == MPI_COMM_UNINITIALIZED"? If yes, it uses smpi_process()->comm_world()
+ * instead of "this".
+ * This is basically how we only have one global variable but all processes have
+ * different communicators (basically, the one their SMPI instance uses).
+ *
+ * See smpi_comm.cpp and the functions therein for details.
+ */
 MPI_Comm MPI_COMM_WORLD = MPI_COMM_UNINITIALIZED;
 MPI_Errhandler *MPI_ERRORS_RETURN = nullptr;
 MPI_Errhandler *MPI_ERRORS_ARE_FATAL = nullptr;
 MPI_Errhandler *MPI_ERRHANDLER_NULL = nullptr;
+// No instance gets manually created; check also the smpirun.in script as
+// this default name is used there as well (when the <actor> tag is generated).
+static const char* smpi_default_instance_name = "smpirun";
 static simgrid::config::Flag<double> smpi_wtime_sleep(
   "smpi/wtime", "Minimum time to inject inside a call to MPI_Wtime", 0.0);
 static simgrid::config::Flag<double> smpi_init_sleep(
@@ -125,22 +137,20 @@ void smpi_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*, s
 
 static void print(std::vector<std::pair<size_t, size_t>> vec) {
   std::fprintf(stderr, "{");
-  for (auto elt : vec) {
+  for (auto const& elt : vec) {
     std::fprintf(stderr, "(0x%zx, 0x%zx),", elt.first, elt.second);
-    }
-    std::fprintf(stderr, "}\n");
+  }
+  std::fprintf(stderr, "}\n");
 }
 static void memcpy_private(void* dest, const void* src, std::vector<std::pair<size_t, size_t>>& private_blocks)
 {
-  for(auto block : private_blocks) {
+  for (auto const& block : private_blocks)
     memcpy((uint8_t*)dest+block.first, (uint8_t*)src+block.first, block.second-block.first);
-  }
 }
 
 static void check_blocks(std::vector<std::pair<size_t, size_t>> &private_blocks, size_t buff_size) {
-  for(auto block : private_blocks) {
+  for (auto const& block : private_blocks)
     xbt_assert(block.first <= block.second && block.second <= buff_size, "Oops, bug in shared malloc.");
-  }
 }
 
 void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t buff_size)
@@ -175,24 +185,23 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b
   auto private_blocks = merge_private_blocks(src_private_blocks, dst_private_blocks);
   check_blocks(private_blocks, buff_size);
   void* tmpbuff=buff;
-  if((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && (static_cast<char*>(buff) >= smpi_start_data_exe)
-      && (static_cast<char*>(buff) < smpi_start_data_exe + smpi_size_data_exe )
-    ){
-       XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
-
-       smpi_switch_data_segment(
-           static_cast<simgrid::smpi::Process*>((static_cast<simgrid::msg::ActorExt*>(comm->src_proc->userdata)->data))
-               ->index());
-       tmpbuff = static_cast<void*>(xbt_malloc(buff_size));
-       memcpy_private(tmpbuff, buff, private_blocks);
+  if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && (static_cast<char*>(buff) >= smpi_data_exe_start) &&
+      (static_cast<char*>(buff) < smpi_data_exe_start + smpi_data_exe_size)) {
+    XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
+
+    smpi_switch_data_segment(
+        static_cast<simgrid::smpi::Process*>((static_cast<simgrid::msg::ActorExt*>(comm->src_proc->userdata)->data))
+            ->index());
+    tmpbuff = static_cast<void*>(xbt_malloc(buff_size));
+    memcpy_private(tmpbuff, buff, private_blocks);
   }
 
-  if((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && ((char*)comm->dst_buff >= smpi_start_data_exe)
-      && ((char*)comm->dst_buff < smpi_start_data_exe + smpi_size_data_exe )){
-       XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
-       smpi_switch_data_segment(
-           static_cast<simgrid::smpi::Process*>((static_cast<simgrid::msg::ActorExt*>(comm->dst_proc->userdata)->data))
-               ->index());
+  if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && ((char*)comm->dst_buff >= smpi_data_exe_start) &&
+      ((char*)comm->dst_buff < smpi_data_exe_start + smpi_data_exe_size)) {
+    XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
+    smpi_switch_data_segment(
+        static_cast<simgrid::smpi::Process*>((static_cast<simgrid::msg::ActorExt*>(comm->dst_proc->userdata)->data))
+            ->index());
   }
   XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff,comm->dst_buff);
   memcpy_private(comm->dst_buff, tmpbuff, private_blocks);
@@ -205,8 +214,8 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b
     //xbt_free(comm->comm.src_data);// inside SMPI the request is kept inside the user data and should be free
     comm->src_buff = nullptr;
   }
-  if(tmpbuff!=buff)xbt_free(tmpbuff);
-
+  if (tmpbuff != buff)
+    xbt_free(tmpbuff);
 }
 
 void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size)
@@ -237,15 +246,13 @@ int smpi_enabled() {
 
 void smpi_global_init()
 {
-  MPI_Group group;
-
   if (not MC_is_active()) {
     global_timer = xbt_os_timer_new();
     xbt_os_walltimer_start(global_timer);
   }
 
-  if (xbt_cfg_get_string("smpi/comp-adjustment-file")[0] != '\0') {
-    std::string filename {xbt_cfg_get_string("smpi/comp-adjustment-file")};
+  std::string filename = xbt_cfg_get_string("smpi/comp-adjustment-file");
+  if (not filename.empty()) {
     std::ifstream fstream(filename);
     if (not fstream.is_open()) {
       xbt_die("Could not open file %s. Does it exist?", filename.c_str());
@@ -271,7 +278,7 @@ void smpi_global_init()
   // and the (computed) event_set.
   std::map</* computation unit name */ std::string, papi_process_data> units2papi_setup;
 
-  if (xbt_cfg_get_string("smpi/papi-events")[0] != '\0') {
+  if (not xbt_cfg_get_string("smpi/papi-events").empty()) {
     if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
       XBT_ERROR("Could not initialize PAPI library; is it correctly installed and linked?"
                 " Expected version is %i",
@@ -279,14 +286,12 @@ void smpi_global_init()
 
     typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
     boost::char_separator<char> separator_units(";");
-    std::string str = std::string(xbt_cfg_get_string("smpi/papi-events"));
+    std::string str = xbt_cfg_get_string("smpi/papi-events");
     Tokenizer tokens(str, separator_units);
 
-    // Iterate over all the computational units. This could be
-    // processes, hosts, threads, ranks... You name it. I'm not exactly
-    // sure what we will support eventually, so I'll leave it at the
-    // general term "units".
-    for (auto& unit_it : tokens) {
+    // Iterate over all the computational units. This could be processes, hosts, threads, ranks... You name it.
+    // I'm not exactly sure what we will support eventually, so I'll leave it at the general term "units".
+    for (auto const& unit_it : tokens) {
       boost::char_separator<char> separator_events(":");
       Tokenizer event_tokens(unit_it, separator_events);
 
@@ -306,7 +311,7 @@ void smpi_global_init()
       // Note that we need to remove the name of the unit
       // (that could also be the "default" value), which always comes first.
       // Hence, we start at ++(events.begin())!
-      for (Tokenizer::iterator events_it = ++(event_tokens.begin()); events_it != event_tokens.end(); events_it++) {
+      for (Tokenizer::iterator events_it = ++(event_tokens.begin()); events_it != event_tokens.end(); ++events_it) {
 
         int event_code   = PAPI_NULL;
         char* event_name = const_cast<char*>((*events_it).c_str());
@@ -335,42 +340,38 @@ void smpi_global_init()
   }
 #endif
 
-  int smpirun = 0;
-  msg_bar_t finalization_barrier = nullptr;
-  if (process_count == 0){
-    process_count = SIMIX_process_count();
-    smpirun=1;
-    finalization_barrier = MSG_barrier_init(process_count);
+  if (index_to_process_data == nullptr) {
+    index_to_process_data = new int[SIMIX_process_count()];
+  }
+
+  bool smpirun = 0;
+  if (process_count == 0) { // The program has been dispatched but no other
+                            // SMPI instances have been registered. We're using smpirun.
+    smpirun = true;
+    SMPI_app_instance_register(smpi_default_instance_name, nullptr,
+                               SIMIX_process_count()); // This call has a side effect on process_count...
+    MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name);
   }
   smpi_universe_size = process_count;
   process_data       = new simgrid::smpi::Process*[process_count];
   for (int i = 0; i < process_count; i++) {
-    process_data[i] = new simgrid::smpi::Process(i, finalization_barrier);
-  }
-  //if the process was launched through smpirun script we generate a global mpi_comm_world
-  //if not, we let MPI_COMM_NULL, and the comm world will be private to each mpi instance
-  if (smpirun) {
-    group = new  simgrid::smpi::Group(process_count);
-    MPI_COMM_WORLD = new  simgrid::smpi::Comm(group, nullptr);
-    MPI_Attr_put(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, reinterpret_cast<void *>(process_count));
-
-    for (int i = 0; i < process_count; i++)
-      group->set_mapping(i, i);
+    if (smpirun) {
+      process_data[i] = new simgrid::smpi::Process(i, smpi_deployment_finalization_barrier(smpi_default_instance_name));
+      smpi_deployment_register_process(smpi_default_instance_name, i, i);
+    } else {
+      // TODO We can pass a nullptr here because Process::set_data() assigns the
+      // barrier from the instance anyway. This is ugly and should be changed
+      process_data[i] = new simgrid::smpi::Process(i, nullptr);
+    }
   }
 }
 
 void smpi_global_destroy()
 {
-  int count = smpi_process_count();
-
   smpi_bench_destroy();
   smpi_shared_destroy();
-  if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){
-      delete MPI_COMM_WORLD->group();
-      MSG_barrier_destroy(process_data[0]->finalization_barrier());
-  }else{
-      smpi_deployment_cleanup_instances();
-  }
+  smpi_deployment_cleanup_instances();
+  int count = smpi_process_count();
   for (int i = 0; i < count; i++) {
     if(process_data[i]->comm_self()!=MPI_COMM_NULL){
       simgrid::smpi::Comm::destroy(process_data[i]->comm_self());
@@ -385,13 +386,8 @@ void smpi_global_destroy()
   delete[] process_data;
   process_data = nullptr;
 
-  if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){
-    MPI_COMM_WORLD->cleanup_smp();
-    MPI_COMM_WORLD->cleanup_attr<simgrid::smpi::Comm>();
-    if(simgrid::smpi::Colls::smpi_coll_cleanup_callback!=nullptr)
-      simgrid::smpi::Colls::smpi_coll_cleanup_callback();
-    delete MPI_COMM_WORLD;
-  }
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback != nullptr)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback();
 
   MPI_COMM_WORLD = MPI_COMM_NULL;
 
@@ -399,7 +395,7 @@ void smpi_global_destroy()
     xbt_os_timer_free(global_timer);
   }
 
-  xbt_free(index_to_process_data);
+  delete[] index_to_process_data;
   if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP)
     smpi_destroy_global_memory_segments();
   smpi_free_static();
@@ -421,11 +417,13 @@ static void smpi_init_logs(){
   XBT_LOG_CONNECT(smpi_datatype);
   XBT_LOG_CONNECT(smpi_dvfs);
   XBT_LOG_CONNECT(smpi_group);
+  XBT_LOG_CONNECT(smpi_host);
   XBT_LOG_CONNECT(smpi_kernel);
   XBT_LOG_CONNECT(smpi_mpi);
   XBT_LOG_CONNECT(smpi_memory);
   XBT_LOG_CONNECT(smpi_op);
   XBT_LOG_CONNECT(smpi_pmpi);
+  XBT_LOG_CONNECT(smpi_process);
   XBT_LOG_CONNECT(smpi_request);
   XBT_LOG_CONNECT(smpi_replay);
   XBT_LOG_CONNECT(smpi_rma);
@@ -435,31 +433,24 @@ static void smpi_init_logs(){
 }
 
 static void smpi_init_options(){
-    //return if already called
-    if (smpi_cpu_threshold > -1)
-      return;
-    simgrid::smpi::Colls::set_collectives();
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=nullptr;
-    smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu-threshold");
-    smpi_host_speed = xbt_cfg_get_double("smpi/host-speed");
-    const char* smpi_privatize_option               = xbt_cfg_get_string("smpi/privatization");
-    if (std::strcmp(smpi_privatize_option, "no") == 0)
-      smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE;
-    else if (std::strcmp(smpi_privatize_option, "yes") == 0)
-      smpi_privatize_global_variables = SMPI_PRIVATIZE_DEFAULT;
-    else if (std::strcmp(smpi_privatize_option, "mmap") == 0)
-      smpi_privatize_global_variables = SMPI_PRIVATIZE_MMAP;
-    else if (std::strcmp(smpi_privatize_option, "dlopen") == 0)
-      smpi_privatize_global_variables = SMPI_PRIVATIZE_DLOPEN;
-
-    // Some compatibility stuff:
-    else if (std::strcmp(smpi_privatize_option, "1") == 0)
-      smpi_privatize_global_variables = SMPI_PRIVATIZE_DEFAULT;
-    else if (std::strcmp(smpi_privatize_option, "0") == 0)
-      smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE;
-
-    else
-      xbt_die("Invalid value for smpi/privatization: '%s'", smpi_privatize_option);
+  // return if already called
+  if (smpi_cpu_threshold > -1)
+    return;
+  simgrid::smpi::Colls::set_collectives();
+  simgrid::smpi::Colls::smpi_coll_cleanup_callback = nullptr;
+  smpi_cpu_threshold                               = xbt_cfg_get_double("smpi/cpu-threshold");
+  smpi_host_speed                                  = xbt_cfg_get_double("smpi/host-speed");
+  std::string smpi_privatize_option                = xbt_cfg_get_string("smpi/privatization");
+  if (smpi_privatize_option == "no" || smpi_privatize_option == "0")
+    smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE;
+  else if (smpi_privatize_option == "yes" || smpi_privatize_option == "1")
+    smpi_privatize_global_variables = SMPI_PRIVATIZE_DEFAULT;
+  else if (smpi_privatize_option == "mmap")
+    smpi_privatize_global_variables = SMPI_PRIVATIZE_MMAP;
+  else if (smpi_privatize_option == "dlopen")
+    smpi_privatize_global_variables = SMPI_PRIVATIZE_DLOPEN;
+  else
+    xbt_die("Invalid value for smpi/privatization: '%s'", smpi_privatize_option.c_str());
 
 #if defined(__FreeBSD__)
     if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
@@ -471,17 +462,16 @@ static void smpi_init_options(){
     if (smpi_cpu_threshold < 0)
       smpi_cpu_threshold = DBL_MAX;
 
-    char* val = xbt_cfg_get_string("smpi/shared-malloc");
-    if (not strcasecmp(val, "yes") || not strcmp(val, "1") || not strcasecmp(val, "on") ||
-        not strcasecmp(val, "global")) {
+    std::string val = xbt_cfg_get_string("smpi/shared-malloc");
+    if ((val == "yes") || (val == "1") || (val == "on") || (val == "global")) {
       smpi_cfg_shared_malloc = shmalloc_global;
-    } else if (not strcasecmp(val, "local")) {
+    } else if (val == "local") {
       smpi_cfg_shared_malloc = shmalloc_local;
-    } else if (not strcasecmp(val, "no") || not strcmp(val, "0") || not strcasecmp(val, "off")) {
+    } else if ((val == "no") || (val == "0") || (val == "off")) {
       smpi_cfg_shared_malloc = shmalloc_none;
     } else {
       xbt_die("Invalid value '%s' for option smpi/shared-malloc. Possible values: 'on' or 'global', 'local', 'off'",
-              val);
+              val.c_str());
     }
 }
 
@@ -536,7 +526,7 @@ int smpi_main(const char* executable, int argc, char *argv[])
     return 0;
   }
 
-  TRACE_global_init(&argc, argv);
+  TRACE_global_init();
 
   SIMIX_global_init(&argc, argv);
   MSG_init(&argc,argv);
@@ -607,10 +597,11 @@ int smpi_main(const char* executable, int argc, char *argv[])
 
         // Load the copy and resolve the entry point:
         void* handle = dlopen(target_executable.c_str(), RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND);
+        int saved_errno = errno;
         if (xbt_cfg_get_boolean("smpi/keep-temps") == false)
           unlink(target_executable.c_str());
         if (handle == nullptr)
-          xbt_die("dlopen failed: %s (errno: %d -- %s)", dlerror(), errno, strerror(errno));
+          xbt_die("dlopen failed: %s (errno: %d -- %s)", dlerror(), saved_errno, strerror(saved_errno));
         smpi_entry_point_type entry_point = smpi_resolve_function(handle);
         if (not entry_point)
           xbt_die("Could not resolve entry point");
@@ -667,8 +658,8 @@ int smpi_main(const char* executable, int argc, char *argv[])
       "You may want to use sampling functions or trace replay to reduce this.");
     }
   }
-  int count = smpi_process_count();
   int ret   = 0;
+  int count = smpi_process_count();
   for (int i = 0; i < count; i++) {
     if(process_data[i]->return_value()!=0){
       ret=process_data[i]->return_value();//return first non 0 value
@@ -691,7 +682,7 @@ void SMPI_init(){
   TRACE_smpi_alloc();
   simgrid::surf::surfExitCallbacks.connect(TRACE_smpi_release);
   if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP)
-    smpi_initialize_global_memory_segments();
+    smpi_backup_global_memory_segment();
 }
 
 void SMPI_finalize(){
index 719b28b..8719bd5 100644 (file)
@@ -3,35 +3,41 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <cstdint>
+#include <cerrno>
 #include <climits>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
 #include <cstring>
-
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdio.h>
+#include <deque>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <errno.h>
+#include <sys/types.h>
+#include <vector>
 
 #ifndef WIN32
 #include <sys/mman.h>
 #include <unistd.h>
 
+#include "src/internal_config.h"
 #include "src/xbt/memory_map.hpp"
 
-#include "private.h"
 #include "private.hpp"
+#include "smpi_process.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_memory, smpi, "Memory layout support for SMPI");
 
-int smpi_loaded_page = -1;
-char* smpi_start_data_exe = nullptr;
-int smpi_size_data_exe = 0;
+int smpi_loaded_page      = -1;
+char* smpi_data_exe_start = nullptr;
+int smpi_data_exe_size    = 0;
 int smpi_privatize_global_variables;
+static void* smpi_data_exe_copy;
+
+// We keep a copy of all the privatization regions: We can then delete everything easily by iterating over this
+// collection and nothing can be leaked. We could also iterate over all actors but we would have to be diligent when two
+// actors use the same privatization region (so, smart pointers would have to be used etc.)
+// Use a std::deque so that pointers remain valid after push_back().
+static std::deque<s_smpi_privatization_region_t> smpi_privatization_regions;
 
 static const int PROT_RWX = (PROT_READ | PROT_WRITE | PROT_EXEC);
 static const int PROT_RW  = (PROT_READ | PROT_WRITE );
@@ -51,15 +57,15 @@ void smpi_get_executable_global_size()
 
     // File backed RW entry:
     if (i->pathname == full_name && (i->prot & PROT_RWX) == PROT_RW) {
-      smpi_start_data_exe = (char*) i->start_addr;
-      smpi_size_data_exe = i->end_addr - i->start_addr;
+      smpi_data_exe_start = (char*)i->start_addr;
+      smpi_data_exe_size  = i->end_addr - i->start_addr;
       ++i;
       /* Here we are making the assumption that a suitable empty region
          following the rw- area is the end of the data segment. It would
          be better to check with the size of the data segment. */
-      if (i != map.end() && i->pathname.empty() && (i->prot & PROT_RWX) == PROT_RW
-          && (char*)i->start_addr ==  smpi_start_data_exe + smpi_size_data_exe) {
-        smpi_size_data_exe = (char*)i->end_addr - smpi_start_data_exe;
+      if (i != map.end() && i->pathname.empty() && (i->prot & PROT_RWX) == PROT_RW &&
+          (char*)i->start_addr == smpi_data_exe_start + smpi_data_exe_size) {
+        smpi_data_exe_size = (char*)i->end_addr - smpi_data_exe_start;
       }
       return;
     }
@@ -68,6 +74,27 @@ void smpi_get_executable_global_size()
 }
 #endif
 
+#if HAVE_SANITIZE_ADDRESS
+#include <sanitizer/asan_interface.h>
+static void* asan_safe_memcpy(void* dest, void* src, size_t n)
+{
+  char* psrc  = static_cast<char*>(src);
+  char* pdest = static_cast<char*>(dest);
+  for (size_t i = 0; i < n;) {
+    while (i < n && __asan_address_is_poisoned(psrc + i))
+      ++i;
+    if (i < n) {
+      char* p  = static_cast<char*>(__asan_region_is_poisoned(psrc + i, n - i));
+      size_t j = p ? (p - psrc) : n;
+      memcpy(pdest + i, psrc + i, j - i);
+      i = j;
+    }
+  }
+  return dest;
+}
+#else
+#define asan_safe_memcpy(dest, src, n) memcpy(dest, src, n)
+#endif
 
 /** Map a given SMPI privatization segment (make a SMPI process active) */
 void smpi_switch_data_segment(int dest) {
@@ -85,22 +112,17 @@ void smpi_switch_data_segment(int dest) {
  */
 void smpi_really_switch_data_segment(int dest)
 {
-  if(smpi_size_data_exe == 0)//no need to switch
+  if (smpi_data_exe_size == 0) // no need to switch
     return;
 
 #if HAVE_PRIVATIZATION
-  if(smpi_loaded_page==-1){//initial switch, do the copy from the real page here
-    for (int i=0; i< smpi_process_count(); i++){
-      memcpy(smpi_privatization_regions[i].address, TOPAGE(smpi_start_data_exe), smpi_size_data_exe);
-    }
-  }
-
   // FIXME, cross-process support (mmap across process when necessary)
-  int current = smpi_privatization_regions[dest].file_descriptor;
+  simgrid::smpi::Process* process = smpi_process_remote(dest);
+  int current                     = process->privatized_region()->file_descriptor;
   XBT_DEBUG("Switching data frame to the one of process %d", dest);
   void* tmp =
-      mmap(TOPAGE(smpi_start_data_exe), smpi_size_data_exe, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, current, 0);
-  if (tmp != TOPAGE(smpi_start_data_exe))
+      mmap(TOPAGE(smpi_data_exe_start), smpi_data_exe_size, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, current, 0);
+  if (tmp != TOPAGE(smpi_data_exe_start))
     xbt_die("Couldn't map the new region (errno %d): %s", errno, strerror(errno));
   smpi_loaded_page = dest;
 #endif
@@ -108,39 +130,50 @@ void smpi_really_switch_data_segment(int dest)
 
 int smpi_is_privatization_file(char* file)
 {
-  return strncmp("/dev/shm/my-buffer-", file, std::strlen("/dev/shm/my-buffer-")) == 0;
+  const std::string buffer_path("/dev/shm/my-buffer-");
+  return buffer_path.compare(0, std::string::npos, file, buffer_path.length()) == 0;
 }
 
-void smpi_initialize_global_memory_segments()
+// TODO: cheinrich: The behavior changed; this now only makes a backup of the
+// data segment. I think the function should be renamed.
+void smpi_backup_global_memory_segment()
 {
-
 #if HAVE_PRIVATIZATION
   smpi_get_executable_global_size();
 
-  XBT_DEBUG ("bss+data segment found : size %d starting at %p", smpi_size_data_exe, smpi_start_data_exe );
+  XBT_DEBUG("bss+data segment found : size %d starting at %p", smpi_data_exe_size, smpi_data_exe_start);
 
-  if (smpi_size_data_exe == 0){//no need to switch
+  if (smpi_data_exe_size == 0) { // no need to do anything as global variables don't exist
     smpi_privatize_global_variables=false;
     return;
   }
 
-  smpi_privatization_regions = static_cast<smpi_privatization_region_t>(
-      xbt_malloc(smpi_process_count() * sizeof(struct s_smpi_privatization_region)));
-
-  for (int i=0; i< smpi_process_count(); i++){
-    // create SIMIX_process_count() mappings of this size with the same data inside
-    int file_descriptor;
-    void* address = nullptr;
-    char path[24];
-    int status;
-
-    do {
-      snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffff);
-      file_descriptor = shm_open(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
-    } while (file_descriptor == -1 && errno == EEXIST);
-    if (file_descriptor < 0) {
-      if (errno == EMFILE) {
-        xbt_die("Impossible to create temporary file for memory mapping: %s\n\
+  smpi_data_exe_copy = ::operator new(smpi_data_exe_size);
+  // Make a copy of the data segment. This clean copy is retained over the whole runtime
+  // of the simulation and can be used to initialize a dynamically added, new process.
+  asan_safe_memcpy(smpi_data_exe_copy, TOPAGE(smpi_data_exe_start), smpi_data_exe_size);
+#else /* ! HAVE_PRIVATIZATION */
+  smpi_privatize_global_variables = false;
+  xbt_die("You are trying to use privatization on a system that does not support it. Don't.");
+  return;
+#endif
+}
+
+// Initializes the memory mapping for a single process and returns the privatization region
+smpi_privatization_region_t smpi_init_global_memory_segment_process()
+{
+  int file_descriptor;
+  void* address = nullptr;
+  char path[24];
+  int status;
+
+  do {
+    snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffffU);
+    file_descriptor = shm_open(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+  } while (file_descriptor == -1 && errno == EEXIST);
+  if (file_descriptor < 0) {
+    if (errno == EMFILE) {
+      xbt_die("Impossible to create temporary file for memory mapping: %s\n\
 The open() system call failed with the EMFILE error code (too many files). \n\n\
 This means that you reached the system limits concerning the amount of files per process. \
 This is not a surprise if you are trying to virtualize many processes on top of SMPI. \
@@ -152,48 +185,44 @@ First, check what your limits are:\n\
   cat /proc/self/limits     # Displays any per-process limitation (including the one given above)\n\n\
 If one of these values is less than the amount of MPI processes that you try to run, then you got the explanation of this error. \
 Ask the Internet about tutorials on how to increase the files limit such as: https://rtcamp.com/tutorials/linux/increase-open-files-limit/",
-                strerror(errno));
-      }
-      xbt_die("Impossible to create temporary file for memory mapping: %s", strerror(errno));
+              strerror(errno));
     }
+    xbt_die("Impossible to create temporary file for memory mapping: %s", strerror(errno));
+  }
 
-    status = ftruncate(file_descriptor, smpi_size_data_exe);
-    if (status)
-      xbt_die("Impossible to set the size of the temporary file for memory mapping");
+  status = ftruncate(file_descriptor, smpi_data_exe_size);
+  if (status)
+    xbt_die("Impossible to set the size of the temporary file for memory mapping");
 
-    /* Ask for a free region */
-    address = mmap(nullptr, smpi_size_data_exe, PROT_READ | PROT_WRITE, MAP_SHARED, file_descriptor, 0);
-    if (address == MAP_FAILED)
-      xbt_die("Couldn't find a free region for memory mapping");
+  /* Ask for a free region */
+  address = mmap(nullptr, smpi_data_exe_size, PROT_READ | PROT_WRITE, MAP_SHARED, file_descriptor, 0);
+  if (address == MAP_FAILED)
+    xbt_die("Couldn't find a free region for memory mapping");
 
-    status = shm_unlink(path);
-    if (status)
-      xbt_die("Impossible to unlink temporary file for memory mapping");
+  status = shm_unlink(path);
+  if (status)
+    xbt_die("Impossible to unlink temporary file for memory mapping");
 
-    // initialize the values
-    memcpy(address, TOPAGE(smpi_start_data_exe), smpi_size_data_exe);
+  // initialize the values
+  asan_safe_memcpy(address, smpi_data_exe_copy, smpi_data_exe_size);
 
-    // store the address of the mapping for further switches
-    smpi_privatization_regions[i].file_descriptor = file_descriptor;
-    smpi_privatization_regions[i].address         = address;
-  }
-#else /* ! HAVE_PRIVATIZATION */
-  smpi_privatize_global_variables = false;
-  xbt_die("You are trying to use privatization on a system that does not support it. Don't.");
-  return;
-#endif
+  // store the address of the mapping for further switches
+  smpi_privatization_regions.emplace_back(s_smpi_privatization_region_t{address, file_descriptor});
+
+  return &smpi_privatization_regions.back();
 }
 
 void smpi_destroy_global_memory_segments(){
-  if (smpi_size_data_exe == 0)//no need to switch
+  if (smpi_data_exe_size == 0) // no need to switch
     return;
 #if HAVE_PRIVATIZATION
-  for (int i=0; i< smpi_process_count(); i++) {
-    if (munmap(smpi_privatization_regions[i].address, smpi_size_data_exe) < 0)
-      XBT_WARN("Unmapping of fd %d failed: %s", smpi_privatization_regions[i].file_descriptor, strerror(errno));
-    close(smpi_privatization_regions[i].file_descriptor);
+  for (auto const& region : smpi_privatization_regions) {
+    if (munmap(region.address, smpi_data_exe_size) < 0)
+      XBT_WARN("Unmapping of fd %d failed: %s", region.file_descriptor, strerror(errno));
+    close(region.file_descriptor);
   }
-  xbt_free(smpi_privatization_regions);
+  smpi_privatization_regions.clear();
+  ::operator delete(smpi_data_exe_copy);
 #endif
 }
 
index 451f3cf..b6c4d10 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.hpp"
+#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)");
 
@@ -24,13 +22,13 @@ extern int* index_to_process_data;
 
 static char *get_mailbox_name(char *str, int index)
 {
-  snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast<int> (sizeof(int) * 2), index);
+  snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast<int>(sizeof(int) * 2), static_cast<unsigned>(index));
   return str;
 }
 
 static char *get_mailbox_name_small(char *str, int index)
 {
-  snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast<int> (sizeof(int) * 2), index);
+  snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast<int>(sizeof(int) * 2), static_cast<unsigned>(index));
   return str;
 }
 
@@ -70,12 +68,12 @@ Process::Process(int index, msg_bar_t finalization_barrier)
 void Process::set_data(int index, int* argc, char*** argv)
 {
     char* instance_id = (*argv)[1];
-    comm_world_         = smpi_deployment_comm_world(instance_id);
-    msg_bar_t bar = smpi_deployment_finalization_barrier(instance_id);
-    if (bar!=nullptr) // don't overwrite the default one
+    comm_world_       = smpi_deployment_comm_world(instance_id);
+    msg_bar_t bar     = smpi_deployment_finalization_barrier(instance_id);
+    if (bar != nullptr) // don't overwrite the current one if the instance has none
       finalization_barrier_ = bar;
     instance_id_ = instance_id;
-    index_ = index;
+    index_       = index;
 
     static_cast<simgrid::msg::ActorExt*>(SIMIX_process_self()->userdata)->data = this;
 
@@ -158,10 +156,8 @@ smx_actor_t Process::process(){
   return process_;
 }
 
-
 /**
- * \brief Returns a structure that stores the location (filename + linenumber)
- *        of the last calls to MPI_* functions.
+ * \brief Returns a structure that stores the location (filename + linenumber) of the last calls to MPI_* functions.
  *
  * \see smpi_trace_set_call_location
  */
@@ -170,6 +166,16 @@ smpi_trace_call_location_t* Process::call_location()
   return &trace_call_loc_;
 }
 
+void Process::set_privatized_region(smpi_privatization_region_t region)
+{
+  privatized_region_ = region;
+}
+
+smpi_privatization_region_t Process::privatized_region()
+{
+  return privatized_region_;
+}
+
 int Process::index()
 {
   return index_;
@@ -274,24 +280,31 @@ void Process::init(int *argc, char ***argv){
     smx_actor_t proc = SIMIX_process_self();
     proc->context->set_cleanup(&MSG_process_cleanup_from_SIMIX);
 
-    int index = proc->pid - 1;
+    int index = proc->pid - 1; // The maestro process has always ID 0 but we don't need that process here
 
     if(index_to_process_data == nullptr){
       index_to_process_data=static_cast<int*>(xbt_malloc(SIMIX_process_count()*sizeof(int)));
     }
 
     char* instance_id = (*argv)[1];
-    int rank = xbt_str_parse_int((*argv)[2], "Invalid rank: %s");
-    smpi_deployment_register_process(instance_id, rank, index);
+    try {
+      int rank = std::stoi(std::string((*argv)[2]));
+      smpi_deployment_register_process(instance_id, rank, index);
+    } catch (std::invalid_argument& ia) {
+      throw std::invalid_argument(std::string("Invalid rank: ") + (*argv)[2]);
+    }
 
+    // cheinrich: I'm not sure what the impact of the SMPI_switch_data_segment on this call is. I moved
+    // this up here so that I can set the privatized region before the switch.
+    Process* process = smpi_process_remote(index);
     if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){
       /* Now using segment index of the process  */
       index = proc->segment_index;
+      process->set_privatized_region(smpi_init_global_memory_segment_process());
       /* Done at the process's creation */
       SMPI_switch_data_segment(index);
     }
 
-    Process* process = smpi_process_remote(index);
     process->set_data(index, argc, argv);
   }
   xbt_assert(smpi_process(),
index c41904e..8e02386 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"
@@ -118,12 +118,8 @@ static MPI_Datatype decode_datatype(const char *const action)
    return MPI_CURRENT_TYPE;
 }
 
-const char* encode_datatype(MPI_Datatype datatype, int* known)
+const char* encode_datatype(MPI_Datatype datatype)
 {
-  //default type for output is set to MPI_BYTE
-  // MPI_DEFAULT_TYPE is not set for output, use directly MPI_BYTE
-  if(known!=nullptr)
-    *known=1;
   if (datatype==MPI_BYTE)
       return "";
   if(datatype==MPI_DOUBLE)
@@ -138,9 +134,6 @@ const char* encode_datatype(MPI_Datatype datatype, int* known)
     return "4";
   if(datatype==MPI_FLOAT)
       return "5";
-  //tell that the datatype is not handled by replay, and that its size should be measured and replayed as size*MPI_BYTE
-  if(known!=nullptr)
-    *known=0;
   // default - not implemented.
   // do not warn here as we pass in this function even for other trace formats
   return "-1";
@@ -165,8 +158,9 @@ static void action_init(const char *const *action)
   XBT_DEBUG("Initialize the counters");
   CHECK_ACTION_PARAMS(action, 0, 1)
   if(action[2])
-    MPI_DEFAULT_TYPE=MPI_DOUBLE; // default MPE dataype
-  else MPI_DEFAULT_TYPE= MPI_BYTE; // default TAU datatype
+    MPI_DEFAULT_TYPE = MPI_DOUBLE; // default MPE datatype
+  else
+    MPI_DEFAULT_TYPE = MPI_BYTE; // default TAU datatype
 
   /* start a simulated timer */
   smpi_process()->simulated_start();
@@ -203,14 +197,11 @@ static void action_compute(const char *const *action)
   double clock = smpi_process()->simulated_elapsed();
   double flops= parse_double(action[2]);
   int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type=TRACING_COMPUTING;
-  extra->comp_size=flops;
-  TRACE_smpi_computing_in(rank, extra);
 
+  TRACE_smpi_computing_in(rank, flops);
   smpi_execute_flops(flops);
-
   TRACE_smpi_computing_out(rank);
+
   log_timed_action (action, clock);
 }
 
@@ -227,23 +218,18 @@ static void action_send(const char *const *action)
     MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
   int rank = smpi_process()->index();
-
   int dst_traced = MPI_COMM_WORLD->group()->rank(to);
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_SEND;
-  extra->send_size = size;
-  extra->src = rank;
-  extra->dst = dst_traced;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
+
+  TRACE_smpi_comm_in(rank, __FUNCTION__,
+                     new simgrid::instr::Pt2PtTIData("send", dst_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
   if (not TRACE_smpi_view_internals())
     TRACE_smpi_send(rank, rank, dst_traced, 0, size*MPI_CURRENT_TYPE->size());
 
   Request::send(nullptr, size, MPI_CURRENT_TYPE, to , 0, MPI_COMM_WORLD);
 
-  log_timed_action (action, clock);
+  TRACE_smpi_comm_out(rank);
 
-  TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+  log_timed_action(action, clock);
 }
 
 static void action_Isend(const char *const *action)
@@ -260,19 +246,14 @@ static void action_Isend(const char *const *action)
 
   int rank = smpi_process()->index();
   int dst_traced = MPI_COMM_WORLD->group()->rank(to);
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_ISEND;
-  extra->send_size = size;
-  extra->src = rank;
-  extra->dst = dst_traced;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__,
+                     new simgrid::instr::Pt2PtTIData("Isend", dst_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
   if (not TRACE_smpi_view_internals())
     TRACE_smpi_send(rank, rank, dst_traced, 0, size*MPI_CURRENT_TYPE->size());
 
-  MPI_Request request = Request::isend(nullptr, size, MPI_CURRENT_TYPE, to, 0,MPI_COMM_WORLD);
+  MPI_Request request = Request::isend(nullptr, size, MPI_CURRENT_TYPE, to, 0, MPI_COMM_WORLD);
 
-  TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
 
   get_reqq_self()->push_back(request);
 
@@ -294,25 +275,20 @@ static void action_recv(const char *const *action) {
   int rank = smpi_process()->index();
   int src_traced = MPI_COMM_WORLD->group()->rank(from);
 
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_RECV;
-  extra->send_size = size;
-  extra->src = src_traced;
-  extra->dst = rank;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__,
+                     new simgrid::instr::Pt2PtTIData("recv", src_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
 
   //unknown size from the receiver point of view
-  if(size<=0.0){
+  if (size <= 0.0) {
     Request::probe(from, 0, MPI_COMM_WORLD, &status);
     size=status.count;
   }
 
   Request::recv(nullptr, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD, &status);
 
-  TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   if (not TRACE_smpi_view_internals()) {
-    TRACE_smpi_recv(rank, src_traced, rank, 0);
+    TRACE_smpi_recv(src_traced, rank, 0);
   }
 
   log_timed_action (action, clock);
@@ -332,29 +308,25 @@ static void action_Irecv(const char *const *action)
 
   int rank = smpi_process()->index();
   int src_traced = MPI_COMM_WORLD->group()->rank(from);
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_IRECV;
-  extra->send_size = size;
-  extra->src = src_traced;
-  extra->dst = rank;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__,
+                     new simgrid::instr::Pt2PtTIData("Irecv", src_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
   MPI_Status status;
   //unknow size from the receiver pov
-  if(size<=0.0){
-      Request::probe(from, 0, MPI_COMM_WORLD, &status);
-      size=status.count;
+  if (size <= 0.0) {
+    Request::probe(from, 0, MPI_COMM_WORLD, &status);
+    size = status.count;
   }
 
   MPI_Request request = Request::irecv(nullptr, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD);
 
-  TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   get_reqq_self()->push_back(request);
 
   log_timed_action (action, clock);
 }
 
-static void action_test(const char *const *action){
+static void action_test(const char* const* action)
+{
   CHECK_ACTION_PARAMS(action, 0, 0)
   double clock = smpi_process()->simulated_elapsed();
   MPI_Status status;
@@ -366,9 +338,7 @@ static void action_test(const char *const *action){
   //In this case, ignore the extra calls.
   if(request!=nullptr){
     int rank = smpi_process()->index();
-    instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-    extra->type=TRACING_TEST;
-    TRACE_smpi_testing_in(rank, extra);
+    TRACE_smpi_testing_in(rank);
 
     int flag = Request::test(&request, &status);
 
@@ -402,49 +372,43 @@ static void action_wait(const char *const *action){
   int src_traced = group->rank(request->src());
   int dst_traced = group->rank(request->dst());
   int is_wait_for_receive = (request->flags() & RECV);
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_WAIT;
-  TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("wait"));
 
   Request::wait(&request, &status);
 
-  TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   if (is_wait_for_receive)
-    TRACE_smpi_recv(rank, src_traced, dst_traced, 0);
+    TRACE_smpi_recv(src_traced, dst_traced, 0);
   log_timed_action (action, clock);
 }
 
 static void action_waitall(const char *const *action){
   CHECK_ACTION_PARAMS(action, 0, 0)
   double clock = smpi_process()->simulated_elapsed();
-  unsigned int count_requests=get_reqq_self()->size();
+  const unsigned int count_requests = get_reqq_self()->size();
 
   if (count_requests>0) {
     MPI_Status status[count_requests];
 
    int rank_traced = smpi_process()->index();
-   instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-   extra->type = TRACING_WAITALL;
-   extra->send_size=count_requests;
-   TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__,extra);
+   TRACE_smpi_comm_in(rank_traced, __FUNCTION__, new simgrid::instr::Pt2PtTIData("waitAll", -1, count_requests, ""));
    int recvs_snd[count_requests];
    int recvs_rcv[count_requests];
-   unsigned int i=0;
-   for (auto req : *(get_reqq_self())){
+   for (unsigned int i = 0; i < count_requests; i++) {
+     const auto& req = (*get_reqq_self())[i];
      if (req && (req->flags () & RECV)){
        recvs_snd[i]=req->src();
        recvs_rcv[i]=req->dst();
      }else
        recvs_snd[i]=-100;
-     i++;
    }
    Request::waitall(count_requests, &(*get_reqq_self())[0], status);
 
-   for (i=0; i<count_requests;i++){
+   for (unsigned i = 0; i < count_requests; i++) {
      if (recvs_snd[i]!=-100)
-       TRACE_smpi_recv(rank_traced, recvs_snd[i], recvs_rcv[i],0);
+       TRACE_smpi_recv(recvs_snd[i], recvs_rcv[i],0);
    }
-   TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
+   TRACE_smpi_comm_out(rank_traced);
   }
   log_timed_action (action, clock);
 }
@@ -452,13 +416,11 @@ static void action_waitall(const char *const *action){
 static void action_barrier(const char *const *action){
   double clock = smpi_process()->simulated_elapsed();
   int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_BARRIER;
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("barrier"));
 
   Colls::barrier(MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -478,19 +440,15 @@ static void action_bcast(const char *const *action)
   }
 
   int rank = smpi_process()->index();
-  int root_traced = MPI_COMM_WORLD->group()->index(root);
-
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_BCAST;
-  extra->send_size = size;
-  extra->root = root_traced;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__,
+                     new simgrid::instr::CollTIData("bcast", MPI_COMM_WORLD->group()->index(root), -1.0, size, -1,
+                                                    encode_datatype(MPI_CURRENT_TYPE), ""));
+
   void *sendbuf = smpi_get_tmp_sendbuffer(size* MPI_CURRENT_TYPE->size());
 
   Colls::bcast(sendbuf, size, MPI_CURRENT_TYPE, root, MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -510,22 +468,16 @@ static void action_reduce(const char *const *action)
   }
 
   int rank = smpi_process()->index();
-  int root_traced = MPI_COMM_WORLD->group()->rank(root);
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_REDUCE;
-  extra->send_size = comm_size;
-  extra->comp_size = comp_size;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->root = root_traced;
-
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__,
+                     new simgrid::instr::CollTIData("reduce", MPI_COMM_WORLD->group()->index(root), comp_size,
+                                                    comm_size, -1, encode_datatype(MPI_CURRENT_TYPE), ""));
 
   void *recvbuf = smpi_get_tmp_sendbuffer(comm_size* MPI_CURRENT_TYPE->size());
   void *sendbuf = smpi_get_tmp_sendbuffer(comm_size* MPI_CURRENT_TYPE->size());
   Colls::reduce(sendbuf, recvbuf, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, root, MPI_COMM_WORLD);
   smpi_execute_flops(comp_size);
 
-  TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -541,19 +493,15 @@ static void action_allReduce(const char *const *action) {
 
   double clock = smpi_process()->simulated_elapsed();
   int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_ALLREDUCE;
-  extra->send_size = comm_size;
-  extra->comp_size = comp_size;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::CollTIData("allReduce", -1, comp_size, comm_size, -1,
+                                                                        encode_datatype(MPI_CURRENT_TYPE), ""));
 
   void *recvbuf = smpi_get_tmp_sendbuffer(comm_size* MPI_CURRENT_TYPE->size());
   void *sendbuf = smpi_get_tmp_sendbuffer(comm_size* MPI_CURRENT_TYPE->size());
   Colls::allreduce(sendbuf, recvbuf, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, MPI_COMM_WORLD);
   smpi_execute_flops(comp_size);
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -576,18 +524,13 @@ static void action_allToAll(const char *const *action) {
   void *recv = smpi_get_tmp_recvbuffer(recv_size*comm_size* MPI_CURRENT_TYPE2->size());
 
   int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_ALLTOALL;
-  extra->send_size = send_size;
-  extra->recv_size = recv_size;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
-
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::CollTIData("allToAll", -1, -1.0, send_size, recv_size,
+                                                                        encode_datatype(MPI_CURRENT_TYPE),
+                                                                        encode_datatype(MPI_CURRENT_TYPE2)));
 
   Colls::alltoall(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -623,22 +566,59 @@ static void action_gather(const char *const *action) {
   if(rank==root)
     recv = smpi_get_tmp_recvbuffer(recv_size*comm_size* MPI_CURRENT_TYPE2->size());
 
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_GATHER;
-  extra->send_size = send_size;
-  extra->recv_size = recv_size;
-  extra->root = root;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
-
-  TRACE_smpi_collective_in(smpi_process()->index(), root, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::CollTIData("gather", root, -1.0, send_size, recv_size,
+                                                                        encode_datatype(MPI_CURRENT_TYPE),
+                                                                        encode_datatype(MPI_CURRENT_TYPE2)));
 
   Colls::gather(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE2, root, MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(smpi_process()->index(), -1, __FUNCTION__);
+  TRACE_smpi_comm_out(smpi_process()->index());
   log_timed_action (action, clock);
 }
 
+static void action_scatter(const char* const* action)
+{
+  /* The structure of the scatter action for the rank 0 (total 4 processes) is the following:
+        0 gather 68 68 0 0 0
+      where:
+        1) 68 is the sendcounts
+        2) 68 is the recvcounts
+        3) 0 is the root node
+        4) 0 is the send datatype id, see decode_datatype()
+        5) 0 is the recv datatype id, see decode_datatype()
+  */
+  CHECK_ACTION_PARAMS(action, 2, 3)
+  double clock                   = smpi_process()->simulated_elapsed();
+  int comm_size                  = MPI_COMM_WORLD->size();
+  int send_size                  = parse_double(action[2]);
+  int recv_size                  = parse_double(action[3]);
+  MPI_Datatype MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;
+  if (action[4] && action[5]) {
+    MPI_CURRENT_TYPE  = decode_datatype(action[5]);
+    MPI_CURRENT_TYPE2 = decode_datatype(action[6]);
+  } else {
+    MPI_CURRENT_TYPE = MPI_DEFAULT_TYPE;
+  }
+  void* send = smpi_get_tmp_sendbuffer(send_size * MPI_CURRENT_TYPE->size());
+  void* recv = nullptr;
+  int root   = 0;
+  if (action[4])
+    root   = atoi(action[4]);
+  int rank = MPI_COMM_WORLD->rank();
+
+  if (rank == root)
+    recv = smpi_get_tmp_recvbuffer(recv_size * comm_size * MPI_CURRENT_TYPE2->size());
+
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::CollTIData("gather", root, -1.0, send_size, recv_size,
+                                                                        encode_datatype(MPI_CURRENT_TYPE),
+                                                                        encode_datatype(MPI_CURRENT_TYPE2)));
+
+  Colls::scatter(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE2, root, MPI_COMM_WORLD);
+
+  TRACE_smpi_comm_out(smpi_process()->index());
+  log_timed_action(action, clock);
+}
+
 static void action_gatherv(const char *const *action) {
   /* The structure of the gatherv action for the rank 0 (total 4 processes) is the following:
        0 gather 68 68 10 10 10 0 0 0
@@ -678,25 +658,74 @@ static void action_gatherv(const char *const *action) {
   if(rank==root)
     recv = smpi_get_tmp_recvbuffer(recv_sum* MPI_CURRENT_TYPE2->size());
 
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_GATHERV;
-  extra->send_size = send_size;
-  extra->recvcounts= xbt_new(int,comm_size);
-  for(int i=0; i< comm_size; i++)//copy data to avoid bad free
-    extra->recvcounts[i] = recvcounts[i];
-  extra->root = root;
-  extra->num_processes = comm_size;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
+  std::vector<int>* trace_recvcounts = new std::vector<int>;
+  for (int i = 0; i < comm_size; i++) // copy data to avoid bad free
+    trace_recvcounts->push_back(recvcounts[i]);
 
-  TRACE_smpi_collective_in(smpi_process()->index(), root, __FUNCTION__, extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
+                                             "gatherV", root, send_size, nullptr, -1, trace_recvcounts,
+                                             encode_datatype(MPI_CURRENT_TYPE), encode_datatype(MPI_CURRENT_TYPE2)));
 
   Colls::gatherv(send, send_size, MPI_CURRENT_TYPE, recv, recvcounts, disps, MPI_CURRENT_TYPE2, root, MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(smpi_process()->index(), -1, __FUNCTION__);
+  TRACE_smpi_comm_out(smpi_process()->index());
   log_timed_action (action, clock);
 }
 
+static void action_scatterv(const char* const* action)
+{
+  /* The structure of the scatterv action for the rank 0 (total 4 processes) is the following:
+       0 gather 68 10 10 10 68 0 0 0
+     where:
+       1) 68 10 10 10 is the sendcounts
+       2) 68 is the recvcount
+       3) 0 is the root node
+       4) 0 is the send datatype id, see decode_datatype()
+       5) 0 is the recv datatype id, see decode_datatype()
+  */
+  double clock  = smpi_process()->simulated_elapsed();
+  int comm_size = MPI_COMM_WORLD->size();
+  CHECK_ACTION_PARAMS(action, comm_size + 1, 2)
+  int recv_size = parse_double(action[2 + comm_size]);
+  int disps[comm_size];
+  int sendcounts[comm_size];
+  int send_sum = 0;
+
+  MPI_Datatype MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;
+  if (action[4 + comm_size] && action[5 + comm_size]) {
+    MPI_CURRENT_TYPE  = decode_datatype(action[4 + comm_size]);
+    MPI_CURRENT_TYPE2 = decode_datatype(action[5 + comm_size]);
+  } else
+    MPI_CURRENT_TYPE = MPI_DEFAULT_TYPE;
+
+  void* send = nullptr;
+  void* recv = smpi_get_tmp_recvbuffer(recv_size * MPI_CURRENT_TYPE->size());
+  for (int i = 0; i < comm_size; i++) {
+    sendcounts[i] = atoi(action[i + 2]);
+    send_sum += sendcounts[i];
+    disps[i] = 0;
+  }
+
+  int root = atoi(action[3 + comm_size]);
+  int rank = MPI_COMM_WORLD->rank();
+
+  if (rank == root)
+    send = smpi_get_tmp_sendbuffer(send_sum * MPI_CURRENT_TYPE2->size());
+
+  std::vector<int>* trace_sendcounts = new std::vector<int>;
+  for (int i = 0; i < comm_size; i++) // copy data to avoid bad free
+    trace_sendcounts->push_back(sendcounts[i]);
+
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
+                                             "gatherV", root, -1, trace_sendcounts, recv_size, nullptr,
+                                             encode_datatype(MPI_CURRENT_TYPE), encode_datatype(MPI_CURRENT_TYPE2)));
+
+  Colls::scatterv(send, sendcounts, disps, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE2, root, MPI_COMM_WORLD);
+
+  TRACE_smpi_comm_out(smpi_process()->index());
+  log_timed_action(action, clock);
+}
+
 static void action_reducescatter(const char *const *action) {
  /* The structure of the reducescatter action for the rank 0 (total 4 processes) is the following:
       0 reduceScatter 275427 275427 275427 204020 11346849 0
@@ -712,6 +741,7 @@ static void action_reducescatter(const char *const *action) {
   int recvcounts[comm_size];
   int rank = smpi_process()->index();
   int size = 0;
+  std::vector<int>* trace_recvcounts = new std::vector<int>;
   if(action[3+comm_size])
     MPI_CURRENT_TYPE=decode_datatype(action[3+comm_size]);
   else
@@ -719,20 +749,14 @@ static void action_reducescatter(const char *const *action) {
 
   for(int i=0;i<comm_size;i++) {
     recvcounts[i] = atoi(action[i+2]);
+    trace_recvcounts->push_back(recvcounts[i]);
     size+=recvcounts[i];
   }
 
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_REDUCE_SCATTER;
-  extra->send_size = 0;
-  extra->recvcounts= xbt_new(int, comm_size);
-  for(int i=0; i< comm_size; i++)//copy data to avoid bad free
-    extra->recvcounts[i] = recvcounts[i];
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->comp_size = comp_size;
-  extra->num_processes = comm_size;
-
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__,
+                     new simgrid::instr::VarCollTIData("reduceScatter", -1, 0, nullptr, -1, trace_recvcounts,
+                                                       std::to_string(comp_size), /* ugly hack to print comp_size */
+                                                       encode_datatype(MPI_CURRENT_TYPE)));
 
   void *sendbuf = smpi_get_tmp_sendbuffer(size* MPI_CURRENT_TYPE->size());
   void *recvbuf = smpi_get_tmp_recvbuffer(size* MPI_CURRENT_TYPE->size());
@@ -740,7 +764,7 @@ static void action_reducescatter(const char *const *action) {
   Colls::reduce_scatter(sendbuf, recvbuf, recvcounts, MPI_CURRENT_TYPE, MPI_OP_NULL, MPI_COMM_WORLD);
   smpi_execute_flops(comp_size);
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -770,19 +794,14 @@ static void action_allgather(const char *const *action) {
   void *recvbuf = smpi_get_tmp_recvbuffer(recvcount* MPI_CURRENT_TYPE2->size());
 
   int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_ALLGATHER;
-  extra->send_size = sendcount;
-  extra->recv_size= recvcount;
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
-  extra->num_processes = MPI_COMM_WORLD->size();
 
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::CollTIData("allGather", -1, -1.0, sendcount, recvcount,
+                                                                        encode_datatype(MPI_CURRENT_TYPE),
+                                                                        encode_datatype(MPI_CURRENT_TYPE2)));
 
   Colls::allgather(sendbuf, sendcount, MPI_CURRENT_TYPE, recvbuf, recvcount, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -820,22 +839,19 @@ static void action_allgatherv(const char *const *action) {
   void *recvbuf = smpi_get_tmp_recvbuffer(recv_sum* MPI_CURRENT_TYPE2->size());
 
   int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_ALLGATHERV;
-  extra->send_size = sendcount;
-  extra->recvcounts= xbt_new(int, comm_size);
-  for(int i=0; i< comm_size; i++)//copy data to avoid bad free
-    extra->recvcounts[i] = recvcounts[i];
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
-  extra->num_processes = comm_size;
-
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
+
+  std::vector<int>* trace_recvcounts = new std::vector<int>;
+  for (int i = 0; i < comm_size; i++) // copy data to avoid bad free
+    trace_recvcounts->push_back(recvcounts[i]);
+
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
+                                             "allGatherV", -1, sendcount, nullptr, -1, trace_recvcounts,
+                                             encode_datatype(MPI_CURRENT_TYPE), encode_datatype(MPI_CURRENT_TYPE2)));
 
   Colls::allgatherv(sendbuf, sendcount, MPI_CURRENT_TYPE, recvbuf, recvcounts, disps, MPI_CURRENT_TYPE2,
                           MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -852,8 +868,12 @@ static void action_allToAllv(const char *const *action) {
 
   int comm_size = MPI_COMM_WORLD->size();
   CHECK_ACTION_PARAMS(action, 2*comm_size+2, 2)
+  int send_size = 0;
+  int recv_size = 0;
   int sendcounts[comm_size];
+  std::vector<int>* trace_sendcounts = new std::vector<int>;
   int recvcounts[comm_size];
+  std::vector<int>* trace_recvcounts = new std::vector<int>;
   int senddisps[comm_size];
   int recvdisps[comm_size];
 
@@ -868,38 +888,29 @@ static void action_allToAllv(const char *const *action) {
   else
     MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
 
+  int rank       = smpi_process()->index();
   void *sendbuf = smpi_get_tmp_sendbuffer(send_buf_size* MPI_CURRENT_TYPE->size());
   void *recvbuf  = smpi_get_tmp_recvbuffer(recv_buf_size* MPI_CURRENT_TYPE2->size());
 
   for(int i=0;i<comm_size;i++) {
     sendcounts[i] = atoi(action[i+3]);
+    trace_sendcounts->push_back(sendcounts[i]);
+    send_size += sendcounts[i];
     recvcounts[i] = atoi(action[i+4+comm_size]);
+    trace_recvcounts->push_back(recvcounts[i]);
+    recv_size += recvcounts[i];
     senddisps[i] = 0;
     recvdisps[i] = 0;
   }
 
-  int rank = smpi_process()->index();
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_ALLTOALLV;
-  extra->recvcounts= xbt_new(int, comm_size);
-  extra->sendcounts= xbt_new(int, comm_size);
-  extra->num_processes = comm_size;
-
-  for(int i=0; i< comm_size; i++){//copy data to avoid bad free
-    extra->send_size += sendcounts[i];
-    extra->sendcounts[i] = sendcounts[i];
-    extra->recv_size += recvcounts[i];
-    extra->recvcounts[i] = recvcounts[i];
-  }
-  extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
-  extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
-
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
+  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
+                                             "allToAllV", -1, send_size, trace_sendcounts, recv_size, trace_recvcounts,
+                                             encode_datatype(MPI_CURRENT_TYPE), encode_datatype(MPI_CURRENT_TYPE2)));
 
   Colls::alltoallv(sendbuf, sendcounts, senddisps, MPI_CURRENT_TYPE,recvbuf, recvcounts, recvdisps,
                          MPI_CURRENT_TYPE, MPI_COMM_WORLD);
 
-  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_comm_out(rank);
   log_timed_action (action, clock);
 }
 
@@ -915,10 +926,8 @@ void smpi_replay_init(int* argc, char*** argv)
   int rank = smpi_process()->index();
   TRACE_smpi_init(rank);
   TRACE_smpi_computing_init(rank);
-  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
-  extra->type = TRACING_INIT;
-  TRACE_smpi_collective_in(rank, -1, "smpi_replay_run_init", extra);
-  TRACE_smpi_collective_out(rank, -1, "smpi_replay_run_init");
+  TRACE_smpi_comm_in(rank, "smpi_replay_run_init", new simgrid::instr::NoOpTIData("init"));
+  TRACE_smpi_comm_out(rank);
   xbt_replay_action_register("init",       simgrid::smpi::action_init);
   xbt_replay_action_register("finalize",   simgrid::smpi::action_finalize);
   xbt_replay_action_register("comm_size",  simgrid::smpi::action_comm_size);
@@ -938,7 +947,9 @@ void smpi_replay_init(int* argc, char*** argv)
   xbt_replay_action_register("allToAll",   simgrid::smpi::action_allToAll);
   xbt_replay_action_register("allToAllV",  simgrid::smpi::action_allToAllv);
   xbt_replay_action_register("gather",     simgrid::smpi::action_gather);
+  xbt_replay_action_register("scatter", simgrid::smpi::action_scatter);
   xbt_replay_action_register("gatherV",    simgrid::smpi::action_gatherv);
+  xbt_replay_action_register("scatterV", simgrid::smpi::action_scatterv);
   xbt_replay_action_register("allGather",  simgrid::smpi::action_allgather);
   xbt_replay_action_register("allGatherV", simgrid::smpi::action_allgatherv);
   xbt_replay_action_register("reduceScatter",  simgrid::smpi::action_reducescatter);
@@ -970,7 +981,7 @@ void smpi_replay_main(int* argc, char*** argv)
     MPI_Status status[count_requests];
     unsigned int i=0;
 
-    for (auto req: *get_reqq_self()){
+    for (auto const& req : *get_reqq_self()) {
       requests[i] = req;
       i++;
     }
@@ -986,13 +997,11 @@ void smpi_replay_main(int* argc, char*** argv)
     xbt_free(recvbuffer);
   }
 
-  instr_extra_data extra_fin = xbt_new0(s_instr_extra_data_t,1);
-  extra_fin->type = TRACING_FINALIZE;
-  TRACE_smpi_collective_in(smpi_process()->index(), -1, "smpi_replay_run_finalize", extra_fin);
+  TRACE_smpi_comm_in(smpi_process()->index(), "smpi_replay_run_finalize", new simgrid::instr::NoOpTIData("finalize"));
 
   smpi_process()->finalize();
 
-  TRACE_smpi_collective_out(smpi_process()->index(), -1, "smpi_replay_run_finalize");
+  TRACE_smpi_comm_out(smpi_process()->index());
   TRACE_smpi_finalize(smpi_process()->index());
 }
 
index cd4b820..9bf2045 100644 (file)
@@ -7,7 +7,7 @@
  * Associated data and metadata are used as follows:
  *
  *                                                                    mmap #1
- *    `allocs' dict                                                     ---- -.
+ *    `allocs' map                                                      ---- -.
  *    ----------      shared_data_t               shared_metadata_t   / |  |  |
  * .->| <name> | ---> -------------------- <--.   -----------------   | |  |  |
  * |  ----------      | fd of <name>     |    |   | size of mmap  | --| |  |  |
@@ -15,7 +15,7 @@
  * `----------------- | <name>           |    |   -----------------     ----  |
  *                    --------------------    |   ^                           |
  *                                            |   |                           |
- *                                            |   |   `allocs_metadata' dict  |
+ *                                            |   |   `allocs_metadata' map   |
  *                                            |   |   ----------------------  |
  *                                            |   `-- | <addr of mmap #1>  |<-'
  *                                            |   .-- | <addr of mmap #2>  |<-.
 #include <map>
 #include <cstring>
 
-#include "private.h"
 #include "private.hpp"
-#include "xbt/dict.h"
-#include "xbt/ex.hpp"
-#include <errno.h>
+#include <cerrno>
 
 #include <sys/types.h>
 #ifndef WIN32
 #include <sys/mman.h>
 #endif
-#include <sys/stat.h>
+#include <cstdio>
 #include <fcntl.h>
-#include <string.h>
-#include <stdio.h>
+#include <sys/stat.h>
 
 #ifndef MAP_ANONYMOUS
 #define MAP_ANONYMOUS MAP_ANON
@@ -69,61 +65,33 @@ namespace{
  *  This information is used by SMPI_SHARED_MALLOC to allocate  some shared memory for all simulated processes.
  */
 
-class smpi_source_location {
-public:
-  smpi_source_location(const char* filename, int line)
-      : filename(xbt_strdup(filename)), filename_length(strlen(filename)), line(line)
-  {
-  }
-
-  /** Pointer to a static string containing the file name */
-  char* filename      = nullptr;
-  int filename_length = 0;
-  int line            = 0;
-
-  bool operator==(smpi_source_location const& that) const
-  {
-    return filename_length == that.filename_length && line == that.line &&
-           std::memcmp(filename, that.filename, filename_length) == 0;
-  }
-  bool operator!=(smpi_source_location const& that) const { return not(*this == that); }
-};
-}
-
-namespace std {
-
-template <> class hash<smpi_source_location> {
+class smpi_source_location : public std::string {
 public:
-  typedef smpi_source_location argument_type;
-  typedef std::size_t result_type;
-  result_type operator()(smpi_source_location const& loc) const
+  smpi_source_location() = default;
+  smpi_source_location(const char* filename, int line) : std::string(std::string(filename) + ":" + std::to_string(line))
   {
-    return xbt_str_hash_ext(loc.filename, loc.filename_length) ^
-           xbt_str_hash_ext((const char*)&loc.line, sizeof(loc.line));
   }
 };
-}
 
-namespace{
-
-typedef struct {
+struct shared_data_t {
   int fd    = -1;
   int count = 0;
-} shared_data_t;
+};
 
-std::unordered_map<smpi_source_location, shared_data_t> allocs;
-typedef std::unordered_map<smpi_source_location, shared_data_t>::value_type shared_data_key_type;
+std::unordered_map<smpi_source_location, shared_data_t, std::hash<std::string>> allocs;
+typedef decltype(allocs)::value_type shared_data_key_type;
 
-typedef struct {
+struct shared_metadata_t {
   size_t size;
   size_t allocated_size;
   void *allocated_ptr;
   std::vector<std::pair<size_t, size_t>> private_blocks;
   shared_data_key_type* data;
-} shared_metadata_t;
+};
 
 std::map<void*, shared_metadata_t> allocs_metadata;
-xbt_dict_t calls = nullptr;           /* Allocated on first use */
+std::map<std::string, void*> calls;
+
 #ifndef WIN32
 static int smpi_shared_malloc_bogusfile           = -1;
 static int smpi_shared_malloc_bogusfile_huge_page  = -1;
@@ -136,7 +104,7 @@ void smpi_shared_destroy()
 {
   allocs.clear();
   allocs_metadata.clear();
-  xbt_dict_free(&calls);
+  calls.clear();
 }
 
 static size_t shm_size(int fd) {
@@ -181,7 +149,7 @@ static void *smpi_shared_malloc_local(size_t size, const char *file, int line)
   auto res = allocs.insert(std::make_pair(loc, shared_data_t()));
   auto data = res.first;
   if (res.second) {
-    // The insertion did not take place.
+    // The new element was inserted.
     // Generate a shared memory name from the address of the shared_data:
     char shmname[32]; // cannot be longer than PSHMNAMLEN = 31 on Mac OS X (shm_open raises ENAMETOOLONG otherwise)
     snprintf(shmname, 31, "/shmalloc%p", &*data);
@@ -223,8 +191,8 @@ static void *smpi_shared_malloc_local(size_t size, const char *file, int line)
 
 void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int nb_shared_blocks)
 {
-  char *huge_page_mount_point = xbt_cfg_get_string("smpi/shared-malloc-hugepage");
-  bool use_huge_page = huge_page_mount_point[0] != '\0';
+  std::string huge_page_mount_point = xbt_cfg_get_string("smpi/shared-malloc-hugepage");
+  bool use_huge_page                = not huge_page_mount_point.empty();
 #ifndef MAP_HUGETLB /* If the system header don't define that mmap flag */
   xbt_assert(not use_huge_page,
              "Huge pages are not available on your system, you cannot use the smpi/shared-malloc-hugepage option.");
@@ -264,24 +232,21 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
    * We cannot use a same file for the two type of calls, since the first one needs to be
    * opened in a hugetlbfs mount point whereas the second needs to be a "classical" file. */
   if(use_huge_page && smpi_shared_malloc_bogusfile_huge_page == -1) {
-    const char *const array[] = {huge_page_mount_point, "simgrid-shmalloc-XXXXXX", nullptr};
-    char *huge_page_filename = xbt_str_join_array(array, "/");
-    smpi_shared_malloc_bogusfile_huge_page = mkstemp(huge_page_filename);
-    XBT_DEBUG("bogusfile_huge_page: %s\n", huge_page_filename);
-    unlink(huge_page_filename);
-    xbt_free(huge_page_filename);
+    std::string huge_page_filename         = huge_page_mount_point + "/simgrid-shmalloc-XXXXXX";
+    smpi_shared_malloc_bogusfile_huge_page = mkstemp((char*)huge_page_filename.c_str());
+    XBT_DEBUG("bogusfile_huge_page: %s\n", huge_page_filename.c_str());
+    unlink(huge_page_filename.c_str());
   }
   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;
@@ -306,9 +271,9 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
               "stop_offset (%zu) should be lower than its successor start offset (%zu)", stop_offset, shared_block_offsets[2*i_block+2]);
     size_t start_block_offset = ALIGN_UP(start_offset, smpi_shared_malloc_blocksize);
     size_t stop_block_offset = ALIGN_DOWN(stop_offset, smpi_shared_malloc_blocksize);
-    for (unsigned block_id=0, i = start_block_offset / smpi_shared_malloc_blocksize; i < stop_block_offset / smpi_shared_malloc_blocksize; block_id++, i++) {
-      XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %d", block_id);
-      void* pos = (void*)((unsigned long)mem + i * smpi_shared_malloc_blocksize);
+    for (size_t offset = start_block_offset; offset < stop_block_offset; offset += smpi_shared_malloc_blocksize) {
+      XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %zx", offset);
+      void* pos = (void*)((unsigned long)mem + offset);
       void* res = mmap(pos, smpi_shared_malloc_blocksize, PROT_READ | PROT_WRITE, mmap_flag,
                        huge_fd, 0);
       xbt_assert(res == pos, "Could not map folded virtual memory (%s). Do you perhaps need to increase the "
@@ -347,7 +312,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;
@@ -380,8 +345,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){
@@ -390,7 +355,7 @@ int smpi_is_shared(void* ptr, std::vector<std::pair<size_t, size_t>> &private_bl
     return 0;
   if ( smpi_cfg_shared_malloc == shmalloc_local || smpi_cfg_shared_malloc == shmalloc_global) {
     auto low = allocs_metadata.lower_bound(ptr);
-    if (low->first==ptr) {
+    if (low != allocs_metadata.end() && low->first == ptr) {
       private_blocks = low->second.private_blocks;
       *offset = 0;
       return 1;
@@ -412,11 +377,11 @@ int smpi_is_shared(void* ptr, std::vector<std::pair<size_t, size_t>> &private_bl
 
 std::vector<std::pair<size_t, size_t>> shift_and_frame_private_blocks(const std::vector<std::pair<size_t, size_t>> vec, size_t offset, size_t buff_size) {
     std::vector<std::pair<size_t, size_t>> result;
-    for(auto block: vec) {
-        auto new_block = std::make_pair(std::min(std::max((size_t)0, block.first-offset), buff_size),
-                                        std::min(std::max((size_t)0, block.second-offset), buff_size));
-        if(new_block.second > 0 && new_block.first < buff_size)
-            result.push_back(new_block);
+    for (auto const& block : vec) {
+      auto new_block = std::make_pair(std::min(std::max((size_t)0, block.first - offset), buff_size),
+                                      std::min(std::max((size_t)0, block.second - offset), buff_size));
+      if (new_block.second > 0 && new_block.first < buff_size)
+        result.push_back(new_block);
     }
     return result;
 }
@@ -475,59 +440,31 @@ 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
 
 int smpi_shared_known_call(const char* func, const char* input)
 {
-  char* loc = bprintf("%s:%s", func, input);
-  int known = 0;
-
-  if (calls==nullptr) {
-    calls = xbt_dict_new_homogeneous(nullptr);
-  }
-  try {
-    xbt_dict_get(calls, loc); /* Succeed or throw */
-    known = 1;
-    xbt_free(loc);
-  }
-  catch (xbt_ex& ex) {
-    xbt_free(loc);
-    if (ex.category != not_found_error)
-      throw;
-  }
-  catch(...) {
-    xbt_free(loc);
-    throw;
-  }
-  return known;
+  std::string loc = std::string(func) + ":" + input;
+  return calls.find(loc) != calls.end();
 }
 
 void* smpi_shared_get_call(const char* func, const char* input) {
-  char* loc = bprintf("%s:%s", func, input);
+  std::string loc = std::string(func) + ":" + input;
 
-  if (calls == nullptr)
-    calls    = xbt_dict_new_homogeneous(nullptr);
-  void* data = xbt_dict_get(calls, loc);
-  xbt_free(loc);
-  return data;
+  return calls.at(loc);
 }
 
 void* smpi_shared_set_call(const char* func, const char* input, void* data) {
-  char* loc = bprintf("%s:%s", func, input);
-
-  if (calls == nullptr)
-    calls = xbt_dict_new_homogeneous(nullptr);
-  xbt_dict_set(calls, loc, data, nullptr);
-  xbt_free(loc);
+  std::string loc = std::string(func) + ":" + input;
+  calls[loc]      = data;
   return data;
 }
-
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 91e01ce..e646ff7 100644 (file)
@@ -1,18 +1,17 @@
-/* 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "smpi/smpi_utils.hpp"
-#include "xbt/sysdep.h"
+#include "smpi_utils.hpp"
 #include "xbt/log.h"
-#include "xbt/str.h"
+#include "xbt/sysdep.h"
 #include <boost/tokenizer.hpp>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)");
 
-std::vector<s_smpi_factor_t> parse_factor(const char *smpi_coef_string)
+std::vector<s_smpi_factor_t> parse_factor(std::string smpi_coef_string)
 {
   std::vector<s_smpi_factor_t> smpi_factor;
 
@@ -20,8 +19,7 @@ std::vector<s_smpi_factor_t> parse_factor(const char *smpi_coef_string)
   typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
   boost::char_separator<char> sep(";");
   boost::char_separator<char> factor_separator(":");
-  std::string tmp_string(smpi_coef_string);
-  Tokenizer tokens(tmp_string, sep);
+  Tokenizer tokens(smpi_coef_string, sep);
 
   /**
    * Iterate over patterns like A:B:C:D;E:F;G:H
@@ -30,26 +28,32 @@ std::vector<s_smpi_factor_t> parse_factor(const char *smpi_coef_string)
    * E --> F
    * G --> H
    */
-  for (Tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); token_iter++) {
+  for (Tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) {
     XBT_DEBUG("token : %s", token_iter->c_str());
     Tokenizer factor_values(*token_iter, factor_separator);
     s_smpi_factor_t fact;
     if (factor_values.begin() == factor_values.end()) {
-      xbt_die("Malformed radical for smpi factor: '%s'", smpi_coef_string);
+      xbt_die("Malformed radical for smpi factor: '%s'", smpi_coef_string.c_str());
     }
     unsigned int iteration = 0;
-    for (Tokenizer::iterator factor_iter = factor_values.begin(); factor_iter != factor_values.end(); factor_iter++) {
+    for (Tokenizer::iterator factor_iter = factor_values.begin(); factor_iter != factor_values.end(); ++factor_iter) {
       iteration++;
-      char *errmsg;
 
       if (factor_iter == factor_values.begin()) { /* first element */
-        errmsg = bprintf("Invalid factor in chunk #%zu: %%s", smpi_factor.size()+1);
-        fact.factor = xbt_str_parse_int(factor_iter->c_str(), errmsg);
+        try {
+          fact.factor = std::stoi(*factor_iter);
+        } catch (std::invalid_argument& ia) {
+          throw std::invalid_argument(std::string("Invalid factor in chunk ") + std::to_string(smpi_factor.size() + 1) +
+                                      ": " + *factor_iter);
+        }
       } else {
-        errmsg = bprintf("Invalid factor value %d in chunk #%zu: %%s", iteration, smpi_factor.size()+1);
-        fact.values.push_back(xbt_str_parse_double(factor_iter->c_str(), errmsg));
+        try {
+          fact.values.push_back(std::stod(*factor_iter));
+        } catch (std::invalid_argument& ia) {
+          throw std::invalid_argument(std::string("Invalid factor value ") + std::to_string(iteration) + " in chunk " +
+                                      std::to_string(smpi_factor.size() + 1) + ": " + *factor_iter);
+        }
       }
-      xbt_free(errmsg);
     }
 
     smpi_factor.push_back(fact);
@@ -58,7 +62,7 @@ std::vector<s_smpi_factor_t> parse_factor(const char *smpi_coef_string)
   std::sort(smpi_factor.begin(), smpi_factor.end(), [](const s_smpi_factor_t &pa, const s_smpi_factor_t &pb) {
     return (pa.factor < pb.factor);
   });
-  for (auto& fact : smpi_factor) {
+  for (auto const& fact : smpi_factor) {
     XBT_DEBUG("smpi_factor:\t%zu : %zu values, first: %f", fact.factor, smpi_factor.size() ,fact.values[0]);
   }
   smpi_factor.shrink_to_fit();
index ee0747f..4998ea0 100644 (file)
@@ -3,48 +3,28 @@
 /* This program is 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/s4u/Host.hpp"
-#include <climits>
-
-#include "src/simix/smx_private.h"
-#include "private.h"
-#include "private.hpp"
 #include "smpi_comm.hpp"
+#include "private.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include "smpi_coll.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_process.hpp"
 #include "smpi_request.hpp"
 #include "smpi_status.hpp"
 #include "smpi_win.hpp"
+#include "src/simix/smx_private.hpp"
+#include <algorithm>
+#include <climits>
+#include <vector>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm)");
 
- simgrid::smpi::Comm mpi_MPI_COMM_UNINITIALIZED;
+simgrid::smpi::Comm mpi_MPI_COMM_UNINITIALIZED;
 MPI_Comm MPI_COMM_UNINITIALIZED=&mpi_MPI_COMM_UNINITIALIZED;
 
 /* Support for cartesian topology was added, but there are 2 other types of topology, graph et dist graph. In order to
  * support them, we have to add a field SMPI_Topo_type, and replace the MPI_Topology field by an union. */
 
-static int smpi_compare_rankmap(const void *a, const void *b)
-{
-  const int* x = static_cast<const int*>(a);
-  const int* y = static_cast<const int*>(b);
-
-  if (x[1] < y[1]) {
-    return -1;
-  }
-  if (x[1] == y[1]) {
-    if (x[0] < y[0]) {
-      return -1;
-    }
-    if (x[0] == y[0]) {
-      return 0;
-    }
-    return 1;
-  }
-  return 1;
-}
-
 namespace simgrid{
 namespace smpi{
 
@@ -75,8 +55,8 @@ void Comm::destroy(Comm* comm)
 
 int Comm::dup(MPI_Comm* newcomm){
   if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
-     smpi_switch_data_segment(smpi_process()->index());
-   }
+    smpi_switch_data_segment(smpi_process()->index());
+  }
   MPI_Group cp = new  Group(this->group());
   (*newcomm) = new  Comm(cp, this->topo());
   int ret = MPI_SUCCESS;
@@ -84,7 +64,7 @@ int Comm::dup(MPI_Comm* newcomm){
   if (not attributes()->empty()) {
     int flag;
     void* value_out;
-    for(auto it : *attributes()){
+    for (auto const& it : *attributes()) {
       smpi_key_elem elem = keyvals_.at(it.first);
       if (elem != nullptr && elem->copy_fn.comm_copy_fn != MPI_NULL_COPY_FN) {
         ret = elem->copy_fn.comm_copy_fn(this, it.first, nullptr, it.second, &value_out, &flag);
@@ -98,8 +78,8 @@ int Comm::dup(MPI_Comm* newcomm){
           (*newcomm)->attributes()->insert({it.first, value_out});
         }
       }
-      }
     }
+  }
   return ret;
 }
 
@@ -216,38 +196,35 @@ MPI_Comm Comm::split(int color, int key)
   /* Do the actual job */
   if(rank == 0) {
     MPI_Group* group_snd = xbt_new(MPI_Group, size);
-    int* rankmap         = xbt_new(int, 2 * size);
+    std::vector<std::pair<int, int>> rankmap;
+    rankmap.reserve(size);
     for (int i = 0; i < size; i++) {
       if (recvbuf[2 * i] != MPI_UNDEFINED) {
-        int count = 0;
+        rankmap.clear();
         for (int j = i + 1; j < size; j++) {
           if(recvbuf[2 * i] == recvbuf[2 * j]) {
             recvbuf[2 * j] = MPI_UNDEFINED;
-            rankmap[2 * count] = j;
-            rankmap[2 * count + 1] = recvbuf[2 * j + 1];
-            count++;
+            rankmap.push_back({recvbuf[2 * j + 1], j});
           }
         }
         /* Add self in the group */
         recvbuf[2 * i] = MPI_UNDEFINED;
-        rankmap[2 * count] = i;
-        rankmap[2 * count + 1] = recvbuf[2 * i + 1];
-        count++;
-        qsort(rankmap, count, 2 * sizeof(int), &smpi_compare_rankmap);
-        group_out = new  Group(count);
+        rankmap.push_back({recvbuf[2 * i + 1], i});
+        std::sort(begin(rankmap), end(rankmap));
+        group_out = new Group(rankmap.size());
         if (i == 0) {
           group_root = group_out; /* Save root's group */
         }
-        for (int j = 0; j < count; j++) {
-          int index = group->index(rankmap[2 * j]);
+        for (unsigned j = 0; j < rankmap.size(); j++) {
+          int index = group->index(rankmap[j].second);
           group_out->set_mapping(index, j);
         }
-        MPI_Request* requests = xbt_new(MPI_Request, count);
+        MPI_Request* requests = xbt_new(MPI_Request, rankmap.size());
         int reqs              = 0;
-        for (int j = 0; j < count; j++) {
-          if(rankmap[2 * j] != 0) {
+        for (auto const& rank : rankmap) {
+          if (rank.second != 0) {
             group_snd[reqs]=new  Group(group_out);
-            requests[reqs] = Request::isend(&(group_snd[reqs]), 1, MPI_PTR, rankmap[2 * j], system_tag, this);
+            requests[reqs] = Request::isend(&(group_snd[reqs]), 1, MPI_PTR, rank.second, system_tag, this);
             reqs++;
           }
         }
@@ -259,7 +236,6 @@ MPI_Comm Comm::split(int color, int key)
       }
     }
     xbt_free(recvbuf);
-    xbt_free(rankmap);
     xbt_free(group_snd);
     group_out = group_root; /* exit with root's group */
   } else {
@@ -287,7 +263,7 @@ void Comm::cleanup_smp(){
   if (non_uniform_map_ != nullptr)
     xbt_free(non_uniform_map_);
   if (leaders_map_ != nullptr)
-    xbt_free(leaders_map_);
+    delete[] leaders_map_;
 }
 
 void Comm::unref(Comm* comm){
@@ -305,14 +281,6 @@ void Comm::unref(Comm* comm){
   }
 }
 
-static int compare_ints (const void *a, const void *b)
-{
-  const int *da = static_cast<const int *>(a);
-  const int *db = static_cast<const int *>(b);
-
-  return static_cast<int>(*da > *db) - static_cast<int>(*da < *db);
-}
-
 void Comm::init_smp(){
   int leader = -1;
 
@@ -325,29 +293,29 @@ void Comm::init_smp(){
   // tell SimGrid we are not in replay for a while, because we need the buffers to be copied for the following calls
   bool replaying = false; //cache data to set it back again after
   if(smpi_process()->replaying()){
-   replaying=true;
-   smpi_process()->set_replaying(false);
+    replaying = true;
+    smpi_process()->set_replaying(false);
   }
 
   if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
-     smpi_switch_data_segment(smpi_process()->index());
-   }
+    smpi_switch_data_segment(smpi_process()->index());
+  }
   //identify neighbours in comm
   //get the indexes of all processes sharing the same simix host
-   xbt_swag_t process_list = sg_host_self()->extension<simgrid::simix::Host>()->process_list;
-   int intra_comm_size     = 0;
-   int min_index           = INT_MAX; // the minimum index will be the leader
-   smx_actor_t actor       = nullptr;
-   xbt_swag_foreach(actor, process_list)
-   {
-     int index = actor->pid - 1;
-
-     if (this->group()->rank(index) != MPI_UNDEFINED) {
-       intra_comm_size++;
-       // the process is in the comm
-       if (index < min_index)
-         min_index = index;
-     }
+  xbt_swag_t process_list = sg_host_self()->extension<simgrid::simix::Host>()->process_list;
+  int intra_comm_size     = 0;
+  int min_index           = INT_MAX; // the minimum index will be the leader
+  smx_actor_t actor       = nullptr;
+  xbt_swag_foreach(actor, process_list)
+  {
+    int index = actor->pid - 1;
+
+    if (this->group()->rank(index) != MPI_UNDEFINED) {
+      intra_comm_size++;
+      // the process is in the comm
+      if (index < min_index)
+        min_index = index;
+    }
   }
   XBT_DEBUG("number of processes deployed on my node : %d", intra_comm_size);
   MPI_Group group_intra = new  Group(intra_comm_size);
@@ -364,38 +332,37 @@ void Comm::init_smp(){
   MPI_Comm comm_intra = new  Comm(group_intra, nullptr);
   leader=min_index;
 
-  int * leaders_map= static_cast<int*>(xbt_malloc0(sizeof(int)*comm_size));
-  int * leader_list= static_cast<int*>(xbt_malloc0(sizeof(int)*comm_size));
-  for(i=0; i<comm_size; i++){
-      leader_list[i]=-1;
-  }
+  int* leaders_map = new int[comm_size];
+  int* leader_list = new int[comm_size];
+  std::fill_n(leaders_map, comm_size, 0);
+  std::fill_n(leader_list, comm_size, -1);
 
   Coll_allgather_mpich::allgather(&leader, 1, MPI_INT , leaders_map, 1, MPI_INT, this);
 
   if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
-     smpi_switch_data_segment(smpi_process()->index());
-   }
+    smpi_switch_data_segment(smpi_process()->index());
+  }
 
   if(leaders_map_==nullptr){
     leaders_map_= leaders_map;
   }else{
-    xbt_free(leaders_map);
+    delete[] leaders_map;
   }
   int j=0;
   int leader_group_size = 0;
   for(i=0; i<comm_size; i++){
-      int already_done=0;
-      for(j=0;j<leader_group_size; j++){
-        if(leaders_map_[i]==leader_list[j]){
-            already_done=1;
-        }
-      }
-      if(already_done==0){
-        leader_list[leader_group_size]=leaders_map_[i];
-        leader_group_size++;
+    int already_done = 0;
+    for (j = 0; j < leader_group_size; j++) {
+      if (leaders_map_[i] == leader_list[j]) {
+        already_done = 1;
       }
+    }
+    if (already_done == 0) {
+      leader_list[leader_group_size] = leaders_map_[i];
+      leader_group_size++;
+    }
   }
-  qsort(leader_list, leader_group_size, sizeof(int),compare_ints);
+  std::sort(leader_list, leader_list + leader_group_size);
 
   MPI_Group leaders_group = new  Group(leader_group_size);
 
@@ -408,7 +375,7 @@ void Comm::init_smp(){
     this->set_leaders_comm(leader_comm);
     this->set_intra_comm(comm_intra);
 
-   //create intracommunicator
+    // create intracommunicator
   }else{
     for (i=0; i< leader_group_size;i++)
       leaders_group->set_mapping(leader_list[i], i);
@@ -437,27 +404,27 @@ void Comm::init_smp(){
       }
     }
     if(is_uniform==0 && this->is_uniform()!=0){
-        non_uniform_map_= non_uniform_map;
+      non_uniform_map_ = non_uniform_map;
     }else{
-        xbt_free(non_uniform_map);
+      xbt_free(non_uniform_map);
     }
     is_uniform_=is_uniform;
   }
   Coll_bcast_mpich::bcast(&(is_uniform_),1, MPI_INT, 0, comm_intra );
 
   if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
-     smpi_switch_data_segment(smpi_process()->index());
-   }
+    smpi_switch_data_segment(smpi_process()->index());
+  }
   // Are the ranks blocked ? = allocated contiguously on the SMP nodes
   int is_blocked=1;
   int prev=this->group()->rank(comm_intra->group()->index(0));
-    for (i=1; i<my_local_size; i++){
-      int that=this->group()->rank(comm_intra->group()->index(i));
-      if(that!=prev+1){
-        is_blocked=0;
-        break;
-      }
-      prev = that;
+  for (i = 1; i < my_local_size; i++) {
+    int that = this->group()->rank(comm_intra->group()->index(i));
+    if (that != prev + 1) {
+      is_blocked = 0;
+      break;
+    }
+    prev = that;
   }
 
   int global_blocked;
@@ -465,12 +432,12 @@ void Comm::init_smp(){
 
   if(MPI_COMM_WORLD==MPI_COMM_UNINITIALIZED || this==MPI_COMM_WORLD){
     if(this->rank()==0){
-        is_blocked_=global_blocked;
+      is_blocked_ = global_blocked;
     }
   }else{
     is_blocked_=global_blocked;
   }
-  xbt_free(leader_list);
+  delete[] leader_list;
 
   if(replaying)
     smpi_process()->set_replaying(true);
@@ -482,9 +449,10 @@ MPI_Comm Comm::f2c(int id) {
   } else if(id==0){
     return MPI_COMM_WORLD;
   } else if(F2C::f2c_lookup() != nullptr && id >= 0) {
-      char key[KEY_SIZE];
-      MPI_Comm tmp =  static_cast<MPI_Comm>(xbt_dict_get_or_null(F2C::f2c_lookup(),get_key_id(key, id)));
-      return tmp != nullptr ? tmp : MPI_COMM_NULL ;
+    char key[KEY_SIZE];
+    const auto& lookup = F2C::f2c_lookup();
+    auto comm          = lookup->find(get_key_id(key, id));
+    return comm == lookup->end() ? MPI_COMM_NULL : static_cast<MPI_Comm>(comm->second);
   } else {
     return MPI_COMM_NULL;
   }
@@ -492,20 +460,19 @@ MPI_Comm Comm::f2c(int id) {
 
 void Comm::free_f(int id) {
   char key[KEY_SIZE];
-  xbt_dict_remove(F2C::f2c_lookup(), id==0? get_key(key, id) : get_key_id(key, id));
+  F2C::f2c_lookup()->erase(id == 0 ? get_key(key, id) : get_key_id(key, id));
 }
 
 int Comm::add_f() {
   if(F2C::f2c_lookup()==nullptr){
-    F2C::set_f2c_lookup(xbt_dict_new_homogeneous(nullptr));
+    F2C::set_f2c_lookup(new std::unordered_map<std::string, F2C*>);
   }
   char key[KEY_SIZE];
-  xbt_dict_set(F2C::f2c_lookup(), this==MPI_COMM_WORLD? get_key(key, F2C::f2c_id()) : get_key_id(key,F2C::f2c_id()), this, nullptr);
+  (*(F2C::f2c_lookup()))[this == MPI_COMM_WORLD ? get_key(key, F2C::f2c_id()) : get_key_id(key, F2C::f2c_id())] = this;
   f2c_id_increment();
   return F2C::f2c_id()-1;
 }
 
-
 void Comm::add_rma_win(MPI_Win win){
   rma_wins_.push_back(win);
 }
@@ -515,7 +482,7 @@ void Comm::remove_rma_win(MPI_Win win){
 }
 
 void Comm::finish_rma_calls(){
-  for(auto it : rma_wins_){
+  for (auto const& it : rma_wins_) {
     if(it->rank()==this->rank()){//is it ours (for MPI_COMM_WORLD)?
       int finished = it->finish_comms();
       XBT_DEBUG("Barrier for rank %d - Finished %d RMA calls",this->rank(), finished);
@@ -523,7 +490,6 @@ void Comm::finish_rma_calls(){
   }
 }
 
-
 }
 }
 
index 565ec99..4237217 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"
@@ -190,11 +189,15 @@ void Datatype::commit()
   flags_ |= DT_FLAG_COMMITED;
 }
 
-
 bool Datatype::is_valid(){
   return (flags_ & DT_FLAG_COMMITED);
 }
 
+bool Datatype::is_basic()
+{
+  return (flags_ & DT_FLAG_BASIC);
+}
+
 size_t Datatype::size(){
   return size_;
 }
@@ -280,9 +283,9 @@ int Datatype::copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
       if (not smpi_process()->replaying())
         memcpy(recvbuf, sendbuf, count);
     } else if (not(sendtype->flags() & DT_FLAG_DERIVED)) {
-      recvtype->unserialize( sendbuf, recvbuf, recvcount/recvtype->size(), MPI_REPLACE);
+      recvtype->unserialize(sendbuf, recvbuf, count / recvtype->size(), MPI_REPLACE);
     } else if (not(recvtype->flags() & DT_FLAG_DERIVED)) {
-      sendtype->serialize(sendbuf, recvbuf, sendcount/sendtype->size());
+      sendtype->serialize(sendbuf, recvbuf, count / sendtype->size());
     }else{
 
       void * buf_tmp = xbt_malloc(count);
index ba77e82..b620511 100644 (file)
@@ -6,30 +6,31 @@
 
 #include "smpi_datatype_derived.hpp"
 #include "smpi_op.hpp"
-
-XBT_LOG_EXTERNAL_CATEGORY(smpi_datatype);
+#include <xbt/log.h>
 
 namespace simgrid{
 namespace smpi{
 
-
-Type_Contiguous::Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type): Datatype(size, lb, ub, flags), block_count_(block_count), old_type_(old_type){
+Type_Contiguous::Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type)
+    : Datatype(size, lb, ub, flags), block_count_(block_count), old_type_(old_type)
+{
   old_type_->ref();
 }
 
-Type_Contiguous::~Type_Contiguous(){
+Type_Contiguous::~Type_Contiguous()
+{
   Datatype::unref(old_type_);
 }
 
-
-void Type_Contiguous::serialize( void* noncontiguous_buf, void *contiguous_buf,
-                            int count){
+void Type_Contiguous::serialize(void* noncontiguous_buf, void* contiguous_buf, int count)
+{
   char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
   char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf)+lb();
   memcpy(contiguous_buf_char, noncontiguous_buf_char, count * block_count_ * old_type_->size());
 }
-void Type_Contiguous::unserialize( void* contiguous_buf, void *noncontiguous_buf,
-                              int count, MPI_Op op){
+
+void Type_Contiguous::unserialize(void* contiguous_buf, void* noncontiguous_buf, int count, MPI_Op op)
+{
   char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
   char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf)+lb();
   int n= count*block_count_;
@@ -37,56 +38,6 @@ void Type_Contiguous::unserialize( void* contiguous_buf, void *noncontiguous_buf
     op->apply( contiguous_buf_char, noncontiguous_buf_char, &n, old_type_);
 }
 
-
-Type_Vector::Type_Vector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int block_length, int stride, MPI_Datatype old_type): Datatype(size, lb, ub, flags), block_count_(count), block_length_(block_length),block_stride_(stride),  old_type_(old_type){
-  old_type_->ref();
-}
-
-Type_Vector::~Type_Vector(){
-  Datatype::unref(old_type_);
-}
-
-
-void Type_Vector::serialize( void* noncontiguous_buf, void *contiguous_buf,
-                            int count){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
-  char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf);
-
-  for (int i = 0; i < block_count_ * count; i++) {
-    if (not(old_type_->flags() & DT_FLAG_DERIVED))
-      memcpy(contiguous_buf_char, noncontiguous_buf_char, block_length_ * old_type_->size());
-    else
-      old_type_->serialize(noncontiguous_buf_char, contiguous_buf_char, block_length_);
-
-    contiguous_buf_char += block_length_*old_type_->size();
-    if((i+1)%block_count_ ==0)
-      noncontiguous_buf_char += block_length_*old_type_->get_extent();
-    else
-      noncontiguous_buf_char += block_stride_*old_type_->get_extent();
-  }
-}
-
-void Type_Vector::unserialize( void* contiguous_buf, void *noncontiguous_buf,
-                              int count, MPI_Op op){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
-  char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf);
-
-  for (int i = 0; i < block_count_ * count; i++) {
-    if (not(old_type_->flags() & DT_FLAG_DERIVED)) {
-      if(op != MPI_OP_NULL)
-        op->apply(contiguous_buf_char, noncontiguous_buf_char, &block_length_,
-          old_type_);
-    }else
-      old_type_->unserialize(contiguous_buf_char, noncontiguous_buf_char, block_length_, op);
-
-    contiguous_buf_char += block_length_*old_type_->size();
-    if((i+1)%block_count_ ==0)
-      noncontiguous_buf_char += block_length_*old_type_->get_extent();
-    else
-      noncontiguous_buf_char += block_stride_*old_type_->get_extent();
-  }
-}
-
 Type_Hvector::Type_Hvector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int block_length, MPI_Aint stride, MPI_Datatype old_type): Datatype(size, lb, ub, flags), block_count_(count), block_length_(block_length), block_stride_(stride), old_type_(old_type){
   old_type->ref();
 }
@@ -113,7 +64,6 @@ void Type_Hvector::serialize( void* noncontiguous_buf, void *contiguous_buf,
   }
 }
 
-
 void Type_Hvector::unserialize( void* contiguous_buf, void *noncontiguous_buf,
                               int count, MPI_Op op){
   char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
@@ -133,86 +83,40 @@ void Type_Hvector::unserialize( void* contiguous_buf, void *noncontiguous_buf,
   }
 }
 
-Type_Indexed::Type_Indexed(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int* block_lengths, int* block_indices, MPI_Datatype old_type): Datatype(size, lb, ub, flags), block_count_(count), old_type_(old_type){
-  old_type->ref();
-  block_lengths_ = new int[count];
-  block_indices_ = new int[count];
-  for (int i = 0; i < count; i++) {
-    block_lengths_[i]=block_lengths[i];
-    block_indices_[i]=block_indices[i];
-  }
-}
-
-Type_Indexed::~Type_Indexed(){
-  Datatype::unref(old_type_);
-  if(refcount()==0){
-    delete[] block_lengths_;
-    delete[] block_indices_;
-  }
-}
-
-
-void Type_Indexed::serialize( void* noncontiguous_buf, void *contiguous_buf,
-                        int count){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
-  char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf)+block_indices_[0] * old_type_->size();
-  for (int j = 0; j < count; j++) {
-    for (int i = 0; i < block_count_; i++) {
-      if (not(old_type_->flags() & DT_FLAG_DERIVED))
-        memcpy(contiguous_buf_char, noncontiguous_buf_char, block_lengths_[i] * old_type_->size());
-      else
-        old_type_->serialize( noncontiguous_buf_char, contiguous_buf_char, block_lengths_[i]);
-
-      contiguous_buf_char += block_lengths_[i]*old_type_->size();
-      if (i<block_count_-1)
-        noncontiguous_buf_char =
-          static_cast<char*>(noncontiguous_buf) + block_indices_[i+1]*old_type_->get_extent();
-      else
-        noncontiguous_buf_char += block_lengths_[i]*old_type_->get_extent();
-    }
-    noncontiguous_buf=static_cast< void*>(noncontiguous_buf_char);
-  }
+Type_Vector::Type_Vector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int block_length, int stride,
+                         MPI_Datatype old_type)
+    : Type_Hvector(size, lb, ub, flags, count, block_length, stride * old_type->get_extent(), old_type)
+{
 }
 
-
-void Type_Indexed::unserialize( void* contiguous_buf, void *noncontiguous_buf,
-                      int count, MPI_Op op){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
-  char* noncontiguous_buf_char =
-    static_cast<char*>(noncontiguous_buf)+block_indices_[0]*old_type_->get_extent();
-  for (int j = 0; j < count; j++) {
-    for (int i = 0; i < block_count_; i++) {
-      if (not(old_type_->flags() & DT_FLAG_DERIVED)) {
-        if(op!=MPI_OP_NULL)
-          op->apply( contiguous_buf_char, noncontiguous_buf_char, &block_lengths_[i],
-                    old_type_);
-      }else
-        old_type_->unserialize( contiguous_buf_char,noncontiguous_buf_char,block_lengths_[i], op);
-
-      contiguous_buf_char += block_lengths_[i]*old_type_->size();
-      if (i<block_count_-1)
-        noncontiguous_buf_char =
-          static_cast<char*>(noncontiguous_buf) + block_indices_[i+1]*old_type_->get_extent();
-      else
-        noncontiguous_buf_char += block_lengths_[i]*old_type_->get_extent();
-    }
-    noncontiguous_buf=static_cast<void*>(noncontiguous_buf_char);
+Type_Hindexed::Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int* block_lengths,
+                             MPI_Aint* block_indices, MPI_Datatype old_type)
+    : Datatype(size, lb, ub, flags), block_count_(count), old_type_(old_type)
+{
+  old_type_->ref();
+  block_lengths_ = new int[count];
+  block_indices_ = new MPI_Aint[count];
+  for (int i = 0; i < count; i++) {
+    block_lengths_[i] = block_lengths[i];
+    block_indices_[i] = block_indices[i];
   }
 }
 
-Type_Hindexed::Type_Hindexed(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int* block_lengths, MPI_Aint* block_indices, MPI_Datatype old_type)
-: Datatype(size, lb, ub, flags), block_count_(count), old_type_(old_type)
+Type_Hindexed::Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int* block_lengths,
+                             int* block_indices, MPI_Datatype old_type, MPI_Aint factor)
+    : Datatype(size, lb, ub, flags), block_count_(count), old_type_(old_type)
 {
   old_type_->ref();
   block_lengths_ = new int[count];
   block_indices_ = new MPI_Aint[count];
   for (int i = 0; i < count; i++) {
-    block_lengths_[i]=block_lengths[i];
-    block_indices_[i]=block_indices[i];
+    block_lengths_[i] = block_lengths[i];
+    block_indices_[i] = block_indices[i] * factor;
   }
 }
 
-    Type_Hindexed::~Type_Hindexed(){
+Type_Hindexed::~Type_Hindexed()
+{
   Datatype::unref(old_type_);
   if(refcount()==0){
     delete[] block_lengths_;
@@ -264,6 +168,12 @@ void Type_Hindexed::unserialize( void* contiguous_buf, void *noncontiguous_buf,
   }
 }
 
+Type_Indexed::Type_Indexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int* block_lengths,
+                           int* block_indices, MPI_Datatype old_type)
+    : Type_Hindexed(size, lb, ub, flags, count, block_lengths, block_indices, old_type, old_type->get_extent())
+{
+}
+
 Type_Struct::Type_Struct(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int* block_lengths, MPI_Aint* block_indices, MPI_Datatype* old_types): Datatype(size, lb, ub, flags), block_count_(count), block_lengths_(block_lengths), block_indices_(block_indices), old_types_(old_types){
   block_lengths_= new int[count];
   block_indices_= new MPI_Aint[count];
index e5a5706..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>
 namespace simgrid{
 namespace smpi{
 
-xbt_dict_t F2C::f2c_lookup_=nullptr;
-int F2C::f2c_id_=0;
+std::unordered_map<std::string, F2C*>* F2C::f2c_lookup_ = nullptr;
+int F2C::f2c_id_ = 0;
 
-xbt_dict_t F2C::f2c_lookup(){
+std::unordered_map<std::string, F2C*>* F2C::f2c_lookup()
+{
   return f2c_lookup_;
 }
 
-void F2C::set_f2c_lookup(xbt_dict_t dict){
-  f2c_lookup_=dict;
+void F2C::set_f2c_lookup(std::unordered_map<std::string, F2C*>* map)
+{
+  f2c_lookup_ = map;
 }
 
 void F2C::f2c_id_increment(){
@@ -32,59 +34,66 @@ int F2C::f2c_id(){
 };
 
 char* F2C::get_key(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x",id);
+  std::snprintf(key, KEY_SIZE, "%x", static_cast<unsigned>(id));
   return key;
 }
 
 char* F2C::get_key_id(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->index());
+  std::snprintf(key, KEY_SIZE, "%x_%d", static_cast<unsigned>(id), smpi_process()->index());
   return key;
 }
 
 void F2C::delete_lookup(){
-  xbt_dict_free(&f2c_lookup_);
+  delete f2c_lookup_;
 }
 
-xbt_dict_t F2C::lookup(){
+std::unordered_map<std::string, F2C*>* F2C::lookup()
+{
   return f2c_lookup_;
 }
 
-void F2C::free_f(int id){
+void F2C::free_f(int id)
+{
   char key[KEY_SIZE];
-  xbt_dict_remove(f2c_lookup_, get_key(key, id));
+  f2c_lookup_->erase(get_key(key, id));
 }
 
-int F2C::add_f(){
-  if(f2c_lookup_==nullptr){
-    f2c_lookup_=xbt_dict_new_homogeneous(nullptr);
-  }
+int F2C::add_f()
+{
+  if (f2c_lookup_ == nullptr)
+    f2c_lookup_ = new std::unordered_map<std::string, F2C*>;
+
   char key[KEY_SIZE];
-  xbt_dict_set(f2c_lookup_, get_key(key, f2c_id_), this, nullptr);
+  (*f2c_lookup_)[get_key(key, f2c_id_)] = this;
   f2c_id_increment();
   return f2c_id_-1;
 }
 
-int F2C::c2f(){
-  if(f2c_lookup_==nullptr){
-    f2c_lookup_=xbt_dict_new_homogeneous(nullptr);
+int F2C::c2f()
+{
+  if (f2c_lookup_ == nullptr) {
+    f2c_lookup_ = new std::unordered_map<std::string, F2C*>;
   }
 
-  char* existing_key = xbt_dict_get_key(f2c_lookup_, this);
-  if(existing_key!=nullptr){
-    return atoi(existing_key);}
-  else{
-    return this->add_f();}
+  for (auto const& elm : *f2c_lookup_)
+    if (elm.second == this)
+      return std::stoi(elm.first);
+
+  /* this function wasn't found, add it */
+  return this->add_f();
 }
 
-F2C* F2C::f2c(int id){
-  if(f2c_lookup_==nullptr){
-    f2c_lookup_=xbt_dict_new_homogeneous(nullptr);
-  }
+F2C* F2C::f2c(int id)
+{
+  if (f2c_lookup_ == nullptr)
+    f2c_lookup_ = new std::unordered_map<std::string, F2C*>;
+
   if(id >= 0){
     char key[KEY_SIZE];
-    return static_cast<F2C*>(xbt_dict_get_or_null(f2c_lookup_, get_key(key, id)));
+    auto comm = f2c_lookup_->find(get_key(key, id));
+    return comm == f2c_lookup_->end() ? nullptr : comm->second;
   }else
-    return NULL;
+    return nullptr;
 }
 
 }
index 115cf49..4506de6 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)");
 
@@ -16,89 +18,55 @@ namespace smpi{
 
 Group::Group()
 {
-  size_=0;                            /* size */
-  rank_to_index_map_=nullptr;                         /* rank_to_index_map_ */
-  index_to_rank_map_=nullptr;                         /* index_to_rank_map_ */
-  refcount_=1;                            /* refcount_: start > 0 so that this group never gets freed */
+  size_              = 0;       /* size */
+  refcount_          = 1;       /* refcount_: start > 0 so that this group never gets freed */
 }
 
-Group::Group(int n) : size_(n)
+Group::Group(int n) : size_(n), rank_to_index_map_(size_, MPI_UNDEFINED)
 {
-  rank_to_index_map_ = xbt_new(int, size_);
-  index_to_rank_map_ = xbt_dict_new_homogeneous(xbt_free_f);
   refcount_ = 1;
-  for (int i = 0; i < size_; i++) {
-    rank_to_index_map_[i] = MPI_UNDEFINED;
-  }
 }
 
 Group::Group(MPI_Group origin)
 {
-  if(origin != MPI_GROUP_NULL
-            && origin != MPI_GROUP_EMPTY)
-    {
-      size_ = origin->size();
-      rank_to_index_map_ = xbt_new(int, size_);
-      index_to_rank_map_ = xbt_dict_new_homogeneous(xbt_free_f);
-      refcount_ = 1;
-      for (int i = 0; i < size_; i++) {
-        rank_to_index_map_[i] = origin->rank_to_index_map_[i];
-      }
-
-      char* key;
-      char* ptr_rank;
-      xbt_dict_cursor_t cursor = nullptr;
-      xbt_dict_foreach(origin->index_to_rank_map_, cursor, key, ptr_rank) {
-        int * cp = static_cast<int*>(xbt_malloc(sizeof(int)));
-        *cp=*reinterpret_cast<int*>(ptr_rank);
-        xbt_dict_set(index_to_rank_map_, key, cp, nullptr);
-      }
-    }
-}
-
-Group::~Group()
-{
-  xbt_free(rank_to_index_map_);
-  xbt_dict_free(&index_to_rank_map_);
+  if (origin != MPI_GROUP_NULL && origin != MPI_GROUP_EMPTY) {
+    size_              = origin->size();
+    refcount_          = 1;
+    rank_to_index_map_ = origin->rank_to_index_map_;
+    index_to_rank_map_ = origin->index_to_rank_map_;
+  }
 }
 
 void Group::set_mapping(int index, int rank)
 {
-  if (rank < size_) {
+  if (0 <= rank && rank < size_) {
     rank_to_index_map_[rank] = index;
-    if (index!=MPI_UNDEFINED ) {
-      int* val_rank = static_cast<int*>(xbt_malloc(sizeof(int)));
-      *val_rank = rank;
-
-      char * key = bprintf("%d", index);
-      xbt_dict_set(index_to_rank_map_, key, val_rank, nullptr);
-      xbt_free(key);
+    if (index != MPI_UNDEFINED) {
+      if ((unsigned)index >= index_to_rank_map_.size())
+        index_to_rank_map_.resize(index + 1, MPI_UNDEFINED);
+      index_to_rank_map_[index] = rank;
     }
   }
 }
 
 int Group::index(int rank)
 {
-  int index = MPI_UNDEFINED;
-
-  if (0 <= rank && rank < size_) {
+  int index;
+  if (0 <= rank && rank < size_)
     index = rank_to_index_map_[rank];
-  }
+  else
+    index = MPI_UNDEFINED;
   return index;
 }
 
 int Group::rank(int index)
 {
-  int * ptr_rank = nullptr;
-  if (this==MPI_GROUP_EMPTY)
-    return MPI_UNDEFINED;
-  char * key = bprintf("%d", index);
-  ptr_rank = static_cast<int*>(xbt_dict_get_or_null(index_to_rank_map_, key));
-  xbt_free(key);
-
-  if (ptr_rank==nullptr)
-    return MPI_UNDEFINED;
-  return *ptr_rank;
+  int rank;
+  if (0 <= index && (unsigned)index < index_to_rank_map_.size())
+    rank = index_to_rank_map_[index];
+  else
+    rank = MPI_UNDEFINED;
+  return rank;
 }
 
 void Group::ref()
@@ -151,10 +119,8 @@ int Group::incl(int n, int* ranks, MPI_Group* newgroup)
     *newgroup = MPI_GROUP_EMPTY;
   } else if (n == size_) {
     *newgroup = this;
-    if(this!= MPI_COMM_WORLD->group()
-              && this != MPI_COMM_SELF->group()
-              && this != MPI_GROUP_EMPTY)
-    this->ref();
+    if (this != MPI_COMM_WORLD->group() && this != MPI_COMM_SELF->group() && this != MPI_GROUP_EMPTY)
+      this->ref();
   } else {
     *newgroup = new Group(n);
     for (i = 0; i < n; i++) {
@@ -250,7 +216,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++)
@@ -263,11 +229,19 @@ int Group::excl(int n, int *ranks, MPI_Group * newgroup){
       j++;
     }
   }
-  xbt_free(to_exclude);
+  delete[] to_exclude;
   return MPI_SUCCESS;
 
 }
 
+static bool is_rank_in_range(int rank, int first, int last)
+{
+  if (first < last)
+    return rank <= last;
+  else
+    return rank >= last;
+}
+
 int Group::range_incl(int n, int ranges[][3], MPI_Group * newgroup){
   int newsize = 0;
   for (int i = 0; i < n; i++) {
@@ -279,13 +253,8 @@ int Group::range_incl(int n, int ranges[][3], MPI_Group * newgroup){
         break;
       }
       rank += ranges[i][2]; /* Stride */
-      if (ranges[i][0] < ranges[i][1]) {
-        if (rank > ranges[i][1])
-          break;
-      } else {
-        if (rank < ranges[i][1])
-          break;
-      }
+      if (not is_rank_in_range(rank, ranges[i][0], ranges[i][1]))
+        break;
     }
   }
   *newgroup = new  Group(newsize);
@@ -301,13 +270,8 @@ int Group::range_incl(int n, int ranges[][3], MPI_Group * newgroup){
         break;
       }
       rank += ranges[i][2]; /* Stride */
-      if (ranges[i][0] < ranges[i][1]) {
-        if (rank > ranges[i][1])
-          break;
-      } else {
-        if (rank < ranges[i][1])
-          break;
-      }
+      if (not is_rank_in_range(rank, ranges[i][0], ranges[i][1]))
+        break;
     }
   }
   return MPI_SUCCESS;
@@ -324,13 +288,8 @@ int Group::range_excl(int n, int ranges[][3], MPI_Group * newgroup){
         break;
       }
       rank += ranges[i][2]; /* Stride */
-      if (ranges[i][0] < ranges[i][1]) {
-        if (rank > ranges[i][1])
-          break;
-      } else {
-        if (rank < ranges[i][1])
-          break;
-      }
+      if (not is_rank_in_range(rank, ranges[i][0], ranges[i][1]))
+        break;
     }
   }
   if (newsize == 0) {
@@ -351,13 +310,8 @@ int Group::range_excl(int n, int ranges[][3], MPI_Group * newgroup){
             break;
           }
           rank += ranges[i][2]; /* Stride */
-          if (ranges[i][0]<ranges[i][1]){
-            if (rank > ranges[i][1])
-              break;
-          }else{
-            if (rank < ranges[i][1])
-              break;
-          }
+          if (not is_rank_in_range(rank, ranges[i][0], ranges[i][1]))
+            break;
         }
       }
       if(add==1){
@@ -376,7 +330,7 @@ MPI_Group Group::f2c(int id) {
     return MPI_GROUP_EMPTY;
   } else if(F2C::f2c_lookup() != nullptr && id >= 0) {
     char key[KEY_SIZE];
-    return static_cast<MPI_Group>(xbt_dict_get_or_null(F2C::f2c_lookup(), get_key(key, id)));
+    return static_cast<MPI_Group>(F2C::f2c_lookup()->at(get_key(key, id)));
   } else {
     return static_cast<MPI_Group>(MPI_GROUP_NULL);
   }
index 093da59..160892e 100644 (file)
 namespace simgrid{
 namespace smpi{
 
-Info::Info():refcount_(1){
-  dict_= xbt_dict_new_homogeneous(xbt_free_f);
-}
-
-Info::Info(Info* info):refcount_(1){
-  dict_= xbt_dict_new_homogeneous(xbt_free_f);
-  xbt_dict_cursor_t cursor = nullptr;
-  char* key;
-  void* data;
-  xbt_dict_foreach(info->dict_,cursor,key,data){
-    xbt_dict_set(dict_, key, xbt_strdup(static_cast<char*>(data)), nullptr);
-  }
-}
-
-Info::~Info(){
-  xbt_dict_free(&dict_);
+Info::Info(Info* info) : map_(info->map_)
+{
 }
 
 void Info::ref(){
@@ -41,45 +27,42 @@ void Info::unref(Info* info){
 }
 
 void Info::set(char *key, char *value){
-  xbt_dict_set(dict_, key, xbt_strdup(value), nullptr);
+  map_[key] = value;
 }
 
 int Info::get(char *key, int valuelen, char *value, int *flag){
   *flag=false;
-  char* tmpvalue=static_cast<char*>(xbt_dict_get_or_null(dict_, key));
-  if(tmpvalue){
+  auto val = map_.find(key);
+  if (val != map_.end()) {
+    std::string tmpvalue = val->second;
+
     memset(value, 0, valuelen);
-    memcpy(value,tmpvalue, (strlen(tmpvalue) + 1 < static_cast<size_t>(valuelen)) ? strlen(tmpvalue) + 1 : valuelen);
+    memcpy(value, tmpvalue.c_str(),
+           (tmpvalue.length() + 1 < static_cast<size_t>(valuelen)) ? tmpvalue.length() + 1 : valuelen);
     *flag=true;
+    return MPI_SUCCESS;
+  } else {
+    return MPI_ERR_INFO_KEY;
   }
-  return MPI_SUCCESS;
 }
 
-
 int Info::remove(char *key){
-  try {
-    xbt_dict_remove(dict_, key);
-  }
-  catch(xbt_ex& e){
+  if (map_.erase(key) == 0)
     return MPI_ERR_INFO_NOKEY;
-  }
-  return MPI_SUCCESS;
+  else
+    return MPI_SUCCESS;
 }
 
 int Info::get_nkeys(int *nkeys){
-  *nkeys=xbt_dict_size(dict_);
+  *nkeys = map_.size();
   return MPI_SUCCESS;
 }
 
 int Info::get_nthkey(int n, char *key){
-  xbt_dict_cursor_t cursor = nullptr;
-  char *keyn;
-  void* data;
   int num=0;
-  xbt_dict_foreach(dict_,cursor,keyn,data){
-    if(num==n){
-      strncpy(key,keyn,strlen(keyn)+1);
-      xbt_dict_cursor_free(&cursor);
+  for (auto const& elm : map_) {
+    if (num == n) {
+      strncpy(key, elm.first.c_str(), elm.first.length() + 1);
       return MPI_SUCCESS;
     }
     num++;
@@ -89,12 +72,14 @@ int Info::get_nthkey(int n, char *key){
 
 int Info::get_valuelen(char *key, int *valuelen, int *flag){
   *flag=false;
-  char* tmpvalue=static_cast<char*>(xbt_dict_get_or_null(dict_, key));
-  if(tmpvalue){
-    *valuelen=strlen(tmpvalue);
+  auto val = map_.find(key);
+  if (val != map_.end()) {
+    *valuelen = val->second.length();
     *flag=true;
+    return MPI_SUCCESS;
+  } else {
+    return MPI_ERR_INFO_KEY;
   }
-  return MPI_SUCCESS;
 }
 
 Info* Info::f2c(int id){
@@ -103,4 +88,3 @@ Info* Info::f2c(int id){
 
 }
 }
-
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 a4c0a36..64c3574 100644 (file)
@@ -5,16 +5,15 @@
 
 #include "smpi_request.hpp"
 
-#include "mc/mc.h"
-#include "src/kernel/activity/CommImpl.hpp"
-#include "src/mc/mc_replay.h"
 #include "SmpiHost.hpp"
-#include "private.h"
+#include "mc/mc.h"
 #include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
 #include "smpi_process.hpp"
+#include "src/kernel/activity/CommImpl.hpp"
+#include "src/mc/mc_replay.hpp"
 
 #include <algorithm>
 
@@ -32,7 +31,8 @@ extern void (*smpi_comm_copy_data_callback) (smx_activity_t, void*, size_t);
 namespace simgrid{
 namespace smpi{
 
-Request::Request(void *buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags) : buf_(buf), old_type_(datatype), src_(src), dst_(dst), tag_(tag), comm_(comm), flags_(flags)
+Request::Request(void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags)
+    : buf_(buf), old_type_(datatype), src_(src), dst_(dst), tag_(tag), comm_(comm), flags_(flags)
 {
   void *old_buf = nullptr;
 // FIXME Handle the case of a partial shared malloc.
@@ -221,11 +221,11 @@ MPI_Request Request::rma_recv_init(void *buf, int count, MPI_Datatype datatype,
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
   if(op==MPI_OP_NULL){
-    request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype,  src, dst, tag,
-                            comm, RMA | NON_PERSISTENT | RECV | PREPARED);
+    request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag, comm,
+                          RMA | NON_PERSISTENT | RECV | PREPARED);
   }else{
-    request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype,  src, dst, tag,
-                            comm, RMA | NON_PERSISTENT | RECV | PREPARED | ACCUMULATE);
+    request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag, comm,
+                          RMA | NON_PERSISTENT | RECV | PREPARED | ACCUMULATE);
     request->op_ = op;
   }
   return request;
@@ -233,16 +233,16 @@ MPI_Request Request::rma_recv_init(void *buf, int count, MPI_Datatype datatype,
 
 MPI_Request Request::irecv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
 {
-  return new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE :
-                          comm->group()->index(src), smpi_process()->index(), tag,
-                          comm, PERSISTENT | RECV | PREPARED);
+  return new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype,
+                     src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->index(src), smpi_process()->index(), tag,
+                     comm, PERSISTENT | RECV | PREPARED);
 }
 
 MPI_Request Request::isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
-  request =  new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
-                           comm->group()->index(dst), tag, comm, NON_PERSISTENT | ISEND | SEND);
+  request             = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+                        comm->group()->index(dst), tag, comm, NON_PERSISTENT | ISEND | SEND);
   request->start();
   return request;
 }
@@ -250,8 +250,8 @@ MPI_Request Request::isend(void *buf, int count, MPI_Datatype datatype, int dst,
 MPI_Request Request::issend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
-  request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
-                        comm->group()->index(dst), tag,comm, NON_PERSISTENT | ISEND | SSEND | SEND);
+  request             = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+                        comm->group()->index(dst), tag, comm, NON_PERSISTENT | ISEND | SSEND | SEND);
   request->start();
   return request;
 }
@@ -260,9 +260,9 @@ MPI_Request Request::issend(void *buf, int count, MPI_Datatype datatype, int dst
 MPI_Request Request::irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
-  request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE :
-                          comm->group()->index(src), smpi_process()->index(), tag, comm,
-                          NON_PERSISTENT | RECV);
+  request             = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype,
+                        src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->index(src), smpi_process()->index(),
+                        tag, comm, NON_PERSISTENT | RECV);
   request->start();
   return request;
 }
@@ -278,8 +278,8 @@ void Request::recv(void *buf, int count, MPI_Datatype datatype, int src, int tag
 void Request::send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
-  request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
-                          comm->group()->index(dst), tag, comm, NON_PERSISTENT | SEND);
+  request             = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+                        comm->group()->index(dst), tag, comm, NON_PERSISTENT | SEND);
 
   request->start();
   wait(&request, MPI_STATUS_IGNORE);
@@ -289,8 +289,8 @@ void Request::send(void *buf, int count, MPI_Datatype datatype, int dst, int tag
 void Request::ssend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
-  request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
-                          comm->group()->index(dst), tag, comm, NON_PERSISTENT | SSEND | SEND);
+  request             = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+                        comm->group()->index(dst), tag, comm, NON_PERSISTENT | SSEND | SEND);
 
   request->start();
   wait(&request,MPI_STATUS_IGNORE);
@@ -401,9 +401,8 @@ void Request::start()
       if (not(old_type_->flags() & DT_FLAG_DERIVED)) {
         oldbuf = buf_;
         if (not process->replaying() && oldbuf != nullptr && size_ != 0) {
-          if((smpi_privatize_global_variables != 0)
-            && (static_cast<char*>(buf_) >= smpi_start_data_exe)
-            && (static_cast<char*>(buf_) < smpi_start_data_exe + smpi_size_data_exe )){
+          if ((smpi_privatize_global_variables != 0) && (static_cast<char*>(buf_) >= smpi_data_exe_start) &&
+              (static_cast<char*>(buf_) < smpi_data_exe_start + smpi_data_exe_size)) {
             XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
             smpi_switch_data_segment(src_);
           }
@@ -508,8 +507,8 @@ int Request::test(MPI_Request * request, MPI_Status * status) {
     if (flag) {
       finish_wait(request,status);
       nsleeps=1;//reset the number of sleeps we will do next time
-      if (*request != MPI_REQUEST_NULL && ((*request)->flags_ & PERSISTENT)==0)
-      *request = MPI_REQUEST_NULL;
+      if (*request != MPI_REQUEST_NULL && ((*request)->flags_ & PERSISTENT) == 0)
+        *request = MPI_REQUEST_NULL;
     } else if (xbt_cfg_get_boolean("smpi/grow-injected-times")){
       nsleeps++;
     }
@@ -693,12 +692,11 @@ void Request::finish_wait(MPI_Request* request, MPI_Status * status)
     if (((req->flags_ & ACCUMULATE) != 0) ||
         (datatype->flags() & DT_FLAG_DERIVED)) { // && (not smpi_is_shared(req->old_buf_))){
 
-      if (not smpi_process()->replaying()) {
-        if( smpi_privatize_global_variables != 0 && (static_cast<char*>(req->old_buf_) >= smpi_start_data_exe)
-            && ((char*)req->old_buf_ < smpi_start_data_exe + smpi_size_data_exe )){
-            XBT_VERB("Privatization : We are unserializing to a zone in global memory  Switch data segment ");
-            smpi_switch_data_segment(smpi_process()->index());
-        }
+      if (not smpi_process()->replaying() && smpi_privatize_global_variables != 0 &&
+          static_cast<char*>(req->old_buf_) >= smpi_data_exe_start &&
+          static_cast<char*>(req->old_buf_) < smpi_data_exe_start + smpi_data_exe_size) {
+        XBT_VERB("Privatization : We are unserializing to a zone in global memory  Switch data segment ");
+        smpi_switch_data_segment(smpi_process()->index());
       }
 
       if(datatype->flags() & DT_FLAG_DERIVED){
@@ -719,7 +717,7 @@ void Request::finish_wait(MPI_Request* request, MPI_Status * status)
   if (TRACE_smpi_view_internals() && ((req->flags_ & RECV) != 0)){
     int rank = smpi_process()->index();
     int src_traced = (req->src_ == MPI_ANY_SOURCE ? req->real_src_ : req->src_);
-    TRACE_smpi_recv(rank, src_traced, rank,req->tag_);
+    TRACE_smpi_recv(src_traced, rank,req->tag_);
   }
   if(req->detached_sender_ != nullptr){
     //integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
@@ -862,7 +860,7 @@ int Request::waitall(int count, MPI_Request requests[], MPI_Status status[])
 
   if (not accumulates.empty()) {
     std::sort(accumulates.begin(), accumulates.end(), sort_accumulates);
-    for (auto req : accumulates) {
+    for (auto& req : accumulates) {
       finish_wait(&req, status);
     }
   }
@@ -885,7 +883,7 @@ int Request::waitsome(int incount, MPI_Request requests[], int *indices, MPI_Sta
         status[index] = *pstat;
       }
      if (requests[index] != MPI_REQUEST_NULL && (requests[index]->flags_ & NON_PERSISTENT))
-     requests[index]=MPI_REQUEST_NULL;
+       requests[index] = MPI_REQUEST_NULL;
     }else{
       return MPI_UNDEFINED;
     }
@@ -897,28 +895,27 @@ MPI_Request Request::f2c(int id) {
   char key[KEY_SIZE];
   if(id==MPI_FORTRAN_REQUEST_NULL)
     return static_cast<MPI_Request>(MPI_REQUEST_NULL);
-  return static_cast<MPI_Request>(xbt_dict_get(F2C::f2c_lookup(), get_key_id(key, id)));
+  return static_cast<MPI_Request>(F2C::f2c_lookup()->at(get_key_id(key, id)));
 }
 
-int Request::add_f() {
-  if(F2C::f2c_lookup()==nullptr){
-    F2C::set_f2c_lookup(xbt_dict_new_homogeneous(nullptr));
+int Request::add_f()
+{
+  if (F2C::f2c_lookup() == nullptr) {
+    F2C::set_f2c_lookup(new std::unordered_map<std::string, F2C*>);
   }
   char key[KEY_SIZE];
-  xbt_dict_set(F2C::f2c_lookup(), get_key_id(key, F2C::f2c_id()), this, nullptr);
+  (*(F2C::f2c_lookup()))[get_key_id(key, F2C::f2c_id())] = this;
   F2C::f2c_id_increment();
   return F2C::f2c_id()-1;
 }
 
-void Request::free_f(int id) {
+void Request::free_f(int id)
+{
   if (id != MPI_FORTRAN_REQUEST_NULL) {
     char key[KEY_SIZE];
-    xbt_dict_remove(F2C::f2c_lookup(), get_key_id(key, id));
+    F2C::f2c_lookup()->erase(get_key_id(key, id));
   }
 }
 
 }
 }
-
-
-
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 fa3701d..04b5179 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 "xbt/sysdep.h"
 #include "smpi/smpi.h"
-#include "private.h"
-#include <vector>
-#include <math.h>
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_topo.hpp"
+#include "xbt/sysdep.h"
+#include <cmath>
+#include <vector>
 
 /* static functions */
 static int assignnodes(int ndim, int nfactor, int *pfacts,int **pdims);
@@ -94,7 +94,7 @@ Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], in
       *comm_cart = MPI_COMM_NULL;
     }
   }
-  comm_=*comm_cart;
+  setComm(*comm_cart);
 }
 
 Topo_Cart* Topo_Cart::sub(const int remain_dims[], MPI_Comm *newcomm) {
@@ -125,7 +125,7 @@ Topo_Cart* Topo_Cart::sub(const int remain_dims[], MPI_Comm *newcomm) {
       }
     }
   }
-  return new Topo_Cart(comm_, newNDims, newDims, newPeriodic, 0, newcomm);
+  return new Topo_Cart(getComm(), newNDims, newDims, newPeriodic, 0, newcomm);
 }
 
 int Topo_Cart::coords(int rank, int maxdims, int coords[]) {
@@ -195,7 +195,7 @@ int Topo_Cart::shift(int direction, int disp, int *rank_source, int *rank_dest)
     return MPI_ERR_DIMS;
   }
 
-  this->coords(comm_->rank(),ndims_, position);
+  this->coords(getComm()->rank(), ndims_, position);
   position[direction] += disp;
 
   if(position[direction] < 0 ||
index f2782d1..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)");
 
@@ -195,7 +195,7 @@ int Win::put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
   if(opened_==0){//check that post/start has been done
     // no fence or start .. lock ok ?
     int locked=0;
-    for(auto it : recv_win->lockers_)
+    for (auto const& it : recv_win->lockers_)
       if (it == comm_->rank())
         locked = 1;
     if(locked != 1)
@@ -252,7 +252,7 @@ int Win::get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
   if(opened_==0){//check that post/start has been done
     // no fence or start .. lock ok ?
     int locked=0;
-    for(auto it : send_win->lockers_)
+    for (auto const& it : send_win->lockers_)
       if (it == comm_->rank())
         locked = 1;
     if(locked != 1)
@@ -314,7 +314,7 @@ int Win::accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
   if(opened_==0){//check that post/start has been done
     // no fence or start .. lock ok ?
     int locked=0;
-    for(auto it : recv_win->lockers_)
+    for (auto const& it : recv_win->lockers_)
       if (it == comm_->rank())
         locked = 1;
     if(locked != 1)
@@ -368,7 +368,7 @@ int Win::get_accumulate( void *origin_addr, int origin_count, MPI_Datatype origi
   if(opened_==0){//check that post/start has been done
     // no fence or start .. lock ok ?
     int locked=0;
-    for(auto it : send_win->lockers_)
+    for (auto const& it : send_win->lockers_)
       if (it == comm_->rank())
         locked = 1;
     if(locked != 1)
@@ -405,7 +405,7 @@ int Win::compare_and_swap(void *origin_addr, void *compare_addr,
   if(opened_==0){//check that post/start has been done
     // no fence or start .. lock ok ?
     int locked=0;
-    for(auto it : send_win->lockers_)
+    for (auto const& it : send_win->lockers_)
       if (it == comm_->rank())
         locked = 1;
     if(locked != 1)
@@ -413,7 +413,7 @@ int Win::compare_and_swap(void *origin_addr, void *compare_addr,
   }
 
   XBT_DEBUG("Entering MPI_Compare_and_swap with %d", target_rank);
-  MPI_Request req;
+  MPI_Request req = MPI_REQUEST_NULL;
   xbt_mutex_acquire(send_win->atomic_mut_);
   get(result_addr, 1, datatype, target_rank,
               target_disp, 1, datatype, &req);
index a8c75e1..3016954 100755 (executable)
@@ -25,7 +25,7 @@ SPEED="${DEFAULT_SPEED}"
 
 PRIVATIZE="--cfg=smpi/privatization:@HAVE_PRIVATIZATION@"
 
-SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP-gamma:4194304"
+SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI"
 
 #usage to print the way this script should be called
 usage () {
@@ -44,7 +44,6 @@ Options:
   -trace-comment-file <file> # put file contents on the top of the trace file as comment
   -trace-grouped             # group MPI processes by location
   -trace-resource            # trace resource utilization
-  -trace-viva                # generate configuration for Viva's GraphView
   -trace-file <tracefile>    # name of the tracefile (simgrid_smpi.trace)
   -ext <value>               # additional parameter (reserved)
 
@@ -75,6 +74,11 @@ unset pid
 
 trapped_signals="HUP INT QUIT ILL ABRT SEGV FPE ALRM TERM USR1 USR2 BUS"
 
+die () {
+    printf '[%s] ** error: %s. Aborting.\n' "$(basename $0)" "$*" >&2
+    exit 1
+}
+
 smpirun_cleanup()
 {
   if [ -z "${KEEP}" ] ; then
@@ -138,24 +142,14 @@ while true; do
         "-platform")
            PLATFORM="$2"
             if [ ! -f "${PLATFORM}" ]; then
-               echo "[`basename $0`] ** error: the file '${PLATFORM}' does not exist. Aborting."
-               exit 1
+                die "the file '${PLATFORM}' does not exist"
             fi
            shift 2
             ;;
-        "-hostfile")
+        "-hostfile" | "-machinefile")
            HOSTFILE="$2"
             if [ ! -f "${HOSTFILE}" ]; then
-               echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
-               exit 1
-            fi
-           shift 2
-            ;;
-        "-machinefile")
-           HOSTFILE="$2"
-            if [ ! -f "${HOSTFILE}" ]; then
-               echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
-               exit 1
+                die "the file '${HOSTFILE}' does not exist"
             fi
            shift 2
             ;;
@@ -200,10 +194,6 @@ while true; do
             TRACE_RESOURCE="true"
             shift 1
             ;;
-        "-trace-viva")
-           TRACE_VIVA="true"
-           shift 1
-            ;;
         "-keep-temps")
            KEEP="true"
            SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
@@ -298,7 +288,7 @@ fi
 UNROLLEDHOSTFILETMP=0
 
 #parse if our lines are terminated by :num_process
-multiple_processes=`grep -c ":" $HOSTFILE`
+multiple_processes=$(grep -c ":" $HOSTFILE)
 if [ "${multiple_processes}" -gt 0 ] ; then
     UNROLLEDHOSTFILETMP=1
     UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
@@ -311,10 +301,9 @@ if [ "${multiple_processes}" -gt 0 ] ; then
 fi
 
 # Don't use wc -l to compute it to avoid issues with trailing \n at EOF
-hostfile_procs=`grep -c "[a-zA-Z0-9]" $HOSTFILE`
+hostfile_procs=$(grep -c "[a-zA-Z0-9]" $HOSTFILE)
 if [ ${hostfile_procs} = 0 ] ; then
-   echo "[`basename $0`] ** error: the hostfile '${HOSTFILE}' is empty. Aborting." >&2
-   exit 1
+    die "the hostfile '${HOSTFILE}' is empty"
 fi
 
 if [ -z "${NUMPROCS}" ] ; then
@@ -401,10 +390,10 @@ fi
 ##  hostfile has less than i lines.
 ##----------------------------------------------------------
 
-HAVE_SEQ="`which seq 2>/dev/null`"
+HAVE_SEQ="$(which seq 2>/dev/null)"
 
 if [ -n "${HAVE_SEQ}" ]; then
-    SEQ=`${HAVE_SEQ} 0 $((${NUMPROCS}-1))`
+    SEQ=$(${HAVE_SEQ} 0 $(( NUMPROCS - 1)))
 else
     cnt=0
     while [ $cnt -lt ${NUMPROCS} ] ; do
@@ -424,7 +413,7 @@ done
 
 for i in ${SEQ}
 do
-    j=$(( $i % ${hostfile_procs} + 1 ))
+    j=$(( i % hostfile_procs + 1 ))
     host=$(eval "echo \${$j}")
 
     ##---- optional display of ranks to actor mapping
@@ -433,7 +422,7 @@ do
     fi
 
     echo "  <actor host=\"${host}\" function=\"$i\"> <!-- function name used only for logging -->
-    <argument value=\"1\"/> <!-- instance -->
+    <argument value=\"smpirun\"/> <!-- instance -->
     <argument value=\"$i\"/> <!-- rank -->" >> ${APPLICATIONTMP}
     if [ ${REPLAY} = 1 ]; then
         if  [ ${NUMTRACES} -gt 1 ]; then
@@ -481,10 +470,6 @@ if [ -n "${TRACE_ACTIVE}" ]; then
     if [ -n "${TRACE_RESOURCE}" ]; then
         TRACEOPTIONS="${TRACEOPTIONS} --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes"
     fi
-
-    if [ -n "${TRACE_VIVA}" ]; then
-        TRACEOPTIONS="${TRACEOPTIONS} --cfg=viva/categorized:smpi_cat.plist --cfg=viva/uncategorized:smpi_uncat.plist"
-    fi
 fi
 ##---------------------- end SMPI TRACING OPTIONS ---------------------------------
 
@@ -520,7 +505,7 @@ pid=""
 # Keep temporary files on failures to help debugging
 #
 if [ ${status} -ne 0 ] ; then
-    if [ -z ${KEEP} ]; then
+    if [ -z "${KEEP}" ]; then
         echo ${EXEC} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
         if [ ${HOSTFILETMP} = 1 ] ; then
             echo "Generated hostfile ${HOSTFILE} kept."
index d562d9e..40fcd3a 100644 (file)
@@ -69,5 +69,5 @@ list_set () {
 # $1: list
 # usage:  eval $(list_get list)
 list_get () {
-    printf 'IFS="$LISTSEP"; eval set -- \\$%s; IFS="$SAVEIFS"' "$1"
+    printf 'IFS="'\$'LISTSEP"; eval set -- \$%s; IFS="'\$'SAVEIFS"\n' "$1"
 }
diff --git a/src/surf/FileImpl.cpp b/src/surf/FileImpl.cpp
deleted file mode 100644 (file)
index 5354850..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Copyright (c) 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/surf/FileImpl.hpp"
-#include "src/surf/StorageImpl.hpp"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_file, surf, "Logging specific to the SURF file module");
-namespace simgrid {
-namespace surf {
-
-FileImpl::FileImpl(sg_storage_t st, std::string path, std::string mount) : path_(path), mount_point_(mount)
-{
-  XBT_DEBUG("\tOpen file '%s'", path.c_str());
-  location_ = st->getImpl();
-  std::map<std::string, sg_size_t>* content = location_->getContent();
-  // if file does not exist create an empty file
-  if (content->find(path) != content->end())
-    size_ = content->at(path);
-  else {
-    size_ = 0;
-    content->insert({path, size_});
-    XBT_DEBUG("File '%s' was not found, file created.", path.c_str());
-  }
-}
-
-Action* FileImpl::read(sg_size_t size)
-{
-  XBT_DEBUG("READ %s on disk '%s'", cname(), location_->cname());
-  if (current_position_ + size > size_) {
-    if (current_position_ > size_) {
-      size = 0;
-    } else {
-      size = size_ - current_position_;
-    }
-    current_position_ = size_;
-  } else
-    current_position_ += size;
-
-  return location_->read(size);
-}
-
-Action* FileImpl::write(sg_size_t size)
-{
-  XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", cname(), location_->cname(), size, size_);
-
-  StorageAction* action = location_->write(size);
-  action->file_         = this;
-  /* Substract the part of the file that might disappear from the used sized on the storage element */
-  location_->usedSize_ -= (size_ - current_position_);
-  // If the storage is full before even starting to write
-  if (location_->usedSize_ >= location_->getSize()) {
-    action->setState(Action::State::failed);
-  }
-  return action;
-}
-
-int FileImpl::seek(sg_offset_t offset, int origin)
-{
-  switch (origin) {
-    case SEEK_SET:
-      current_position_ = offset;
-      return 0;
-    case SEEK_CUR:
-      current_position_ += offset;
-      return 0;
-    case SEEK_END:
-      current_position_ = size_ + offset;
-      return 0;
-    default:
-      return -1;
-  }
-}
-
-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());
-    return -1;
-  } else {
-    XBT_DEBUG("UNLINK %s on disk '%s'", cname(), location_->cname());
-    location_->usedSize_ -= size_;
-
-    // Remove the file from storage
-    location_->getContent()->erase(path_);
-
-    return 0;
-  }
-}
-
-void FileImpl::move(const char* fullpath)
-{
-  /* Check if the new full path is on the same mount point */
-  if (not strncmp(mount_point_.c_str(), fullpath, mount_point_.size())) {
-    std::map<std::string, sg_size_t>* content = location_->getContent();
-    if (content->find(path_) != content->end()) { // src file exists
-      sg_size_t new_size = content->at(path_);
-      content->erase(path_);
-      std::string path = std::string(fullpath).substr(mount_point_.size(), strlen(fullpath));
-      content->insert({path.c_str(), new_size});
-      XBT_DEBUG("Move file from %s to %s, size '%llu'", path_.c_str(), fullpath, new_size);
-    } else {
-      XBT_WARN("File %s doesn't exist", path_.c_str());
-    }
-  } else {
-    XBT_WARN("New full path %s is not on the same mount point: %s.", fullpath, mount_point_.c_str());
-  }
-}
-}
-}
diff --git a/src/surf/FileImpl.hpp b/src/surf/FileImpl.hpp
deleted file mode 100644 (file)
index 0478ea1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (c) 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 SRC_SURF_FILEIMPL_HPP_
-#define SRC_SURF_FILEIMPL_HPP_
-
-#include "surf/surf.h"
-#include <string>
-
-namespace simgrid {
-namespace surf {
-
-class FileImpl {
-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 char* mount() { return mount_point_.c_str(); }
-  sg_size_t size() { return size_; }
-  void setSize(sg_size_t size) { size_ = size; }
-  void setPosition(sg_size_t size) { current_position_ = size; }
-  void incrPosition(sg_size_t incr) { current_position_ += incr; }
-  sg_size_t tell() { return current_position_; }
-  int seek(sg_offset_t offset, int origin);
-  int unlink();
-  void move(const char* fullpath);
-  Action* read(sg_size_t size);
-  Action* write(sg_size_t size);
-
-private:
-  StorageImpl* location_;
-  std::string path_;
-  std::string mount_point_;
-  sg_size_t size_;
-  sg_size_t current_position_ = SEEK_SET;
-};
-}
-}
-#endif /* SRC_SURF_FILEIMPL_HPP_ */
index 6d88f27..2a24cc6 100644 (file)
@@ -1,10 +1,9 @@
-/* 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. */
 
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include "src/surf/FileImpl.hpp"
 #include <string>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf, "Logging specific to the SURF host module");
@@ -29,9 +28,9 @@ namespace surf {
 void HostModel::ignoreEmptyVmInPmLMM()
 {
   /* iterate for all virtual machines */
-  for (s4u::VirtualMachine* ws_vm : vm::VirtualMachineImpl::allVms_) {
+  for (s4u::VirtualMachine* const& ws_vm : vm::VirtualMachineImpl::allVms_) {
     Cpu* cpu = ws_vm->pimpl_cpu;
-    int active_tasks = lmm_constraint_get_variable_amount(cpu->constraint());
+    int active_tasks = cpu->constraint()->get_variable_amount();
 
     /* The impact of the VM over its PM is the min between its vCPU amount and the amount of tasks it contains */
     int impact = std::min(active_tasks, ws_vm->pimpl_vm_->coreAmount());
@@ -80,13 +79,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;
 }
 
@@ -102,9 +104,9 @@ HostImpl::HostImpl(s4u::Host* host) : piface_(host)
 
 void HostImpl::getAttachedStorageList(std::vector<const char*>* storages)
 {
-  for (auto s : storage_)
+  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 2eda708..6298706 100644 (file)
@@ -1,38 +1,39 @@
-/* Copyright (c) 2015. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2015-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/sysdep.h"
 #include "PropertyHolder.hpp"
 
 namespace simgrid {
 namespace surf {
 
-PropertyHolder::PropertyHolder() = default;
-
 PropertyHolder::~PropertyHolder() {
-  xbt_dict_free(&properties_);
+  delete properties_;
 }
 
 /** @brief Return the property associated to the provided key (or nullptr if not existing) */
-const char *PropertyHolder::getProperty(const char*key) {
+const char* PropertyHolder::getProperty(std::string key)
+{
   if (properties_ == nullptr)
     return nullptr;
-  return static_cast<const char*>(xbt_dict_get_or_null(properties_,key));
+  auto prop = properties_->find(key);
+  return prop == properties_->end() ? nullptr : prop->second.c_str();
 }
 
 /** @brief Change the value of a given key in the property set */
-void PropertyHolder::setProperty(const char*key, const char*value) {
+void PropertyHolder::setProperty(std::string key, std::string value)
+{
   if (not properties_)
-    properties_ = xbt_dict_new_homogeneous(xbt_free_f);
-  xbt_dict_set(properties_, key, xbt_strdup(value), nullptr);
+    properties_       = new std::map<std::string, std::string>;
+  (*properties_)[key] = value;
 }
 
 /** @brief Return the whole set of properties. Don't mess with it, dude! */
-xbt_dict_t PropertyHolder::getProperties() {
+std::map<std::string, std::string>* PropertyHolder::getProperties()
+{
   if (not properties_)
-    properties_ = xbt_dict_new_homogeneous(xbt_free_f);
+    properties_ = new std::map<std::string, std::string>;
   return properties_;
 }
 
index ba06640..64633b3 100644 (file)
@@ -5,7 +5,8 @@
 
 #ifndef SRC_SURF_PROPERTYHOLDER_HPP_
 #define SRC_SURF_PROPERTYHOLDER_HPP_
-#include <xbt/dict.h>
+#include <map>
+#include <string>
 
 namespace simgrid {
 namespace surf {
@@ -17,18 +18,19 @@ namespace surf {
 class PropertyHolder { // DO NOT DERIVE THIS CLASS, or the diamond inheritance mayhem will get you
 
 public:
-  explicit PropertyHolder();
+  PropertyHolder() = default;
   ~PropertyHolder();
 
-  const char *getProperty(const char*id);
-  void setProperty(const char*id, const char*value);
+  const char* getProperty(std::string key);
+  void setProperty(std::string id, std::string value);
 
   /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy).
    * But some user API expose this call so removing it is not so easy.
    */
-  xbt_dict_t getProperties();
+  std::map<std::string, std::string>* getProperties();
+
 private:
-  xbt_dict_t properties_ = nullptr;
+  std::map<std::string, std::string>* properties_ = nullptr;
 };
 
 } /* namespace surf */
index 03e1f87..6b79856 100644 (file)
@@ -5,12 +5,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "StorageImpl.hpp"
-
-#include "surf_private.h"
-#include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/join.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <fstream>
+#include "surf/maxmin.hpp"
+#include "surf_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf, "Logging specific to the SURF storage module");
 
@@ -32,7 +28,7 @@ simgrid::xbt::signal<void(StorageAction*, Action::State, Action::State)> storage
 std::unordered_map<std::string, StorageImpl*>* StorageImpl::storages =
     new std::unordered_map<std::string, StorageImpl*>();
 
-StorageImpl* StorageImpl::byName(const char* name)
+StorageImpl* StorageImpl::byName(std::string name)
 {
   if (storages->find(name) == storages->end())
     return nullptr;
@@ -45,12 +41,12 @@ StorageImpl* StorageImpl::byName(const char* name)
 
 StorageModel::StorageModel() : Model()
 {
-  maxminSystem_ = lmm_system_new(true /* lazy update */);
+  maxminSystem_ = new s_lmm_system_t(true /* lazy update */);
 }
 
 StorageModel::~StorageModel()
 {
-  lmm_system_free(maxminSystem_);
+  delete maxminSystem_;
   surf_storage_model = nullptr;
 }
 
@@ -58,56 +54,27 @@ StorageModel::~StorageModel()
  * Resource *
  ************/
 
-StorageImpl::StorageImpl(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
-                         const char* type_id, const char* content_name, sg_size_t size, const char* attach)
-    : Resource(model, name, lmm_constraint_new(maxminSystem, this, MAX(bread, bwrite)))
+StorageImpl::StorageImpl(Model* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
+                         std::string type_id, std::string content_name, sg_size_t size, std::string attach)
+    : Resource(model, name.c_str(), maxminSystem->constraint_new(this, std::max(bread, bwrite)))
     , piface_(this)
     , typeId_(type_id)
+    , content_name(content_name)
     , size_(size)
     , attach_(attach)
 {
-  content_ = parseContent(content_name);
-  turnOn();
+  StorageImpl::turnOn();
   XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
-  constraintRead_  = lmm_constraint_new(maxminSystem, this, bread);
-  constraintWrite_ = lmm_constraint_new(maxminSystem, this, bwrite);
+  constraintRead_  = maxminSystem->constraint_new(this, bread);
+  constraintWrite_ = maxminSystem->constraint_new(this, bwrite);
   storages->insert({name, this});
 }
 
 StorageImpl::~StorageImpl()
 {
   storageDestructedCallbacks(this);
-  if (content_ != nullptr)
-    delete content_;
 }
 
-std::map<std::string, sg_size_t>* StorageImpl::parseContent(const char* filename)
-{
-  usedSize_ = 0;
-  if ((not filename) || (strcmp(filename, "") == 0))
-    return nullptr;
-
-  std::map<std::string, sg_size_t>* parse_content = new std::map<std::string, sg_size_t>();
-
-  std::ifstream* fs = surf_ifsopen(filename);
-
-  std::string line;
-  std::vector<std::string> tokens;
-  do {
-    std::getline(*fs, line);
-    boost::trim(line);
-    if (line.length() > 0) {
-      boost::split(tokens, line, boost::is_any_of(" \t"), boost::token_compress_on);
-      xbt_assert(tokens.size() == 2, "Parse error in %s: %s", filename, line.c_str());
-      sg_size_t size = std::stoull(tokens.at(1));
-
-      usedSize_ += size;
-      parse_content->insert({tokens.front(), size});
-    }
-  } while (not fs->eof());
-  delete fs;
-  return parse_content;
-}
 
 bool StorageImpl::isUsed()
 {
@@ -135,22 +102,6 @@ void StorageImpl::turnOff()
   }
 }
 
-std::map<std::string, sg_size_t>* StorageImpl::getContent()
-{
-  /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */
-  return content_;
-}
-
-sg_size_t StorageImpl::getFreeSize()
-{
-  return size_ - usedSize_;
-}
-
-sg_size_t StorageImpl::getUsedSize()
-{
-  return usedSize_;
-}
-
 /**********
  * Action *
  **********/
index c2ea20b..d83cd62 100644 (file)
@@ -32,28 +32,27 @@ class StorageAction;
  * @brief Callbacks handler which emit the callbacks after Storage creation *
  * @details Callback functions have the following signature: `void(Storage*)`
  */
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageImpl*)>) storageCreatedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(StorageImpl*)>) storageCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage destruction *
  * @details Callback functions have the following signature: `void(StoragePtr)`
  */
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageImpl*)>) storageDestructedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(StorageImpl*)>) storageDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage State changed *
  * @details Callback functions have the following signature: `void(StorageAction *action, int previouslyOn, int
  * currentlyOn)`
  */
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageImpl*, int, int)>) storageStateChangedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(StorageImpl*, int, int)>) storageStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
  * @details Callback functions have the following signature: `void(StorageAction *action, simgrid::surf::Action::State
  * old, simgrid::surf::Action::State current)`
  */
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageAction*, simgrid::surf::Action::State,
-                                          simgrid::surf::Action::State)>)
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(StorageAction*, Action::State, Action::State)>)
 storageActionStateChangedCallbacks;
 
 /*********
@@ -68,8 +67,8 @@ public:
   StorageModel();
   ~StorageModel();
 
-  virtual StorageImpl* createStorage(const char* id, const char* type_id, const char* content_name,
-                                     const char* attach) = 0;
+  virtual StorageImpl* createStorage(std::string id, std::string type_id, std::string content_name,
+                                     std::string attach) = 0;
 
   std::vector<StorageImpl*> p_storageList;
 };
@@ -81,18 +80,17 @@ public:
  * @brief SURF storage interface class
  * @details A Storage represent a storage unit (e.g.: hard drive, usb key)
  */
-class StorageImpl : public simgrid::surf::Resource, public simgrid::surf::PropertyHolder {
+class StorageImpl : public Resource, public PropertyHolder {
 public:
   /** @brief Storage constructor */
-  StorageImpl(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
-              const char* type_id, const char* content_name, sg_size_t size, const char* attach);
+  StorageImpl(Model* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
+              std::string type_id, std::string content_name, sg_size_t size, std::string attach);
 
   ~StorageImpl() override;
 
-public:
   /** @brief Public interface */
   s4u::Storage piface_;
-  static StorageImpl* byName(const char* name);
+  static StorageImpl* byName(std::string name);
 
   /** @brief Check if the Storage is used (if an action currently uses its resources) */
   bool isUsed() override;
@@ -117,32 +115,9 @@ public:
    * @return The StorageAction corresponding to the writing
    */
   virtual StorageAction* write(sg_size_t size) = 0;
-
-  /**
-   * @brief Get the content of the current Storage
-   *
-   * @return A xbt_dict_t with path as keys and size in bytes as values
-   */
-  virtual std::map<std::string, sg_size_t>* getContent();
-
-  /**
-   * @brief Get the available size in bytes of the current Storage
-   *
-   * @return The available size in bytes of the current Storage
-   */
-  virtual sg_size_t getFreeSize();
-
-  /**
-   * @brief Get the used size in bytes of the current Storage
-   *
-   * @return The used size in bytes of the current Storage
-   */
-  virtual sg_size_t getUsedSize();
   virtual sg_size_t getSize() { return size_; }
   virtual std::string getHost() { return attach_; }
 
-  std::map<std::string, sg_size_t>* parseContent(const char* filename);
-  static std::unordered_map<std::string, StorageImpl*>* storages;
   static std::unordered_map<std::string, StorageImpl*>* storagesMap() { return StorageImpl::storages; }
 
   lmm_constraint_t constraintWrite_; /* Constraint for maximum write bandwidth*/
@@ -150,10 +125,11 @@ public:
 
   std::string typeId_;
   sg_size_t usedSize_ = 0;
+  std::string content_name;
 
 private:
   sg_size_t size_;
-  std::map<std::string, sg_size_t>* content_;
+  static std::unordered_map<std::string, StorageImpl*>* storages;
   // Name of the host to which this storage is attached. Only used at platform parsing time, then the interface stores
   // the Host directly.
   std::string attach_;
@@ -166,10 +142,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
@@ -206,19 +182,23 @@ public:
 
   e_surf_action_storage_type_t type_;
   StorageImpl* storage_;
-  FileImpl* file_ = nullptr;
 };
-}
-}
 
-typedef struct s_storage_type {
-  char* model;
-  char* content;
-  char* type_id;
-  xbt_dict_t properties;
+class StorageType {
+public:
+  std::string id;
+  std::string model;
+  std::string content;
+  std::map<std::string, std::string>* properties;
   std::map<std::string, std::string>* model_properties;
   sg_size_t size;
-} s_storage_type_t;
-typedef s_storage_type_t* storage_type_t;
+  StorageType(std::string id, std::string model, std::string content, std::map<std::string, std::string>* properties,
+              std::map<std::string, std::string>* model_properties, sg_size_t size)
+      : id(id), model(model), content(content), properties(properties), model_properties(model_properties), size(size)
+  {
+  }
+};
+}
+}
 
 #endif /* STORAGE_INTERFACE_HPP_ */
index 22eac86..d25bf1f 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
@@ -6,8 +6,9 @@
 
 #include "cpu_cas01.hpp"
 #include "cpu_ti.hpp"
-#include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
+#include "surf/maxmin.hpp"
+#include <algorithm>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu, "Logging specific to the SURF CPU IMPROVED module");
 
@@ -19,8 +20,7 @@ void surf_cpu_model_init_Cas01()
   xbt_assert(not surf_cpu_model_pm);
   xbt_assert(not surf_cpu_model_vm);
 
-  char *optim = xbt_cfg_get_string("cpu/optim");
-  if (not strcmp(optim, "TI")) {
+  if (xbt_cfg_get_string("cpu/optim") == "TI") {
     surf_cpu_model_init_ti();
     return;
   }
@@ -37,27 +37,25 @@ namespace surf {
 
 CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
 {
-  char *optim = xbt_cfg_get_string("cpu/optim");
+  std::string optim = xbt_cfg_get_string("cpu/optim");
   bool select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
 
-  if (not strcmp(optim, "Full")) {
-    updateMechanism_ = UM_FULL;
+  if (optim == "Full") {
+    setUpdateMechanism(UM_FULL);
     selectiveUpdate_ = select;
-  } else if (not strcmp(optim, "Lazy")) {
-    updateMechanism_ = UM_LAZY;
+  } else if (optim == "Lazy") {
+    setUpdateMechanism(UM_LAZY);
     selectiveUpdate_ = true;
     xbt_assert(select || (xbt_cfg_is_default_value("cpu/maxmin-selective-update")),
                "Disabling selective update while using the lazy update mechanism is dumb!");
   } else {
-    xbt_die("Unsupported optimization (%s) for this model", optim);
+    xbt_die("Unsupported optimization (%s) for this model", optim.c_str());
   }
 
   p_cpuRunningActionSetThatDoesNotNeedBeingChecked = new ActionList();
-  maxminSystem_ = lmm_system_new(selectiveUpdate_);
+  maxminSystem_                                    = new s_lmm_system_t(selectiveUpdate_);
 
   if (getUpdateMechanism() == UM_LAZY) {
-    actionHeap_ = xbt_heap_new(8, nullptr);
-    xbt_heap_set_update_callback(actionHeap_,  surf_action_lmm_update_index_heap);
     modifiedSet_ = new ActionLmmList();
     maxminSystem_->keep_track = modifiedSet_;
   }
@@ -65,9 +63,8 @@ CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
 
 CpuCas01Model::~CpuCas01Model()
 {
-  lmm_system_free(maxminSystem_);
+  delete maxminSystem_;
   maxminSystem_ = nullptr;
-  xbt_heap_free(actionHeap_);
   delete modifiedSet_;
 
   surf_cpu_model_pm = nullptr;
@@ -83,9 +80,9 @@ Cpu *CpuCas01Model::createCpu(simgrid::s4u::Host *host, std::vector<double> *spe
 /************
  * Resource *
  ************/
-CpuCas01::CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core)
-: Cpu(model, host, lmm_constraint_new(model->getMaxminSystem(), this, core * speedPerPstate->front()),
-    speedPerPstate, core)
+CpuCas01::CpuCas01(CpuCas01Model* model, simgrid::s4u::Host* host, std::vector<double>* speedPerPstate, int core)
+    : Cpu(model, host, model->getMaxminSystem()->constraint_new(this, core * speedPerPstate->front()), speedPerPstate,
+          core)
 {
 }
 
@@ -101,7 +98,7 @@ std::vector<double> * CpuCas01::getSpeedPeakList(){
 
 bool CpuCas01::isUsed()
 {
-  return lmm_constraint_used(model()->getMaxminSystem(), constraint());
+  return model()->getMaxminSystem()->constraint_used(constraint());
 }
 
 /** @brief take into account changes of speed (either load or max) */
@@ -109,12 +106,12 @@ void CpuCas01::onSpeedChange() {
   lmm_variable_t var = nullptr;
   lmm_element_t elem = nullptr;
 
-  lmm_update_constraint_bound(model()->getMaxminSystem(), constraint(), coresAmount_ * speed_.scale * speed_.peak);
-  while ((var = lmm_get_var_from_cnst(model()->getMaxminSystem(), constraint(), &elem))) {
-    CpuCas01Action* action = static_cast<CpuCas01Action*>(lmm_variable_id(var));
+  model()->getMaxminSystem()->update_constraint_bound(constraint(), coresAmount_ * speed_.scale * speed_.peak);
+  while ((var = constraint()->get_variable(&elem))) {
+    CpuCas01Action* action = static_cast<CpuCas01Action*>(var->get_id());
 
-    lmm_update_variable_bound(model()->getMaxminSystem(), action->getVariable(),
-                              action->requestedCore() * speed_.scale * speed_.peak);
+    model()->getMaxminSystem()->update_variable_bound(action->getVariable(),
+                                                      action->requestedCore() * speed_.scale * speed_.peak);
   }
 
   Cpu::onSpeedChange();
@@ -146,8 +143,8 @@ void CpuCas01::apply_event(tmgr_trace_event_t event, double value)
 
       turnOff();
 
-      while ((var = lmm_get_var_from_cnst(model()->getMaxminSystem(), cnst, &elem))) {
-        Action *action = static_cast<Action*>(lmm_variable_id(var));
+      while ((var = cnst->get_variable(&elem))) {
+        Action* action = static_cast<Action*>(var->get_id());
 
         if (action->getState() == Action::State::running ||
             action->getState() == Action::State::ready ||
@@ -177,13 +174,13 @@ CpuAction* CpuCas01::execution_start(double size, int requestedCores)
 CpuAction *CpuCas01::sleep(double duration)
 {
   if (duration > 0)
-    duration = MAX(duration, sg_surf_precision);
+    duration = std::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
-  action->maxDuration_ = duration;
+  action->setMaxDuration(duration);
   action->suspended_ = 2;
   if (duration < 0) { // NO_MAX_DURATION
     /* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */
@@ -192,7 +189,7 @@ CpuAction *CpuCas01::sleep(double duration)
     action->getStateSet()->push_back(*action);
   }
 
-  lmm_update_variable_weight(model()->getMaxminSystem(), action->getVariable(), 0.0);
+  model()->getMaxminSystem()->update_variable_weight(action->getVariable(), 0.0);
   if (model()->getUpdateMechanism() == UM_LAZY) { // remove action from the heap
     action->heapRemove(model()->getActionHeap());
     // this is necessary for a variable with weight 0 since such variables are ignored in lmm and we need to set its
@@ -210,15 +207,14 @@ CpuAction *CpuCas01::sleep(double duration)
 CpuCas01Action::CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm_constraint_t constraint,
                                int requestedCore)
     : CpuAction(model, cost, failed,
-                lmm_variable_new(model->getMaxminSystem(), this, 1.0 / requestedCore, requestedCore * speed, 1))
+                model->getMaxminSystem()->variable_new(this, 1.0 / requestedCore, requestedCore * speed, 1))
     , requestedCore_(requestedCore)
 {
   if (model->getUpdateMechanism() == UM_LAZY) {
-    indexHeap_ = -1;
-    lastUpdate_ = surf_get_clock();
-    lastValue_ = 0.0;
+    refreshLastUpdate();
+    setLastValue(0.0);
   }
-  lmm_expand(model->getMaxminSystem(), constraint, getVariable(), 1.0);
+  model->getMaxminSystem()->expand(constraint, getVariable(), 1.0);
 }
 
 CpuCas01Action::CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm_constraint_t constraint)
index 955de3a..6708124 100644 (file)
@@ -1,12 +1,12 @@
-/* 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
  * 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");
@@ -23,35 +23,29 @@ namespace surf {
 
 void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
 {
-  while ((xbt_heap_size(getActionHeap()) > 0)
-         && (double_equals(xbt_heap_maxkey(getActionHeap()), now, sg_surf_precision))) {
+  while (not actionHeapIsEmpty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
 
-    CpuAction *action = static_cast<CpuAction*>(xbt_heap_pop(getActionHeap()));
+    CpuAction* action = static_cast<CpuAction*>(actionHeapPop());
     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()),
+      Cpu* cpu = static_cast<Cpu*>(action->getVariable()->get_constraint(0)->get_id());
+      TRACE_surf_host_set_utilization(cpu->getCname(), action->getCategory(), action->getVariable()->get_value(),
                                       action->getLastUpdate(), now - action->getLastUpdate());
     }
 
-    action->finish();
+    action->finish(Action::State::done);
     XBT_CDEBUG(surf_kernel, "Action %p finished", action);
 
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     action->setRemains(0);
-    action->setState(Action::State::done);
   }
   if (TRACE_is_enabled()) {
     //defining the last timestamp that we can safely dump to trace file
     //without losing the event ascending order (considering all CPU's)
     double smaller = -1;
-    ActionList *actionSet = getRunningActionSet();
-    ActionList::iterator it(actionSet->begin());
-    ActionList::iterator itend(actionSet->end());
-    for (; it != itend; ++it) {
-      CpuAction *action = static_cast<CpuAction*>(&*it);
-      if (smaller < 0 || action->getLastUpdate() < smaller)
-        smaller = action->getLastUpdate();
+    for (Action const& action : *getRunningActionSet()) {
+      if (smaller < 0 || action.getLastUpdate() < smaller)
+        smaller = action.getLastUpdate();
     }
     if (smaller > 0) {
       TRACE_last_timestamp_to_dump = smaller;
@@ -61,31 +55,24 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
 
 void CpuModel::updateActionsStateFull(double now, double delta)
 {
-  CpuAction *action = nullptr;
-  ActionList *running_actions = getRunningActionSet();
-  ActionList::iterator it(running_actions->begin());
-  ActionList::iterator itNext = it;
-  ActionList::iterator itend(running_actions->end());
-  for (; it != itend; it = itNext) {
-    ++itNext;
-    action = static_cast<CpuAction*>(&*it);
+  for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
+    CpuAction& action = static_cast<CpuAction&>(*it);
+    ++it; // increment iterator here since the following calls to action.finish() may invalidate it
     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()),
+      Cpu* cpu = static_cast<Cpu*>(action.getVariable()->get_constraint(0)->get_id());
+      TRACE_surf_host_set_utilization(cpu->getCname(), action.getCategory(), action.getVariable()->get_value(),
                                       now - delta, delta);
       TRACE_last_timestamp_to_dump = now - delta;
     }
 
-    action->updateRemains(lmm_variable_getvalue(action->getVariable()) * delta);
+    action.updateRemains(action.getVariable()->get_value() * delta);
 
-    if (action->getMaxDuration() != NO_MAX_DURATION)
-      action->updateMaxDuration(delta);
+    if (action.getMaxDuration() != NO_MAX_DURATION)
+      action.updateMaxDuration(delta);
 
-    if (((action->getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) ||
-        ((action->getMaxDuration() != NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
-      action->finish();
-      action->setState(Action::State::done);
+    if (((action.getRemainsNoUpdate() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.getMaxDuration() != NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+      action.finish(Action::State::done);
     }
   }
 }
@@ -110,7 +97,7 @@ Cpu::Cpu(Model* model, simgrid::s4u::Host* host, lmm_constraint_t constraint, st
   xbt_assert(speed_.scale > 0, "Speed of host %s must be >0", host->getCname());
 
   // Copy the power peak array:
-  for (double value : *speedPerPstate) {
+  for (double const& value : *speedPerPstate) {
     speedPerPstate_.push_back(value);
   }
 }
@@ -125,8 +112,9 @@ 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,
-             static_cast<int>(speedPerPstate_.size()));
+             "Invalid parameters for CPU %s (pstate %d > length of pstates %d). Please fix your platform file, or your "
+             "call to change the pstate.",
+             getCname(), pstate_index, static_cast<int>(speedPerPstate_.size()));
 
   double new_peak_speed = speedPerPstate_[pstate_index];
   pstate_ = pstate_index;
@@ -159,7 +147,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_);
 }
 
@@ -191,25 +179,39 @@ void CpuAction::updateRemainingLazy(double now)
   xbt_assert(getStateSet() == getModel()->getRunningActionSet(), "You're updating an action that is not running.");
   xbt_assert(getPriority() > 0, "You're updating an action that seems suspended.");
 
-  double delta = now - lastUpdate_;
+  double delta = now - getLastUpdate();
 
-  if (remains_ > 0) {
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %f, last_update was: %f", this, remains_, lastUpdate_);
-    double_update(&(remains_), lastValue_ * delta, sg_maxmin_precision*sg_surf_precision);
+  if (getRemainsNoUpdate() > 0) {
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %f, last_update was: %f", this, getRemainsNoUpdate(),
+               getLastUpdate());
+    updateRemains(getLastValue() * delta);
 
     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_);
+      Cpu* cpu = static_cast<Cpu*>(getVariable()->get_constraint(0)->get_id());
+      TRACE_surf_host_set_utilization(cpu->getCname(), getCategory(), getLastValue(), getLastUpdate(),
+                                      now - getLastUpdate());
     }
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, remains_);
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, getRemainsNoUpdate());
   }
 
-  lastUpdate_ = now;
-  lastValue_ = lmm_variable_getvalue(getVariable());
+  refreshLastUpdate();
+  setLastValue(getVariable()->get_value());
 }
 
 simgrid::xbt::signal<void(simgrid::surf::CpuAction*, Action::State)> CpuAction::onStateChange;
 
+void CpuAction::suspend(){
+  Action::State previous = getState();
+  onStateChange(this, previous);
+  Action::suspend();
+}
+
+void CpuAction::resume(){
+  Action::State previous = getState();
+  onStateChange(this, previous);
+  Action::resume();
+}
+
 void CpuAction::setState(Action::State state){
   Action::State previous = getState();
   Action::setState(state);
@@ -218,13 +220,12 @@ void CpuAction::setState(Action::State state){
 /** @brief returns a list of all CPUs that this action is using */
 std::list<Cpu*> CpuAction::cpus() {
   std::list<Cpu*> retlist;
-  lmm_system_t sys = getModel()->getMaxminSystem();
-  int llen = lmm_get_number_of_cnst_from_var(sys, getVariable());
+  int llen = getVariable()->get_number_of_constraint();
 
   for (int i = 0; i < llen; i++) {
     /* Beware of composite actions: ptasks put links and cpus together */
     // extra pb: we cannot dynamic_cast from void*...
-    Resource* resource = static_cast<Resource*>(lmm_constraint_id(lmm_get_cnst_from_var(sys, getVariable(), i)));
+    Resource* resource = static_cast<Resource*>(getVariable()->get_constraint(i)->get_id());
     Cpu* cpu           = dynamic_cast<Cpu*>(resource);
     if (cpu != nullptr)
       retlist.push_back(cpu);
index 920f92f..ab01fc3 100644 (file)
@@ -7,7 +7,7 @@
 #define SURF_CPU_INTERFACE_HPP_
 
 #include "simgrid/s4u/Host.hpp"
-#include "src/surf/maxmin_private.hpp"
+#include "surf/maxmin.hpp"
 
 #include <list>
 
 namespace simgrid {
 namespace surf {
 
-class CpuModel;
-class Cpu;
-class CpuAction;
-
  /** @ingroup SURF_cpu_interface
  * @brief SURF cpu model interface class
  * @details A model is an object which handle the interactions between its Resources and its Actions
@@ -168,6 +164,9 @@ static simgrid::xbt::signal<void(simgrid::surf::CpuAction*)> onShareChange;
 
   void updateRemainingLazy(double now) override;
   std::list<Cpu*> cpus();
+  
+  void suspend() override;
+  void resume() override;
 };
 
 }
index 9173e1d..55b0d23 100644 (file)
@@ -1,12 +1,12 @@
-/* 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
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_ti.hpp"
-#include "xbt/heap.h"
 #include "src/surf/trace_mgr.hpp"
+#include <algorithm>
 
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
@@ -16,12 +16,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu, "Logging specific to the
 namespace simgrid {
 namespace surf {
 
-static inline
-void cpu_ti_action_update_index_heap(void *action, int i)
-{
-  (static_cast<simgrid::surf::CpuTiAction*>(action))->updateIndexHeap(i);
-}
-
 /*********
  * Trace *
  *********/
@@ -34,7 +28,7 @@ CpuTiTrace::CpuTiTrace(tmgr_trace_t speedTrace)
   nbPoints_ = speedTrace->event_list.size() + 1;
   timePoints_ = new double[nbPoints_];
   integral_ =  new double[nbPoints_];
-  for (auto val : speedTrace->event_list) {
+  for (auto const& val : speedTrace->event_list) {
     timePoints_[i] = time;
     integral_[i] = integral;
     integral += val.date_ * val.value_;
@@ -273,7 +267,7 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value) :
   type_ = TRACE_DYNAMIC;
 
   /* count the total time of trace file */
-  for (auto val : speedTrace->event_list)
+  for (auto const& val : speedTrace->event_list)
     total_time += val.date_;
 
   trace_ = new CpuTiTrace(speedTrace);
@@ -337,9 +331,6 @@ CpuTiModel::CpuTiModel() : CpuModel()
   runningActionSetThatDoesNotNeedBeingChecked_ = new ActionList();
 
   modifiedCpu_ = new CpuTiList();
-
-  tiActionHeap_ = xbt_heap_new(8, nullptr);
-  xbt_heap_set_update_callback(tiActionHeap_, cpu_ti_action_update_index_heap);
 }
 
 CpuTiModel::~CpuTiModel()
@@ -347,7 +338,6 @@ CpuTiModel::~CpuTiModel()
   surf_cpu_model_pm = nullptr;
   delete runningActionSetThatDoesNotNeedBeingChecked_;
   delete modifiedCpu_;
-  xbt_heap_free(tiActionHeap_);
 }
 
 Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, std::vector<double>* speedPerPstate, int core)
@@ -359,16 +349,16 @@ double CpuTiModel::nextOccuringEvent(double now)
 {
   double min_action_duration = -1;
 
-/* iterates over modified cpus to update share resources */
-  for(CpuTiList::iterator it(modifiedCpu_->begin()), itend(modifiedCpu_->end()) ; it != itend ;) {
-    CpuTi *ti = &*it;
-    ++it;
-    ti->updateActionsFinishTime(now);
+  /* iterates over modified cpus to update share resources */
+  for (auto it = std::begin(*modifiedCpu_); it != std::end(*modifiedCpu_);) {
+    CpuTi& ti = *it;
+    ++it; // increment iterator here since the following call to ti.updateActionsFinishTime() may invalidate it
+    ti.updateActionsFinishTime(now);
   }
 
-/* get the min next event if heap not empty */
-  if (xbt_heap_size(tiActionHeap_) > 0)
-    min_action_duration = xbt_heap_maxkey(tiActionHeap_) - now;
+  /* get the min next event if heap not empty */
+  if (not actionHeapIsEmpty())
+    min_action_duration = actionHeapTopDate() - now;
 
   XBT_DEBUG("Share resources, min next event date: %f", min_action_duration);
 
@@ -377,13 +367,12 @@ double CpuTiModel::nextOccuringEvent(double now)
 
 void CpuTiModel::updateActionsState(double now, double /*delta*/)
 {
-  while ((xbt_heap_size(tiActionHeap_) > 0) && (xbt_heap_maxkey(tiActionHeap_) <= now)) {
-    CpuTiAction *action = static_cast<CpuTiAction*>(xbt_heap_pop(tiActionHeap_));
+  while (not actionHeapIsEmpty() && actionHeapTopDate() <= now) {
+    CpuTiAction* action = static_cast<CpuTiAction*>(actionHeapPop());
     XBT_DEBUG("Action %p: finish", action);
-    action->finish();
+    action->finish(Action::State::done);
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     action->setRemains(0);
-    action->setState(Action::State::done);
     /* update remaining amount of all actions */
     action->cpu_->updateRemainingAmount(surf_get_clock());
   }
@@ -461,20 +450,12 @@ void CpuTi::apply_event(tmgr_trace_event_t event, double value)
       double date = surf_get_clock();
 
       /* put all action running on cpu to failed */
-      for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()); it != itend ; ++it) {
-
-        CpuTiAction *action = &*it;
-        if (action->getState() == Action::State::running
-         || action->getState() == Action::State::ready
-         || action->getState() == Action::State::not_in_the_system) {
-          action->setFinishTime(date);
-          action->setState(Action::State::failed);
-          if (action->indexHeap_ >= 0) {
-            CpuTiAction* heap_act = static_cast<CpuTiAction*>(
-                xbt_heap_remove(static_cast<CpuTiModel*>(model())->tiActionHeap_, action->indexHeap_));
-            if (heap_act != action)
-              DIE_IMPOSSIBLE;
-          }
+      for (CpuTiAction& action : *actionSet_) {
+        if (action.getState() == Action::State::running || action.getState() == Action::State::ready ||
+            action.getState() == Action::State::not_in_the_system) {
+          action.setFinishTime(date);
+          action.setState(Action::State::failed);
+          action.heapRemove(model()->getActionHeap());
         }
       }
     }
@@ -487,70 +468,62 @@ void CpuTi::apply_event(tmgr_trace_event_t event, double value)
 
 void CpuTi::updateActionsFinishTime(double now)
 {
-  CpuTiAction *action;
   double sum_priority = 0.0;
   double total_area;
 
   /* update remaining amount of actions */
   updateRemainingAmount(now);
 
-  for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()) ; it != itend ; ++it) {
-    action = &*it;
+  for (CpuTiAction const& action : *actionSet_) {
     /* action not running, skip it */
-    if (action->getStateSet() != surf_cpu_model_pm->getRunningActionSet())
+    if (action.getStateSet() != surf_cpu_model_pm->getRunningActionSet())
       continue;
 
     /* bogus priority, skip it */
-    if (action->getPriority() <= 0)
+    if (action.getPriority() <= 0)
       continue;
 
     /* action suspended, skip it */
-    if (action->suspended_ != 0)
+    if (action.suspended_ != 0)
       continue;
 
-    sum_priority += 1.0 / action->getPriority();
+    sum_priority += 1.0 / action.getPriority();
   }
   sumPriority_ = sum_priority;
 
-  for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()) ; it != itend ; ++it) {
-    action = &*it;
+  for (CpuTiAction& action : *actionSet_) {
     double min_finish = -1;
     /* action not running, skip it */
-    if (action->getStateSet() !=  surf_cpu_model_pm->getRunningActionSet())
+    if (action.getStateSet() != surf_cpu_model_pm->getRunningActionSet())
       continue;
 
     /* verify if the action is really running on cpu */
-    if (action->suspended_ == 0 && action->getPriority() > 0) {
+    if (action.suspended_ == 0 && action.getPriority() > 0) {
       /* total area needed to finish the action. Used in trace integration */
-      total_area = (action->getRemains()) * sum_priority * action->getPriority();
+      total_area = (action.getRemains()) * sum_priority * action.getPriority();
 
       total_area /= speed_.peak;
 
-      action->setFinishTime(speedIntegratedTrace_->solve(now, total_area));
+      action.setFinishTime(speedIntegratedTrace_->solve(now, total_area));
       /* verify which event will happen before (max_duration or finish time) */
-      if (action->getMaxDuration() > NO_MAX_DURATION &&
-          action->getStartTime() + action->getMaxDuration() < action->finishTime_)
-        min_finish = action->getStartTime() + action->getMaxDuration();
+      if (action.getMaxDuration() > NO_MAX_DURATION &&
+          action.getStartTime() + action.getMaxDuration() < action.getFinishTime())
+        min_finish = action.getStartTime() + action.getMaxDuration();
       else
-        min_finish = action->finishTime_;
+        min_finish = action.getFinishTime();
     } else {
       /* put the max duration time on heap */
-      if (action->getMaxDuration() > NO_MAX_DURATION)
-        min_finish = action->getStartTime() + action->getMaxDuration();
+      if (action.getMaxDuration() > NO_MAX_DURATION)
+        min_finish = action.getStartTime() + action.getMaxDuration();
     }
     /* add in action heap */
-    XBT_DEBUG("action(%p) index %d", action, action->indexHeap_);
-    if (action->indexHeap_ >= 0) {
-      CpuTiAction* heap_act = static_cast<CpuTiAction*>(
-          xbt_heap_remove(static_cast<CpuTiModel*>(model())->tiActionHeap_, action->indexHeap_));
-      if (heap_act != action)
-        DIE_IMPOSSIBLE;
-    }
     if (min_finish > NO_MAX_DURATION)
-      xbt_heap_push(static_cast<CpuTiModel*>(model())->tiActionHeap_, action, min_finish);
+      action.heapUpdate(model()->getActionHeap(), min_finish, NOTSET);
+    else
+      action.heapRemove(model()->getActionHeap());
 
-    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.getFinishTime(), action.getMaxDuration());
   }
   /* remove from modified cpu */
   modified(false);
@@ -578,39 +551,37 @@ void CpuTi::updateRemainingAmount(double now)
   /* compute the integration area */
   double area_total = speedIntegratedTrace_->integrate(lastUpdate_, now) * speed_.peak;
   XBT_DEBUG("Flops total: %f, Last update %f", area_total, lastUpdate_);
-
-  for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()) ; it != itend ; ++it) {
-    CpuTiAction *action = &*it;
+  for (CpuTiAction& action : *actionSet_) {
     /* action not running, skip it */
-    if (action->getStateSet() != model()->getRunningActionSet())
+    if (action.getStateSet() != model()->getRunningActionSet())
       continue;
 
     /* bogus priority, skip it */
-    if (action->getPriority() <= 0)
+    if (action.getPriority() <= 0)
       continue;
 
     /* action suspended, skip it */
-    if (action->suspended_ != 0)
+    if (action.suspended_ != 0)
       continue;
 
     /* action don't need update */
-    if (action->getStartTime() >= now)
+    if (action.getStartTime() >= now)
       continue;
 
     /* skip action that are finishing now */
-    if (action->finishTime_ >= 0 && action->finishTime_ <= now)
+    if (action.getFinishTime() >= 0 && action.getFinishTime() <= now)
       continue;
 
     /* update remaining */
-    action->updateRemains(area_total / (sumPriority_ * action->getPriority()));
-    XBT_DEBUG("Update remaining action(%p) remaining %f", action, action->remains_);
+    action.updateRemains(area_total / (sumPriority_ * action.getPriority()));
+    XBT_DEBUG("Update remaining action(%p) remaining %f", &action, action.getRemainsNoUpdate());
   }
   lastUpdate_ = 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);
@@ -623,12 +594,12 @@ CpuAction *CpuTi::execution_start(double size)
 CpuAction *CpuTi::sleep(double duration)
 {
   if (duration > 0)
-    duration = MAX(duration, sg_surf_precision);
+    duration = std::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;
+  action->setMaxDuration(duration);
   action->suspended_ = 2;
   if (duration == NO_MAX_DURATION) {
    /* Move to the *end* of the corresponding action set. This convention
@@ -668,11 +639,6 @@ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cp
   cpu_->modified(true);
 }
 
-void CpuTiAction::updateIndexHeap(int i)
-{
-  indexHeap_ = i;
-}
-
 void CpuTiAction::setState(Action::State state)
 {
   CpuAction::setState(state);
@@ -689,7 +655,7 @@ int CpuTiAction::unref()
     if (action_ti_hook.is_linked())
       cpu_->actionSet_->erase(cpu_->actionSet_->iterator_to(*this));
     /* remove from heap */
-    xbt_heap_remove(static_cast<CpuTiModel*>(getModel())->tiActionHeap_, this->indexHeap_);
+    heapRemove(getModel()->getActionHeap());
     cpu_->modified(true);
     delete this;
     return 1;
@@ -700,7 +666,7 @@ int CpuTiAction::unref()
 void CpuTiAction::cancel()
 {
   this->setState(Action::State::failed);
-  xbt_heap_remove(getModel()->getActionHeap(), this->indexHeap_);
+  heapRemove(getModel()->getActionHeap());
   cpu_->modified(true);
 }
 
@@ -709,7 +675,7 @@ void CpuTiAction::suspend()
   XBT_IN("(%p)", this);
   if (suspended_ != 2) {
     suspended_ = 1;
-    xbt_heap_remove(getModel()->getActionHeap(), indexHeap_);
+    heapRemove(getModel()->getActionHeap());
     cpu_->modified(true);
   }
   XBT_OUT();
@@ -731,7 +697,7 @@ void CpuTiAction::setMaxDuration(double duration)
 
   XBT_IN("(%p,%g)", this, duration);
 
-  maxDuration_ = duration;
+  Action::setMaxDuration(duration);
 
   if (duration >= 0)
     min_finish = (getStartTime() + getMaxDuration()) < getFinishTime() ?
@@ -739,13 +705,8 @@ void CpuTiAction::setMaxDuration(double duration)
   else
     min_finish = getFinishTime();
 
-/* add in action heap */
-  if (indexHeap_ >= 0) {
-    CpuTiAction *heap_act = static_cast<CpuTiAction*>(xbt_heap_remove(getModel()->getActionHeap(), indexHeap_));
-    if (heap_act != this)
-      DIE_IMPOSSIBLE;
-  }
-  xbt_heap_push(getModel()->getActionHeap(), this, min_finish);
+  /* add in action heap */
+  heapUpdate(getModel()->getActionHeap(), min_finish, NOTSET);
 
   XBT_OUT();
 }
@@ -753,7 +714,7 @@ void CpuTiAction::setMaxDuration(double duration)
 void CpuTiAction::setSharingWeight(double priority)
 {
   XBT_IN("(%p,%g)", this, priority);
-  sharingWeight_ = priority;
+  setSharingWeightNoUpdate(priority);
   cpu_->modified(true);
   XBT_OUT();
 }
@@ -763,7 +724,7 @@ double CpuTiAction::getRemains()
   XBT_IN("(%p)", this);
   cpu_->updateRemainingAmount(surf_get_clock());
   XBT_OUT();
-  return remains_;
+  return getRemainsNoUpdate();
 }
 
 }
index 3f0fc96..1789127 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
@@ -88,7 +88,6 @@ public:
   void setState(simgrid::surf::Action::State state) override;
   int unref() override;
   void cancel() override;
-  void updateIndexHeap(int i);
   void suspend() override;
   void resume() override;
   void setMaxDuration(double duration) override;
@@ -96,8 +95,6 @@ public:
   double getRemains() override;
 
   CpuTi *cpu_;
-  int indexHeap_ = -1;
-  int suspended_ = 0;
 
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
@@ -152,15 +149,6 @@ public:
 
   ActionList *runningActionSetThatDoesNotNeedBeingChecked_;
   CpuTiList *modifiedCpu_;
-  xbt_heap_t tiActionHeap_;
-
-protected:
-  void NotifyResourceTurnedOn(simgrid::surf::Resource*){};
-  void NotifyResourceTurnedOff(simgrid::surf::Resource*){};
-
-  void NotifyActionCancel(Action*){};
-  void NotifyActionResume(Action*){};
-  void NotifyActionSuspend(Action*){};
 };
 
 }
index 2f44bdb..2695717 100644 (file)
@@ -1,22 +1,23 @@
-/* Copyright (c) 2007-2011, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2007-2011, 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. */
 
-#include "maxmin_private.hpp"
+#include "surf/maxmin.hpp"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
-#include <float.h>
-#include <math.h>
-#include <stdlib.h>
+#include <algorithm>
+#include <cfloat>
+#include <cmath>
+#include <cstdlib>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_maxmin);
 #define SHOW_EXPR_G(expr) XBT_DEBUG(#expr " = %g",expr);
 #define SHOW_EXPR_D(expr) XBT_DEBUG(#expr " = %d",expr);
 #define SHOW_EXPR_P(expr) XBT_DEBUG(#expr " = %p",expr);
 
-void bottleneck_solve(lmm_system_t sys)
+void simgrid::surf::bottleneck_solve(lmm_system_t sys)
 {
   void *_var;
   void *_var_next;
@@ -43,15 +44,12 @@ void bottleneck_solve(lmm_system_t sys)
   XBT_DEBUG("Variable set : %d", xbt_swag_size(var_list));
   xbt_swag_foreach(_var, var_list) {
     var = static_cast<lmm_variable_t>(_var);
-    int nb = 0;
     var->value = 0.0;
     XBT_DEBUG("Handling variable %p", var);
     xbt_swag_insert(var, &(sys->saturated_variable_set));
-    for (int i = 0; i < var->cnsts_number; i++) {
-      if (var->cnsts[i].consumption_weight == 0.0)
-        nb++;
-    }
-    if ((nb == var->cnsts_number) && (var->sharing_weight > 0.0)) {
+    auto weighted = std::find_if(begin(var->cnsts), end(var->cnsts),
+                                 [](s_lmm_element_t const& x) { return x.consumption_weight != 0.0; });
+    if (weighted == end(var->cnsts) && var->sharing_weight > 0.0) {
       XBT_DEBUG("Err, finally, there is no need to take care of variable %p", var);
       xbt_swag_remove(var, &(sys->saturated_variable_set));
       var->value = 1.0;
@@ -84,7 +82,7 @@ void bottleneck_solve(lmm_system_t sys)
   do {
     if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
       XBT_DEBUG("Fair bottleneck done");
-      lmm_print(sys);
+      sys->print();
     }
     XBT_DEBUG("******* Constraints to process: %d *******", xbt_swag_size(cnst_list));
     xbt_swag_foreach_safe(_cnst, _cnst_next, cnst_list) {
@@ -115,13 +113,12 @@ void bottleneck_solve(lmm_system_t sys)
     xbt_swag_foreach_safe(_var, _var_next, var_list) {
       var = static_cast<lmm_variable_t>(_var);
       double min_inc = DBL_MAX;
-      for (int i = 0; i < var->cnsts_number; i++) {
-        lmm_element_t elm = &var->cnsts[i];
-        if (elm->consumption_weight > 0)
-          min_inc = MIN(min_inc, elm->constraint->usage / elm->consumption_weight);
+      for (s_lmm_element_t const& elm : var->cnsts) {
+        if (elm.consumption_weight > 0)
+          min_inc = std::min(min_inc, elm.constraint->usage / elm.consumption_weight);
       }
       if (var->bound > 0)
-        min_inc = MIN(min_inc, var->bound - var->value);
+        min_inc = std::min(min_inc, var->bound - var->value);
       var->mu = min_inc;
       XBT_DEBUG("Updating variable %p maximum increment: %g", var, var->mu);
       var->value += var->mu;
@@ -144,7 +141,7 @@ void bottleneck_solve(lmm_system_t sys)
         } else {
           XBT_DEBUG("\tNon-Shared variable. Update constraint usage of %p (%g) with variable %p by %g",
               cnst, cnst->usage, elem->variable, elem->variable->mu);
-          cnst->usage = MIN(cnst->usage, elem->consumption_weight * elem->variable->mu);
+          cnst->usage = std::min(cnst->usage, elem->consumption_weight * elem->variable->mu);
         }
       }
       if (not cnst->sharing_policy) {
@@ -172,9 +169,9 @@ void bottleneck_solve(lmm_system_t sys)
   } while (xbt_swag_size(var_list));
 
   xbt_swag_reset(cnst_list);
-  sys->modified = 0;
+  sys->modified = true;
   if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
     XBT_DEBUG("Fair bottleneck done");
-    lmm_print(sys);
+    sys->print();
   }
 }
index 420221a..6a271cd 100644 (file)
@@ -3,21 +3,21 @@
 /* This program is 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"
-#include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
+#include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include "xbt/graph.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy");
 
 static int platform_created = 0;            /* indicate whether the platform file has been traced */
-static std::vector<container_t> currentContainer; /* push and pop, used only in creation */
+static std::vector<simgrid::instr::NetZoneContainer*> currentContainer; /* push and pop, used only in creation */
 
 static const char *instr_node_name (xbt_node_t node)
 {
@@ -28,23 +28,23 @@ static const char *instr_node_name (xbt_node_t node)
 static container_t lowestCommonAncestor (container_t a1, container_t a2)
 {
   //this is only an optimization (since most of a1 and a2 share the same parent)
-  if (a1->father == a2->father)
-    return a1->father;
+  if (a1->father_ == a2->father_)
+    return a1->father_;
 
   //create an array with all ancestors of a1
   std::vector<container_t> ancestors_a1;
-  container_t p = a1->father;
+  container_t p = a1->father_;
   while (p){
     ancestors_a1.push_back(p);
-    p = p->father;
+    p = p->father_;
   }
 
   //create an array with all ancestors of a2
   std::vector<container_t> ancestors_a2;
-  p = a2->father;
+  p = a2->father_;
   while (p){
     ancestors_a2.push_back(p);
-    p = p->father;
+    p = p->father_;
   }
 
   //find the lowest ancestor
@@ -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->getName() == "__loopback__" || dst->getName() == "__loopback__") {
     XBT_DEBUG ("  linkContainers: ignoring loopback link");
     return;
   }
@@ -79,54 +79,46 @@ 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->getName() + dst->getName();
+  std::string aux2 = dst->getName() + src->getName();
+  if (filter->find(aux1) != filter->end()) {
+    XBT_DEBUG("  linkContainers: already registered %s <-> %s (1)", src->getCname(), dst->getCname());
+    return;
+  }
+  if (filter->find(aux2) != filter->end()) {
+    XBT_DEBUG("  linkContainers: already registered %s <-> %s (2)", dst->getCname(), src->getCname());
+    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);
-  type_t link_type = PJ_type_get_or_null (link_typename, father->type);
-  if (link_type == nullptr){
-    link_type = PJ_type_link_new (link_typename, father->type, src->type, dst->type);
-  }
+  std::string link_typename = father->type_->getName() + "-" + src->type_->getName() +
+                              std::to_string(src->type_->getId()) + "-" + dst->type_->getName() +
+                              std::to_string(dst->type_->getId());
+  simgrid::instr::LinkType* link = father->type_->getOrCreateLinkType(link_typename, src->type_, dst->type_);
+  link->setCallingContainer(father);
 
   //register EDGE types for triva configuration
-  xbt_dict_set (trivaEdgeTypes, link_type->name, xbt_strdup("1"), nullptr);
+  trivaEdgeTypes.insert(link->getName());
 
   //create the link
   static long long counter = 0;
 
-  char key[INSTR_DEFAULT_STR_SIZE];
-  snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
+  std::string key = std::to_string(counter);
   counter++;
 
-  new StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key);
-  new EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key);
+  link->startEvent(src, "topology", key);
+  link->endEvent(dst, "topology", key);
 
-  XBT_DEBUG ("  linkContainers %s <-> %s", src->name, dst->name);
+  XBT_DEBUG("  linkContainers %s <-> %s", src->getCname(), dst->getCname());
 }
 
-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.");
@@ -135,28 +127,24 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t
   XBT_DEBUG("Graph extraction for NetZone = %s", netzone->getCname());
   if (not netzone->getChildren()->empty()) {
     //bottom-up recursion
-    for (auto nz_son : *netzone->getChildren()) {
-      container_t child_container = static_cast<container_t>(xbt_dict_get(container->children, nz_son->getCname()));
+    for (auto const& nz_son : *netzone->getChildren()) {
+      container_t child_container = container->children_.at(nz_son->getCname());
       recursiveGraphExtraction(nz_son, child_container, filter);
     }
   }
 
   xbt_graph_t graph = xbt_graph_new_graph (0, nullptr);
-  xbt_dict_t nodes = xbt_dict_new_homogeneous(nullptr);
-  xbt_dict_t edges = xbt_dict_new_homogeneous(nullptr);
-  xbt_edge_t edge = nullptr;
-
-  xbt_dict_cursor_t cursor = nullptr;
-  char *edge_name;
+  std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
+  std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_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);
+  for (auto elm : *edges) {
+    xbt_edge_t edge = elm.second;
+    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);
+  delete nodes;
+  delete edges;
   xbt_graph_free_graph(graph, xbt_free_f, xbt_free_f, nullptr);
 }
 
@@ -165,21 +153,16 @@ 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){
-    PJ_container_alloc ();
-    container_t root = PJ_container_new (id, INSTR_AS, nullptr);
-    PJ_container_set_root (root);
+  if (simgrid::instr::Container::getRoot() == nullptr) {
+    simgrid::instr::NetZoneContainer* root = new simgrid::instr::NetZoneContainer(id, 0, nullptr);
 
     if (TRACE_smpi_is_enabled()) {
-      type_t mpi = PJ_type_get_or_null ("MPI", root->type);
-      if (mpi == nullptr){
-        mpi = PJ_type_container_new("MPI", root->type);
-        if (not TRACE_smpi_is_grouped())
-          PJ_type_state_new ("MPI_STATE", mpi);
-        PJ_type_link_new ("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");
+      root->type_->getOrCreateLinkType("MPI_LINK", mpi, mpi);
     }
 
     if (TRACE_needs_platform()){
@@ -189,8 +172,8 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
   }
 
   if (TRACE_needs_platform()){
-    container_t father = currentContainer.back();
-    container_t container = PJ_container_new (id, INSTR_AS, father);
+    simgrid::instr::NetZoneContainer* container =
+        new simgrid::instr::NetZoneContainer(id, currentContainer.size(), currentContainer.back());
     currentContainer.push_back(container);
   }
 }
@@ -206,120 +189,87 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link)
 {
   if (currentContainer.empty()) // No ongoing parsing. Are you creating the loopback?
     return;
-  container_t father = currentContainer.back();
-
-  double bandwidth_value = link.bandwidth();
-  double latency_value   = link.latency();
 
-  container_t container = PJ_container_new(link.name(), INSTR_LINK, father);
+  container_t father    = currentContainer.back();
+  container_t container = new simgrid::instr::Container(link.getName(), "LINK", father);
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
-    type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type);
-    if (bandwidth == nullptr) {
-      bandwidth = PJ_type_variable_new("bandwidth", nullptr, container->type);
-    }
-    type_t latency = PJ_type_get_or_null("latency", container->type);
-    if (latency == nullptr) {
-      latency = PJ_type_variable_new("latency", nullptr, container->type);
-    }
-    new SetVariableEvent(0, container, bandwidth, bandwidth_value);
-    new SetVariableEvent(0, container, latency, latency_value);
+    simgrid::instr::VariableType* bandwidth = container->type_->getOrCreateVariableType("bandwidth", "");
+    bandwidth->setCallingContainer(container);
+    bandwidth->setEvent(0, link.bandwidth());
+    simgrid::instr::VariableType* latency = container->type_->getOrCreateVariableType("latency", "");
+    latency->setCallingContainer(container);
+    latency->setEvent(0, link.latency());
   }
   if (TRACE_uncategorized()) {
-    type_t bandwidth_used = PJ_type_get_or_null("bandwidth_used", container->type);
-    if (bandwidth_used == nullptr) {
-      PJ_type_variable_new("bandwidth_used", "0.5 0.5 0.5", container->type);
-    }
+    container->type_->getOrCreateVariableType("bandwidth_used", "0.5 0.5 0.5");
   }
 }
 
 static void sg_instr_new_host(simgrid::s4u::Host& host)
 {
-  container_t father = currentContainer.back();
-  container_t container = PJ_container_new(host.getCname(), INSTR_HOST, father);
+  container_t container = new simgrid::instr::HostContainer(host, currentContainer.back());
+  container_t root      = simgrid::instr::Container::getRoot();
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
-    type_t speed = PJ_type_get_or_null ("power", container->type);
-    if (speed == nullptr){
-      speed = PJ_type_variable_new ("power", nullptr, container->type);
-    }
-
-    double current_speed_state = host.getSpeed();
-    new SetVariableEvent (0, container, speed, current_speed_state);
-  }
-  if (TRACE_uncategorized()){
-    type_t speed_used = PJ_type_get_or_null ("power_used", container->type);
-    if (speed_used == nullptr){
-      PJ_type_variable_new ("power_used", "0.5 0.5 0.5", container->type);
-    }
+    simgrid::instr::VariableType* power = container->type_->getOrCreateVariableType("power", "");
+    power->setCallingContainer(container);
+    power->setEvent(0, host.getSpeed());
   }
 
-  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
-    type_t mpi = PJ_type_get_or_null ("MPI", container->type);
-    if (mpi == nullptr){
-      mpi = PJ_type_container_new("MPI", container->type);
-      PJ_type_state_new ("MPI_STATE", mpi);
-    }
-  }
+  if (TRACE_uncategorized())
+    container->type_->getOrCreateVariableType("power_used", "0.5 0.5 0.5");
+
+  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped())
+    container->type_->getOrCreateContainerType("MPI")->getOrCreateStateType("MPI_STATE");
 
   if (TRACE_msg_process_is_enabled()) {
-    type_t msg_process = PJ_type_get_or_null ("MSG_PROCESS", container->type);
-    if (msg_process == nullptr){
-      msg_process = PJ_type_container_new("MSG_PROCESS", container->type);
-      type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process);
-      PJ_value_new ("suspend", "1 0 1", state);
-      PJ_value_new ("sleep", "1 1 0", state);
-      PJ_value_new ("receive", "1 0 0", state);
-      PJ_value_new ("send", "0 0 1", state);
-      PJ_value_new ("task_execute", "0 1 1", state);
-      PJ_type_link_new ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
-      PJ_type_link_new ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
-    }
+    simgrid::instr::ContainerType* msg_process = container->type_->getOrCreateContainerType("MSG_PROCESS");
+    simgrid::instr::StateType* state           = msg_process->getOrCreateStateType("MSG_PROCESS_STATE");
+    state->addEntityValue("suspend", "1 0 1");
+    state->addEntityValue("sleep", "1 1 0");
+    state->addEntityValue("receive", "1 0 0");
+    state->addEntityValue("send", "0 0 1");
+    state->addEntityValue("task_execute", "0 1 1");
+    root->type_->getOrCreateLinkType("MSG_PROCESS_LINK", msg_process, msg_process);
+    root->type_->getOrCreateLinkType("MSG_PROCESS_TASK_LINK", msg_process, msg_process);
   }
 
   if (TRACE_msg_vm_is_enabled()) {
-    type_t msg_vm = PJ_type_get_or_null ("MSG_VM", container->type);
-    if (msg_vm == nullptr){
-      msg_vm = PJ_type_container_new("MSG_VM", container->type);
-      type_t state = PJ_type_state_new ("MSG_VM_STATE", msg_vm);
-      PJ_value_new ("suspend", "1 0 1", state);
-      PJ_value_new ("sleep", "1 1 0", state);
-      PJ_value_new ("receive", "1 0 0", state);
-      PJ_value_new ("send", "0 0 1", state);
-      PJ_value_new ("task_execute", "0 1 1", state);
-      PJ_type_link_new ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
-      PJ_type_link_new ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
-    }
+    simgrid::instr::ContainerType* msg_vm = container->type_->getOrCreateContainerType("MSG_VM");
+    simgrid::instr::StateType* state      = msg_vm->getOrCreateStateType("MSG_VM_STATE");
+    state->addEntityValue("suspend", "1 0 1");
+    state->addEntityValue("sleep", "1 1 0");
+    state->addEntityValue("receive", "1 0 0");
+    state->addEntityValue("send", "0 0 1");
+    state->addEntityValue("task_execute", "0 1 1");
+    root->type_->getOrCreateLinkType("MSG_VM_LINK", msg_vm, msg_vm);
+    root->type_->getOrCreateLinkType("MSG_VM_PROCESS_LINK", msg_vm, msg_vm);
   }
-
 }
 
 static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint)
 {
-  if (not netpoint->isRouter())
-    return;
-  if (TRACE_is_enabled() && TRACE_needs_platform()) {
-    container_t father = currentContainer.back();
-    PJ_container_new(netpoint->cname(), INSTR_ROUTER, father);
-  }
+  if (netpoint->isRouter() && TRACE_is_enabled() && TRACE_needs_platform())
+    new simgrid::instr::RouterContainer(netpoint->getCname(), currentContainer.back());
 }
 
 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);
+  recursiveGraphExtraction(simgrid::s4u::Engine::getInstance()->getNetRoot(), simgrid::instr::Container::getRoot(),
+                           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,93 +279,71 @@ void instr_routing_define_callbacks ()
   }
   simgrid::s4u::NetZone::onCreation.connect(sg_instr_AS_begin);
   simgrid::s4u::NetZone::onSeal.connect(sg_instr_AS_end);
-  simgrid::kernel::routing::NetPoint::onCreation.connect(&sg_instr_new_router);
+  simgrid::kernel::routing::NetPoint::onCreation.connect(sg_instr_new_router);
 }
 /*
  * user categories support
  */
-static void recursiveNewVariableType (const char *new_typename, const char *color, type_t root)
+static void recursiveNewVariableType(std::string new_typename, std::string 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);
-    PJ_type_variable_new (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);
-    PJ_type_variable_new (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);
-    PJ_type_variable_new (tnstr, color, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  type_t 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);
+
+  if (root->getName() == "LINK")
+    root->getOrCreateVariableType(std::string("b") + new_typename, color);
+
+  for (auto elm : root->children_) {
+    recursiveNewVariableType(new_typename, color, elm.second);
   }
 }
 
-void instr_new_variable_type (const char *new_typename, const char *color)
+void instr_new_variable_type(std::string new_typename, std::string color)
 {
-  recursiveNewVariableType (new_typename, color, PJ_type_get_root());
+  recursiveNewVariableType(new_typename, color, simgrid::instr::Container::getRoot()->type_);
 }
 
-static void recursiveNewUserVariableType (const char *father_type, const char *new_typename, const char *color, type_t root)
+static void recursiveNewUserVariableType(std::string father_type, std::string new_typename, std::string color,
+                                         simgrid::instr::Type* root)
 {
-  if (not strcmp(root->name, father_type)) {
-    PJ_type_variable_new (new_typename, color, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  type_t 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);
   }
+  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)
+void instr_new_user_variable_type(std::string father_type, std::string new_typename, std::string color)
 {
-  recursiveNewUserVariableType (father_type, new_typename, color, PJ_type_get_root());
+  recursiveNewUserVariableType(father_type, new_typename, color, simgrid::instr::Container::getRoot()->type_);
 }
 
-static void recursiveNewUserStateType (const char *father_type, const char *new_typename, type_t root)
+static void recursiveNewUserStateType(std::string father_type, std::string new_typename, simgrid::instr::Type* root)
 {
-  if (not strcmp(root->name, father_type)) {
-    PJ_type_state_new (new_typename, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  type_t 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)
+void instr_new_user_state_type(std::string father_type, std::string new_typename)
 {
-  recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root());
+  recursiveNewUserStateType(father_type, new_typename, simgrid::instr::Container::getRoot()->type_);
 }
 
-static void recursiveNewValueForUserStateType (const char *type_name, const char *value, const char *color, type_t root)
+static void recursiveNewValueForUserStateType(std::string type_name, const char* val, std::string color,
+                                              simgrid::instr::Type* root)
 {
-  if (not strcmp(root->name, type_name)) {
-    PJ_value_new (value, color, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  type_t child_type;
-  char *name;
-  xbt_dict_foreach(root->children, cursor, name, child_type) {
-    recursiveNewValueForUserStateType (type_name, value, color, child_type);
-  }
+  if (root->getName() == type_name)
+    static_cast<simgrid::instr::StateType*>(root)->addEntityValue(val, color);
+
+  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)
+void instr_new_value_for_user_state_type(std::string type_name, const char* value, std::string color)
 {
-  recursiveNewValueForUserStateType (type_name, value, color, PJ_type_get_root());
+  recursiveNewValueForUserStateType(type_name, value, color, simgrid::instr::Container::getRoot()->type_);
 }
 
 int instr_platform_traced ()
@@ -425,14 +353,14 @@ int instr_platform_traced ()
 
 #define GRAPHICATOR_SUPPORT_FUNCTIONS
 
-static void recursiveXBTGraphExtraction(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, sg_netzone_t netzone,
+static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                                        std::map<std::string, xbt_edge_t>* edges, sg_netzone_t netzone,
                                         container_t container)
 {
   if (not netzone->getChildren()->empty()) {
     //bottom-up recursion
-    for (auto netzone_child : *netzone->getChildren()) {
-      container_t child_container =
-          static_cast<container_t>(xbt_dict_get(container->children, netzone_child->getCname()));
+    for (auto const& netzone_child : *netzone->getChildren()) {
+      container_t child_container = container->children_.at(netzone_child->getCname());
       recursiveXBTGraphExtraction(graph, nodes, edges, netzone_child, child_container);
     }
   }
@@ -443,12 +371,12 @@ static void recursiveXBTGraphExtraction(xbt_graph_t graph, xbt_dict_t nodes, xbt
 xbt_graph_t instr_routing_platform_graph ()
 {
   xbt_graph_t ret = xbt_graph_new_graph (0, nullptr);
-  xbt_dict_t nodes = xbt_dict_new_homogeneous(nullptr);
-  xbt_dict_t edges = xbt_dict_new_homogeneous(nullptr);
+  std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
+  std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
   recursiveXBTGraphExtraction(ret, nodes, edges, simgrid::s4u::Engine::getInstance()->getNetRoot(),
-                              PJ_container_get_root());
-  xbt_dict_free (&nodes);
-  xbt_dict_free (&edges);
+                              simgrid::instr::Container::getRoot());
+  delete nodes;
+  delete edges;
   return ret;
 }
 
index df986ab..2746a66 100644 (file)
@@ -1,49 +1,31 @@
-/* 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");
 
-void TRACE_surf_alloc()
-{
-  TRACE_surf_resource_utilization_alloc();
-}
-
-void TRACE_surf_release()
-{
-  TRACE_surf_resource_utilization_release();
-}
-
 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);
-    type_t type = PJ_type_get ("power", container->type);
-    new SetVariableEvent(date, container, type, speed);
+    simgrid::instr::Container::byName(resource)->getVariable("power")->setEvent(date, 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);
-    type_t type = PJ_type_get ("bandwidth", container->type);
-    new SetVariableEvent(date, container, type, bandwidth);
+    simgrid::instr::Container::byName(resource)->getVariable("bandwidth")->setEvent(date, bandwidth);
   }
 }
 
 void TRACE_surf_action(surf_action_t surf_action, const char *category)
 {
-  if (not TRACE_is_enabled())
-    return;
-  if (not TRACE_categorized())
-    return;
-  if (not category)
+  if (not TRACE_is_enabled() || not TRACE_categorized() || not category)
     return;
 
   surf_action->setCategory(category);
index dc52269..e81ea8e 100644 (file)
@@ -7,19 +7,26 @@
  * Modeling the proportional fairness using the Lagrangian Optimization Approach. For a detailed description see:
  * "ssh://username@scm.gforge.inria.fr/svn/memo/people/pvelho/lagrange/ppf.ps".
  */
+#include "surf/maxmin.hpp"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
-#include "maxmin_private.hpp"
 
-#include <stdlib.h>
+#include <algorithm>
+#include <cstdlib>
 #ifndef MATH
-#include <math.h>
+#include <cmath>
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_lagrange, surf, "Logging specific to SURF (lagrange)");
 XBT_LOG_NEW_SUBCATEGORY(surf_lagrange_dichotomy, surf_lagrange, "Logging specific to SURF (lagrange dichotomy)");
 
 #define SHOW_EXPR(expr) XBT_CDEBUG(surf_lagrange,#expr " = %g",expr);
+#define VEGAS_SCALING 1000.0
+#define RENO_SCALING 1.0
+#define RENO2_SCALING 1.0
+
+namespace simgrid {
+namespace surf {
 
 double (*func_f_def) (lmm_variable_t, double);
 double (*func_fp_def) (lmm_variable_t, double);
@@ -37,7 +44,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;
@@ -84,8 +93,8 @@ static double new_value(lmm_variable_t var)
 {
   double tmp = 0;
 
-  for (int i = 0; i < var->cnsts_number; i++) {
-    tmp += (var->cnsts[i].constraint)->lambda;
+  for (s_lmm_element_t const& elem : var->cnsts) {
+    tmp += elem.constraint->lambda;
   }
   if (var->bound > 0)
     tmp += var->mu;
@@ -99,8 +108,8 @@ static double new_mu(lmm_variable_t var)
   double mu_i = 0.0;
   double sigma_i = 0.0;
 
-  for (int j = 0; j < var->cnsts_number; j++) {
-    sigma_i += (var->cnsts[j].constraint)->lambda;
+  for (s_lmm_element_t const& elem : var->cnsts) {
+    sigma_i += elem.constraint->lambda;
   }
   mu_i = var->func_fp(var, var->bound) - sigma_i;
   if (mu_i < 0.0)
@@ -124,8 +133,8 @@ static double dual_objective(xbt_swag_t var_list, xbt_swag_t cnst_list)
     if (not var->sharing_weight)
       break;
 
-    for (int j = 0; j < var->cnsts_number; j++)
-      sigma_i += (var->cnsts[j].constraint)->lambda;
+    for (s_lmm_element_t const& elem : var->cnsts)
+      sigma_i += elem.constraint->lambda;
 
     if (var->bound > 0)
       sigma_i += var->mu;
@@ -154,38 +163,23 @@ void lagrange_solve(lmm_system_t sys)
   double dichotomy_min_error = 1e-14;
   double overall_modification = 1;
 
-  /* Variables to manipulate the data structure proposed to model the maxmin fairness. See documentation for details. */
-  xbt_swag_t cnst_list = nullptr;
-  void *_cnst;
-  lmm_constraint_t cnst = nullptr;
-
-  xbt_swag_t var_list = nullptr;
-  void *_var;
-  lmm_variable_t var = nullptr;
-
-  /* Auxiliary variables. */
-  int iteration = 0;
-  double tmp = 0;
-  int i;
-  double obj;
-  double new_obj;
-
   XBT_DEBUG("Iterative method configuration snapshot =====>");
   XBT_DEBUG("#### Maximum number of iterations        : %d", max_iterations);
   XBT_DEBUG("#### Minimum error tolerated             : %e", epsilon_min_error);
   XBT_DEBUG("#### Minimum error tolerated (dichotomy) : %e", dichotomy_min_error);
 
   if (XBT_LOG_ISENABLED(surf_lagrange, xbt_log_priority_debug)) {
-    lmm_print(sys);
+    sys->print();
   }
 
   if (not sys->modified)
     return;
 
   /* Initialize lambda. */
-  cnst_list = &(sys->active_constraint_set);
+  xbt_swag_t cnst_list = &(sys->active_constraint_set);
+  void* _cnst;
   xbt_swag_foreach(_cnst, cnst_list) {
-  cnst = (lmm_constraint_t)_cnst;
+    lmm_constraint_t cnst = (lmm_constraint_t)_cnst;
     cnst->lambda = 1.0;
     cnst->new_lambda = 2.0;
     XBT_DEBUG("#### cnst(%p)->lambda :  %e", cnst, cnst->lambda);
@@ -195,40 +189,37 @@ void lagrange_solve(lmm_system_t sys)
    * Initialize the var list variable with only the active variables.
    * Associate an index in the swag variables. Initialize mu.
    */
-  var_list = &(sys->variable_set);
-  i = 0;
+  xbt_swag_t var_list = &(sys->variable_set);
+  void* _var;
   xbt_swag_foreach(_var, var_list) {
-  var = static_cast<lmm_variable_t>(_var);
-  if (not var->sharing_weight)
-    var->value = 0.0;
-  else {
-    int nb = 0;
-    if (var->bound < 0.0) {
-      XBT_DEBUG("#### NOTE var(%d) is a boundless variable", i);
-      var->mu    = -1.0;
+    lmm_variable_t var = static_cast<lmm_variable_t>(_var);
+    if (not var->sharing_weight)
+      var->value = 0.0;
+    else {
+      if (var->bound < 0.0) {
+        XBT_DEBUG("#### NOTE var(%p) is a boundless variable", var);
+        var->mu    = -1.0;
+      } else {
+        var->mu     = 1.0;
+        var->new_mu = 2.0;
+      }
       var->value = new_value(var);
-    } else {
-      var->mu     = 1.0;
-      var->new_mu = 2.0;
-      var->value  = new_value(var);
-    }
-    XBT_DEBUG("#### var(%p) ->weight :  %e", var, var->sharing_weight);
-    XBT_DEBUG("#### var(%p) ->mu :  %e", var, var->mu);
-    XBT_DEBUG("#### var(%p) ->weight: %e", var, var->sharing_weight);
-    XBT_DEBUG("#### var(%p) ->bound: %e", var, var->bound);
-    for (i = 0; i < var->cnsts_number; i++) {
-      if (var->cnsts[i].consumption_weight == 0.0)
-        nb++;
-    }
-    if (nb == var->cnsts_number)
-      var->value = 1.0;
+      XBT_DEBUG("#### var(%p) ->weight :  %e", var, var->sharing_weight);
+      XBT_DEBUG("#### var(%p) ->mu :  %e", var, var->mu);
+      XBT_DEBUG("#### var(%p) ->weight: %e", var, var->sharing_weight);
+      XBT_DEBUG("#### var(%p) ->bound: %e", var, var->bound);
+      auto weighted = std::find_if(begin(var->cnsts), end(var->cnsts),
+                                   [](s_lmm_element_t const& x) { return x.consumption_weight != 0.0; });
+      if (weighted == end(var->cnsts))
+        var->value = 1.0;
     }
   }
 
   /*  Compute dual objective. */
-  obj = dual_objective(var_list, cnst_list);
+  double obj = dual_objective(var_list, cnst_list);
 
   /* While doesn't reach a minimum error or a number maximum of iterations. */
+  int iteration = 0;
   while (overall_modification > epsilon_min_error && iteration < max_iterations) {
     iteration++;
     XBT_DEBUG("************** ITERATION %d **************", iteration);
@@ -236,18 +227,14 @@ void lagrange_solve(lmm_system_t sys)
 
     /* Improve the value of mu_i */
     xbt_swag_foreach(_var, var_list) {
-      var = static_cast<lmm_variable_t>(_var);
-      if (not var->sharing_weight)
-        break;
-      if (var->bound >= 0) {
+      lmm_variable_t var = static_cast<lmm_variable_t>(_var);
+      if (var->sharing_weight && var->bound >= 0) {
         XBT_DEBUG("Working on var (%p)", var);
         var->new_mu = new_mu(var);
-/*   dual_updated += (fabs(var->new_mu-var->mu)>dichotomy_min_error); */
-/*   XBT_DEBUG("dual_updated (%d) : %1.20f",dual_updated,fabs(var->new_mu-var->mu)); */
         XBT_DEBUG("Updating mu : var->mu (%p) : %1.20f -> %1.20f", var, var->mu, var->new_mu);
         var->mu = var->new_mu;
 
-        new_obj = dual_objective(var_list, cnst_list);
+        double new_obj = dual_objective(var_list, cnst_list);
         XBT_DEBUG("Improvement for Objective (%g -> %g) : %g", obj, new_obj, obj - new_obj);
         xbt_assert(obj - new_obj >= -epsilon_min_error, "Our gradient sucks! (%1.20f)", obj - new_obj);
         obj = new_obj;
@@ -256,15 +243,13 @@ void lagrange_solve(lmm_system_t sys)
 
     /* Improve the value of lambda_i */
     xbt_swag_foreach(_cnst, cnst_list) {
-      cnst = static_cast<lmm_constraint_t>(_cnst);
+      lmm_constraint_t cnst = static_cast<lmm_constraint_t>(_cnst);
       XBT_DEBUG("Working on cnst (%p)", cnst);
       cnst->new_lambda = dichotomy(cnst->lambda, partial_diff_lambda, cnst, dichotomy_min_error);
-/*       dual_updated += (fabs(cnst->new_lambda-cnst->lambda)>dichotomy_min_error); */
-/*       XBT_DEBUG("dual_updated (%d) : %1.20f",dual_updated,fabs(cnst->new_lambda-cnst->lambda)); */
       XBT_DEBUG("Updating lambda : cnst->lambda (%p) : %1.20f -> %1.20f", cnst, cnst->lambda, cnst->new_lambda);
       cnst->lambda = cnst->new_lambda;
 
-      new_obj = dual_objective(var_list, cnst_list);
+      double new_obj = dual_objective(var_list, cnst_list);
       XBT_DEBUG("Improvement for Objective (%g -> %g) : %g", obj, new_obj, obj - new_obj);
       xbt_assert(obj - new_obj >= -epsilon_min_error, "Our gradient sucks! (%1.20f)", obj - new_obj);
       obj = new_obj;
@@ -274,13 +259,13 @@ void lagrange_solve(lmm_system_t sys)
     XBT_DEBUG("-------------- Check convergence ----------");
     overall_modification = 0;
     xbt_swag_foreach(_var, var_list) {
-      var = static_cast<lmm_variable_t>(_var);
+      lmm_variable_t var = static_cast<lmm_variable_t>(_var);
       if (var->sharing_weight <= 0)
         var->value = 0.0;
       else {
-        tmp = new_value(var);
+        double tmp = new_value(var);
 
-        overall_modification = MAX(overall_modification, fabs(var->value - tmp));
+        overall_modification = std::max(overall_modification, fabs(var->value - tmp));
 
         var->value = tmp;
         XBT_DEBUG("New value of var (%p)  = %e, overall_modification = %e", var, var->value, overall_modification);
@@ -291,10 +276,6 @@ void lagrange_solve(lmm_system_t sys)
     if (not __check_feasible(cnst_list, var_list, 0))
       overall_modification = 1.0;
     XBT_DEBUG("Iteration %d: overall_modification : %f", iteration, overall_modification);
-    /*     if(not dual_updated) { */
-    /*       XBT_WARN("Could not improve the convergence at iteration %d. Drop it!",iteration); */
-    /*       break; */
-    /*     } */
   }
 
   __check_feasible(cnst_list, var_list, 1);
@@ -307,7 +288,7 @@ void lagrange_solve(lmm_system_t sys)
   }
 
   if (XBT_LOG_ISENABLED(surf_lagrange, xbt_log_priority_debug)) {
-    lmm_print(sys);
+    sys->print();
   }
 }
 
@@ -391,25 +372,20 @@ static double dichotomy(double init, double diff(double, void *), void *var_cnst
         min = middle;
         overall_error = max_diff - middle_diff;
         min_diff = middle_diff;
-/*   SHOW_EXPR(overall_error); */
       } else if (middle_diff > 0) {
         XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing max");
         max = middle;
         overall_error = max_diff - middle_diff;
         max_diff = middle_diff;
-/*   SHOW_EXPR(overall_error); */
       } else {
         overall_error = 0;
-/*   SHOW_EXPR(overall_error); */
       }
     } else if (fabs(min_diff) < 1e-20) {
       max = min;
       overall_error = 0;
-/*       SHOW_EXPR(overall_error); */
     } else if (fabs(max_diff) < 1e-20) {
       min = max;
       overall_error = 0;
-/*       SHOW_EXPR(overall_error); */
     } else if (min_diff > 0 && max_diff < 0) {
       XBT_CWARN(surf_lagrange_dichotomy, "The impossible happened, partial_diff(min) > 0 && partial_diff(max) < 0");
       xbt_abort();
@@ -446,8 +422,8 @@ static double partial_diff_lambda(double lambda, void *param_cnst)
     double sigma_i = 0.0;
 
     // Compute sigma_i
-    for (int j = 0; j < var->cnsts_number; j++) {
-      sigma_i += (var->cnsts[j].constraint)->lambda;
+    for (s_lmm_element_t const& elem : var->cnsts) {
+      sigma_i += elem.constraint->lambda;
     }
 
     //add mu_i if this flow has a RTT constraint associated
@@ -492,8 +468,6 @@ void lmm_set_default_protocol_function(double (*func_f) (lmm_variable_t var, dou
  * Therefore: $fp(x) = \frac{\alpha D_f}{x}$
  * Therefore: $fpi(x) = \frac{\alpha D_f}{x}$
  */
-#define VEGAS_SCALING 1000.0
-
 double func_vegas_f(lmm_variable_t var, double x)
 {
   xbt_assert(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
@@ -517,7 +491,6 @@ double func_vegas_fpi(lmm_variable_t var, double x)
  * Therefore: $fp(x)  = \frac{3}{3 D_f^2 x^2+2}$
  * Therefore: $fpi(x)  = \sqrt{\frac{1}{{D_f}^2 x} - \frac{2}{3{D_f}^2}}$
  */
-#define RENO_SCALING 1.0
 double func_reno_f(lmm_variable_t var, double x)
 {
   xbt_assert(var->sharing_weight > 0.0, "Don't call me with stupid values!");
@@ -541,7 +514,6 @@ double func_reno_fpi(lmm_variable_t var, double x)
             2.0 / (3.0 * var->sharing_weight * var->sharing_weight);
   if (res_fpi <= 0.0)
     return 0.0;
-/*   xbt_assert(res_fpi>0.0,"Don't call me with stupid values!"); */
   return sqrt(res_fpi);
 }
 
@@ -550,7 +522,6 @@ double func_reno_fpi(lmm_variable_t var, double x)
  * Therefore:   $fp(x)  = 2/(Weight*x + 2)
  * Therefore:   $fpi(x) = (2*Weight)/x - 4
  */
-#define RENO2_SCALING 1.0
 double func_reno2_f(lmm_variable_t var, double x)
 {
   xbt_assert(var->sharing_weight > 0.0, "Don't call me with stupid values!");
@@ -575,3 +546,5 @@ double func_reno2_fpi(lmm_variable_t var, double x)
   res_fpi = RENO2_SCALING * (-3.0 * tmp + sqrt(res_fpi)) / (4.0 * tmp);
   return res_fpi;
 }
+}
+}
index 0fafd62..0ae0d70 100644 (file)
@@ -5,48 +5,36 @@
 
 /* \file callbacks.h */
 
-#include "maxmin_private.hpp"
+#include "surf/maxmin.hpp"
+#include "xbt/backtrace.hpp"
 #include "xbt/log.h"
 #include "xbt/mallocator.h"
 #include "xbt/sysdep.h"
+#include <algorithm>
+#include <cmath>
+#include <cstdlib>
 #include <cxxabi.h>
 #include <limits>
-#include <math.h>
-#include <stdlib.h>
+#include <vector>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)");
 
-typedef struct s_dyn_light {
-  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 */
 double sg_surf_precision   = 0.00001; /* Change this with --cfg=surf/precision:VALUE */
 int sg_concurrency_limit   = -1;      /* Change this with --cfg=maxmin/concurrency-limit:VALUE */
 
-static void *lmm_variable_mallocator_new_f();
-static void lmm_variable_mallocator_free_f(void *var);
-#define lmm_variable_mallocator_reset_f ((void_f_pvoid_t)nullptr)
-static void lmm_update_modified_set(lmm_system_t sys, lmm_constraint_t cnst);
-static void lmm_remove_all_modified_set(lmm_system_t sys);
-static int Global_debug_id = 1;
-static int Global_const_debug_id = 1;
+namespace simgrid {
+namespace surf {
 
-static inline void lmm_cnst_free(lmm_system_t sys, lmm_constraint_t cnst);
+typedef std::vector<int> dyn_light_t;
 
-static void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr);
-static void lmm_enable_var(lmm_system_t sys, lmm_variable_t var);
-static int lmm_can_enable_var(lmm_variable_t var);
-static void lmm_disable_var(lmm_system_t sys, lmm_variable_t var);
-static int lmm_concurrency_slack(lmm_constraint_t cnstr);
-static int lmm_cnstrs_min_concurrency_slack(lmm_variable_t var);
+int s_lmm_variable_t::Global_debug_id   = 1;
+int s_lmm_constraint_t::Global_debug_id = 1;
 
-inline int lmm_element_concurrency(lmm_element_t elem) {
+int s_lmm_element_t::get_concurrency() const
+{
   //Ignore element with weight less than one (e.g. cross-traffic)
-  return (elem->consumption_weight >= 1) ? 1 : 0;
+  return (consumption_weight >= 1) ? 1 : 0;
   //There are other alternatives, but they will change the behaviour of the model..
   //So do not use it unless you want to make a new model.
   //If you do, remember to change the variables concurrency share to reflect it.
@@ -55,31 +43,32 @@ inline int lmm_element_concurrency(lmm_element_t elem) {
   //return (int)ceil(elem->weight);//Include element as the rounded-up integer value of the element weight
 }
 
-inline void lmm_decrease_concurrency(lmm_element_t elem) {
-  xbt_assert(elem->constraint->concurrency_current>=lmm_element_concurrency(elem));
-  elem->constraint->concurrency_current-=lmm_element_concurrency(elem);
+void s_lmm_element_t::decrease_concurrency()
+{
+  xbt_assert(constraint->concurrency_current >= get_concurrency());
+  constraint->concurrency_current -= get_concurrency();
 }
 
-inline void lmm_increase_concurrency(lmm_element_t elem) {
-  elem->constraint->concurrency_current+= lmm_element_concurrency(elem);
-
-  lmm_constraint_t cnstr=elem->constraint;
+void s_lmm_element_t::increase_concurrency()
+{
+  constraint->concurrency_current += get_concurrency();
 
-  if(cnstr->concurrency_current > cnstr->concurrency_maximum)
-    cnstr->concurrency_maximum= cnstr->concurrency_current;
+  if (constraint->concurrency_current > constraint->concurrency_maximum)
+    constraint->concurrency_maximum = constraint->concurrency_current;
 
-  xbt_assert(cnstr->concurrency_limit<0 || cnstr->concurrency_current<=cnstr->concurrency_limit,
+  xbt_assert(constraint->get_concurrency_limit() < 0 ||
+                 constraint->concurrency_current <= constraint->get_concurrency_limit(),
              "Concurrency limit overflow!");
 }
 
-static void lmm_check_concurrency(lmm_system_t sys)
+void s_lmm_system_t::check_concurrency()
 {
   // These checks are very expensive, so do them only if we want to debug SURF LMM
   if (not XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug))
     return;
 
   void* cnstIt;
-  xbt_swag_foreach(cnstIt, &(sys->constraint_set))
+  xbt_swag_foreach(cnstIt, &constraint_set)
   {
     lmm_constraint_t cnst = (lmm_constraint_t)cnstIt;
     int concurrency       = 0;
@@ -88,29 +77,30 @@ static void lmm_check_concurrency(lmm_system_t sys)
     {
       lmm_element_t elem = (lmm_element_t)elemIt;
       xbt_assert(elem->variable->sharing_weight > 0);
-      concurrency += lmm_element_concurrency(elem);
+      concurrency += elem->get_concurrency();
     }
 
     xbt_swag_foreach(elemIt, &(cnst->disabled_element_set))
     {
       lmm_element_t elem = (lmm_element_t)elemIt;
       // We should have staged variables only if concurrency is reached in some constraint
-      xbt_assert(cnst->concurrency_limit < 0 || elem->variable->staged_weight == 0 ||
-                     lmm_cnstrs_min_concurrency_slack(elem->variable) < elem->variable->concurrency_share,
+      xbt_assert(cnst->get_concurrency_limit() < 0 || elem->variable->staged_weight == 0 ||
+                     elem->variable->get_min_concurrency_slack() < elem->variable->concurrency_share,
                  "should not have staged variable!");
     }
 
-    xbt_assert(cnst->concurrency_limit < 0 || cnst->concurrency_limit >= concurrency, "concurrency check failed!");
+    xbt_assert(cnst->get_concurrency_limit() < 0 || cnst->get_concurrency_limit() >= concurrency,
+               "concurrency check failed!");
     xbt_assert(cnst->concurrency_current == concurrency, "concurrency_current is out-of-date!");
   }
 
   // Check that for each variable, all corresponding elements are in the same state (i.e. same element sets)
   void* varIt;
-  xbt_swag_foreach(varIt, &(sys->variable_set))
+  xbt_swag_foreach(varIt, &variable_set)
   {
     lmm_variable_t var = (lmm_variable_t)varIt;
 
-    if (not var->cnsts_number)
+    if (var->cnsts.empty())
       continue;
 
     lmm_element_t elem     = &var->cnsts[0];
@@ -118,466 +108,265 @@ static void lmm_check_concurrency(lmm_system_t sys)
     int belong_to_disabled = xbt_swag_belongs(elem, &(elem->constraint->disabled_element_set));
     int belong_to_active   = xbt_swag_belongs(elem, &(elem->constraint->active_element_set));
 
-    for (int i = 1; i < var->cnsts_number; i++) {
-      elem = &var->cnsts[i];
-      xbt_assert(belong_to_enabled == xbt_swag_belongs(elem, &(elem->constraint->enabled_element_set)),
+    for (s_lmm_element_t const& elem : var->cnsts) {
+      xbt_assert(belong_to_enabled == xbt_swag_belongs(&elem, &(elem.constraint->enabled_element_set)),
                  "Variable inconsistency (1): enabled_element_set");
-      xbt_assert(belong_to_disabled == xbt_swag_belongs(elem, &(elem->constraint->disabled_element_set)),
+      xbt_assert(belong_to_disabled == xbt_swag_belongs(&elem, &(elem.constraint->disabled_element_set)),
                  "Variable inconsistency (2): disabled_element_set");
-      xbt_assert(belong_to_active == xbt_swag_belongs(elem, &(elem->constraint->active_element_set)),
+      xbt_assert(belong_to_active == xbt_swag_belongs(&elem, &(elem.constraint->active_element_set)),
                  "Variable inconsistency (3): active_element_set");
     }
   }
 }
 
-static inline void lmm_variable_remove(lmm_system_t sys, lmm_variable_t var)
+void s_lmm_system_t::var_free(lmm_variable_t var)
 {
-  XBT_IN("(sys=%p, var=%p)", sys, var);
-  sys->modified = 1;
+  XBT_IN("(sys=%p, var=%p)", this, var);
+  modified = true;
 
   // TODOLATER Can do better than that by leaving only the variable in only one enabled_element_set, call
-  // lmm_update_modified_set, and then remove it..
-  if (var->cnsts_number)
-    lmm_update_modified_set(sys, var->cnsts[0].constraint);
+  // update_modified_set, and then remove it..
+  if (not var->cnsts.empty())
+    update_modified_set(var->cnsts[0].constraint);
 
-  for (int i = 0; i < var->cnsts_number; i++) {
-    lmm_element_t elem = &var->cnsts[i];
+  for (s_lmm_element_t& elem : var->cnsts) {
     if (var->sharing_weight > 0)
-      lmm_decrease_concurrency(elem);
-    xbt_swag_remove(elem, &(elem->constraint->enabled_element_set));
-    xbt_swag_remove(elem, &(elem->constraint->disabled_element_set));
-    xbt_swag_remove(elem, &(elem->constraint->active_element_set));
-    int nelements = xbt_swag_size(&(elem->constraint->enabled_element_set)) +
-                    xbt_swag_size(&(elem->constraint->disabled_element_set));
+      elem.decrease_concurrency();
+    xbt_swag_remove(&elem, &(elem.constraint->enabled_element_set));
+    xbt_swag_remove(&elem, &(elem.constraint->disabled_element_set));
+    xbt_swag_remove(&elem, &(elem.constraint->active_element_set));
+    int nelements = xbt_swag_size(&(elem.constraint->enabled_element_set)) +
+                    xbt_swag_size(&(elem.constraint->disabled_element_set));
     if (nelements == 0)
-      make_constraint_inactive(sys, elem->constraint);
+      make_constraint_inactive(elem.constraint);
     else
-      lmm_on_disabled_var(sys, elem->constraint);
+      on_disabled_var(elem.constraint);
   }
 
-  // Check if we can enable new variables going through the constraints where var was.
-  // Do it after removing all elements, so he first disabled variables get priority over those with smaller requirement
-  for (int i = 0; i < var->cnsts_number; i++) {
-    lmm_element_t elem = &var->cnsts[i];
-    if (xbt_swag_size(&(elem->constraint->disabled_element_set)))
-      lmm_on_disabled_var(sys, elem->constraint);
-  }
-
-  var->cnsts_number = 0;
+  var->cnsts.clear();
 
-  lmm_check_concurrency(sys);
+  check_concurrency();
 
+  xbt_mallocator_release(variable_mallocator, var);
   XBT_OUT();
 }
 
-static void lmm_var_free(lmm_system_t sys, lmm_variable_t var)
-{
-  lmm_variable_remove(sys, var);
-  xbt_mallocator_release(sys->variable_mallocator, var);
-}
-
-lmm_system_t lmm_system_new(bool selective_update)
+s_lmm_system_t::s_lmm_system_t(bool selective_update) : selective_update_active(selective_update)
 {
   s_lmm_variable_t var;
   s_lmm_constraint_t cnst;
 
-  lmm_system_t l = xbt_new0(s_lmm_system_t, 1);
-
-  l->modified = 0;
-  l->selective_update_active = selective_update;
-  l->visited_counter = 1;
-
-  XBT_DEBUG("Setting selective_update_active flag to %d", l->selective_update_active);
-
-  xbt_swag_init(&(l->variable_set), xbt_swag_offset(var, variable_set_hookup));
-  xbt_swag_init(&(l->constraint_set), xbt_swag_offset(cnst, constraint_set_hookup));
+  modified                = false;
+  visited_counter         = 1;
 
-  xbt_swag_init(&(l->active_constraint_set), xbt_swag_offset(cnst, active_constraint_set_hookup));
+  XBT_DEBUG("Setting selective_update_active flag to %d", selective_update_active);
 
-  xbt_swag_init(&(l->modified_constraint_set), xbt_swag_offset(cnst, modified_constraint_set_hookup));
-  xbt_swag_init(&(l->saturated_variable_set), xbt_swag_offset(var, saturated_variable_set_hookup));
-  xbt_swag_init(&(l->saturated_constraint_set), xbt_swag_offset(cnst, saturated_constraint_set_hookup));
+  xbt_swag_init(&variable_set, xbt_swag_offset(var, variable_set_hookup));
+  xbt_swag_init(&constraint_set, xbt_swag_offset(cnst, constraint_set_hookup));
 
-  l->variable_mallocator = xbt_mallocator_new(65536,
-                                              lmm_variable_mallocator_new_f,
-                                              lmm_variable_mallocator_free_f,
-                                              lmm_variable_mallocator_reset_f);
+  xbt_swag_init(&active_constraint_set, xbt_swag_offset(cnst, active_constraint_set_hookup));
 
-  l->solve_fun = &lmm_solve;
+  xbt_swag_init(&modified_constraint_set, xbt_swag_offset(cnst, modified_constraint_set_hookup));
+  xbt_swag_init(&saturated_variable_set, xbt_swag_offset(var, saturated_variable_set_hookup));
+  xbt_swag_init(&saturated_constraint_set, xbt_swag_offset(cnst, saturated_constraint_set_hookup));
 
-  return l;
+  keep_track          = nullptr;
+  variable_mallocator = xbt_mallocator_new(65536, s_lmm_system_t::variable_mallocator_new_f,
+                                           s_lmm_system_t::variable_mallocator_free_f, nullptr);
+  solve_fun = &lmm_solve;
 }
 
-void lmm_system_free(lmm_system_t sys)
+s_lmm_system_t::~s_lmm_system_t()
 {
-  lmm_variable_t var = nullptr;
-  lmm_constraint_t cnst = nullptr;
+  lmm_variable_t var;
+  lmm_constraint_t cnst;
 
-  if (sys == nullptr)
-    return;
-
-  while ((var = (lmm_variable_t) extract_variable(sys))) {
-    int status;
-    char* demangled = abi::__cxa_demangle(typeid(*var->id).name(), 0, 0, &status);
-
-    XBT_WARN("Probable bug: a %s variable (#%d) not removed before the LMM system destruction.", demangled,
+  while ((var = extract_variable())) {
+    auto demangled = simgrid::xbt::demangle(typeid(*var->id).name());
+    XBT_WARN("Probable bug: a %s variable (#%d) not removed before the LMM system destruction.", demangled.get(),
              var->id_int);
-    xbt_free(demangled);
-    lmm_var_free(sys, var);
+    var_free(var);
   }
-  while ((cnst = (lmm_constraint_t) extract_constraint(sys)))
-    lmm_cnst_free(sys, cnst);
+  while ((cnst = extract_constraint()))
+    cnst_free(cnst);
 
-  xbt_mallocator_free(sys->variable_mallocator);
-  free(sys);
+  xbt_mallocator_free(variable_mallocator);
 }
 
-static inline void lmm_cnst_free(lmm_system_t sys, lmm_constraint_t cnst)
+void s_lmm_system_t::cnst_free(lmm_constraint_t cnst)
 {
-  make_constraint_inactive(sys, cnst);
-  free(cnst);
+  make_constraint_inactive(cnst);
+  delete cnst;
 }
 
-lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id, double bound_value)
+s_lmm_constraint_t::s_lmm_constraint_t(void* id_value, double bound_value) : bound(bound_value), id(id_value)
 {
-  lmm_constraint_t cnst = nullptr;
   s_lmm_element_t elem;
 
-  cnst = xbt_new0(s_lmm_constraint_t, 1);
-  cnst->id = id;
-  cnst->id_int = Global_const_debug_id++;
-  xbt_swag_init(&(cnst->enabled_element_set), xbt_swag_offset(elem, enabled_element_set_hookup));
-  xbt_swag_init(&(cnst->disabled_element_set), xbt_swag_offset(elem, disabled_element_set_hookup));
-  xbt_swag_init(&(cnst->active_element_set), xbt_swag_offset(elem, active_element_set_hookup));
-
-  cnst->bound = bound_value;
-  cnst->concurrency_maximum=0;
-  cnst->concurrency_current=0;
-  cnst->concurrency_limit  = sg_concurrency_limit;
-  cnst->usage = 0;
-  cnst->sharing_policy = 1; /* FIXME: don't hardcode the value */
-  insert_constraint(sys, cnst);
-
-  return cnst;
+  id_int = Global_debug_id++;
+  xbt_swag_init(&enabled_element_set, xbt_swag_offset(elem, enabled_element_set_hookup));
+  xbt_swag_init(&disabled_element_set, xbt_swag_offset(elem, disabled_element_set_hookup));
+  xbt_swag_init(&active_element_set, xbt_swag_offset(elem, active_element_set_hookup));
+
+  remaining           = 0.0;
+  usage               = 0.0;
+  concurrency_limit   = sg_concurrency_limit;
+  concurrency_current = 0;
+  concurrency_maximum = 0;
+  sharing_policy      = 1; /* FIXME: don't hardcode the value */
+
+  lambda     = 0.0;
+  new_lambda = 0.0;
+  cnst_light = nullptr;
 }
 
-int lmm_constraint_concurrency_limit_get(lmm_constraint_t cnst)
+lmm_constraint_t s_lmm_system_t::constraint_new(void* id, double bound_value)
 {
- return cnst->concurrency_limit;
-}
-
-void lmm_constraint_concurrency_limit_set(lmm_constraint_t cnst, int concurrency_limit)
-{
-  xbt_assert(concurrency_limit<0 || cnst->concurrency_maximum<=concurrency_limit,
-             "New concurrency limit should be larger than observed concurrency maximum. Maybe you want to call"
-             " lmm_constraint_concurrency_maximum_reset() to reset the maximum?");
-  cnst->concurrency_limit = concurrency_limit;
-}
-
-void lmm_constraint_concurrency_maximum_reset(lmm_constraint_t cnst)
-{
-  cnst->concurrency_maximum = 0;
-}
-
-int lmm_constraint_concurrency_maximum_get(lmm_constraint_t cnst)
-{
- xbt_assert(cnst->concurrency_limit<0 || cnst->concurrency_maximum<=cnst->concurrency_limit,
-            "Very bad: maximum observed concurrency is higher than limit. This is a bug of SURF, please report it.");
-  return cnst->concurrency_maximum;
-}
-
-void lmm_constraint_shared(lmm_constraint_t cnst)
-{
-  cnst->sharing_policy = 0;
-}
-
-/** Return true if the constraint is shared, and false if it's FATPIPE */
-int lmm_constraint_sharing_policy(lmm_constraint_t cnst)
-{
-  return (cnst->sharing_policy);
-}
-
-/* @brief Remove a constraint
- * Currently this is dead code, but it is exposed in maxmin.h
- * 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.
- */
-inline void lmm_constraint_free(lmm_system_t sys,lmm_constraint_t cnst)
-{
-  xbt_assert(not xbt_swag_size(&(cnst->active_element_set)), "Removing constraint but it still has active elements");
-  xbt_assert(not xbt_swag_size(&(cnst->enabled_element_set)), "Removing constraint but it still has enabled elements");
-  xbt_assert(not xbt_swag_size(&(cnst->disabled_element_set)),
-             "Removing constraint but it still has disabled elements");
-  remove_constraint(sys, cnst);
-  lmm_cnst_free(sys, cnst);
+  lmm_constraint_t cnst = new s_lmm_constraint_t(id, bound_value);
+  insert_constraint(cnst);
+  return cnst;
 }
 
-static void *lmm_variable_mallocator_new_f()
+void* s_lmm_system_t::variable_mallocator_new_f()
 {
-  lmm_variable_t var = xbt_new(s_lmm_variable_t, 1);
-  var->cnsts = nullptr; /* will be created by realloc */
-  return var;
+  return new s_lmm_variable_t;
 }
 
-static void lmm_variable_mallocator_free_f(void *var)
+void s_lmm_system_t::variable_mallocator_free_f(void* var)
 {
-  xbt_free(((lmm_variable_t) var)->cnsts);
-  xbt_free(var);
+  delete static_cast<lmm_variable_t>(var);
 }
 
-lmm_variable_t lmm_variable_new(lmm_system_t sys, simgrid::surf::Action* id, double sharing_weight, double bound,
-                                int number_of_constraints)
+lmm_variable_t s_lmm_system_t::variable_new(simgrid::surf::Action* id, double sharing_weight, double bound,
+                                            int number_of_constraints)
 {
-  XBT_IN("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)", sys, id, sharing_weight, bound, number_of_constraints);
-
-  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));
-  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;
-    var->cnsts[i].disabled_element_set_hookup.next = nullptr;
-    var->cnsts[i].disabled_element_set_hookup.prev = nullptr;
-    var->cnsts[i].active_element_set_hookup.next = nullptr;
-    var->cnsts[i].active_element_set_hookup.prev = nullptr;
-    var->cnsts[i].constraint = nullptr;
-    var->cnsts[i].variable = nullptr;
-    var->cnsts[i].consumption_weight               = 0.0;
-  }
-  var->cnsts_size = number_of_constraints;
-  var->cnsts_number = 0;
-  var->sharing_weight    = sharing_weight;
-  var->staged_weight = 0.0;
-  var->bound = bound;
-  var->concurrency_share = 1;
-  var->value = 0.0;
-  var->visited = sys->visited_counter - 1;
-  var->mu = 0.0;
-  var->new_mu = 0.0;
-  var->func_f = func_f_def;
-  var->func_fp = func_fp_def;
-  var->func_fpi = func_fpi_def;
-
-  var->variable_set_hookup.next = nullptr;
-  var->variable_set_hookup.prev = nullptr;
-  var->saturated_variable_set_hookup.next = nullptr;
-  var->saturated_variable_set_hookup.prev = nullptr;
+  XBT_IN("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)", this, id, sharing_weight, bound, number_of_constraints);
 
+  lmm_variable_t var = static_cast<lmm_variable_t>(xbt_mallocator_get(variable_mallocator));
+  var->initialize(id, sharing_weight, bound, number_of_constraints, visited_counter - 1);
   if (sharing_weight)
-    xbt_swag_insert_at_head(var, &(sys->variable_set));
+    xbt_swag_insert_at_head(var, &variable_set);
   else
-    xbt_swag_insert_at_tail(var, &(sys->variable_set));
+    xbt_swag_insert_at_tail(var, &variable_set);
 
   XBT_OUT(" returns %p", var);
   return var;
 }
 
-void lmm_variable_free(lmm_system_t sys, lmm_variable_t var)
-{
-  remove_variable(sys, var);
-  lmm_var_free(sys, var);
-}
-
-double lmm_variable_getvalue(lmm_variable_t var)
-{
-  return (var->value);
-}
-
-void lmm_variable_concurrency_share_set(lmm_variable_t var, short int concurrency_share)
-{
-  var->concurrency_share=concurrency_share;
-}
-
-double lmm_variable_getbound(lmm_variable_t var)
+void s_lmm_system_t::variable_free(lmm_variable_t var)
 {
-  return (var->bound);
-}
-
-void lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var)
-{
-  lmm_element_t elem = nullptr;
-  int found = 0;
-
-  for (int i = 0; i < var->cnsts_number; i++) {
-    elem = &(var->cnsts[i]);
-    if (elem->constraint == cnst) {
-      found = 1;
-      break;
-    }
-  }
-
-  if (not found) {
-    XBT_DEBUG("cnst %p is not found in var %p", cnst, var);
-    return;
-  }
-
-  sys->modified = 1;
-
-  XBT_DEBUG("remove elem(value %f, cnst %p, var %p) in var %p", elem->consumption_weight, elem->constraint,
-            elem->variable, var);
-
-  /* We are going to change the constraint object and the variable object.
-   * Propagate this change to other objects. Calling here before removing variable from not active elements
-   * (inactive elements are not visited)
-   */
-  lmm_update_modified_set(sys, cnst);
-  //Useful in case var was already removed from the constraint
-  lmm_update_modified_set(sys, var->cnsts[0].constraint); // will look up enabled_element_set of this constraint, and
-                                                     //then each var in the enabled_element_set, and each var->cnsts[i].
-
-  if(xbt_swag_remove(elem, &(elem->constraint->enabled_element_set)))
-    lmm_decrease_concurrency(elem);
-
-  xbt_swag_remove(elem, &(elem->constraint->active_element_set));
-  elem->constraint = nullptr;
-  elem->variable = nullptr;
-  elem->consumption_weight = 0;
-
-  var->cnsts_number -= 1;
-
-  //No variable in this constraint -> make it inactive
-  if (xbt_swag_size(&(cnst->enabled_element_set))+xbt_swag_size(&(cnst->disabled_element_set)) == 0)
-    make_constraint_inactive(sys, cnst);
-  else {
-    //Check maxconcurrency to see if we can enable new variables
-    lmm_on_disabled_var(sys,elem->constraint);
-  }
-
-  lmm_check_concurrency(sys);
+  remove_variable(var);
+  var_free(var);
 }
 
-void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double consumption_weight)
+void s_lmm_system_t::expand(lmm_constraint_t cnst, lmm_variable_t var, double consumption_weight)
 {
-  sys->modified = 1;
+  modified = true;
 
   //Check if this variable already has an active element in this constraint
   //If it does, substract it from the required slack
   int current_share = 0;
   if(var->concurrency_share>1){
-    for (int i = 0; i < var->cnsts_number; i++) {
-      if(var->cnsts[i].constraint==cnst &&
-         xbt_swag_belongs(&var->cnsts[i],&(var->cnsts[i].constraint->enabled_element_set)))
-         current_share+=lmm_element_concurrency(&(var->cnsts[i]));
+    for (s_lmm_element_t& elem : var->cnsts) {
+      if (elem.constraint == cnst && xbt_swag_belongs(&elem, &(elem.constraint->enabled_element_set)))
+        current_share += elem.get_concurrency();
     }
   }
 
   //Check if we need to disable the variable
-  if (var->sharing_weight > 0 && var->concurrency_share - current_share > lmm_concurrency_slack(cnst)) {
+  if (var->sharing_weight > 0 && var->concurrency_share - current_share > cnst->get_concurrency_slack()) {
     double weight = var->sharing_weight;
-    lmm_disable_var(sys,var);
-    for (int i = 0; i < var->cnsts_number; i++)
-      lmm_on_disabled_var(sys,var->cnsts[i].constraint);
+    disable_var(var);
+    for (s_lmm_element_t const& elem : var->cnsts)
+      on_disabled_var(elem.constraint);
     consumption_weight = 0;
     var->staged_weight=weight;
     xbt_assert(not var->sharing_weight);
   }
 
-  xbt_assert(var->cnsts_number < var->cnsts_size, "Too much constraints");
+  xbt_assert(var->cnsts.size() < var->cnsts.capacity(), "Too much constraints");
 
-  lmm_element_t elem = &(var->cnsts[var->cnsts_number++]);
+  var->cnsts.resize(var->cnsts.size() + 1);
+  s_lmm_element_t& elem = var->cnsts.back();
 
-  elem->consumption_weight = consumption_weight;
-  elem->constraint = cnst;
-  elem->variable = var;
+  elem.consumption_weight = consumption_weight;
+  elem.constraint         = cnst;
+  elem.variable           = var;
 
   if (var->sharing_weight) {
-    xbt_swag_insert_at_head(elem, &(elem->constraint->enabled_element_set));
-    lmm_increase_concurrency(elem);
+    xbt_swag_insert_at_head(&elem, &(elem.constraint->enabled_element_set));
+    elem.increase_concurrency();
   } else
-    xbt_swag_insert_at_tail(elem, &(elem->constraint->disabled_element_set));
+    xbt_swag_insert_at_tail(&elem, &(elem.constraint->disabled_element_set));
 
-  if (not sys->selective_update_active) {
-    make_constraint_active(sys, cnst);
-  } else if (elem->consumption_weight > 0 || var->sharing_weight > 0) {
-    make_constraint_active(sys, cnst);
-    lmm_update_modified_set(sys, cnst);
+  if (not selective_update_active) {
+    make_constraint_active(cnst);
+  } else if (elem.consumption_weight > 0 || var->sharing_weight > 0) {
+    make_constraint_active(cnst);
+    update_modified_set(cnst);
     //TODOLATER: Why do we need this second call?
-    if (var->cnsts_number > 1)
-      lmm_update_modified_set(sys, var->cnsts[0].constraint);
+    if (var->cnsts.size() > 1)
+      update_modified_set(var->cnsts[0].constraint);
   }
 
-  lmm_check_concurrency(sys);
+  check_concurrency();
 }
 
-void lmm_expand_add(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double value)
+void s_lmm_system_t::expand_add(lmm_constraint_t cnst, lmm_variable_t var, double value)
 {
-  int i;
-  sys->modified = 1;
+  modified = true;
 
-  lmm_check_concurrency(sys);
+  check_concurrency();
 
   //BEWARE: In case you have multiple elements in one constraint, this will always add value to the first element.
-  for (i = 0; i < var->cnsts_number; i++)
-    if (var->cnsts[i].constraint == cnst)
-      break;
-
-  if (i < var->cnsts_number) {
+  auto elem_it = std::find_if(begin(var->cnsts), end(var->cnsts),
+                              [&cnst](s_lmm_element_t const& x) { return x.constraint == cnst; });
+  if (elem_it != end(var->cnsts)) {
+    s_lmm_element_t& elem = *elem_it;
     if (var->sharing_weight)
-      lmm_decrease_concurrency(&var->cnsts[i]);
+      elem.decrease_concurrency();
 
     if (cnst->sharing_policy)
-      var->cnsts[i].consumption_weight += value;
+      elem.consumption_weight += value;
     else
-      var->cnsts[i].consumption_weight = MAX(var->cnsts[i].consumption_weight, value);
+      elem.consumption_weight = std::max(elem.consumption_weight, value);
 
     //We need to check that increasing value of the element does not cross the concurrency limit
     if (var->sharing_weight) {
-      if(lmm_concurrency_slack(cnst)<lmm_element_concurrency(&var->cnsts[i])){
+      if (cnst->get_concurrency_slack() < elem.get_concurrency()) {
         double weight = var->sharing_weight;
-        lmm_disable_var(sys,var);
-        for (int j = 0; j < var->cnsts_number; j++)
-          lmm_on_disabled_var(sys,var->cnsts[j].constraint);
+        disable_var(var);
+        for (s_lmm_element_t const& elem2 : var->cnsts)
+          on_disabled_var(elem2.constraint);
         var->staged_weight=weight;
         xbt_assert(not var->sharing_weight);
       }
-      lmm_increase_concurrency(&var->cnsts[i]);
+      elem.increase_concurrency();
     }
-    lmm_update_modified_set(sys, cnst);
+    update_modified_set(cnst);
   } else
-    lmm_expand(sys, cnst, var, value);
+    expand(cnst, var, value);
 
-  lmm_check_concurrency(sys);
+  check_concurrency();
 }
 
-lmm_constraint_t lmm_get_cnst_from_var(lmm_system_t /*sys*/, lmm_variable_t var, int num)
-{
-  if (num < var->cnsts_number)
-    return (var->cnsts[num].constraint);
-  else
-    return nullptr;
-}
-
-double lmm_get_cnst_weight_from_var(lmm_system_t /*sys*/, lmm_variable_t var, int num)
-{
-  if (num < var->cnsts_number)
-    return (var->cnsts[num].consumption_weight);
-  else
-    return 0.0;
-}
-
-int lmm_get_number_of_cnst_from_var(lmm_system_t /*sys*/, lmm_variable_t var)
-{
-  return (var->cnsts_number);
-}
-
-lmm_variable_t lmm_get_var_from_cnst(lmm_system_t /*sys*/, lmm_constraint_t cnst, lmm_element_t * elem)
+lmm_variable_t s_lmm_constraint_t::get_variable(lmm_element_t* elem) const
 {
   if (*elem == nullptr) {
     // That is the first call, pick the first element among enabled_element_set (or disabled_element_set if
     // enabled_element_set is empty)
-    *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->enabled_element_set));
+    *elem = (lmm_element_t)xbt_swag_getFirst(&enabled_element_set);
     if (*elem == nullptr)
-      *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
+      *elem = (lmm_element_t)xbt_swag_getFirst(&disabled_element_set);
   } else {
     //elem is not null, so we carry on
-    if(xbt_swag_belongs(*elem,&(cnst->enabled_element_set))){
+    if (xbt_swag_belongs(*elem, &enabled_element_set)) {
       //Look at enabled_element_set, and jump to disabled_element_set when finished
-      *elem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->enabled_element_set.offset);
+      *elem = (lmm_element_t)xbt_swag_getNext(*elem, enabled_element_set.offset);
       if (*elem == nullptr)
-        *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
+        *elem = (lmm_element_t)xbt_swag_getFirst(&disabled_element_set);
     } else {
-      *elem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->disabled_element_set.offset);
+      *elem = (lmm_element_t)xbt_swag_getNext(*elem, disabled_element_set.offset);
     }
   }
   if (*elem)
@@ -588,14 +377,13 @@ lmm_variable_t lmm_get_var_from_cnst(lmm_system_t /*sys*/, lmm_constraint_t cnst
 
 //if we modify the swag between calls, normal version may loop forever
 //this safe version ensures that we browse the swag elements only once
-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)
+lmm_variable_t s_lmm_constraint_t::get_variable_safe(lmm_element_t* elem, lmm_element_t* nextelem, int* numelem) const
 {
   if (*elem == nullptr) {
-    *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->enabled_element_set));
-    *numelem = xbt_swag_size(&(cnst->enabled_element_set))+xbt_swag_size(&(cnst->disabled_element_set))-1;
+    *elem    = (lmm_element_t)xbt_swag_getFirst(&enabled_element_set);
+    *numelem = xbt_swag_size(&enabled_element_set) + xbt_swag_size(&disabled_element_set) - 1;
     if (*elem == nullptr)
-      *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
+      *elem = (lmm_element_t)xbt_swag_getFirst(&disabled_element_set);
   }else{
     *elem = *nextelem;
     if(*numelem>0){
@@ -605,64 +393,43 @@ lmm_variable_t lmm_get_var_from_cnst_safe(lmm_system_t /*sys*/, lmm_constraint_t
   }
   if (*elem){
     //elem is not null, so we carry on
-    if(xbt_swag_belongs(*elem,&(cnst->enabled_element_set))){
+    if (xbt_swag_belongs(*elem, &enabled_element_set)) {
       //Look at enabled_element_set, and jump to disabled_element_set when finished
-      *nextelem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->enabled_element_set.offset);
+      *nextelem = (lmm_element_t)xbt_swag_getNext(*elem, enabled_element_set.offset);
       if (*nextelem == nullptr)
-        *nextelem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
+        *nextelem = (lmm_element_t)xbt_swag_getFirst(&disabled_element_set);
     } else {
-      *nextelem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->disabled_element_set.offset);
+      *nextelem = (lmm_element_t)xbt_swag_getNext(*elem, disabled_element_set.offset);
     }
     return (*elem)->variable;
   }else
     return nullptr;
 }
 
-void *lmm_constraint_id(lmm_constraint_t cnst)
-{
-  return cnst->id;
-}
-
-void *lmm_variable_id(lmm_variable_t var)
-{
-  return var->id;
-}
-
-static inline void saturated_constraint_set_update(double usage, int cnst_light_num,
-                                                   dyn_light_t saturated_constraint_set, double *min_usage)
+static inline void saturated_constraints_update(double usage, int cnst_light_num, dyn_light_t& saturated_constraints,
+                                                double* min_usage)
 {
   xbt_assert(usage > 0,"Impossible");
 
   if (*min_usage < 0 || *min_usage > usage) {
     *min_usage = usage;
     XBT_HERE(" min_usage=%f (cnst->remaining / cnst->usage =%f)", *min_usage, usage);
-    saturated_constraint_set->data[0] = cnst_light_num;
-    saturated_constraint_set->pos = 1;
+    saturated_constraints.assign(1, cnst_light_num);
   } else if (*min_usage == usage) {
-    if(saturated_constraint_set->pos == saturated_constraint_set->size) { // realloc the size
-      saturated_constraint_set->size *= 2;
-      saturated_constraint_set->data =
-        (int*) xbt_realloc(saturated_constraint_set->data, (saturated_constraint_set->size) * sizeof(int));
-    }
-    saturated_constraint_set->data[saturated_constraint_set->pos] = cnst_light_num;
-    saturated_constraint_set->pos++;
+    saturated_constraints.emplace_back(cnst_light_num);
   }
 }
 
-static inline void saturated_variable_set_update(s_lmm_constraint_light_t *cnst_light_tab,
-                                                 dyn_light_t saturated_constraint_set, lmm_system_t sys)
+static inline void saturated_variable_set_update(s_lmm_constraint_light_tcnst_light_tab,
+                                                 const dyn_light_t& saturated_constraints, lmm_system_t sys)
 {
   /* Add active variables (i.e. variables that need to be set) from the set of constraints to saturate (cnst_light_tab)*/
-  lmm_constraint_light_t cnst = nullptr;
-  void *_elem;
-  lmm_element_t elem = nullptr;
-  xbt_swag_t elem_list = nullptr;
-  int i;
-  for(i = 0; i< saturated_constraint_set->pos; i++){
-    cnst = &cnst_light_tab[saturated_constraint_set->data[i]];
-    elem_list = &(cnst->cnst->active_element_set);
+  for (int const& saturated_cnst : saturated_constraints) {
+    lmm_constraint_light_t cnst = &cnst_light_tab[saturated_cnst];
+    void* _elem;
+    xbt_swag_t elem_list = &(cnst->cnst->active_element_set);
     xbt_swag_foreach(_elem, elem_list) {
-      elem = (lmm_element_t)_elem;
+      lmm_element_t elem = (lmm_element_t)_elem;
       //Visiting active_element_set, so, by construction, should never get a zero weight, correct?
       xbt_assert(elem->variable->sharing_weight > 0);
       if (elem->consumption_weight > 0)
@@ -671,13 +438,13 @@ static inline void saturated_variable_set_update(s_lmm_constraint_light_t *cnst_
   }
 }
 
-void lmm_print(lmm_system_t sys)
+void s_lmm_system_t::print()
 {
   std::string buf       = std::string("MAX-MIN ( ");
   void* _var;
 
   /* Printing Objective */
-  xbt_swag_t var_list = &(sys->variable_set);
+  xbt_swag_t var_list = &variable_set;
   xbt_swag_foreach(_var, var_list) {
     lmm_variable_t var = (lmm_variable_t)_var;
     buf = buf + "'" + std::to_string(var->id_int) + "'(" + std::to_string(var->sharing_weight) + ") ";
@@ -689,7 +456,7 @@ void lmm_print(lmm_system_t sys)
   XBT_DEBUG("Constraints");
   /* Printing Constraints */
   void* _cnst;
-  xbt_swag_t cnst_list = &(sys->active_constraint_set);
+  xbt_swag_t cnst_list = &active_constraint_set;
   xbt_swag_foreach(_cnst, cnst_list) {
     lmm_constraint_t cnst = (lmm_constraint_t)_cnst;
     double sum = 0.0;
@@ -705,7 +472,7 @@ void lmm_print(lmm_system_t sys)
       if(cnst->sharing_policy)
         sum += elem->consumption_weight * elem->variable->value;
       else
-        sum = MAX(sum, elem->consumption_weight * elem->variable->value);
+        sum = std::max(sum, elem->consumption_weight * elem->variable->value);
     }
     //TODO: Adding disabled elements only for test compatibility, but do we really want them to be printed?
     elem_list = &(cnst->disabled_element_set);
@@ -716,7 +483,7 @@ void lmm_print(lmm_system_t sys)
       if(cnst->sharing_policy)
         sum += elem->consumption_weight * elem->variable->value;
       else
-        sum = MAX(sum, elem->consumption_weight * elem->variable->value);
+        sum = std::max(sum, elem->consumption_weight * elem->variable->value);
     }
 
     buf = buf + "0) <= " + std::to_string(cnst->bound) + " ('" + std::to_string(cnst->id_int) + "')";
@@ -744,7 +511,7 @@ void lmm_print(lmm_system_t sys)
   }
 }
 
-void lmm_solve(lmm_system_t sys)
+void s_lmm_system_t::solve()
 {
   void* _cnst;
   void* _cnst_next;
@@ -752,22 +519,21 @@ void lmm_solve(lmm_system_t sys)
   double min_usage = -1;
   double min_bound = -1;
 
-  if (not sys->modified)
+  if (not modified)
     return;
 
-  XBT_IN("(sys=%p)", sys);
+  XBT_IN("(sys=%p)", this);
 
   /* Compute Usage and store the variables that reach the maximum. If selective_update_active is true, only constraints
    * that changed are considered. Otherwise all constraints with active actions are considered.
    */
-  xbt_swag_t cnst_list = sys->selective_update_active ? &(sys->modified_constraint_set) : &(sys->active_constraint_set);
+  xbt_swag_t cnst_list = selective_update_active ? &modified_constraint_set : &active_constraint_set;
 
   XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list));
   /* Init: Only modified code portions: reset the value of active variables */
   xbt_swag_foreach(_cnst, cnst_list) {
     lmm_constraint_t cnst = (lmm_constraint_t)_cnst;
     xbt_swag_t elem_list  = &(cnst->enabled_element_set);
-    //XBT_DEBUG("Variable set : %d", xbt_swag_size(elem_list));
     xbt_swag_foreach(_elem, elem_list) {
       lmm_variable_t var = ((lmm_element_t)_elem)->variable;
       xbt_assert(var->sharing_weight > 0.0);
@@ -775,12 +541,9 @@ 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_t* cnst_light_tab = new s_lmm_constraint_light_t[xbt_swag_size(cnst_list)]();
   int cnst_light_num = 0;
-  dyn_light_t saturated_constraint_set = xbt_new0(s_dyn_light_t,1);
-  saturated_constraint_set->size = 5;
-  saturated_constraint_set->data = xbt_new0(int, saturated_constraint_set->size);
+  dyn_light_t saturated_constraints;
 
   xbt_swag_foreach_safe(_cnst, _cnst_next, cnst_list) {
     lmm_constraint_t cnst = (lmm_constraint_t)_cnst;
@@ -800,33 +563,33 @@ void lmm_solve(lmm_system_t sys)
         else if (cnst->usage < elem->consumption_weight / elem->variable->sharing_weight)
           cnst->usage = elem->consumption_weight / elem->variable->sharing_weight;
 
-        make_elem_active(elem);
+        elem->make_active();
         simgrid::surf::Action *action = static_cast<simgrid::surf::Action*>(elem->variable->id);
-        if (sys->keep_track && not action->is_linked())
-          sys->keep_track->push_back(*action);
+        if (keep_track && not action->is_linked())
+          keep_track->push_back(*action);
       }
     }
     XBT_DEBUG("Constraint '%d' usage: %f remaining: %f concurrency: %i<=%i<=%i", cnst->id_int, cnst->usage,
-              cnst->remaining,cnst->concurrency_current,cnst->concurrency_maximum,cnst->concurrency_limit);
+              cnst->remaining, cnst->concurrency_current, cnst->concurrency_maximum, cnst->get_concurrency_limit());
     /* Saturated constraints update */
 
     if(cnst->usage > 0) {
       cnst_light_tab[cnst_light_num].cnst = cnst;
       cnst->cnst_light = &(cnst_light_tab[cnst_light_num]);
       cnst_light_tab[cnst_light_num].remaining_over_usage = cnst->remaining / cnst->usage;
-      saturated_constraint_set_update(cnst_light_tab[cnst_light_num].remaining_over_usage,
-        cnst_light_num, saturated_constraint_set, &min_usage);
+      saturated_constraints_update(cnst_light_tab[cnst_light_num].remaining_over_usage, cnst_light_num,
+                                   saturated_constraints, &min_usage);
       xbt_assert(cnst->active_element_set.count>0, "There is no sense adding a constraint that has no active element!");
       cnst_light_num++;
     }
   }
 
-  saturated_variable_set_update(  cnst_light_tab, saturated_constraint_set, sys);
+  saturated_variable_set_update(cnst_light_tab, saturated_constraints, this);
 
   /* Saturated variables update */
   do {
     /* Fix the variables that have to be */
-    xbt_swag_t var_list = &(sys->saturated_variable_set);
+    xbt_swag_t var_list = &saturated_variable_set;
     void* _var;
     lmm_variable_t var = nullptr;
     xbt_swag_foreach(_var, var_list) {
@@ -840,19 +603,16 @@ void lmm_solve(lmm_system_t sys)
         if (min_bound < 0)
           min_bound = var->bound * var->sharing_weight;
         else
-          min_bound = MIN(min_bound, (var->bound * var->sharing_weight));
+          min_bound = std::min(min_bound, (var->bound * var->sharing_weight));
         XBT_DEBUG("Updated min_bound=%f", min_bound);
       }
     }
 
     while ((var = (lmm_variable_t)xbt_swag_getFirst(var_list))) {
-      int i;
-
       if (min_bound < 0) {
         //If no variable could reach its bound, deal iteratively the constraints usage ( at worst one constraint is
         // saturated at each cycle)
         var->value = min_usage / var->sharing_weight;
-        // XBT_DEBUG("Setting %p (%d) value to %f\n", var, var->id_int, var->value);
         XBT_DEBUG("Setting var (%d) value to %f\n", var->id_int, var->value);
       } else {
          //If there exist a variable that can reach its bound, only update it (and other with the same bound) for now.
@@ -870,23 +630,19 @@ void lmm_solve(lmm_system_t sys)
                 var->id_int, var->value);
 
       /* Update the usage of contraints where this variable is involved */
-      for (i = 0; i < var->cnsts_number; i++) {
-        lmm_element_t elem    = &var->cnsts[i];
-        lmm_constraint_t cnst = elem->constraint;
+      for (s_lmm_element_t& elem : var->cnsts) {
+        lmm_constraint_t cnst = elem.constraint;
         if (cnst->sharing_policy) {
-          //Remember: shared constraints require that sum(elem->value * var->value) < cnst->bound
-          double_update(&(cnst->remaining), elem->consumption_weight * var->value, cnst->bound * sg_maxmin_precision);
-          double_update(&(cnst->usage), elem->consumption_weight / var->sharing_weight, sg_maxmin_precision);
-          //If the constraint is saturated, remove it from the set of active constraints (light_tab)
+          // Remember: shared constraints require that sum(elem.value * var->value) < cnst->bound
+          double_update(&(cnst->remaining), elem.consumption_weight * var->value, cnst->bound * sg_maxmin_precision);
+          double_update(&(cnst->usage), elem.consumption_weight / var->sharing_weight, sg_maxmin_precision);
+          // If the constraint is saturated, remove it from the set of active constraints (light_tab)
           if (not double_positive(cnst->usage, sg_maxmin_precision) ||
               not double_positive(cnst->remaining, cnst->bound * sg_maxmin_precision)) {
             if (cnst->cnst_light) {
               int index = (cnst->cnst_light-cnst_light_tab);
               XBT_DEBUG("index: %d \t cnst_light_num: %d \t || usage: %f remaining: %f bound: %f  ",
                          index,cnst_light_num, cnst->usage, cnst->remaining, cnst->bound);
-              //XBT_DEBUG("index: %d \t cnst_light_num: %d \t || \t cnst: %p \t cnst->cnst_light: %p "
-              //          "\t cnst_light_tab: %p usage: %f remaining: %f bound: %f  ", index,cnst_light_num,
-              //          cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound);
               cnst_light_tab[index]=cnst_light_tab[cnst_light_num-1];
               cnst_light_tab[index].cnst->cnst_light = &cnst_light_tab[index];
               cnst_light_num--;
@@ -895,18 +651,19 @@ void lmm_solve(lmm_system_t sys)
           } else {
             cnst->cnst_light->remaining_over_usage = cnst->remaining / cnst->usage;
           }
-          make_elem_inactive(elem);
+          elem.make_inactive();
         } else {
-          //Remember: non-shared constraints only require that max(elem->value * var->value) < cnst->bound
+          // Remember: non-shared constraints only require that max(elem.value * var->value) < cnst->bound
           cnst->usage = 0.0;
-          make_elem_inactive(elem);
+          elem.make_inactive();
           xbt_swag_t elem_list = &(cnst->enabled_element_set);
           xbt_swag_foreach(_elem, elem_list) {
-            elem = (lmm_element_t)_elem;
-            xbt_assert(elem->variable->sharing_weight > 0);
-            if (elem->variable->value > 0) continue;
-            if (elem->consumption_weight > 0)
-              cnst->usage = MAX(cnst->usage, elem->consumption_weight / elem->variable->sharing_weight);
+            lmm_element_t elem2 = static_cast<lmm_element_t>(_elem);
+            xbt_assert(elem2->variable->sharing_weight > 0);
+            if (elem2->variable->value > 0)
+              continue;
+            if (elem2->consumption_weight > 0)
+              cnst->usage = std::max(cnst->usage, elem2->consumption_weight / elem2->variable->sharing_weight);
           }
           //If the constraint is saturated, remove it from the set of active constraints (light_tab)
           if (not double_positive(cnst->usage, sg_maxmin_precision) ||
@@ -934,7 +691,7 @@ void lmm_solve(lmm_system_t sys)
     /* Find out which variables reach the maximum */
     min_usage = -1;
     min_bound = -1;
-    saturated_constraint_set->pos = 0;
+    saturated_constraints.clear();
     int pos;
     for(pos=0; pos<cnst_light_num; pos++){
       xbt_assert(cnst_light_tab[pos].cnst->active_element_set.count>0, "Cannot saturate more a constraint that has"
@@ -942,30 +699,32 @@ void lmm_solve(lmm_system_t sys)
                  " because of possible rounding effects.\n\tFor the record, the usage of this constraint is %g while "
                  "the maxmin precision to which it is compared is %g.\n\tThe usage of the previous constraint is %g.",
                  cnst_light_tab[pos].cnst->usage, sg_maxmin_precision, cnst_light_tab[pos-1].cnst->usage);
-      saturated_constraint_set_update(cnst_light_tab[pos].remaining_over_usage, pos, saturated_constraint_set,
-                                      &min_usage);
+      saturated_constraints_update(cnst_light_tab[pos].remaining_over_usage, pos, saturated_constraints, &min_usage);
     }
 
-    saturated_variable_set_update(cnst_light_tab, saturated_constraint_set, sys);
+    saturated_variable_set_update(cnst_light_tab, saturated_constraints, this);
 
   } while (cnst_light_num > 0);
 
-  sys->modified = 0;
-  if (sys->selective_update_active)
-    lmm_remove_all_modified_set(sys);
+  modified = false;
+  if (selective_update_active)
+    remove_all_modified_set();
 
   if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
-    lmm_print(sys);
+    print();
   }
 
-  lmm_check_concurrency(sys);
+  check_concurrency();
 
-  xbt_free(saturated_constraint_set->data);
-  xbt_free(saturated_constraint_set);
-  xbt_free(cnst_light_tab);
+  delete[] cnst_light_tab;
   XBT_OUT();
 }
 
+void lmm_solve(lmm_system_t sys)
+{
+  sys->solve();
+}
+
 /** \brief Attribute the value bound to var->bound.
  *
  *  \param sys the lmm_system_t
@@ -975,101 +734,105 @@ void lmm_solve(lmm_system_t sys)
  *  Makes var->bound equal to bound. Whenever this function is called a change is  signed in the system. To
  *  avoid false system changing detection it is a good idea to test (bound != 0) before calling it.
  */
-void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var, double bound)
+void s_lmm_system_t::update_variable_bound(lmm_variable_t var, double bound)
 {
-  sys->modified = 1;
+  modified   = true;
   var->bound = bound;
 
-  if (var->cnsts_number)
-    lmm_update_modified_set(sys, var->cnsts[0].constraint);
+  if (not var->cnsts.empty())
+    update_modified_set(var->cnsts[0].constraint);
 }
 
-int lmm_concurrency_slack(lmm_constraint_t cnstr){
-  //FIXME MARTIN: Replace by infinite value std::numeric_limits<int>::(max)(), or something better within Simgrid?
-  if(cnstr->concurrency_limit<0)
-    return 666;
-
-  return  cnstr->concurrency_limit - cnstr->concurrency_current;
+void s_lmm_variable_t::initialize(simgrid::surf::Action* id_value, double sharing_weight_value, double bound_value,
+                                  int number_of_constraints, unsigned visited_value)
+{
+  id     = id_value;
+  id_int = Global_debug_id++;
+  cnsts.reserve(number_of_constraints);
+  sharing_weight    = sharing_weight_value;
+  staged_weight     = 0.0;
+  bound             = bound_value;
+  concurrency_share = 1;
+  value             = 0.0;
+  visited           = visited_value;
+  mu                = 0.0;
+  new_mu            = 0.0;
+  func_f            = func_f_def;
+  func_fp           = func_fp_def;
+  func_fpi          = func_fpi_def;
+
+  variable_set_hookup.next           = nullptr;
+  variable_set_hookup.prev           = nullptr;
+  saturated_variable_set_hookup.next = nullptr;
+  saturated_variable_set_hookup.prev = nullptr;
 }
 
-/** \brief Measure the minimum concurrency slack across all constraints where the given var is involved */
-int lmm_cnstrs_min_concurrency_slack(lmm_variable_t var){
+int s_lmm_variable_t::get_min_concurrency_slack() const
+{
   int minslack = std::numeric_limits<int>::max();
-  for (int i = 0; i < var->cnsts_number; i++) {
-    int slack = lmm_concurrency_slack(var->cnsts[i].constraint);
-
-    //This is only an optimization, to avoid looking at more constraints when slack is already zero
-    //Disable it when debugging to let lmm_concurrency_slack catch nasty things
-    if (not slack && not XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug))
-      return 0;
-
-    if(minslack>slack)
-      minslack=slack;
+  for (s_lmm_element_t const& elem : cnsts) {
+    int slack = elem.constraint->get_concurrency_slack();
+    if (slack < minslack) {
+      // This is only an optimization, to avoid looking at more constraints when slack is already zero
+      if (slack == 0)
+        return 0;
+      minslack = slack;
+    }
   }
-
   return minslack;
 }
 
-/* /Check if a variable can be enabled
- *
- * Make sure to set staged_weight before, if your intent is only to check concurrency
- */
-int lmm_can_enable_var(lmm_variable_t var){
-  return var->staged_weight>0 && lmm_cnstrs_min_concurrency_slack(var)>=var->concurrency_share;
-}
-
 //Small remark: In this implementation of lmm_enable_var and lmm_disable_var, we will meet multiple times with var when
-// running lmm_update_modified_set.
-//A priori not a big performance issue, but we might do better by calling lmm_update_modified_set within the for loops
+// running sys->update_modified_set.
+// A priori not a big performance issue, but we might do better by calling sys->update_modified_set within the for loops
 // (after doing the first for enabling==1, and before doing the last for disabling==1)
-void lmm_enable_var(lmm_system_t sys, lmm_variable_t var){
-  xbt_assert(lmm_can_enable_var(var));
+void s_lmm_system_t::enable_var(lmm_variable_t var)
+{
+  xbt_assert(not XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug) || var->can_enable());
 
   var->sharing_weight = var->staged_weight;
   var->staged_weight = 0;
 
-  // Enabling the variable, move to var to list head. Subtlety is: here, we need to call lmm_update_modified_set AFTER
+  // Enabling the variable, move to var to list head. Subtlety is: here, we need to call update_modified_set AFTER
   // moving at least one element of var.
 
-  xbt_swag_remove(var, &(sys->variable_set));
-  xbt_swag_insert_at_head(var, &(sys->variable_set));
-  for (int i = 0; i < var->cnsts_number; i++) {
-    lmm_element_t elem = &var->cnsts[i];
-    xbt_swag_remove(elem, &(elem->constraint->disabled_element_set));
-    xbt_swag_insert_at_head(elem, &(elem->constraint->enabled_element_set));
-    lmm_increase_concurrency(elem);
+  xbt_swag_remove(var, &variable_set);
+  xbt_swag_insert_at_head(var, &variable_set);
+  for (s_lmm_element_t& elem : var->cnsts) {
+    xbt_swag_remove(&elem, &(elem.constraint->disabled_element_set));
+    xbt_swag_insert_at_head(&elem, &(elem.constraint->enabled_element_set));
+    elem.increase_concurrency();
   }
-  if (var->cnsts_number)
-    lmm_update_modified_set(sys, var->cnsts[0].constraint);
+  if (not var->cnsts.empty())
+    update_modified_set(var->cnsts[0].constraint);
 
-  //When used within lmm_on_disabled_var, we would get an assertion fail, because transiently there can be variables
+  // When used within on_disabled_var, we would get an assertion fail, because transiently there can be variables
   // that are staged and could be activated.
-  //Anyway, caller functions all call lmm_check_concurrency() in the end.
-  //  lmm_check_concurrency(sys);
+  // Anyway, caller functions all call check_concurrency() in the end.
 }
 
-void lmm_disable_var(lmm_system_t sys, lmm_variable_t var){
+void s_lmm_system_t::disable_var(lmm_variable_t var)
+{
   xbt_assert(not var->staged_weight, "Staged weight should have been cleared");
-  // Disabling the variable, move to var to list tail. Subtlety is: here, we need to call lmm_update_modified_set BEFORE
-  // moving the last element of var.
-  xbt_swag_remove(var, &(sys->variable_set));
-  xbt_swag_insert_at_tail(var, &(sys->variable_set));
-  if (var->cnsts_number)
-    lmm_update_modified_set(sys, var->cnsts[0].constraint);
-  for (int i = 0; i < var->cnsts_number; i++) {
-    lmm_element_t elem = &var->cnsts[i];
-    xbt_swag_remove(elem, &(elem->constraint->enabled_element_set));
-    xbt_swag_insert_at_tail(elem, &(elem->constraint->disabled_element_set));
-
-    xbt_swag_remove(elem, &(elem->constraint->active_element_set));
-
-    lmm_decrease_concurrency(elem);
+  // Disabling the variable, move to var to list tail. Subtlety is: here, we need to call update_modified_set
+  // BEFORE moving the last element of var.
+  xbt_swag_remove(var, &variable_set);
+  xbt_swag_insert_at_tail(var, &variable_set);
+  if (not var->cnsts.empty())
+    update_modified_set(var->cnsts[0].constraint);
+  for (s_lmm_element_t& elem : var->cnsts) {
+    xbt_swag_remove(&elem, &(elem.constraint->enabled_element_set));
+    xbt_swag_insert_at_tail(&elem, &(elem.constraint->disabled_element_set));
+
+    xbt_swag_remove(&elem, &(elem.constraint->active_element_set));
+
+    elem.decrease_concurrency();
   }
 
   var->sharing_weight = 0.0;
   var->staged_weight=0.0;
   var->value = 0.0;
-  lmm_check_concurrency(sys);
+  check_concurrency();
 }
 
 /* /brief Find variables that can be enabled and enable them.
@@ -1079,9 +842,9 @@ void lmm_disable_var(lmm_system_t sys, lmm_variable_t var){
  * If yes, check that none of the constraints that this variable is involved in is at the limit of its concurrency
  * And then add it to enabled variables
  */
-void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){
-
-  if(cnstr->concurrency_limit<0)
+void s_lmm_system_t::on_disabled_var(lmm_constraint_t cnstr)
+{
+  if (cnstr->get_concurrency_limit() < 0)
     return;
 
   int numelem = xbt_swag_size(&(cnstr->disabled_element_set));
@@ -1095,17 +858,15 @@ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){
 
     lmm_element_t nextelem = (lmm_element_t)xbt_swag_getNext(elem, cnstr->disabled_element_set.offset);
 
-    if (elem->variable->staged_weight>0 ){
+    if (elem->variable->staged_weight > 0 && elem->variable->can_enable()) {
       //Found a staged variable
       //TODOLATER: Add random timing function to model reservation protocol fuzziness? Then how to make sure that
       //staged variables will eventually be called?
-      if(lmm_can_enable_var(elem->variable)){
-        lmm_enable_var(sys,elem->variable);
-      }
+      enable_var(elem->variable);
     }
 
-    xbt_assert(cnstr->concurrency_current<=cnstr->concurrency_limit,"Concurrency overflow!");
-    if(cnstr->concurrency_current==cnstr->concurrency_limit)
+    xbt_assert(cnstr->concurrency_current <= cnstr->get_concurrency_limit(), "Concurrency overflow!");
+    if (cnstr->concurrency_current == cnstr->get_concurrency_limit())
       break;
 
     elem = nextelem;
@@ -1113,14 +874,13 @@ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){
 
   //We could get an assertion fail, because transiently there can be variables that are staged and could be activated.
   //And we need to go through all constraints of the disabled var before getting back a coherent state.
-  //Anyway, caller functions all call lmm_check_concurrency() in the end.
-  //  lmm_check_concurrency(sys);
+  // Anyway, caller functions all call check_concurrency() in the end.
 }
 
 /* \brief update the weight of a variable, and enable/disable it.
  * @return Returns whether a change was made
  */
-void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double weight)
+void s_lmm_system_t::update_variable_weight(lmm_variable_t var, double weight)
 {
   xbt_assert(weight>=0,"Variable weight should not be negative!");
 
@@ -1130,60 +890,40 @@ void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double wei
   int enabling_var  = (weight > 0 && var->sharing_weight <= 0);
   int disabling_var = (weight <= 0 && var->sharing_weight > 0);
 
-  XBT_IN("(sys=%p, var=%p, weight=%f)", sys, var, weight);
+  XBT_IN("(sys=%p, var=%p, weight=%f)", this, var, weight);
 
-  sys->modified = 1;
+  modified = true;
 
   //Are we enabling this variable?
   if (enabling_var){
     var->staged_weight = weight;
-    int minslack       = lmm_cnstrs_min_concurrency_slack(var);
+    int minslack       = var->get_min_concurrency_slack();
     if (minslack < var->concurrency_share) {
       XBT_DEBUG("Staging var (instead of enabling) because min concurrency slack %i, with weight %f and concurrency"
                 " share %i", minslack, weight, var->concurrency_share);
       return;
     }
     XBT_DEBUG("Enabling var with min concurrency slack %i", minslack);
-    lmm_enable_var(sys,var);
+    enable_var(var);
   } else if (disabling_var){
     //Are we disabling this variable?
-    lmm_disable_var(sys,var);
+    disable_var(var);
   } else {
     var->sharing_weight = weight;
   }
 
-  lmm_check_concurrency(sys);
+  check_concurrency();
 
   XBT_OUT();
 }
 
-double lmm_get_variable_weight(lmm_variable_t var)
-{
-  return var->sharing_weight;
-}
-
-void lmm_update_constraint_bound(lmm_system_t sys, lmm_constraint_t cnst, double bound)
+void s_lmm_system_t::update_constraint_bound(lmm_constraint_t cnst, double bound)
 {
-  sys->modified = 1;
-  lmm_update_modified_set(sys, cnst);
+  modified = true;
+  update_modified_set(cnst);
   cnst->bound = bound;
 }
 
-int lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst)
-{
-  return xbt_swag_belongs(cnst, &(sys->active_constraint_set));
-}
-
-inline lmm_constraint_t lmm_get_first_active_constraint(lmm_system_t sys)
-{
-  return (lmm_constraint_t)xbt_swag_getFirst(&(sys->active_constraint_set));
-}
-
-inline lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t sys, lmm_constraint_t cnst)
-{
-  return (lmm_constraint_t)xbt_swag_getNext(cnst, (sys->active_constraint_set).offset);
-}
-
 /** \brief Update the constraint set propagating recursively to other constraints so the system should not be entirely
  *  computed.
  *
@@ -1193,53 +933,48 @@ inline lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t sys, lmm_con
  *  A recursive algorithm to optimize the system recalculation selecting only constraints that have changed. Each
  *  constraint change is propagated to the list of constraints for each variable.
  */
-static void lmm_update_modified_set_rec(lmm_system_t sys, lmm_constraint_t cnst)
+void s_lmm_system_t::update_modified_set_rec(lmm_constraint_t cnst)
 {
   void* _elem;
 
-  //TODOLATER: Why lmm_modified_set has been changed in git version 2392B5157...? Looks equivalent logically and less obvious..
   xbt_swag_foreach(_elem, &cnst->enabled_element_set) {
     lmm_variable_t var = ((lmm_element_t)_elem)->variable;
-    s_lmm_element_t *cnsts = var->cnsts;
-    int i;
-    for (i = 0; var->visited != sys->visited_counter && i < var->cnsts_number ; i++) {
-      if (cnsts[i].constraint != cnst && not xbt_swag_belongs(cnsts[i].constraint, &sys->modified_constraint_set)) {
-        xbt_swag_insert(cnsts[i].constraint, &sys->modified_constraint_set);
-        lmm_update_modified_set_rec(sys, cnsts[i].constraint);
+    for (s_lmm_element_t const& elem : var->cnsts) {
+      if (var->visited == visited_counter)
+        break;
+      if (elem.constraint != cnst && not xbt_swag_belongs(elem.constraint, &modified_constraint_set)) {
+        xbt_swag_insert(elem.constraint, &modified_constraint_set);
+        update_modified_set_rec(elem.constraint);
       }
     }
     //var will be ignored in later visits as long as sys->visited_counter does not move
-    var->visited = sys->visited_counter;
+    var->visited = visited_counter;
   }
 }
 
-static void lmm_update_modified_set(lmm_system_t sys, lmm_constraint_t cnst)
+void s_lmm_system_t::update_modified_set(lmm_constraint_t cnst)
 {
   /* nothing to do if selective update isn't active */
-  if (sys->selective_update_active && not xbt_swag_belongs(cnst, &sys->modified_constraint_set)) {
-    xbt_swag_insert(cnst, &sys->modified_constraint_set);
-    lmm_update_modified_set_rec(sys, cnst);
+  if (selective_update_active && not xbt_swag_belongs(cnst, &modified_constraint_set)) {
+    xbt_swag_insert(cnst, &modified_constraint_set);
+    update_modified_set_rec(cnst);
   }
 }
 
-/** \brief Remove all constraints of the modified_constraint_set.
- *
- *  \param sys the lmm_system_t
- */
-static void lmm_remove_all_modified_set(lmm_system_t sys)
+void s_lmm_system_t::remove_all_modified_set()
 {
-  //We cleverly un-flag all variables just by incrementing sys->visited_counter
-  //In effect, the var->visited value will no more be equal to sys->visited counter
-  //To be clean, when visited counter has wrapped around, we force these var->visited values so that variables that
-  //were in the modified a long (long long) time ago are not wrongly skipped here, which would lead to very nasty bugs
-  //(i.e. not readibily reproducible, and requiring a lot of run time before happening).
-  if (++sys->visited_counter == 1) {
+  // We cleverly un-flag all variables just by incrementing visited_counter
+  // In effect, the var->visited value will no more be equal to visited counter
+  // To be clean, when visited counter has wrapped around, we force these var->visited values so that variables that
+  // were in the modified a long long time ago are not wrongly skipped here, which would lead to very nasty bugs
+  // (i.e. not readibily reproducible, and requiring a lot of run time before happening).
+  if (++visited_counter == 1) {
     /* the counter wrapped around, reset each variable->visited */
-  void *_var;
-    xbt_swag_foreach(_var, &sys->variable_set)
+    void *_var;
+    xbt_swag_foreach(_var, &variable_set)
       ((lmm_variable_t)_var)->visited = 0;
   }
-  xbt_swag_reset(&sys->modified_constraint_set);
+  xbt_swag_reset(&modified_constraint_set);
 }
 
 /**
@@ -1253,33 +988,37 @@ static void lmm_remove_all_modified_set(lmm_system_t sys)
  *
  * \param cnst the lmm_constraint_t associated to the resource
  */
-double lmm_constraint_get_usage(lmm_constraint_t cnst) {
-  double usage         = 0.0;
-  xbt_swag_t elem_list = &(cnst->enabled_element_set);
+double s_lmm_constraint_t::get_usage() const
+{
+  double result              = 0.0;
+  const_xbt_swag_t elem_list = &enabled_element_set;
   void* _elem;
 
   xbt_swag_foreach(_elem, elem_list)
   {
     lmm_element_t elem = (lmm_element_t)_elem;
     if (elem->consumption_weight > 0) {
-      if (cnst->sharing_policy)
-        usage += elem->consumption_weight * elem->variable->value;
-      else if (usage < elem->consumption_weight * elem->variable->value)
-        usage = std::max(usage, elem->consumption_weight * elem->variable->value);
+      if (sharing_policy)
+        result += elem->consumption_weight * elem->variable->value;
+      else if (result < elem->consumption_weight * elem->variable->value)
+        result = std::max(result, elem->consumption_weight * elem->variable->value);
     }
   }
-  return usage;
+  return result;
 }
 
-int lmm_constraint_get_variable_amount(lmm_constraint_t cnst) {
-  int usage = 0;
-  xbt_swag_t elem_list = &(cnst->enabled_element_set);
+int s_lmm_constraint_t::get_variable_amount() const
+{
+  int result                 = 0;
+  const_xbt_swag_t elem_list = &enabled_element_set;
   void *_elem;
 
   xbt_swag_foreach(_elem, elem_list) {
     lmm_element_t elem = (lmm_element_t)_elem;
     if (elem->consumption_weight > 0)
-      usage++;
+      result++;
   }
- return usage;
+  return result;
+}
+}
 }
diff --git a/src/surf/maxmin_private.hpp b/src/surf/maxmin_private.hpp
deleted file mode 100644 (file)
index 44fac8c..0000000
+++ /dev/null
@@ -1,158 +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_MAXMIN_PRIVATE_H
-#define SURF_MAXMIN_PRIVATE_H
-
-#include "surf/maxmin.h"
-#include "xbt/swag.h"
-#include "xbt/mallocator.h"
-#include "surf_interface.hpp"
-
-/** @ingroup SURF_lmm
- * @brief LMM element
- * Elements can be seen as glue between constraint objects and variable objects.
- * 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 {
-  /* hookup to constraint */
-  s_xbt_swag_hookup_t enabled_element_set_hookup;
-  s_xbt_swag_hookup_t disabled_element_set_hookup;
-  s_xbt_swag_hookup_t active_element_set_hookup;
-
-  lmm_constraint_t constraint;
-  lmm_variable_t variable;
-
-  // consumption_weight: impact of 1 byte or flop of your application onto the resource (in byte or flop)
-  //   - 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 {
-  double remaining_over_usage;
-  lmm_constraint_t cnst;
-} s_lmm_constraint_light_t;
-
-/** @ingroup SURF_lmm
- * @brief LMM constraint
- * Each constraint contains several partially overlapping logical sets of elements:
- * \li Disabled elements which variable's weight is zero. This variables are not at all processed by LMM, but eventually the corresponding action will enable it (at least this is the idea).
- * \li Enabled elements which variable's weight is non-zero. They are utilized in some LMM functions.
- * \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 {
-  /* hookup to system */
-  s_xbt_swag_hookup_t constraint_set_hookup;
-  s_xbt_swag_hookup_t active_constraint_set_hookup;
-  s_xbt_swag_hookup_t modified_constraint_set_hookup;
-  s_xbt_swag_hookup_t saturated_constraint_set_hookup;
-
-  s_xbt_swag_t enabled_element_set;     /* a list of lmm_element_t */
-  s_xbt_swag_t disabled_element_set;     /* a list of lmm_element_t */
-  s_xbt_swag_t active_element_set;      /* a list of lmm_element_t */
-  double remaining;
-  double usage;
-  double bound;
-  int concurrency_limit; /* The maximum number of variables that may be enabled at any time (stage variables if necessary) */
-  //TODO MARTIN Check maximum value across resources at the end of simulation and give a warning is more than e.g. 500
-  int concurrency_current; /* The current concurrency */
-  int concurrency_maximum; /* The maximum number of (enabled and disabled) variables associated to the constraint at any given time (essentially for tracing)*/
-
-  int sharing_policy; /* see @e_surf_link_sharing_policy_t (0: FATPIPE, 1: SHARED, 2: FULLDUPLEX) */
-  void *id;
-  int id_int;
-  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 {
-  /* hookup to system */
-  s_xbt_swag_hookup_t variable_set_hookup;
-  s_xbt_swag_hookup_t saturated_variable_set_hookup;
-
-  s_lmm_element_t *cnsts;
-  int cnsts_size;
-  int cnsts_number;
-
-  // sharing_weight: variable's impact on the resource during the sharing
-  //   if == 0, the variable is not considered by LMM
-  //   on CPU, actions with N threads have a sharing of N
-  //   on network, the actions with higher latency have a lesser sharing_weight
-  double sharing_weight;
-
-  double staged_weight; /* If non-zero, variable is staged for addition as soon as maxconcurrency constraints will be met */
-  double bound;
-  double value;
-  short int concurrency_share; /* The maximum number of elements that variable will add to a constraint */
-  simgrid::surf::Action* id;
-  int id_int;
-  unsigned visited;             /* used by lmm_update_modified_set */
-  /* \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}    */
-  /* \end{For Lagrange only} */
-} s_lmm_variable_t;
-
-/** @ingroup SURF_lmm
- * @brief LMM system
- */
-typedef struct lmm_system {
-  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)*/
-  s_xbt_swag_t variable_set;    /* a list of lmm_variable_t */
-  s_xbt_swag_t constraint_set;  /* a list of lmm_constraint_t */
-
-  s_xbt_swag_t active_constraint_set;   /* a list of lmm_constraint_t */
-  s_xbt_swag_t modified_constraint_set; /* a list of modified lmm_constraint_t */
-
-  s_xbt_swag_t saturated_variable_set;  /* a list of lmm_variable_t */
-  s_xbt_swag_t saturated_constraint_set;        /* a list of lmm_constraint_t_t */
-
-  simgrid::surf::ActionLmmListPtr keep_track;
-
-  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))
-#define insert_constraint(sys,cnst) xbt_swag_insert(cnst,&(sys->constraint_set))
-#define remove_variable(sys,var) do {xbt_swag_remove(var,&(sys->variable_set));\
-                                 xbt_swag_remove(var,&(sys->saturated_variable_set));} while(0)
-#define remove_constraint(sys,cnst) do {xbt_swag_remove(cnst,&(sys->constraint_set));\
-                                        xbt_swag_remove(cnst,&(sys->saturated_constraint_set));} while(0)
-#define make_constraint_active(sys,cnst) xbt_swag_insert(cnst,&(sys->active_constraint_set))
-#define make_constraint_inactive(sys,cnst) \
-  do { xbt_swag_remove(cnst, &sys->active_constraint_set);              \
-    xbt_swag_remove(cnst, &sys->modified_constraint_set); } while (0)
-
-/** @ingroup SURF_lmm
- * @brief Print information about a lmm system
- *
- * @param sys A lmm system
- */
-//XBT_PRIVATE void lmm_print(lmm_system_t sys);
-
-extern XBT_PRIVATE double (*func_f_def) (lmm_variable_t, double);
-extern XBT_PRIVATE double (*func_fp_def) (lmm_variable_t, double);
-extern XBT_PRIVATE double (*func_fpi_def) (lmm_variable_t, double);
-
-#endif /* SURF_MAXMIN_PRIVATE_H */
index 4a771e9..915e5c2 100644 (file)
@@ -5,15 +5,14 @@
 
 #include <algorithm>
 
-#include "maxmin_private.hpp"
 #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
+#include "surf/maxmin.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
-double sg_sender_gap = 0.0;
 double sg_latency_factor = 1.0; /* default value; can be set by model or from command line */
 double sg_bandwidth_factor = 1.0;       /* default value; can be set by model or from command line */
 double sg_weight_S_parameter = 0.0;     /* default value; can be set by model or from command line */
@@ -88,13 +87,14 @@ void surf_network_model_init_Reno()
   if (surf_network_model)
     return;
 
-  lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
+  lmm_set_default_protocol_function(simgrid::surf::func_reno_f, simgrid::surf::func_reno_fp,
+                                    simgrid::surf::func_reno_fpi);
 
   xbt_cfg_setdefault_double("network/latency-factor", 13.01);
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve);
+  surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::surf::lagrange_solve);
   all_existing_models->push_back(surf_network_model);
 }
 
@@ -104,13 +104,14 @@ void surf_network_model_init_Reno2()
   if (surf_network_model)
     return;
 
-  lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp, func_reno2_fpi);
+  lmm_set_default_protocol_function(simgrid::surf::func_reno2_f, simgrid::surf::func_reno2_fp,
+                                    simgrid::surf::func_reno2_fpi);
 
   xbt_cfg_setdefault_double("network/latency-factor", 13.01);
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve);
+  surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::surf::lagrange_solve);
   all_existing_models->push_back(surf_network_model);
 }
 
@@ -119,13 +120,14 @@ void surf_network_model_init_Vegas()
   if (surf_network_model)
     return;
 
-  lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi);
+  lmm_set_default_protocol_function(simgrid::surf::func_vegas_f, simgrid::surf::func_vegas_fp,
+                                    simgrid::surf::func_vegas_fpi);
 
   xbt_cfg_setdefault_double("network/latency-factor", 13.01);
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve);
+  surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::surf::lagrange_solve);
   all_existing_models->push_back(surf_network_model);
 }
 
@@ -135,27 +137,25 @@ namespace surf {
 NetworkCm02Model::NetworkCm02Model()
   :NetworkModel()
 {
-  char *optim = xbt_cfg_get_string("network/optim");
+  std::string optim = xbt_cfg_get_string("network/optim");
   bool select = xbt_cfg_get_boolean("network/maxmin-selective-update");
 
-  if (not strcmp(optim, "Full")) {
-    updateMechanism_ = UM_FULL;
+  if (optim == "Full") {
+    setUpdateMechanism(UM_FULL);
     selectiveUpdate_ = select;
-  } else if (not strcmp(optim, "Lazy")) {
-    updateMechanism_ = UM_LAZY;
+  } else if (optim == "Lazy") {
+    setUpdateMechanism(UM_LAZY);
     selectiveUpdate_ = true;
     xbt_assert(select || (xbt_cfg_is_default_value("network/maxmin-selective-update")),
                "You cannot disable selective update when using the lazy update mechanism");
   } else {
-    xbt_die("Unsupported optimization (%s) for this model. Accepted: Full, Lazy.", optim);
+    xbt_die("Unsupported optimization (%s) for this model. Accepted: Full, Lazy.", optim.c_str());
   }
 
-  maxminSystem_ = lmm_system_new(selectiveUpdate_);
-  loopback_     = createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
+  maxminSystem_ = new s_lmm_system_t(selectiveUpdate_);
+  loopback_     = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
 
-  if (updateMechanism_ == UM_LAZY) {
-    actionHeap_ = xbt_heap_new(8, nullptr);
-    xbt_heap_set_update_callback(actionHeap_, surf_action_lmm_update_index_heap);
+  if (getUpdateMechanism() == UM_LAZY) {
     modifiedSet_ = new ActionLmmList();
     maxminSystem_->keep_track = modifiedSet_;
   }
@@ -166,7 +166,7 @@ NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(lmm_system_t self))
   maxminSystem_->solve_fun = specificSolveFun;
 }
 
-LinkImpl* NetworkCm02Model::createLink(const char* name, double bandwidth, double latency,
+LinkImpl* NetworkCm02Model::createLink(const std::string& name, double bandwidth, double latency,
                                        e_surf_link_sharing_policy_t policy)
 {
   return new NetworkCm02Link(this, name, bandwidth, latency, policy, maxminSystem_);
@@ -174,20 +174,18 @@ LinkImpl* NetworkCm02Model::createLink(const char* name, double bandwidth, doubl
 
 void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
 {
-  while ((xbt_heap_size(actionHeap_) > 0)
-         && (double_equals(xbt_heap_maxkey(actionHeap_), now, sg_surf_precision))) {
+  while (not actionHeapIsEmpty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
 
-    NetworkCm02Action *action = static_cast<NetworkCm02Action*> (xbt_heap_pop(actionHeap_));
+    NetworkCm02Action* action = static_cast<NetworkCm02Action*>(actionHeapPop());
     XBT_DEBUG("Something happened to action %p", action);
     if (TRACE_is_enabled()) {
-      int n = lmm_get_number_of_cnst_from_var(maxminSystem_, action->getVariable());
+      int n = action->getVariable()->get_number_of_constraint();
 
       for (int i = 0; i < n; i++){
-        lmm_constraint_t constraint = lmm_get_cnst_from_var(maxminSystem_, action->getVariable(), i);
-        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(),
+        lmm_constraint_t constraint = action->getVariable()->get_constraint(i);
+        NetworkCm02Link* link       = static_cast<NetworkCm02Link*>(constraint->get_id());
+        double value = action->getVariable()->get_value() * action->getVariable()->get_constraint_weight(i);
+        TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(), value, action->getLastUpdate(),
                                         now - action->getLastUpdate());
       }
     }
@@ -195,8 +193,8 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
     // if I am wearing a latency hat
     if (action->getHat() == LATENCY) {
       XBT_DEBUG("Latency paid for action %p. Activating", action);
-      lmm_update_variable_weight(maxminSystem_, action->getVariable(), action->weight_);
-      action->heapRemove(actionHeap_);
+      maxminSystem_->update_variable_weight(action->getVariable(), action->weight_);
+      action->heapRemove(getActionHeap());
       action->refreshLastUpdate();
 
         // if I am wearing a max_duration or normal hat
@@ -205,11 +203,8 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
         // assume that flows that reached max_duration have remaining of 0
       XBT_DEBUG("Action %p finished", action);
       action->setRemains(0);
-      action->finish();
-      action->setState(Action::State::done);
-      action->heapRemove(actionHeap_);
-
-      action->gapRemove();
+      action->finish(Action::State::done);
+      action->heapRemove(getActionHeap());
     }
   }
 }
@@ -217,54 +212,47 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
 
 void NetworkCm02Model::updateActionsStateFull(double now, double delta)
 {
-  ActionList *running_actions = getRunningActionSet();
-
-  for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
-     ; it != itend ; it=itNext) {
-    ++itNext;
-
-    NetworkCm02Action *action = static_cast<NetworkCm02Action*> (&*it);
-    XBT_DEBUG("Something happened to action %p", action);
-      double deltap = delta;
-      if (action->latency_ > 0) {
-        if (action->latency_ > deltap) {
-          double_update(&(action->latency_), deltap, sg_surf_precision);
-          deltap = 0.0;
-        } else {
-          double_update(&(deltap), action->latency_, sg_surf_precision);
-          action->latency_ = 0.0;
-        }
-        if (action->latency_ <= 0.0 && not action->isSuspended())
-          lmm_update_variable_weight(maxminSystem_, action->getVariable(), action->weight_);
-      }
-      if (TRACE_is_enabled()) {
-        int n = lmm_get_number_of_cnst_from_var(maxminSystem_, action->getVariable());
-        for (int i = 0; i < n; i++){
-          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(),
-                                          (lmm_variable_getvalue(action->getVariable()) *
-                                           lmm_get_cnst_weight_from_var(maxminSystem_, action->getVariable(), i)),
-                                          action->getLastUpdate(), now - action->getLastUpdate());
-        }
+  for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
+    NetworkCm02Action& action = static_cast<NetworkCm02Action&>(*it);
+    ++it; // increment iterator here since the following calls to action.finish() may invalidate it
+    XBT_DEBUG("Something happened to action %p", &action);
+    double deltap = delta;
+    if (action.latency_ > 0) {
+      if (action.latency_ > deltap) {
+        double_update(&action.latency_, deltap, sg_surf_precision);
+        deltap = 0.0;
+      } else {
+        double_update(&deltap, action.latency_, sg_surf_precision);
+        action.latency_ = 0.0;
       }
-      if (not lmm_get_number_of_cnst_from_var(maxminSystem_, action->getVariable())) {
-        /* There is actually no link used, hence an infinite bandwidth. This happens often when using models like
-         * vivaldi. In such case, just make sure that the action completes immediately.
-         */
-        action->updateRemains(action->getRemains());
+      if (action.latency_ <= 0.0 && not action.isSuspended())
+        maxminSystem_->update_variable_weight(action.getVariable(), action.weight_);
+    }
+    if (TRACE_is_enabled()) {
+      int n = action.getVariable()->get_number_of_constraint();
+      for (int i = 0; i < n; i++) {
+        lmm_constraint_t constraint = action.getVariable()->get_constraint(i);
+        NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
+        TRACE_surf_link_set_utilization(
+            link->getCname(), action.getCategory(),
+            (action.getVariable()->get_value() * action.getVariable()->get_constraint_weight(i)),
+            action.getLastUpdate(), now - action.getLastUpdate());
       }
-    action->updateRemains(lmm_variable_getvalue(action->getVariable()) * delta);
+    }
+    if (not action.getVariable()->get_number_of_constraint()) {
+      /* There is actually no link used, hence an infinite bandwidth. This happens often when using models like
+       * vivaldi. In such case, just make sure that the action completes immediately.
+       */
+      action.updateRemains(action.getRemains());
+    }
+    action.updateRemains(action.getVariable()->get_value() * delta);
 
-    if (action->getMaxDuration() > NO_MAX_DURATION)
-      action->updateMaxDuration(delta);
+    if (action.getMaxDuration() > NO_MAX_DURATION)
+      action.updateMaxDuration(delta);
 
-    if (((action->getRemains() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) ||
-        ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
-      action->finish();
-      action->setState(Action::State::done);
-      action->gapRemove();
+    if (((action.getRemains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+      action.finish(Action::State::done);
     }
   }
 }
@@ -273,24 +261,23 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
 {
   int failed = 0;
   double latency = 0.0;
-  std::vector<LinkImpl*>* back_route = nullptr;
-  std::vector<LinkImpl*>* route = new std::vector<LinkImpl*>();
+  std::vector<LinkImpl*> back_route;
+  std::vector<LinkImpl*> route;
 
   XBT_IN("(%s,%s,%g,%g)", src->getCname(), dst->getCname(), size, rate);
 
   src->routeTo(dst, route, &latency);
-  xbt_assert(not route->empty() || latency,
+  xbt_assert(not route.empty() || latency,
              "You're trying to send data from %s to %s but there is no connecting path between these two hosts.",
              src->getCname(), dst->getCname());
 
-  for (auto link: *route)
+  for (auto const& link : route)
     if (link->isOff())
       failed = 1;
 
   if (sg_network_crosstraffic == 1) {
-    back_route = new std::vector<LinkImpl*>();
     dst->routeTo(src, back_route, nullptr);
-    for (auto link: *back_route)
+    for (auto const& link : back_route)
       if (link->isOff())
         failed = 1;
   }
@@ -299,17 +286,16 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
   action->weight_ = latency;
   action->latency_ = latency;
   action->rate_ = rate;
-  if (updateMechanism_ == UM_LAZY) {
-    action->indexHeap_ = -1;
-    action->lastUpdate_ = surf_get_clock();
+  if (getUpdateMechanism() == UM_LAZY) {
+    action->refreshLastUpdate();
   }
 
   double bandwidth_bound = -1.0;
   if (sg_weight_S_parameter > 0)
-    for (auto link : *route)
+    for (auto const& link : route)
       action->weight_ += sg_weight_S_parameter / link->bandwidth();
 
-  for (auto link : *route) {
+  for (auto const& link : route) {
     double bb       = bandwidthFactor(size) * link->bandwidth();
     bandwidth_bound = (bandwidth_bound < 0.0) ? bb : std::min(bandwidth_bound, bb);
   }
@@ -317,66 +303,54 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
   action->latCurrent_ = action->latency_;
   action->latency_ *= latencyFactor(size);
   action->rate_ = bandwidthConstraint(action->rate_, bandwidth_bound, size);
-  if (haveGap_) {
-    xbt_assert(not route->empty(),
-               "Using a model with a gap (e.g., SMPI) with a platform without links (e.g. vivaldi)!!!");
-
-    gapAppend(size, route->at(0), action);
-    XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)", action, src->getCname(), dst->getCname(), action->senderGap_,
-              action->latency_);
-  }
 
-  int constraints_per_variable = route->size();
-  if (back_route != nullptr)
-    constraints_per_variable += back_route->size();
+  int constraints_per_variable = route.size();
+  constraints_per_variable += back_route.size();
 
   if (action->latency_ > 0) {
-    action->variable_ = lmm_variable_new(maxminSystem_, action, 0.0, -1.0, constraints_per_variable);
-    if (updateMechanism_ == UM_LAZY) {
+    action->setVariable(maxminSystem_->variable_new(action, 0.0, -1.0, constraints_per_variable));
+    if (getUpdateMechanism() == UM_LAZY) {
       // add to the heap the event when the latency is payed
-      XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->latency_ + action->lastUpdate_);
-      action->heapInsert(actionHeap_, action->latency_ + action->lastUpdate_, route->empty() ? NORMAL : LATENCY);
+      XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->latency_ + action->getLastUpdate());
+      action->heapInsert(getActionHeap(), action->latency_ + action->getLastUpdate(), route.empty() ? NORMAL : LATENCY);
     }
   } else
-    action->variable_ = lmm_variable_new(maxminSystem_, action, 1.0, -1.0, constraints_per_variable);
+    action->setVariable(maxminSystem_->variable_new(action, 1.0, -1.0, constraints_per_variable));
 
   if (action->rate_ < 0) {
-    lmm_update_variable_bound(maxminSystem_, action->getVariable(), (action->latCurrent_ > 0) ? sg_tcp_gamma / (2.0 * action->latCurrent_) : -1.0);
+    maxminSystem_->update_variable_bound(action->getVariable(),
+                                         (action->latCurrent_ > 0) ? sg_tcp_gamma / (2.0 * action->latCurrent_) : -1.0);
   } else {
-    lmm_update_variable_bound(maxminSystem_, action->getVariable(), (action->latCurrent_ > 0) ? std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_)) : action->rate_);
+    maxminSystem_->update_variable_bound(action->getVariable(),
+                                         (action->latCurrent_ > 0)
+                                             ? std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_))
+                                             : action->rate_);
   }
 
-  for (auto link: *route)
-    lmm_expand(maxminSystem_, link->constraint(), action->getVariable(), 1.0);
+  for (auto const& link : route)
+    maxminSystem_->expand(link->constraint(), action->getVariable(), 1.0);
 
-  if (back_route != nullptr) { //  sg_network_crosstraffic was activated
+  if (not back_route.empty()) { //  sg_network_crosstraffic was activated
     XBT_DEBUG("Fullduplex active adding backward flow using 5%%");
-    for (auto link : *back_route)
-      lmm_expand(maxminSystem_, link->constraint(), action->getVariable(), .05);
+    for (auto const& link : back_route)
+      maxminSystem_->expand(link->constraint(), action->getVariable(), .05);
 
     //Change concurrency_share here, if you want that cross-traffic is included in the SURF concurrency
     //(You would also have to change lmm_element_concurrency())
     //lmm_variable_concurrency_share_set(action->getVariable(),2);
   }
-
-  delete route;
-  delete back_route;
   XBT_OUT();
 
   simgrid::s4u::Link::onCommunicate(action, src, dst);
   return action;
 }
 
-void NetworkCm02Model::gapAppend(double size, const LinkImpl* link, NetworkAction* action){
-    // Nothing
-};
-
 /************
  * Resource *
  ************/
-NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const char* name, double bandwidth, double latency,
+NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
                                  e_surf_link_sharing_policy_t policy, lmm_system_t system)
-    : LinkImpl(model, name, lmm_constraint_new(system, this, sg_bandwidth_factor * bandwidth))
+    : LinkImpl(model, name, system->constraint_new(this, sg_bandwidth_factor * bandwidth))
 {
   bandwidth_.scale = 1.0;
   bandwidth_.peak  = bandwidth;
@@ -385,7 +359,7 @@ NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const char* name, doub
   latency_.peak  = latency;
 
   if (policy == SURF_LINK_FATPIPE)
-    lmm_constraint_shared(constraint());
+    constraint()->unshare();
 
   simgrid::s4u::Link::onCreation(this->piface_);
 }
@@ -410,8 +384,8 @@ void NetworkCm02Link::apply_event(tmgr_trace_event_t triggered, double value)
       double now = surf_get_clock();
 
       turnOff();
-      while ((var = lmm_get_var_from_cnst(model()->getMaxminSystem(), constraint(), &elem))) {
-        Action *action = static_cast<Action*>( lmm_variable_id(var) );
+      while ((var = constraint()->get_variable(&elem))) {
+        Action* action = static_cast<Action*>(var->get_id());
 
         if (action->getState() == Action::State::running ||
             action->getState() == Action::State::ready) {
@@ -430,12 +404,11 @@ void NetworkCm02Link::apply_event(tmgr_trace_event_t triggered, double value)
 
 void NetworkCm02Link::setBandwidth(double value)
 {
-
   bandwidth_.peak = 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);
+  model()->getMaxminSystem()->update_constraint_bound(constraint(),
+                                                      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);
@@ -444,11 +417,11 @@ void NetworkCm02Link::setBandwidth(double value)
     lmm_element_t elem = nullptr;
     lmm_element_t nextelem = nullptr;
     int numelem = 0;
-    while ((var = lmm_get_var_from_cnst_safe(model()->getMaxminSystem(), constraint(), &elem, &nextelem, &numelem))) {
-      NetworkCm02Action *action = static_cast<NetworkCm02Action*>(lmm_variable_id(var));
+    while ((var = constraint()->get_variable_safe(&elem, &nextelem, &numelem))) {
+      NetworkCm02Action* action = static_cast<NetworkCm02Action*>(var->get_id());
       action->weight_ += delta;
       if (not action->isSuspended())
-        lmm_update_variable_weight(model()->getMaxminSystem(), action->getVariable(), action->weight_);
+        model()->getMaxminSystem()->update_variable_weight(action->getVariable(), action->weight_);
     }
   }
 }
@@ -463,16 +436,16 @@ void NetworkCm02Link::setLatency(double value)
 
   latency_.peak = value;
 
-  while ((var = lmm_get_var_from_cnst_safe(model()->getMaxminSystem(), constraint(), &elem, &nextelem, &numelem))) {
-    NetworkCm02Action *action = static_cast<NetworkCm02Action*>(lmm_variable_id(var));
+  while ((var = constraint()->get_variable_safe(&elem, &nextelem, &numelem))) {
+    NetworkCm02Action* action = static_cast<NetworkCm02Action*>(var->get_id());
     action->latCurrent_ += delta;
     action->weight_ += delta;
     if (action->rate_ < 0)
-      lmm_update_variable_bound(model()->getMaxminSystem(), action->getVariable(),
-                                sg_tcp_gamma / (2.0 * action->latCurrent_));
+      model()->getMaxminSystem()->update_variable_bound(action->getVariable(),
+                                                        sg_tcp_gamma / (2.0 * action->latCurrent_));
     else {
-      lmm_update_variable_bound(model()->getMaxminSystem(), action->getVariable(),
-                                std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_)));
+      model()->getMaxminSystem()->update_variable_bound(
+          action->getVariable(), std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_)));
 
       if (action->rate_ < sg_tcp_gamma / (2.0 * action->latCurrent_)) {
         XBT_INFO("Flow is limited BYBANDWIDTH");
@@ -481,7 +454,7 @@ void NetworkCm02Link::setLatency(double value)
       }
     }
     if (not action->isSuspended())
-      lmm_update_variable_weight(model()->getMaxminSystem(), action->getVariable(), action->weight_);
+      model()->getMaxminSystem()->update_variable_weight(action->getVariable(), action->weight_);
   }
 }
 
@@ -494,31 +467,30 @@ void NetworkCm02Action::updateRemainingLazy(double now)
   if (suspended_ != 0)
     return;
 
-  double delta = now - lastUpdate_;
+  double delta        = now - getLastUpdate();
+  double max_duration = getMaxDuration();
 
-  if (remains_ > 0) {
-    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, remains_, lastUpdate_);
-    double_update(&(remains_), lastValue_ * delta, sg_maxmin_precision*sg_surf_precision);
+  if (getRemainsNoUpdate() > 0) {
+    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, getRemainsNoUpdate(), getLastUpdate());
+    updateRemains(getLastValue() * delta);
 
-    XBT_DEBUG("Updating action(%p): remains is now %f", this, remains_);
+    XBT_DEBUG("Updating action(%p): remains is now %f", this, getRemainsNoUpdate());
   }
 
-  if (maxDuration_ > NO_MAX_DURATION)
-    double_update(&maxDuration_, delta, sg_surf_precision);
+  if (max_duration > NO_MAX_DURATION) {
+    double_update(&max_duration, delta, sg_surf_precision);
+    setMaxDuration(max_duration);
+  }
 
-  if ((remains_ <= 0 && (lmm_get_variable_weight(getVariable()) > 0)) ||
-      ((maxDuration_ > NO_MAX_DURATION) && (maxDuration_ <= 0))) {
-    finish();
-    setState(Action::State::done);
+  if ((getRemainsNoUpdate() <= 0 && (getVariable()->get_weight() > 0)) ||
+      ((max_duration > NO_MAX_DURATION) && (max_duration <= 0))) {
+    finish(Action::State::done);
     heapRemove(getModel()->getActionHeap());
   }
 
-  lastUpdate_ = now;
-  lastValue_ = lmm_variable_getvalue(getVariable());
+  refreshLastUpdate();
+  setLastValue(getVariable()->get_value());
 }
 
-void NetworkCm02Link::gapAppend(double size, const LinkImpl* link, NetworkAction* action){
-    // Nothing
-};
 }
 }
index a04f215..7fd4187 100644 (file)
@@ -38,15 +38,11 @@ public:
   NetworkCm02Model();
   explicit NetworkCm02Model(void (*solve_fun)(lmm_system_t self));
   virtual ~NetworkCm02Model() = default;
-  LinkImpl* createLink(const char* name, double bandwidth, double latency,
+  LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;
   void updateActionsStateLazy(double now, double delta) override;
   void updateActionsStateFull(double now, double delta) override;
   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
-  virtual void gapAppend(double size, const LinkImpl* link, NetworkAction* action);
-
-protected:
-  bool haveGap_ = false;
 };
 
 /************
@@ -55,13 +51,12 @@ protected:
 
 class NetworkCm02Link : public LinkImpl {
 public:
-  NetworkCm02Link(NetworkCm02Model* model, const char* name, double bandwidth, double latency,
+  NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
                   e_surf_link_sharing_policy_t policy, lmm_system_t system);
   virtual ~NetworkCm02Link() = default;
   void apply_event(tmgr_trace_event_t event, double value) override;
   void setBandwidth(double value) override;
   void setLatency(double value) override;
-  virtual void gapAppend(double size, const LinkImpl* link, NetworkAction* action);
 };
 
 /**********
@@ -75,9 +70,6 @@ public:
   NetworkCm02Action(Model* model, double cost, bool failed) : NetworkAction(model, cost, failed){};
   virtual ~NetworkCm02Action() = default;
   void updateRemainingLazy(double now) override;
-
-protected:
-  double senderGap_;
 };
 }
 }
index 68a291a..166d70e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2013-2015. 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. */
@@ -20,56 +19,46 @@ void surf_network_model_init_Constant()
 
 namespace simgrid {
 namespace surf {
-LinkImpl* NetworkConstantModel::createLink(const char* name, double bw, double lat, e_surf_link_sharing_policy_t policy)
+LinkImpl* NetworkConstantModel::createLink(const std::string& name, double bw, double lat,
+                                           e_surf_link_sharing_policy_t policy)
 {
 
   xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
           "Please remove any link from your platform (and switch to routing='None')",
-          name);
+          name.c_str());
   return nullptr;
 }
 
 double NetworkConstantModel::nextOccuringEvent(double /*now*/)
 {
   double min = -1.0;
-
-  ActionList* actionSet = getRunningActionSet();
-  ActionList::iterator it(actionSet->begin());
-  ActionList::iterator itend(actionSet->end());
-  for (; it != itend; ++it) {
-    NetworkConstantAction* action = static_cast<NetworkConstantAction*>(&*it);
-    if (action->latency_ > 0 && (min < 0 || action->latency_ < min))
-      min = action->latency_;
+  for (Action const& action : *getRunningActionSet()) {
+    const NetworkConstantAction& net_action = static_cast<const NetworkConstantAction&>(action);
+    if (net_action.latency_ > 0 && (min < 0 || net_action.latency_ < min))
+      min = net_action.latency_;
   }
-
   return min;
 }
 
 void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
 {
-  NetworkConstantAction* action = nullptr;
-  ActionList* actionSet         = getRunningActionSet();
-  ActionList::iterator it(actionSet->begin());
-  ActionList::iterator itNext = it;
-  ActionList::iterator itend(actionSet->end());
-  for (; it != itend; it = itNext) {
-    ++itNext;
-    action = static_cast<NetworkConstantAction*>(&*it);
-    if (action->latency_ > 0) {
-      if (action->latency_ > delta) {
-        double_update(&(action->latency_), delta, sg_surf_precision);
+  for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
+    NetworkConstantAction& action = static_cast<NetworkConstantAction&>(*it);
+    ++it; // increment iterator here since the following calls to action.finish() may invalidate it
+    if (action.latency_ > 0) {
+      if (action.latency_ > delta) {
+        double_update(&action.latency_, delta, sg_surf_precision);
       } else {
-        action->latency_ = 0.0;
+        action.latency_ = 0.0;
       }
     }
-    action->updateRemains(action->getCost() * delta / action->initialLatency_);
-    if (action->getMaxDuration() != NO_MAX_DURATION)
-      action->updateMaxDuration(delta);
+    action.updateRemains(action.getCost() * delta / action.initialLatency_);
+    if (action.getMaxDuration() != NO_MAX_DURATION)
+      action.updateMaxDuration(delta);
 
-    if (((action->getRemainsNoUpdate() <= 0) ||
-         ((action->getMaxDuration() != NO_MAX_DURATION) && (action->getMaxDuration() <= 0)))) {
-      action->finish();
-      action->setState(Action::State::done);
+    if ((action.getRemainsNoUpdate() <= 0) ||
+        ((action.getMaxDuration() != NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+      action.finish(Action::State::done);
     }
   }
 }
index 61e36a5..108941c 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2013-2015. 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. */
@@ -30,7 +29,8 @@ namespace simgrid {
       double nextOccuringEvent(double now) override;
       void updateActionsState(double now, double delta) override;
 
-      LinkImpl* createLink(const char* name, double bw, double lat, e_surf_link_sharing_policy_t policy) override;
+      LinkImpl* createLink(const std::string& name, double bw, double lat,
+                           e_surf_link_sharing_policy_t policy) override;
     };
 
     /**********
index e3f1898..4752d1a 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
@@ -8,9 +8,9 @@
 
 #include "simgrid/sg_config.h"
 #include "src/surf/HostImpl.hpp"
-#include "src/surf/maxmin_private.hpp"
 #include "src/surf/network_ib.hpp"
 #include "src/surf/xml/platf.hpp"
+#include "surf/maxmin.hpp"
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 
@@ -22,13 +22,11 @@ static void IB_create_host_callback(simgrid::s4u::Host& host){
 
   static int id=0;
   // pour t->id -> rajouter une nouvelle struct dans le dict, pour stocker les comms actives
-  if(((NetworkIBModel*)surf_network_model)->active_nodes==nullptr)
-    ((NetworkIBModel*)surf_network_model)->active_nodes = xbt_dict_new_homogeneous(nullptr);
 
   IBNode* act = new IBNode(id);
 
   id++;
-  xbt_dict_set(((NetworkIBModel*)surf_network_model)->active_nodes, host.getCname(), act, nullptr);
+  ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.getName(), act});
 }
 
 static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* action)
@@ -51,12 +49,22 @@ static void IB_action_init_callback(simgrid::surf::NetworkAction* action, simgri
                                     simgrid::s4u::Host* dst)
 {
   simgrid::surf::NetworkIBModel* ibModel = (simgrid::surf::NetworkIBModel*)surf_network_model;
+  simgrid::surf::IBNode* act_src;
+  simgrid::surf::IBNode* act_dst;
+
+  auto asrc = ibModel->active_nodes.find(src->getName());
+  if (asrc != ibModel->active_nodes.end()) {
+    act_src = asrc->second;
+  } else {
+    throw std::out_of_range(std::string("Could not find '") + src->getCname() + "' active comms !");
+  }
 
-  simgrid::surf::IBNode* act_src = (simgrid::surf::IBNode*)xbt_dict_get_or_null(ibModel->active_nodes, src->getCname());
-  xbt_assert(act_src, "could not find src node active comms !");
-
-  simgrid::surf::IBNode* act_dst = (simgrid::surf::IBNode*)xbt_dict_get_or_null(ibModel->active_nodes, dst->getCname());
-  xbt_assert(act_dst, "could not find dst node active comms !");
+  auto adst = ibModel->active_nodes.find(dst->getName());
+  if (adst != ibModel->active_nodes.end()) {
+    act_dst = adst->second;
+  } else {
+    throw std::out_of_range(std::string("Could not find '") + dst->getCname() + "' active comms !");
+  }
 
   ibModel->active_comms[action]=std::make_pair(act_src, act_dst);
 
@@ -92,142 +100,142 @@ void surf_network_model_init_IB()
 }
 
 namespace simgrid {
-  namespace surf {
-
-    NetworkIBModel::NetworkIBModel()
-    : NetworkSmpiModel() {
-      haveGap_=false;
-      active_nodes=nullptr;
-
-      const char* IB_factors_string=xbt_cfg_get_string("smpi/IB-penalty-factors");
-      std::vector<std::string> radical_elements;
-      boost::split(radical_elements, IB_factors_string, boost::is_any_of(";"));
-
-      surf_parse_assert(radical_elements.size() == 3, "smpi/IB-penalty-factors should be provided and contain 3 "
-                                                      "elements, semi-colon separated. Example: 0.965;0.925;1.35");
-
-      Be = xbt_str_parse_double(radical_elements.front().c_str(),
-                                "First part of smpi/IB-penalty-factors is not numerical: %s");
-      Bs = xbt_str_parse_double((radical_elements.at(1)).c_str(),
-                                "Second part of smpi/IB-penalty-factors is not numerical: %s");
-      ys = xbt_str_parse_double(radical_elements.back().c_str(),
-                                "Third part of smpi/IB-penalty-factors is not numerical: %s");
-    }
+namespace surf {
 
-    NetworkIBModel::~NetworkIBModel()
-    {
-      xbt_dict_cursor_t cursor = nullptr;
-      IBNode* instance = nullptr;
-      char *name = nullptr;
-      xbt_dict_foreach(active_nodes, cursor, name, instance)
-      delete instance;
-      xbt_dict_free(&active_nodes);
-    }
+NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
+{
+  std::string IB_factors_string = xbt_cfg_get_string("smpi/IB-penalty-factors");
+  std::vector<std::string> radical_elements;
+  boost::split(radical_elements, IB_factors_string, boost::is_any_of(";"));
 
-    void NetworkIBModel::computeIBfactors(IBNode *root) {
-      double num_comm_out = (double) root->ActiveCommsUp.size();
-      double max_penalty_out=0.0;
-      //first, compute all outbound penalties to get their max
-      for (std::vector<ActiveComm*>::iterator it= root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
-        double my_penalty_out = 1.0;
-
-        if(num_comm_out!=1){
-          if((*it)->destination->nbActiveCommsDown > 2)//number of comms sent to the receiving node
-            my_penalty_out = num_comm_out * Bs * ys;
-          else
-            my_penalty_out = num_comm_out * Bs;
-        }
-
-        max_penalty_out = std::max(max_penalty_out,my_penalty_out);
-      }
+  surf_parse_assert(radical_elements.size() == 3, "smpi/IB-penalty-factors should be provided and contain 3 "
+                                                  "elements, semi-colon separated. Example: 0.965;0.925;1.35");
 
-      for (std::vector<ActiveComm*>::iterator it= root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
+  try {
+    Be = std::stod(radical_elements.front());
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("First part of smpi/IB-penalty-factors is not numerical:") + ia.what());
+  }
 
-        //compute inbound penalty
-        double my_penalty_in = 1.0;
-        int nb_comms = (*it)->destination->nbActiveCommsDown;//total number of incoming comms
-        if(nb_comms!=1)
-          my_penalty_in = ((*it)->destination->ActiveCommsDown)[root] //number of comm sent to dest by root node
-                                                                * Be
-                                                                * (*it)->destination->ActiveCommsDown.size();//number of different nodes sending to dest
+  try {
+    Bs = std::stod(radical_elements.at(1));
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Second part of smpi/IB-penalty-factors is not numerical:") + ia.what());
+  }
 
-        double penalty = std::max(my_penalty_in,max_penalty_out);
+  try {
+    ys = std::stod(radical_elements.back());
+  } catch (std::invalid_argument& ia) {
+    throw std::invalid_argument(std::string("Third part of smpi/IB-penalty-factors is not numerical:") + ia.what());
+  }
+}
 
-        double rate_before_update = (*it)->action->getBound();
-        //save initial rate of the action
-        if((*it)->init_rate==-1)
-          (*it)->init_rate= rate_before_update;
+NetworkIBModel::~NetworkIBModel()
+{
+  for (auto const& instance : active_nodes)
+    delete instance.second;
+}
 
-        double penalized_bw = num_comm_out ? (*it)->init_rate / penalty : (*it)->init_rate;
+void NetworkIBModel::computeIBfactors(IBNode* root)
+{
+  double num_comm_out    = static_cast<double>(root->ActiveCommsUp.size());
+  double max_penalty_out = 0.0;
+  // first, compute all outbound penalties to get their max
+  for (std::vector<ActiveComm*>::iterator it = root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
+    double my_penalty_out = 1.0;
+
+    if (num_comm_out != 1) {
+      if ((*it)->destination->nbActiveCommsDown > 2) // number of comms sent to the receiving node
+        my_penalty_out = num_comm_out * Bs * ys;
+      else
+        my_penalty_out = num_comm_out * Bs;
+    }
 
-        if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) {
-          XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id,(*it)->destination->id,(*it)->action,penalized_bw, (*it)->action->getBound(), (*it)->init_rate );
-          lmm_update_variable_bound(maxminSystem_, (*it)->action->getVariable(), penalized_bw);
-        }else{
-          XBT_DEBUG("%d->%d action %p penalty not updated : bw %f, initial rate %f", root->id,(*it)->destination->id,(*it)->action,penalized_bw, (*it)->init_rate );
-        }
+    max_penalty_out = std::max(max_penalty_out, my_penalty_out);
+  }
 
-      }
-      XBT_DEBUG("Finished computing IB penalties");
+  for (std::vector<ActiveComm*>::iterator it = root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
+    // compute inbound penalty
+    double my_penalty_in = 1.0;
+    int nb_comms         = (*it)->destination->nbActiveCommsDown; // total number of incoming comms
+    if (nb_comms != 1)
+      my_penalty_in = ((*it)->destination->ActiveCommsDown)[root]        // number of comm sent to dest by root node
+                      * Be * (*it)->destination->ActiveCommsDown.size(); // number of different nodes sending to dest
+
+    double penalty = std::max(my_penalty_in, max_penalty_out);
+
+    double rate_before_update = (*it)->action->getBound();
+    // save initial rate of the action
+    if ((*it)->init_rate == -1)
+      (*it)->init_rate = rate_before_update;
+
+    double penalized_bw = num_comm_out ? (*it)->init_rate / penalty : (*it)->init_rate;
+
+    if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) {
+      XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id,
+                (*it)->destination->id, (*it)->action, penalized_bw, (*it)->action->getBound(), (*it)->init_rate);
+      maxminSystem_->update_variable_bound((*it)->action->getVariable(), penalized_bw);
+    } else {
+      XBT_DEBUG("%d->%d action %p penalty not updated : bw %f, initial rate %f", root->id, (*it)->destination->id,
+                (*it)->action, penalized_bw, (*it)->init_rate);
     }
+  }
+  XBT_DEBUG("Finished computing IB penalties");
+}
 
-    void NetworkIBModel::updateIBfactors_rec(IBNode *root, bool* updatedlist) {
-      if(updatedlist[root->id]==0){
-        XBT_DEBUG("IB - Updating rec %d", root->id);
-        computeIBfactors(root);
-        updatedlist[root->id]=1;
-        for (std::vector<ActiveComm*>::iterator it= root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
-          if(updatedlist[(*it)->destination->id]!=1)
-            updateIBfactors_rec((*it)->destination, updatedlist);
-        }
-        for (std::map<IBNode*, int>::iterator it= root->ActiveCommsDown.begin(); it != root->ActiveCommsDown.end(); ++it) {
-          if(updatedlist[it->first->id]!=1)
-            updateIBfactors_rec(it->first, updatedlist);
-        }
-      }
+void NetworkIBModel::updateIBfactors_rec(IBNode* root, std::vector<bool>& updatedlist)
+{
+  if (not updatedlist[root->id]) {
+    XBT_DEBUG("IB - Updating rec %d", root->id);
+    computeIBfactors(root);
+    updatedlist[root->id] = true;
+    for (std::vector<ActiveComm*>::iterator it = root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
+      if (not updatedlist[(*it)->destination->id])
+        updateIBfactors_rec((*it)->destination, updatedlist);
+    }
+    for (std::map<IBNode*, int>::iterator it = root->ActiveCommsDown.begin(); it != root->ActiveCommsDown.end(); ++it) {
+      if (not updatedlist[it->first->id])
+        updateIBfactors_rec(it->first, updatedlist);
     }
+  }
+}
 
+void NetworkIBModel::updateIBfactors(NetworkAction* action, IBNode* from, IBNode* to, int remove)
+{
+  if (from == to) // disregard local comms (should use loopback)
+    return;
 
-    void NetworkIBModel::updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove) {
-      if (from == to)//disregard local comms (should use loopback)
-        return;
-
-      bool* updated=(bool*)xbt_malloc0(xbt_dict_size(active_nodes)*sizeof(bool));
-      ActiveComm* comm=nullptr;
-      if(remove){
-        if(to->ActiveCommsDown[from]==1)
-          to->ActiveCommsDown.erase(from);
-        else
-          to->ActiveCommsDown[from]-=1;
-
-        to->nbActiveCommsDown--;
-        for (std::vector<ActiveComm*>::iterator it= from->ActiveCommsUp.begin();
-            it != from->ActiveCommsUp.end(); ++it) {
-          if((*it)->action==action){
-            comm=(*it);
-            from->ActiveCommsUp.erase(it);
-            break;
-          }
-        }
-        action->unref();
-
-      }else{
-        action->ref();
-        ActiveComm* comm=new ActiveComm();
-        comm->action=action;
-        comm->destination=to;
-        from->ActiveCommsUp.push_back(comm);
-
-        to->ActiveCommsDown[from]+=1;
-        to->nbActiveCommsDown++;
+  ActiveComm* comm = nullptr;
+  if (remove) {
+    if (to->ActiveCommsDown[from] == 1)
+      to->ActiveCommsDown.erase(from);
+    else
+      to->ActiveCommsDown[from] -= 1;
+
+    to->nbActiveCommsDown--;
+    for (std::vector<ActiveComm*>::iterator it = from->ActiveCommsUp.begin(); it != from->ActiveCommsUp.end(); ++it) {
+      if ((*it)->action == action) {
+        comm = (*it);
+        from->ActiveCommsUp.erase(it);
+        break;
       }
-      XBT_DEBUG("IB - Updating %d", from->id);
-      updateIBfactors_rec(from, updated);
-      XBT_DEBUG("IB - Finished updating %d", from->id);
-      if(comm)
-        delete comm;
-      xbt_free(updated);
     }
-
+    action->unref();
+  } else {
+    action->ref();
+    ActiveComm* comm  = new ActiveComm();
+    comm->action      = action;
+    comm->destination = to;
+    from->ActiveCommsUp.push_back(comm);
+
+    to->ActiveCommsDown[from] += 1;
+    to->nbActiveCommsDown++;
   }
+  XBT_DEBUG("IB - Updating %d", from->id);
+  std::vector<bool> updated(active_nodes.size(), false);
+  updateIBfactors_rec(from, updated);
+  XBT_DEBUG("IB - Finished updating %d", from->id);
+  delete comm;
+}
+}
 }
index f132f83..df41a88 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,7 +10,8 @@
 #include "src/surf/network_smpi.hpp"
 #include "xbt/base.h"
 
-#include <map>
+#include <unordered_map>
+#include <vector>
 
 namespace simgrid {
   namespace surf {
@@ -42,7 +43,7 @@ namespace simgrid {
 
     class XBT_PRIVATE NetworkIBModel : public NetworkSmpiModel {
     private:
-      void updateIBfactors_rec(IBNode *root, bool* updatedlist);
+      void updateIBfactors_rec(IBNode* root, std::vector<bool>& updatedlist);
       void computeIBfactors(IBNode *root);
     public:
       NetworkIBModel();
@@ -50,8 +51,8 @@ namespace simgrid {
       ~NetworkIBModel() override;
       void updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove);
 
-      xbt_dict_t active_nodes;
-      std::map<NetworkAction *, std::pair<IBNode*,IBNode*> > active_comms;
+      std::unordered_map<std::string, IBNode*> active_nodes;
+      std::unordered_map<NetworkAction*, std::pair<IBNode*, IBNode*>> active_comms;
 
       double Bs;
       double Be;
index 81c55be..c52c443 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
@@ -20,23 +20,29 @@ namespace simgrid {
   /* List of links */
   std::unordered_map<std::string, LinkImpl*>* LinkImpl::links = new std::unordered_map<std::string, LinkImpl*>();
 
-  LinkImpl* LinkImpl::byName(const char* name)
+  LinkImpl* LinkImpl::byName(std::string name)
   {
-    if (links->find(name) == links->end())
-      return nullptr;
-    return links->at(name);
+    auto link = links->find(name);
+    return link == links->end() ? nullptr : link->second;
   }
   /** @brief Returns the amount of links in the platform */
   int LinkImpl::linksCount()
   {
     return links->size();
   }
+  void LinkImpl::linksList(std::vector<s4u::Link*>* linkList)
+  {
+    for (auto const& kv : *links) {
+      linkList->push_back(&kv.second->piface_);
+    }
+  }
+
   /** @brief Returns a list of all existing links */
   LinkImpl** LinkImpl::linksList()
   {
     LinkImpl** res = xbt_new(LinkImpl*, (int)links->size());
     int i          = 0;
-    for (auto kv : *links) {
+    for (auto const& kv : *links) {
       res[i] = kv.second;
       i++;
     }
@@ -45,7 +51,7 @@ namespace simgrid {
   /** @brief destructor of the static data */
   void LinkImpl::linksExit()
   {
-    for (auto kv : *links)
+    for (auto const& kv : *links)
       (kv.second)->destroy();
     delete links;
   }
@@ -63,8 +69,7 @@ namespace simgrid {
 
     NetworkModel::~NetworkModel()
     {
-      lmm_system_free(maxminSystem_);
-      xbt_heap_free(actionHeap_);
+      delete maxminSystem_;
       delete modifiedSet_;
     }
 
@@ -84,10 +89,10 @@ namespace simgrid {
     {
       double minRes = Model::nextOccuringEventFull(now);
 
-      for(auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; it++) {
-        NetworkAction *action = static_cast<NetworkAction*>(&*it);
-        if (action->latency_ > 0)
-          minRes = (minRes < 0) ? action->latency_ : std::min(minRes, action->latency_);
+      for (Action const& action : *getRunningActionSet()) {
+        const NetworkAction& net_action = static_cast<const NetworkAction&>(action);
+        if (net_action.latency_ > 0)
+          minRes = (minRes < 0) ? net_action.latency_ : std::min(minRes, net_action.latency_);
       }
 
       XBT_DEBUG("Min of share resources %f", minRes);
@@ -99,19 +104,18 @@ namespace simgrid {
      * Resource *
      ************/
 
-    LinkImpl::LinkImpl(simgrid::surf::NetworkModel* model, const char* name, lmm_constraint_t constraint)
+    LinkImpl::LinkImpl(simgrid::surf::NetworkModel* model, const std::string& name, lmm_constraint_t constraint)
         : Resource(model, name, constraint), piface_(this)
     {
 
-      if (strcmp(name,"__loopback__"))
-        xbt_assert(not LinkImpl::byName(name), "Link '%s' declared several times in the platform.", name);
+      if (name != "__loopback__")
+        xbt_assert(not LinkImpl::byName(name), "Link '%s' declared several times in the platform.", name.c_str());
 
       latency_.scale   = 1;
       bandwidth_.scale = 1;
 
       links->insert({name, this});
-      XBT_DEBUG("Create link '%s'",name);
-
+      XBT_DEBUG("Create link '%s'", name.c_str());
     }
 
     /** @brief use destroy() instead of this destructor */
@@ -134,7 +138,7 @@ namespace simgrid {
 
     bool LinkImpl::isUsed()
     {
-      return lmm_constraint_used(model()->getMaxminSystem(), constraint());
+      return model()->getMaxminSystem()->constraint_used(constraint());
     }
 
     double LinkImpl::latency()
@@ -149,7 +153,7 @@ namespace simgrid {
 
     int LinkImpl::sharingPolicy()
     {
-      return lmm_constraint_sharing_policy(constraint());
+      return constraint()->get_sharing_policy();
     }
 
     void LinkImpl::turnOn()
@@ -168,17 +172,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);
     }
 
@@ -197,13 +201,12 @@ namespace simgrid {
     std::list<LinkImpl*> NetworkAction::links()
     {
       std::list<LinkImpl*> retlist;
-      lmm_system_t sys = getModel()->getMaxminSystem();
-      int llen         = lmm_get_number_of_cnst_from_var(sys, variable_);
+      int llen = getVariable()->get_number_of_constraint();
 
       for (int i = 0; i < llen; i++) {
         /* Beware of composite actions: ptasks put links and cpus together */
         // extra pb: we cannot dynamic_cast from void*...
-        Resource* resource = static_cast<Resource*>(lmm_constraint_id(lmm_get_cnst_from_var(sys, getVariable(), i)));
+        Resource* resource = static_cast<Resource*>(getVariable()->get_constraint(i)->get_id());
         LinkImpl* link     = dynamic_cast<LinkImpl*>(resource);
         if (link != nullptr)
           retlist.push_back(link);
index 59c93cc..e678a32 100644 (file)
@@ -9,6 +9,7 @@
 #include "simgrid/s4u/Link.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include "src/surf/surf_interface.hpp"
+#include "surf/maxmin.hpp"
 #include "xbt/base.h"
 #include <list>
 #include <unordered_map>
@@ -43,7 +44,7 @@ public:
    * @param latency The initial latency of the Link in seconds
    * @param policy The sharing policy of the Link
    */
-  virtual LinkImpl* createLink(const char* name, double bandwidth, double latency,
+  virtual LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                                e_surf_link_sharing_policy_t policy) = 0;
 
   /**
@@ -114,7 +115,7 @@ public:
  */
 class LinkImpl : public simgrid::surf::Resource, public simgrid::surf::PropertyHolder {
 protected:
-  LinkImpl(simgrid::surf::NetworkModel* model, const char* name, lmm_constraint_t constraint);
+  LinkImpl(simgrid::surf::NetworkModel* model, const std::string& name, lmm_constraint_t constraint);
   ~LinkImpl() override;
 
 public:
@@ -171,9 +172,10 @@ private:
   static std::unordered_map<std::string, LinkImpl*>* links;
 
 public:
-  static LinkImpl* byName(const char* name);
+  static LinkImpl* byName(std::string name);
   static int linksCount();
   static LinkImpl** linksList();
+  static void linksList(std::vector<s4u::Link*>* linkList);
   static void linksExit();
 };
 
@@ -208,10 +210,10 @@ public:
   void setState(simgrid::surf::Action::State state) override;
   virtual std::list<LinkImpl*> links();
 
-  double latency_;
-  double latCurrent_;
-  double weight_;
-  double rate_;
+  double latency_    = {};
+  double latCurrent_ = {};
+  double weight_     = {};
+  double rate_       = {};
 };
 }
 }
index b2e8eaf..7c30095 100644 (file)
@@ -3,17 +3,19 @@
 /* This program is 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_set>
 
 #include "xbt/config.hpp"
+#include "xbt/string.hpp"
 
 #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"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
 
-std::vector<char*> IPV4addr;
+std::vector<std::string> IPV4addr;
 
 /*****************
  * Crude globals *
  *****************/
 
-extern xbt_dict_t flowFromSock;
+extern std::map<std::string, SgFlow*> flowFromSock;
 
 static ns3::InternetStackHelper stack;
 static ns3::NodeContainer nodes;
@@ -54,50 +56,48 @@ NetPointNs3::NetPointNs3()
  * Callbacks *
  *************/
 
-static void clusterCreation_cb(sg_platf_cluster_cbarg_t cluster)
+static void clusterCreation_cb(ClusterCreationArgs* cluster)
 {
-  for (int i : *cluster->radicals) {
+  for (int const& i : *cluster->radicals) {
     // Routers don't create a router on the other end of the private link by themselves.
     // We just need this router to be given an ID so we create a temporary NetPointNS3 so that it gets one
     NetPointNs3* host_dst = new NetPointNs3();
 
     // Create private link
-    char* host_id = bprintf("%s%d%s", cluster->prefix, i, cluster->suffix);
-    NetPointNs3* host_src = sg_host_by_name(host_id)->pimpl_netpoint->extension<NetPointNs3>();
-    xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id);
+    std::string host_id   = cluster->prefix + std::to_string(i) + cluster->suffix;
+    NetPointNs3* host_src = sg_host_by_name(host_id.c_str())->pimpl_netpoint->extension<NetPointNs3>();
+    xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id.c_str());
 
     // Any NS3 route is symmetrical
     ns3_add_link(host_src, host_dst, cluster->bw, cluster->lat);
 
     delete host_dst;
-    free(host_id);
   }
 
   //Create link backbone
-  ns3_add_cluster(cluster->id, cluster->bb_bw, cluster->bb_lat);
+  ns3_add_cluster(cluster->id.c_str(), cluster->bb_bw, cluster->bb_lat);
 }
 
 static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoint* src,
                              simgrid::kernel::routing::NetPoint* dst, simgrid::kernel::routing::NetPoint* gw_src,
                              simgrid::kernel::routing::NetPoint* gw_dst,
-                             std::vector<simgrid::surf::LinkImpl*>* link_list)
+                             std::vector<simgrid::surf::LinkImpl*>& link_list)
 {
-  if (link_list->size() == 1) {
-    simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list->at(0));
+  if (link_list.size() == 1) {
+    simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list[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 {
@@ -109,7 +109,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;
   }
 }
@@ -135,8 +135,8 @@ void surf_network_model_init_NS3()
   all_existing_models->push_back(surf_network_model);
 }
 
-static simgrid::config::Flag<std::string> ns3_tcp_model("ns3/TcpModel",
-    "The ns3 tcp model can be : NewReno or Reno or Tahoe", "NewReno");
+static simgrid::config::Flag<std::string>
+    ns3_tcp_model("ns3/TcpModel", "The ns3 tcp model can be : NewReno or Reno or Tahoe", "default");
 
 namespace simgrid {
 namespace surf {
@@ -148,25 +148,18 @@ 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);
   simgrid::s4u::NetZone::onRouteCreation.connect(&routeCreation_cb);
-
-  LogComponentEnable("PacketSink", ns3::LOG_LEVEL_INFO);
-  LogComponentEnable("UdpEchoClientApplication", ns3::LOG_LEVEL_INFO);
-  LogComponentEnable("UdpEchoServerApplication", ns3::LOG_LEVEL_INFO);
 }
 
 NetworkNS3Model::~NetworkNS3Model() {
-  for (auto addr : IPV4addr)
-    free(addr);
   IPV4addr.clear();
-  xbt_dict_free(&flowFromSock);
 }
 
-LinkImpl* NetworkNS3Model::createLink(const char* name, double bandwidth, double latency,
+LinkImpl* NetworkNS3Model::createLink(const std::string& name, double bandwidth, double latency,
                                       e_surf_link_sharing_policy_t policy)
 {
   return new LinkNS3(this, name, bandwidth, latency);
@@ -201,7 +194,7 @@ double NetworkNS3Model::nextOccuringEvent(double now)
 
 void NetworkNS3Model::updateActionsState(double now, double delta)
 {
-  static xbt_dynar_t socket_to_destroy = xbt_dynar_new(sizeof(char*),nullptr);
+  static std::vector<std::string> socket_to_destroy;
 
   /* If there are no running flows, advance the NS3 simulator and return */
   if (getRunningActionSet()->empty()) {
@@ -212,10 +205,10 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
     return;
   }
 
-  xbt_dict_cursor_t cursor = nullptr;
-  char *ns3Socket;
-  SgFlow *sgFlow;
-  xbt_dict_foreach(flowFromSock,cursor,ns3Socket,sgFlow){
+  std::string ns3Socket;
+  for (auto elm : flowFromSock) {
+    ns3Socket                 = elm.first;
+    SgFlow* sgFlow            = elm.second;
     NetworkNS3Action * action = sgFlow->action_;
     XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action);
     action->setRemains(action->getCost() - sgFlow->sentBytes_);
@@ -226,30 +219,30 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
 
       std::vector<LinkImpl*> route = std::vector<LinkImpl*>();
 
-      action->src_->routeTo(action->dst_, &route, nullptr);
-      for (auto link : route)
-        TRACE_surf_link_set_utilization(link->cname(), action->getCategory(), (data_delta_sent) / delta, now - delta,
+      action->src_->routeTo(action->dst_, route, nullptr);
+      for (auto const& link : route)
+        TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(), (data_delta_sent) / delta, now - delta,
                                         delta);
 
       action->lastSent_ = sgFlow->sentBytes_;
     }
 
     if(sgFlow->finished_){
-      xbt_dynar_push(socket_to_destroy,&ns3Socket);
+      socket_to_destroy.push_back(ns3Socket);
       XBT_DEBUG("Destroy socket %p of action %p", ns3Socket, action);
-      action->finish();
-      action->setState(Action::State::done);
+      action->finish(Action::State::done);
     }
   }
 
-  while (not xbt_dynar_is_empty(socket_to_destroy)) {
-    xbt_dynar_pop(socket_to_destroy,&ns3Socket);
-
+  while (not socket_to_destroy.empty()) {
+    ns3Socket = socket_to_destroy.back();
+    socket_to_destroy.pop_back();
+    SgFlow* flow = flowFromSock.at(ns3Socket);
     if (XBT_LOG_ISENABLED(ns3, xbt_log_priority_debug)) {
-      SgFlow *flow = (SgFlow*)xbt_dict_get (flowFromSock, ns3Socket);
       XBT_DEBUG ("Removing socket %p of action %p", ns3Socket, flow->action_);
     }
-    xbt_dict_remove(flowFromSock, ns3Socket);
+    delete flow;
+    flowFromSock.erase(ns3Socket);
   }
 }
 
@@ -257,7 +250,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
  * Resource *
  ************/
 
-LinkNS3::LinkNS3(NetworkNS3Model* model, const char* name, double bandwidth, double latency)
+LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency)
     : LinkImpl(model, name, nullptr)
 {
   bandwidth_.peak = bandwidth;
@@ -348,22 +341,22 @@ 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());
-  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());
+  std::string& addr = IPV4addr[node2];
+  xbt_assert(not addr.empty(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
+             dst->pimpl_netpoint->getCname());
 
-  XBT_DEBUG("ns3_create_flow %d Bytes from %d to %d with Interface %s",TotalBytes, node1, node2,addr);
+  XBT_DEBUG("ns3_create_flow %u Bytes from %u to %u with Interface %s", TotalBytes, node1, node2, addr.c_str());
   ns3::PacketSinkHelper sink("ns3::TcpSocketFactory", ns3::InetSocketAddress (ns3::Ipv4Address::GetAny(), port_number));
   sink.Install (dst_node);
 
   ns3::Ptr<ns3::Socket> sock = ns3::Socket::CreateSocket(src_node, ns3::TcpSocketFactory::GetTypeId());
 
-  xbt_dict_set(flowFromSock, transformSocketPtr(sock), new SgFlow(TotalBytes, action), nullptr);
+  flowFromSock.insert({transformSocketPtr(sock), new SgFlow(TotalBytes, action)});
 
   sock->Bind(ns3::InetSocketAddress(port_number));
 
-  ns3::Simulator::ScheduleNow(&StartFlow, sock, addr, port_number);
+  ns3::Simulator::ScheduleNow(&StartFlow, sock, addr.c_str(), port_number);
 
   port_number++;
   xbt_assert(port_number <= 65000, "Too many connections! Port number is saturated.");
@@ -407,11 +400,11 @@ void ns3_add_cluster(const char* id, double bw, double lat) {
 
   for (unsigned int i = number_of_clusters_nodes; i < Cluster_nodes.GetN(); i++) {
     Nodes.Add(Cluster_nodes.Get(i));
-    XBT_DEBUG("Add node %d to cluster",i);
+    XBT_DEBUG("Add node %u to cluster", i);
   }
   number_of_clusters_nodes = Cluster_nodes.GetN();
 
-  XBT_DEBUG("Add router %d to cluster",nodes.GetN()-Nodes.GetN()-1);
+  XBT_DEBUG("Add router %u to cluster", nodes.GetN() - Nodes.GetN() - 1);
   Nodes.Add(nodes.Get(nodes.GetN()-Nodes.GetN()-1));
 
   xbt_assert(Nodes.GetN() <= 65000, "Cluster with NS3 is limited to 65000 nodes");
@@ -421,11 +414,10 @@ void ns3_add_cluster(const char* id, double bw, double lat) {
   ns3::NetDeviceContainer devices = csma.Install(Nodes);
   XBT_DEBUG("Create CSMA");
 
-  char * adr = bprintf("%d.%d.0.0",number_of_networks,number_of_links);
-  XBT_DEBUG("Assign IP Addresses %s to CSMA.",adr);
+  std::string addr = simgrid::xbt::string_printf("%d.%d.0.0", number_of_networks, number_of_links);
+  XBT_DEBUG("Assign IP Addresses %s to CSMA.", addr.c_str());
   ns3::Ipv4AddressHelper ipv4;
-  ipv4.SetBase (adr, "255.255.0.0");
-  free(adr);
+  ipv4.SetBase(addr.c_str(), "255.255.0.0");
   interfaces.Add(ipv4.Assign (devices));
 
   if(number_of_links == 255){
@@ -435,14 +427,14 @@ void ns3_add_cluster(const char* id, double bw, double lat) {
   }else{
     number_of_links++;
   }
-  XBT_DEBUG("Number of nodes in Cluster_nodes: %d",Cluster_nodes.GetN());
+  XBT_DEBUG("Number of nodes in Cluster_nodes: %u", Cluster_nodes.GetN());
 }
 
-static char* transformIpv4Address (ns3::Ipv4Address from){
+static std::string transformIpv4Address(ns3::Ipv4Address from)
+{
   std::stringstream sstream;
   sstream << from ;
-  std::string s = sstream.str();
-  return bprintf("%s",s.c_str());
+  return sstream.str();
 }
 
 void ns3_add_link(NetPointNs3* src, NetPointNs3* dst, double bw, double lat) {
@@ -460,28 +452,26 @@ void ns3_add_link(NetPointNs3* src, NetPointNs3* dst, double bw, double lat) {
   pointToPoint.SetDeviceAttribute("DataRate", ns3::DataRateValue(ns3::DataRate(bw*8)));// NS3 takes bps, but we provide Bps
   pointToPoint.SetChannelAttribute("Delay", ns3::TimeValue(ns3::Seconds(lat)));
 
-  char *filename = bprintf("link-%d-%d.tr", srcNum, dstNum);
+  std::string filename = simgrid::xbt::string_printf("link-%d-%d.tr", srcNum, dstNum);
   ns3::AsciiTraceHelper ascii;
-  pointToPoint.EnableAsciiAll (ascii.CreateFileStream (filename));
+  pointToPoint.EnableAsciiAll(ascii.CreateFileStream(filename));
   pointToPoint.EnablePcapAll ("tcp-bulk-send", false);
-  xbt_free(filename);
 
   ns3::NetDeviceContainer netA;
   netA.Add(pointToPoint.Install (a, b));
 
-  char * adr = bprintf("%d.%d.0.0",number_of_networks,number_of_links);
-  address.SetBase (adr, "255.255.0.0");
-  XBT_DEBUG("\tInterface stack '%s'",adr);
-  free(adr);
+  std::string addr = simgrid::xbt::string_printf("%d.%d.0.0", number_of_networks, number_of_links);
+  address.SetBase(addr.c_str(), "255.255.0.0");
+  XBT_DEBUG("\tInterface stack '%s'", addr.c_str());
   interfaces.Add(address.Assign (netA));
 
   if (IPV4addr.size() <= (unsigned)srcNum)
-    IPV4addr.resize(srcNum + 1, nullptr);
-  IPV4addr.at(srcNum) = transformIpv4Address(interfaces.GetAddress(interfaces.GetN() - 2));
+    IPV4addr.resize(srcNum + 1);
+  IPV4addr[srcNum] = transformIpv4Address(interfaces.GetAddress(interfaces.GetN() - 2));
 
   if (IPV4addr.size() <= (unsigned)dstNum)
-    IPV4addr.resize(dstNum + 1, nullptr);
-  IPV4addr.at(dstNum) = transformIpv4Address(interfaces.GetAddress(interfaces.GetN() - 1));
+    IPV4addr.resize(dstNum + 1);
+  IPV4addr[dstNum] = transformIpv4Address(interfaces.GetAddress(interfaces.GetN() - 1));
 
   if (number_of_links == 255){
     xbt_assert(number_of_networks < 255, "Number of links and networks exceed 255*255");
index d7ff3ce..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 {
@@ -18,11 +18,11 @@ class NetworkNS3Model : public NetworkModel {
 public:
   NetworkNS3Model();
   ~NetworkNS3Model();
-  LinkImpl* createLink(const char* name, double bandwidth, double latency,
+  LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;
   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
   double nextOccuringEvent(double now) override;
-  bool nextOccuringEventIsIdempotent() {return false;}
+  bool nextOccuringEventIsIdempotent() override { return false; }
   void updateActionsState(double now, double delta) override;
 };
 
@@ -31,7 +31,7 @@ public:
  ************/
 class LinkNS3 : public LinkImpl {
 public:
-  explicit LinkNS3(NetworkNS3Model* model, const char* name, double bandwidth, double latency);
+  explicit LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency);
   ~LinkNS3();
 
   void apply_event(tmgr_trace_event_t event, double value) override;
@@ -48,7 +48,7 @@ class XBT_PRIVATE NetworkNS3Action : public NetworkAction {
 public:
   NetworkNS3Action(Model* model, double cost, s4u::Host* src, s4u::Host* dst);
 
-  bool isSuspended();
+  bool isSuspended() override;
   int unref() override;
   void suspend() override;
   void resume() override;
index 411a467..47b0d16 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
 
 #include "network_smpi.hpp"
 #include "simgrid/sg_config.h"
-#include "smpi/smpi_utils.hpp"
+#include "smpi_utils.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 std::vector<s_smpi_factor_t> smpi_bw_factor;
 std::vector<s_smpi_factor_t> smpi_lat_factor;
 
-xbt_dict_t gap_lookup = nullptr;
-
 /*********
  * Model *
  *********/
@@ -42,73 +40,65 @@ void surf_network_model_init_SMPI()
   surf_network_model = new simgrid::surf::NetworkSmpiModel();
   all_existing_models->push_back(surf_network_model);
 
-  xbt_cfg_setdefault_double("network/sender-gap", 10e-6);
   xbt_cfg_setdefault_double("network/weight-S", 8775);
 }
 
 namespace simgrid {
-  namespace surf {
-
-  NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
-  {
-    haveGap_ = true;
-    }
-
-    NetworkSmpiModel::~NetworkSmpiModel()
-    {
-      xbt_dict_free(&gap_lookup);
-    }
-
-    double NetworkSmpiModel::bandwidthFactor(double size)
-    {
-      if (smpi_bw_factor.empty())
-        smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw-factor"));
-
-      double current = 1.0;
-      for (const auto& fact : smpi_bw_factor) {
-        if (size <= fact.factor) {
-          XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
-          return current;
-        } else
-          current = fact.values.front();
-      }
-      XBT_DEBUG("%f > %zu return %f", size, smpi_bw_factor.back().factor, current);
+namespace surf {
 
-      return current;
-    }
-
-    double NetworkSmpiModel::latencyFactor(double size)
-    {
-      if (smpi_lat_factor.empty())
-        smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
-
-      double current=1.0;
-      for (const auto& fact : smpi_lat_factor) {
-        if (size <= fact.factor) {
-          XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
-          return current;
-        }else
-          current=fact.values.front();
-      }
-      XBT_DEBUG("%f > %zu return %f", size, smpi_lat_factor.back().factor, current);
+NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
+{
+}
+
+NetworkSmpiModel::~NetworkSmpiModel() = default;
 
+double NetworkSmpiModel::bandwidthFactor(double size)
+{
+  if (smpi_bw_factor.empty())
+    smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw-factor"));
+
+  double current = 1.0;
+  for (auto const& fact : smpi_bw_factor) {
+    if (size <= fact.factor) {
+      XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
       return current;
-    }
+    } else
+      current = fact.values.front();
+  }
+  XBT_DEBUG("%f > %zu return %f", size, smpi_bw_factor.back().factor, current);
+
+  return current;
+}
 
-    double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
-    {
-      return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
-    }
+double NetworkSmpiModel::latencyFactor(double size)
+{
+  if (smpi_lat_factor.empty())
+    smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
 
-    /************
-     * Resource *
-     ************/
+  double current = 1.0;
+  for (auto const& fact : smpi_lat_factor) {
+    if (size <= fact.factor) {
+      XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
+      return current;
+    } else
+      current = fact.values.front();
+  }
+  XBT_DEBUG("%f > %zu return %f", size, smpi_lat_factor.back().factor, current);
 
+  return current;
+}
 
+double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
+{
+  return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
+}
 
-    /**********
    * Action *
    **********/
+/************
* Resource *
************/
 
-  }
+/**********
+ * Action *
+ **********/
+}
 }
index 7a2f4db..8a91cb8 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
@@ -16,11 +16,9 @@ namespace simgrid {
       NetworkSmpiModel();
       ~NetworkSmpiModel();
 
-      using NetworkCm02Model::gapAppend; // Explicit about overloaded method (silence Woverloaded-virtual from clang)
       double latencyFactor(double size);
       double bandwidthFactor(double size);
       double bandwidthConstraint(double rate, double bound, double size);
-      void communicateCallBack() {};
     };
   }
 }
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 76%
rename from src/surf/ns3/ns3_simulator.cc
rename to src/surf/ns3/ns3_simulator.cpp
index b27b852..f41d1e8 100644 (file)
@@ -3,16 +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 "src/surf/ns3/ns3_simulator.h"
-#include "xbt/dict.h"
+#include "src/surf/ns3/ns3_simulator.hpp"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
 
 #include <algorithm>
 
-xbt_dict_t flowFromSock = xbt_dict_new_homogeneous([](void *p) {
-  delete (SgFlow*)p;
-}); // ns3::sock -> SgFlow
+std::map<std::string, SgFlow*> flowFromSock; // ns3::sock -> SgFlow
 
 static void receive_callback(ns3::Ptr<ns3::Socket> socket);
 static void datasent_callback(ns3::Ptr<ns3::Socket> socket, uint32_t dataSent);
@@ -28,7 +25,8 @@ SgFlow::SgFlow(uint32_t totalBytes, simgrid::surf::NetworkNS3Action* action)
 
 static SgFlow* getFlowFromSocket(ns3::Ptr<ns3::Socket> socket)
 {
-  return (SgFlow*)xbt_dict_get_or_null(flowFromSock, transformSocketPtr(socket));
+  auto it = flowFromSock.find(transformSocketPtr(socket));
+  return (it == flowFromSock.end()) ? nullptr : it->second;
 }
 
 static void receive_callback(ns3::Ptr<ns3::Socket> socket)
@@ -37,7 +35,7 @@ static void receive_callback(ns3::Ptr<ns3::Socket> socket)
 
   if (flow->finished_ == false) {
     flow->finished_ = true;
-    XBT_DEBUG("recv_cb of F[%p, %p, %d]", flow, flow->action_, flow->totalBytes_);
+    XBT_DEBUG("recv_cb of F[%p, %p, %u]", flow, flow->action_, flow->totalBytes_);
     XBT_DEBUG("Stop simulator at %f seconds", ns3::Simulator::Now().GetSeconds());
     ns3::Simulator::Stop(ns3::Seconds(0.0));
     ns3::Simulator::Run();
@@ -57,14 +55,14 @@ 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;
     flow->remaining_ -= amountSent;
 
-    XBT_DEBUG("%f: sent %d bytes over flow %p (still %d to go)",
-        ns3::Simulator::Now().GetSeconds(), amountSent, flow, flow->remaining_);
+    XBT_DEBUG("%f: sent %d bytes over flow %p (still %u to go)", ns3::Simulator::Now().GetSeconds(), amountSent, flow,
+              flow->remaining_);
   }
 
   if (flow->bufferedBytes_ >= flow->totalBytes_)
@@ -76,34 +74,34 @@ static void datasent_callback(ns3::Ptr<ns3::Socket> socket, uint32_t dataSent)
   /* The tracing wants to know */
   SgFlow* flow = getFlowFromSocket(socket);
   flow->sentBytes_ += dataSent;
-  XBT_DEBUG("datasent_cb of F[%p, %p, %d] %d sent (%d total)",
-      flow, flow->action_, flow->totalBytes_, dataSent, flow->sentBytes_);
+  XBT_DEBUG("datasent_cb of F[%p, %p, %u] %u sent (%u total)", flow, flow->action_, flow->totalBytes_, dataSent,
+            flow->sentBytes_);
 }
 
 static void normalClose_callback(ns3::Ptr<ns3::Socket> socket)
 {
   SgFlow* flow = getFlowFromSocket(socket);
-  XBT_DEBUG("normalClose_cb of F[%p, %p, %d]", flow, flow->action_, flow->totalBytes_);
+  XBT_DEBUG("normalClose_cb of F[%p, %p, %u]", flow, flow->action_, flow->totalBytes_);
   receive_callback(socket);
 }
 
 static void errorClose_callback(ns3::Ptr<ns3::Socket> socket)
 {
   SgFlow* flow = getFlowFromSocket(socket);
-  XBT_DEBUG("errorClose_cb of F[%p, %p, %d]", flow, flow->action_, flow->totalBytes_);
+  XBT_DEBUG("errorClose_cb of F[%p, %p, %u]", flow, flow->action_, flow->totalBytes_);
   xbt_die("NS3: a socket was closed anormally");
 }
 
 static void succeededConnect_callback(ns3::Ptr<ns3::Socket> socket)
 {
   SgFlow* flow = getFlowFromSocket(socket);
-  XBT_DEBUG("succeededConnect_cb of F[%p, %p, %d]", flow, flow->action_, flow->totalBytes_);
+  XBT_DEBUG("succeededConnect_cb of F[%p, %p, %u]", flow, flow->action_, flow->totalBytes_);
 }
 
 static void failedConnect_callback(ns3::Ptr<ns3::Socket> socket)
 {
   SgFlow* mysocket = getFlowFromSocket(socket);
-  XBT_DEBUG("failedConnect_cb of F[%p, %p, %d]", mysocket, mysocket->action_, mysocket->totalBytes_);
+  XBT_DEBUG("failedConnect_cb of F[%p, %p, %u]", mysocket, mysocket->action_, mysocket->totalBytes_);
   xbt_die("NS3: a socket failed to connect");
 }
 
@@ -115,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, %d] dest=%s port=%d", flow, flow->action_, flow->totalBytes_, to, port_number);
+  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 80%
rename from src/surf/ns3/ns3_simulator.h
rename to src/surf/ns3/ns3_simulator.hpp
index c69c1a8..743f003 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>
@@ -18,7 +18,7 @@
 #include <ns3/point-to-point-helper.h>
 #include <ns3/tcp-socket-factory.h>
 
-class SgFlow {
+class XBT_PRIVATE SgFlow {
 public:
   SgFlow(uint32_t totalBytes, simgrid::surf::NetworkNS3Action* action);
 
@@ -33,14 +33,11 @@ public:
 
 void StartFlow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number);
 
-static inline const char* transformSocketPtr(ns3::Ptr<ns3::Socket> localSocket)
+static inline std::string transformSocketPtr(ns3::Ptr<ns3::Socket> localSocket)
 {
-  static char key[24];
   std::stringstream sstream;
   sstream << localSocket;
-  snprintf(key, 24, "%s", sstream.str().c_str());
-
-  return key;
+  return sstream.str();
 }
 
 #endif
index 0436ec2..21853c6 100644 (file)
 
 /** @addtogroup plugin_energy
 
-
-This is the energy plugin, enabling to account not only for computation time,
-but also for the dissipated energy in the simulated platform.
-To activate this plugin, first call sg_host_energy_plugin_init() before your #MSG_init(),
-and then use MSG_host_get_consumed_energy() to retrieve the consumption of a given host.
-
-When the host is on, this energy consumption naturally depends on both the
-current CPU load and the host energy profile. According to our measurements,
-the consumption is somehow linear in the amount of cores at full speed,
-with an abnormality when all the cores are idle. The full details are in
+This is the energy plugin, enabling to account not only for computation time, but also for the dissipated energy in the
+simulated platform.
+To activate this plugin, first call sg_host_energy_plugin_init() before your #MSG_init(), and then use
+MSG_host_get_consumed_energy() to retrieve the consumption of a given host.
+
+When the host is on, this energy consumption naturally depends on both the current CPU load and the host energy profile.
+According to our measurements, the consumption is somehow linear in the amount of cores at full speed, with an
+abnormality when all the cores are idle. The full details are in
 <a href="https://hal.inria.fr/hal-01523608">our scientific paper</a> on that topic.
 
 As a result, our energy model takes 4 parameters:
@@ -61,15 +59,14 @@ This is enough to compute the consumption as a function of the amount of loaded
 
 ### What if a given core is only at load 50%?
 
-This is impossible in SimGrid because we recompute everything each time
-that the CPU starts or stops doing something. So if a core is at load 50% over
-a period, it means that it is at load 100% half of the time and at load 0% the
-rest of the time, and our model holds.
+This is impossible in SimGrid because we recompute everything each time that the CPU starts or stops doing something.
+So if a core is at load 50% over a period, it means that it is at load 100% half of the time and at load 0% the rest of
+the time, and our model holds.
 
 ### What if the host has only one core?
 
 In this case, the parameters \b OneCore and \b AllCores are obviously the same.
-Actually, SimGrid expect an energetic profile formated as 'Idle:Running' for mono-cores hosts.
+Actually, SimGrid expect an energetic profile formatted as 'Idle:Running' for mono-cores hosts.
 If you insist on passing 3 parameters in this case, then you must have the same value for \b OneCore and \b AllCores.
 
 \code{.xml}
@@ -81,8 +78,7 @@ If you insist on passing 3 parameters in this case, then you must have the same
 
 ### How does DVFS interact with the host energy model?
 
-If your host has several DVFS levels (several pstates), then you should
-give the energetic profile of each pstate level:
+If your host has several DVFS levels (several pstates), then you should give the energetic profile of each pstate level:
 
 \code{.xml}
 <host id="HostC" power="100.0Mf,50.0Mf,20.0Mf" cores="4">
@@ -104,20 +100,17 @@ To change the pstate of a given CPU, use the following functions:
 
 ### How accurate are these models?
 
-This model cannot be more accurate than your instantiation:
-with the default values, your result will not be accurate at all. You can still get
-accurate energy prediction, provided that you carefully instantiate the model.
-The first step is to ensure that your timing prediction match perfectly. But this
-is only the first step of the path, and you really want to read
-<a href="https://hal.inria.fr/hal-01523608">this paper</a> to see all what you need
-to do before you can get accurate energy predictions.
-
+This model cannot be more accurate than your instantiation: with the default values, your result will not be accurate at
+all. You can still get accurate energy prediction, provided that you carefully instantiate the model.
+The first step is to ensure that your timing prediction match perfectly. But this is only the first step of the path,
+and you really want to read <a href="https://hal.inria.fr/hal-01523608">this paper</a> to see all what you need to do
+before you can get accurate energy predictions.
  */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_energy, surf, "Logging specific to the SURF energy plugin");
 
 namespace simgrid {
-namespace energy {
+namespace plugin {
 
 class PowerRange {
 public:
@@ -147,9 +140,8 @@ private:
   std::vector<PowerRange>
       power_range_watts_list; /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
 
-  /* We need to keep track of what pstate has been used, as we will sometimes
-   * be notified only *after* a pstate has been used (but we need to update the energy consumption
-   * with the old pstate!)
+  /* We need to keep track of what pstate has been used, as we will sometimes be notified only *after* a pstate has been
+   * used (but we need to update the energy consumption with the old pstate!)
    */
   int pstate = 0;
   const int pstate_off = -1;
@@ -162,7 +154,7 @@ public:
 
 simgrid::xbt::Extension<simgrid::s4u::Host, HostEnergy> HostEnergy::EXTENSION_ID;
 
-/* Computes the consumption so far.  Called lazily on need. */
+/* Computes the consumption so far. Called lazily on need. */
 void HostEnergy::update()
 {
   double start_time  = this->last_updated;
@@ -182,7 +174,7 @@ void HostEnergy::update()
       // We consider that the machine is then fully loaded. That's arbitrary but it avoids a NaN
       cpu_load = 1;
     else
-      cpu_load = lmm_constraint_get_usage(host->pimpl_cpu->constraint()) / current_speed;
+      cpu_load = host->pimpl_cpu->constraint()->get_usage() / current_speed;
 
     /** Divide by the number of cores here **/
     cpu_load /= host->pimpl_cpu->coreCount();
@@ -208,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;
@@ -229,9 +221,12 @@ HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host(ptr), last_updated(surf_g
 
   const char* off_power_str = host->getProperty("watt_off");
   if (off_power_str != nullptr) {
-    char* msg       = bprintf("Invalid value for property watt_off of host %s: %%s", host->getCname());
-    this->watts_off = xbt_str_parse_double(off_power_str, msg);
-    xbt_free(msg);
+    try {
+      this->watts_off = std::stod(std::string(off_power_str));
+    } catch (std::invalid_argument& ia) {
+      throw std::invalid_argument(std::string("Invalid value for property watt_off of host ") + host->getCname() +
+                                  ": " + off_power_str);
+    }
   }
   /* watts_off is 0 by default */
 }
@@ -255,6 +250,14 @@ double HostEnergy::getCurrentWattsValue(double cpu_load)
 {
   xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->getCname());
 
+ /*
+  *    * Return watts_off if pstate == pstate_off
+  *       * this happens when host is off
+  */
+  if (this->pstate == pstate_off) {
+    return watts_off;
+  }
+
   /* min_power corresponds to the power consumed when only one core is active */
   /* max_power is the power consumed at 100% cpu load       */
   auto range           = power_range_watts_list.at(this->pstate);
@@ -315,7 +318,7 @@ void HostEnergy::initWattsRangeList()
   XBT_DEBUG("%s: profile: %s, cores: %d", host->getCname(), all_power_values_str, host->getCoreCount());
 
   int i = 0;
-  for (auto current_power_values_str : all_power_values) {
+  for (auto const& current_power_values_str : all_power_values) {
     /* retrieve the power values associated with the current pstate */
     std::vector<std::string> current_power_values;
     boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
@@ -330,7 +333,7 @@ void HostEnergy::initWattsRangeList()
       } else { // size == 3
         xbt_assert((current_power_values.at(1)) == (current_power_values.at(2)),
                    "Power properties incorrectly defined for host %s.\n"
-                   "The energy profile of mono-cores should be formated as 'Idle:FullSpeed' only.\n"
+                   "The energy profile of mono-cores should be formatted as 'Idle:FullSpeed' only.\n"
                    "If you go for a 'Idle:OneCore:AllCores' power profile on mono-cores, then OneCore and AllCores "
                    "must be equal.",
                    host->getCname());
@@ -360,7 +363,7 @@ void HostEnergy::initWattsRangeList()
 }
 }
 
-using simgrid::energy::HostEnergy;
+using simgrid::plugin::HostEnergy;
 
 /* **************************** events  callback *************************** */
 static void onCreation(simgrid::s4u::Host& host)
@@ -368,14 +371,14 @@ 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));
 }
 
 static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf::Action::State previous)
 {
-  for (simgrid::surf::Cpu* cpu : action->cpus()) {
+  for (simgrid::surf::Cpu* const& cpu : action->cpus()) {
     simgrid::s4u::Host* host = cpu->getHost();
     if (host != nullptr) {
 
@@ -437,7 +440,7 @@ static void onSimulationEnd()
 }
 
 /* **************************** Public interface *************************** */
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup plugin_energy
  * \brief Enable host energy plugin
@@ -469,7 +472,7 @@ void sg_host_energy_update_all()
   simgrid::simix::kernelImmediate([]() {
     std::vector<simgrid::s4u::Host*> list;
     simgrid::s4u::Engine::getInstance()->getHostList(&list);
-    for (auto host : list)
+    for (auto const& host : list)
       if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host) == nullptr) // Ignore virtual machines
         host->extension<HostEnergy>()->update();
   });
@@ -515,8 +518,7 @@ double sg_host_get_current_consumption(sg_host_t host)
 {
   xbt_assert(HostEnergy::EXTENSION_ID.valid(),
              "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
-  double cpu_load = lmm_constraint_get_usage(host->pimpl_cpu->constraint()) / host->getSpeed();
+  double cpu_load = host->pimpl_cpu->constraint()->get_usage() / host->getSpeed();
   return host->extension<HostEnergy>()->getCurrentWattsValue(cpu_load);
 }
-
-SG_END_DECL()
+}
index 71ccf35..71e8bf0 100644 (file)
@@ -54,7 +54,7 @@ HostLoad::HostLoad(simgrid::s4u::Host* ptr)
     : host(ptr)
     , last_updated(surf_get_clock())
     , last_reset(surf_get_clock())
-    , current_flops(lmm_constraint_get_usage(host->pimpl_cpu->constraint()))
+    , current_flops(host->pimpl_cpu->constraint()->get_usage())
 {
 }
 
@@ -66,7 +66,7 @@ void HostLoad::update()
   if (last_updated < now) {
     /* Current flop per second computed by the cpu; current_flops = k * pstate_speed_in_flops, k \in {0, 1, ..., cores}
      * number of active cores */
-    current_flops = lmm_constraint_get_usage(host->pimpl_cpu->constraint());
+    current_flops = host->pimpl_cpu->constraint()->get_usage();
 
     /* flops == pstate_speed * cores_being_currently_used */
     computed_flops += (now - last_updated) * current_flops;
@@ -106,13 +106,6 @@ void HostLoad::reset()
 using simgrid::plugin::HostLoad;
 
 /* **************************** events  callback *************************** */
-static void on_host_added(simgrid::s4u::Host& host)
-{
-  if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
-    return;
-  host.extension_set(new HostLoad(&host));
-}
-
 /* This callback is fired either when the host changes its state (on/off) or its speed
  * (because the user changed the pstate, or because of external trace events) */
 static void onHostChange(simgrid::s4u::Host& host)
@@ -120,14 +113,13 @@ static void onHostChange(simgrid::s4u::Host& host)
   if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
     return;
 
-  HostLoad* host_load = host.extension<HostLoad>();
-  host_load->update();
+  host.extension<HostLoad>()->update();
 }
 
 /* This callback is called when an action (computation, idle, ...) terminates */
-static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf::Action::State previous)
+static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf::Action::State /*previous*/)
 {
-  for (simgrid::surf::Cpu* cpu : action->cpus()) {
+  for (simgrid::surf::Cpu* const& cpu : action->cpus()) {
     simgrid::s4u::Host* host = cpu->getHost();
 
     if (host != nullptr) {
@@ -139,7 +131,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
@@ -152,7 +144,14 @@ void sg_host_load_plugin_init()
 
   HostLoad::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostLoad>();
 
-  simgrid::s4u::Host::onCreation.connect(&on_host_added);
+  /* When attaching a callback into a signal, you can use a lambda as follows, or a regular function as done below */
+
+  simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
+    if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
+      return;
+    host.extension_set(new HostLoad(&host));
+  });
+
   simgrid::surf::CpuAction::onStateChange.connect(&onActionStateChange);
   simgrid::s4u::Host::onStateChange.connect(&onHostChange);
   simgrid::s4u::Host::onSpeedChange.connect(&onHostChange);
@@ -185,5 +184,4 @@ void sg_host_load_reset(sg_host_t host)
 
   host->extension<HostLoad>()->reset();
 }
-
-SG_END_DECL()
+}
diff --git a/src/surf/plugins/link_energy.cpp b/src/surf/plugins/link_energy.cpp
new file mode 100644 (file)
index 0000000..f7bc8eb
--- /dev/null
@@ -0,0 +1,259 @@
+/* Copyright (c) 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/plugins/energy.h"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/simix.hpp"
+#include "src/surf/network_interface.hpp"
+#include <boost/algorithm/string/classification.hpp>
+#include <boost/algorithm/string/split.hpp>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
+
+/** @addtogroup SURF_plugin_energy
+
+
+ This is the energy plugin, enabling to account for the dissipated energy in the simulated platform.
+
+ The energy consumption of a link depends directly on its current traffic load. Specify that consumption in your
+ platform file as follows:
+
+ \verbatim
+ <link id="SWITCH1" bandwidth="125000000" latency="5E-5" sharing_policy="SHARED" >
+ <prop id="watts" value="100.0:200.0" />
+ <prop id="watt_off" value="10" />
+ </link>
+ \endverbatim
+
+ The first property means that when your link is switched on, but without anything to do, it will dissipate 100 Watts.
+ If it's fully loaded, it will dissipate 200 Watts. If its load is at 50%, then it will dissipate 150 Watts.
+ The second property means that when your host is turned off, it will dissipate only 10 Watts (please note that these
+ values are arbitrary).
+
+ To simulate the energy-related elements, first call the simgrid#energy#sg_link_energy_plugin_init() before your
+ #MSG_init(),
+ and then use the following function to retrieve the consumption of a given link: MSG_link_get_consumed_energy().
+ */
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(link_energy, surf, "Logging specific to the SURF LinkEnergy plugin");
+
+namespace simgrid {
+namespace plugin {
+
+class LinkPowerRange {
+public:
+  double idle;
+  double busy;
+
+  LinkPowerRange(double idle, double busy) : idle(idle), busy(busy) {}
+};
+
+class LinkEnergy {
+public:
+  static simgrid::xbt::Extension<simgrid::s4u::Link, LinkEnergy> EXTENSION_ID;
+
+  explicit LinkEnergy(simgrid::s4u::Link* ptr);
+  ~LinkEnergy();
+
+  double getALinkTotalPower();
+  void initWattsRangeList();
+  double getTotalEnergy();
+  void update();
+
+private:
+  double getPower();
+
+  simgrid::s4u::Link* link{};
+
+  std::vector<LinkPowerRange> power_range_watts_list{};
+
+  double total_energy{0.0};
+  double last_updated{0.0}; /*< Timestamp of the last energy update event*/
+};
+
+simgrid::xbt::Extension<simgrid::s4u::Link, LinkEnergy> LinkEnergy::EXTENSION_ID;
+
+LinkEnergy::LinkEnergy(simgrid::s4u::Link* ptr) : link(ptr), last_updated(surf_get_clock())
+{
+}
+
+LinkEnergy::~LinkEnergy() = default;
+
+void LinkEnergy::update()
+{
+  double power = getPower();
+  double now   = surf_get_clock();
+  total_energy += power * (now - last_updated);
+  last_updated = now;
+}
+
+void LinkEnergy::initWattsRangeList()
+{
+
+  if (!power_range_watts_list.empty())
+    return;
+
+  const char* all_power_values_str = this->link->getProperty("watt_range");
+
+  if (all_power_values_str == nullptr)
+    return;
+
+  std::vector<std::string> all_power_values;
+  boost::split(all_power_values, all_power_values_str, boost::is_any_of(","));
+
+  for (auto current_power_values_str : all_power_values) {
+    /* retrieve the power values associated */
+    std::vector<std::string> current_power_values;
+    boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
+    xbt_assert(current_power_values.size() == 2, "Power properties incorrectly defined - "
+                                                 "could not retrieve idle and busy power values for link %s",
+               this->link->getCname());
+
+    /* min_power corresponds to the idle power (link load = 0) */
+    /* max_power is the power consumed at 100% link load       */
+    char* idle = bprintf("Invalid idle power value for link%s", this->link->getCname());
+    char* busy = bprintf("Invalid busy power value for %s", this->link->getCname());
+
+    double idleVal = xbt_str_parse_double((current_power_values.at(0)).c_str(), idle);
+
+    double busyVal = xbt_str_parse_double((current_power_values.at(1)).c_str(), busy);
+
+    this->power_range_watts_list.push_back(LinkPowerRange(idleVal, busyVal));
+
+    xbt_free(idle);
+    xbt_free(busy);
+    update();
+  }
+}
+
+double LinkEnergy::getPower()
+{
+
+  if (power_range_watts_list.empty())
+    return 0.0;
+
+  auto range = power_range_watts_list[0];
+
+  double busy = range.busy;
+  double idle = range.idle;
+
+  double power_slope = busy - idle;
+
+  double normalized_link_usage = link->getUsage() / link->bandwidth();
+  double dynamic_power         = power_slope * normalized_link_usage;
+
+  return idle + dynamic_power;
+}
+
+double LinkEnergy::getTotalEnergy()
+{
+  update();
+  return this->total_energy;
+}
+}
+}
+
+using simgrid::plugin::LinkEnergy;
+
+/* **************************** events  callback *************************** */
+static void onCreation(simgrid::s4u::Link& link)
+{
+  XBT_DEBUG("onCreation is called for link: %s", link.getCname());
+  link.extension_set(new LinkEnergy(&link));
+}
+
+static void onCommunicate(simgrid::surf::NetworkAction* action, simgrid::s4u::Host* src, simgrid::s4u::Host* dst)
+{
+  XBT_DEBUG("onCommunicate is called");
+  for (simgrid::surf::LinkImpl* link : action->links()) {
+
+    if (link == nullptr)
+      continue;
+
+    XBT_DEBUG("Update link %s", link->getCname());
+    // Get the link_energy extension for the relevant link
+    LinkEnergy* link_energy = link->piface_.extension<LinkEnergy>();
+    link_energy->initWattsRangeList();
+    link_energy->update();
+  }
+}
+
+static void onActionStateChange(simgrid::surf::NetworkAction* action)
+{
+  XBT_DEBUG("onActionStateChange is called");
+  for (simgrid::surf::LinkImpl* link : action->links()) {
+
+    if (link == nullptr)
+      continue;
+
+    // Get the link_energy extension for the relevant link
+    LinkEnergy* link_energy = link->piface_.extension<LinkEnergy>();
+    link_energy->update();
+  }
+}
+
+static void onLinkStateChange(simgrid::s4u::Link& link)
+{
+  XBT_DEBUG("onLinkStateChange is called for link: %s", link.getCname());
+
+  LinkEnergy* link_energy = link.extension<LinkEnergy>();
+  link_energy->update();
+}
+
+static void onLinkDestruction(simgrid::s4u::Link& link)
+{
+  XBT_DEBUG("onLinkDestruction is called for link: %s", link.getCname());
+
+  LinkEnergy* link_energy = link.extension<LinkEnergy>();
+  link_energy->update();
+}
+
+static void computeAndDisplayTotalEnergy()
+{
+  std::vector<simgrid::s4u::Link*> link_list;
+  simgrid::s4u::Engine::getInstance()->getLinkList(&link_list);
+  double total_energy = 0.0; // Total dissipated energy (whole platform)
+  for (const auto link : link_list) {
+    LinkEnergy* link_energy = link->extension<LinkEnergy>();
+
+    double a_link_total_energy = link_energy->getTotalEnergy();
+    total_energy += a_link_total_energy;
+    const char* name = link->getCname();
+    if (strcmp(name, "__loopback__"))
+      XBT_INFO("Link '%s' total consumption: %f", name, a_link_total_energy);
+  }
+
+  XBT_INFO("Total energy over all links: %f", total_energy);
+}
+
+static void onSimulationEnd()
+{
+  computeAndDisplayTotalEnergy();
+}
+/* **************************** Public interface *************************** */
+SG_BEGIN_DECL()
+/** \ingroup SURF_plugin_energy
+ * \brief Enable energy plugin
+ * \details Enable energy plugin to get joules consumption of each cpu. You should call this function before
+ * #MSG_init().
+ */
+void sg_link_energy_plugin_init()
+{
+
+  if (LinkEnergy::EXTENSION_ID.valid())
+    return;
+  LinkEnergy::EXTENSION_ID = simgrid::s4u::Link::extension_create<LinkEnergy>();
+
+  simgrid::s4u::Link::onCreation.connect(&onCreation);
+  simgrid::s4u::Link::onStateChange.connect(&onLinkStateChange);
+  simgrid::s4u::Link::onDestruction.connect(&onLinkDestruction);
+  simgrid::s4u::Link::onCommunicationStateChange.connect(&onActionStateChange);
+  simgrid::s4u::Link::onCommunicate.connect(&onCommunicate);
+  simgrid::s4u::onSimulationEnd.connect(&onSimulationEnd);
+}
+
+SG_END_DECL()
index 24129d9..9da1734 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2010, 2013-2015. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@ namespace simgrid {
 namespace surf {
 
 HostL07Model::HostL07Model() : HostModel() {
-  maxminSystem_ = lmm_system_new(true /* lazy */);
+  maxminSystem_            = new s_lmm_system_t(true /* lazy */);
   maxminSystem_->solve_fun = &bottleneck_solve;
   surf_network_model = new NetworkL07Model(this,maxminSystem_);
   surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
@@ -42,7 +42,7 @@ HostL07Model::HostL07Model() : HostModel() {
 
 HostL07Model::~HostL07Model()
 {
-  lmm_system_free(maxminSystem_);
+  delete maxminSystem_;
   maxminSystem_ = nullptr;
   delete surf_network_model;
   delete surf_cpu_model_pm;
@@ -65,7 +65,7 @@ NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys)
   , hostModel_(hmodel)
 {
   maxminSystem_ = sys;
-  loopback_     = createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
+  loopback_     = NetworkL07Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
 }
 
 NetworkL07Model::~NetworkL07Model()
@@ -76,13 +76,11 @@ NetworkL07Model::~NetworkL07Model()
 double HostL07Model::nextOccuringEvent(double now)
 {
   double min = HostModel::nextOccuringEventFull(now);
-  ActionList::iterator it(getRunningActionSet()->begin());
-  ActionList::iterator itend(getRunningActionSet()->end());
-  for (; it != itend; ++it) {
-    L07Action *action = static_cast<L07Action*>(&*it);
-    if (action->latency_ > 0 && (min < 0 || action->latency_ < min)) {
-      min = action->latency_;
-      XBT_DEBUG("Updating min with %p (start %f): %f", action, action->getStartTime(), min);
+  for (Action const& action : *getRunningActionSet()) {
+    const L07Action& net_action = static_cast<const L07Action&>(action);
+    if (net_action.latency_ > 0 && (min < 0 || net_action.latency_ < min)) {
+      min = net_action.latency_;
+      XBT_DEBUG("Updating min with %p (start %f): %f", &net_action, net_action.getStartTime(), min);
     }
   }
   XBT_DEBUG("min value: %f", min);
@@ -90,36 +88,30 @@ double HostL07Model::nextOccuringEvent(double now)
   return min;
 }
 
-void HostL07Model::updateActionsState(double /*now*/, double delta) {
-
-  L07Action *action;
-  ActionList *actionSet = getRunningActionSet();
-  ActionList::iterator it(actionSet->begin());
-  ActionList::iterator itNext = it;
-  ActionList::iterator itend(actionSet->end());
-
-  for (; it != itend; it = itNext) {
-    ++itNext;
-    action = static_cast<L07Action*>(&*it);
-    if (action->latency_ > 0) {
-      if (action->latency_ > delta) {
-        double_update(&(action->latency_), delta, sg_surf_precision);
+void HostL07Model::updateActionsState(double /*now*/, double delta)
+{
+  for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
+    L07Action& action = static_cast<L07Action&>(*it);
+    ++it; // increment iterator here since the following calls to action.finish() may invalidate it
+    if (action.latency_ > 0) {
+      if (action.latency_ > delta) {
+        double_update(&(action.latency_), delta, sg_surf_precision);
       } else {
-        action->latency_ = 0.0;
+        action.latency_ = 0.0;
       }
-      if ((action->latency_ <= 0.0) && (action->isSuspended() == 0)) {
-        action->updateBound();
-        lmm_update_variable_weight(maxminSystem_, action->getVariable(), 1.0);
+      if ((action.latency_ <= 0.0) && (action.isSuspended() == 0)) {
+        action.updateBound();
+        maxminSystem_->update_variable_weight(action.getVariable(), 1.0);
       }
     }
-    XBT_DEBUG("Action (%p) : remains (%g) updated by %g.",
-           action, action->getRemains(), lmm_variable_getvalue(action->getVariable()) * delta);
-    action->updateRemains(lmm_variable_getvalue(action->getVariable()) * delta);
+    XBT_DEBUG("Action (%p) : remains (%g) updated by %g.", &action, action.getRemains(),
+              action.getVariable()->get_value() * delta);
+    action.updateRemains(action.getVariable()->get_value() * delta);
 
-    if (action->getMaxDuration() > NO_MAX_DURATION)
-      action->updateMaxDuration(delta);
+    if (action.getMaxDuration() > NO_MAX_DURATION)
+      action.updateMaxDuration(delta);
 
-    XBT_DEBUG("Action (%p) : remains (%g).", action, action->getRemains());
+    XBT_DEBUG("Action (%p) : remains (%g).", &action, action.getRemains());
 
     /* In the next if cascade, the action can be finished either because:
      *  - The amount of remaining work reached 0
@@ -127,24 +119,22 @@ void HostL07Model::updateActionsState(double /*now*/, double delta) {
      * If it's not done, it may have failed.
      */
 
-    if (((action->getRemains() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) ||
-        ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
-      action->finish();
-      action->setState(Action::State::done);
+    if (((action.getRemains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+      action.finish(Action::State::done);
     } else {
       /* Need to check that none of the model has failed */
       int i = 0;
-      lmm_constraint_t cnst = lmm_get_cnst_from_var(maxminSystem_, action->getVariable(), i);
+      lmm_constraint_t cnst = action.getVariable()->get_constraint(i);
       while (cnst != nullptr) {
         i++;
-        void *constraint_id = lmm_constraint_id(cnst);
+        void* constraint_id = cnst->get_id();
         if (static_cast<simgrid::surf::Resource*>(constraint_id)->isOff()) {
-          XBT_DEBUG("Action (%p) Failed!!", action);
-          action->finish();
-          action->setState(Action::State::failed);
+          XBT_DEBUG("Action (%p) Failed!!", &action);
+          action.finish(Action::State::failed);
           break;
         }
-        cnst = lmm_get_cnst_from_var(maxminSystem_, action->getVariable(), i);
+        cnst = action.getVariable()->get_constraint(i);
       }
     }
   }
@@ -184,11 +174,11 @@ L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
           double lat=0.0;
 
           std::vector<LinkImpl*> route;
-          hostList_->at(i)->routeTo(hostList_->at(j), &route, &lat);
-          latency = MAX(latency, lat);
+          hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
+          latency = std::max(latency, lat);
 
-          for (auto link : route)
-            affected_links.insert(link->cname());
+          for (auto const& link : route)
+            affected_links.insert(link->getCname());
         }
       }
     }
@@ -197,28 +187,26 @@ L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
   }
 
   XBT_DEBUG("Creating a parallel task (%p) with %d hosts and %d unique links.", this, host_nb, nb_link);
-  this->latency_ = latency;
+  latency_ = latency;
 
-  this->variable_ = lmm_variable_new(model->getMaxminSystem(), this, 1.0,
-      (rate > 0 ? rate : -1.0),
-      host_nb + nb_link);
+  setVariable(model->getMaxminSystem()->variable_new(this, 1.0, (rate > 0 ? rate : -1.0), host_nb + nb_link));
 
-  if (this->latency_ > 0)
-    lmm_update_variable_weight(model->getMaxminSystem(), this->getVariable(), 0.0);
+  if (latency_ > 0)
+    model->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
 
   for (int i = 0; i < host_nb; i++)
-    lmm_expand(model->getMaxminSystem(), host_list[i]->pimpl_cpu->constraint(), this->getVariable(), flops_amount[i]);
+    model->getMaxminSystem()->expand(host_list[i]->pimpl_cpu->constraint(), getVariable(), flops_amount[i]);
 
   if(bytes_amount != nullptr) {
     for (int i = 0; i < host_nb; i++) {
       for (int j = 0; j < host_nb; j++) {
         if (bytes_amount[i * host_nb + j] > 0.0) {
           std::vector<LinkImpl*> route;
-          hostList_->at(i)->routeTo(hostList_->at(j), &route, nullptr);
+          hostList_->at(i)->routeTo(hostList_->at(j), route, nullptr);
 
-          for (auto link : route)
-            lmm_expand_add(model->getMaxminSystem(), link->constraint(), this->getVariable(),
-                           bytes_amount[i * host_nb + j]);
+          for (auto const& link : route)
+            model->getMaxminSystem()->expand_add(link->constraint(), this->getVariable(),
+                                                 bytes_amount[i * host_nb + j]);
         }
       }
     }
@@ -228,14 +216,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;
@@ -249,7 +237,7 @@ Cpu *CpuL07Model::createCpu(simgrid::s4u::Host *host,  std::vector<double> *spee
   return new CpuL07(this, host, speedPerPstate, core);
 }
 
-LinkImpl* NetworkL07Model::createLink(const char* name, double bandwidth, double latency,
+LinkImpl* NetworkL07Model::createLink(const std::string& name, double bandwidth, double latency,
                                       e_surf_link_sharing_policy_t policy)
 {
   return new LinkL07(this, name, bandwidth, latency, policy);
@@ -260,30 +248,29 @@ LinkImpl* NetworkL07Model::createLink(const char* name, double bandwidth, double
  ************/
 
 CpuL07::CpuL07(CpuL07Model* model, simgrid::s4u::Host* host, std::vector<double>* speedPerPstate, int core)
-    : Cpu(model, host, lmm_constraint_new(model->getMaxminSystem(), this, speedPerPstate->front()), speedPerPstate,
-          core)
+    : Cpu(model, host, model->getMaxminSystem()->constraint_new(this, speedPerPstate->front()), speedPerPstate, core)
 {
 }
 
 CpuL07::~CpuL07()=default;
 
-LinkL07::LinkL07(NetworkL07Model* model, const char* name, double bandwidth, double latency,
+LinkL07::LinkL07(NetworkL07Model* model, const std::string& name, double bandwidth, double latency,
                  e_surf_link_sharing_policy_t policy)
-    : LinkImpl(model, name, lmm_constraint_new(model->getMaxminSystem(), this, bandwidth))
+    : LinkImpl(model, name, model->getMaxminSystem()->constraint_new(this, bandwidth))
 {
   bandwidth_.peak = bandwidth;
   latency_.peak   = latency;
 
   if (policy == SURF_LINK_FATPIPE)
-    lmm_constraint_shared(constraint());
+    constraint()->unshare();
 
   s4u::Link::onCreation(this->piface_);
 }
 
 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;
@@ -294,15 +281,15 @@ Action *CpuL07::execution_start(double size)
 Action *CpuL07::sleep(double duration)
 {
   L07Action *action = static_cast<L07Action*>(execution_start(1.0));
-  action->maxDuration_ = duration;
+  action->setMaxDuration(duration);
   action->suspended_ = 2;
-  lmm_update_variable_weight(model()->getMaxminSystem(), action->getVariable(), 0.0);
+  model()->getMaxminSystem()->update_variable_weight(action->getVariable(), 0.0);
 
   return action;
 }
 
 bool CpuL07::isUsed(){
-  return lmm_constraint_used(model()->getMaxminSystem(), constraint());
+  return model()->getMaxminSystem()->constraint_used(constraint());
 }
 
 /** @brief take into account changes of speed (either load or max) */
@@ -310,11 +297,11 @@ void CpuL07::onSpeedChange() {
   lmm_variable_t var = nullptr;
   lmm_element_t elem = nullptr;
 
-  lmm_update_constraint_bound(model()->getMaxminSystem(), constraint(), speed_.peak * speed_.scale);
-  while ((var = lmm_get_var_from_cnst(model()->getMaxminSystem(), constraint(), &elem))) {
-    Action* action = static_cast<Action*>(lmm_variable_id(var));
+  model()->getMaxminSystem()->update_constraint_bound(constraint(), speed_.peak * speed_.scale);
+  while ((var = constraint()->get_variable(&elem))) {
+    Action* action = static_cast<Action*>(var->get_id());
 
-    lmm_update_variable_bound(model()->getMaxminSystem(), action->getVariable(), speed_.scale * speed_.peak);
+    model()->getMaxminSystem()->update_variable_bound(action->getVariable(), speed_.scale * speed_.peak);
   }
 
   Cpu::onSpeedChange();
@@ -322,12 +309,12 @@ void CpuL07::onSpeedChange() {
 
 
 bool LinkL07::isUsed(){
-  return lmm_constraint_used(model()->getMaxminSystem(), constraint());
+  return model()->getMaxminSystem()->constraint_used(constraint());
 }
 
 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();
@@ -347,7 +334,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);
@@ -371,7 +358,7 @@ void LinkL07::apply_event(tmgr_trace_event_t triggered, double value)
 void LinkL07::setBandwidth(double value)
 {
   bandwidth_.peak = value;
-  lmm_update_constraint_bound(model()->getMaxminSystem(), constraint(), bandwidth_.peak * bandwidth_.scale);
+  model()->getMaxminSystem()->update_constraint_bound(constraint(), bandwidth_.peak * bandwidth_.scale);
 }
 
 void LinkL07::setLatency(double value)
@@ -381,8 +368,8 @@ void LinkL07::setLatency(double value)
   lmm_element_t elem = nullptr;
 
   latency_.peak = value;
-  while ((var = lmm_get_var_from_cnst(model()->getMaxminSystem(), constraint(), &elem))) {
-    action = static_cast<L07Action*>(lmm_variable_id(var));
+  while ((var = constraint()->get_variable(&elem))) {
+    action = static_cast<L07Action*>(var->get_id());
     action->updateBound();
   }
 }
@@ -394,8 +381,8 @@ LinkL07::~LinkL07() = default;
 
 L07Action::~L07Action(){
   delete hostList_;
-  free(communicationAmount_);
-  free(computationAmount_);
+  delete[] communicationAmount_;
+  delete[] computationAmount_;
 }
 
 void L07Action::updateBound()
@@ -411,9 +398,9 @@ void L07Action::updateBound()
         if (communicationAmount_[i * hostNb + j] > 0) {
           double lat = 0.0;
           std::vector<LinkImpl*> route;
-          hostList_->at(i)->routeTo(hostList_->at(j), &route, &lat);
+          hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
 
-          lat_current = MAX(lat_current, lat * communicationAmount_[i * hostNb + j]);
+          lat_current = std::max(lat_current, lat * communicationAmount_[i * hostNb + j]);
         }
       }
     }
@@ -422,9 +409,9 @@ void L07Action::updateBound()
   XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
   if ((latency_ <= 0.0) && (suspended_ == 0)) {
     if (rate_ < 0)
-      lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), lat_bound);
+      getModel()->getMaxminSystem()->update_variable_bound(getVariable(), lat_bound);
     else
-      lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), std::min(rate_, lat_bound));
+      getModel()->getMaxminSystem()->update_variable_bound(getVariable(), std::min(rate_, lat_bound));
   }
 }
 
@@ -435,7 +422,7 @@ int L07Action::unref()
     if (action_hook.is_linked())
       stateSet_->erase(stateSet_->iterator_to(*this));
     if (getVariable())
-      lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
+      getModel()->getMaxminSystem()->variable_free(getVariable());
     delete this;
     return 1;
   }
index 5d25d4e..3b944a3 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
@@ -58,7 +58,7 @@ class NetworkL07Model : public NetworkModel {
 public:
   NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys);
   ~NetworkL07Model();
-  LinkImpl* createLink(const char* name, double bandwidth, double latency,
+  LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;
 
   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
@@ -84,7 +84,7 @@ protected:
 
 class LinkL07 : public LinkImpl {
 public:
-  LinkL07(NetworkL07Model* model, const char* name, double bandwidth, double latency,
+  LinkL07(NetworkL07Model* model, const std::string& name, double bandwidth, double latency,
           e_surf_link_sharing_policy_t policy);
   ~LinkL07() override;
   bool isUsed() override;
index 663f8c8..81a15d0 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"
 
@@ -35,8 +35,7 @@ XBT_PRIVATE std::vector<std::string> known_storages;
 namespace simgrid {
 namespace surf {
 
-simgrid::xbt::signal<void(sg_platf_cluster_cbarg_t)> on_cluster;
-
+simgrid::xbt::signal<void(ClusterCreationArgs*)> on_cluster;
 }
 }
 
@@ -48,7 +47,7 @@ extern std::map<std::string, simgrid::s4u::Host*> host_list;
 }
 
 static int surf_parse_models_setup_already_called = 0;
-std::map<std::string, storage_type_t> storage_types;
+std::map<std::string, simgrid::surf::StorageType*> storage_types;
 
 /** The current AS in the parsing */
 static simgrid::kernel::routing::NetZoneImpl* current_routing = nullptr;
@@ -75,14 +74,11 @@ void sg_platf_exit() {
 /** @brief Add an host to the current AS */
 void sg_platf_new_host(sg_platf_host_cbarg_t args)
 {
-  std::unordered_map<std::string, std::string> props;
+  std::map<std::string, std::string> props;
   if (args->properties) {
-    xbt_dict_cursor_t cursor=nullptr;
-    char *key;
-    char* data;
-    xbt_dict_foreach (args->properties, cursor, key, data)
-      props[key] = data;
-    xbt_dict_free(&args->properties);
+    for (auto const& elm : *args->properties)
+      props.insert({elm.first, elm.second});
+    delete args->properties;
   }
 
   simgrid::s4u::Host* host =
@@ -100,22 +96,21 @@ void sg_platf_new_host(sg_platf_host_cbarg_t args)
     host->pimpl_cpu->setPState(args->pstate);
   if (args->coord && strcmp(args->coord, ""))
     new simgrid::kernel::routing::vivaldi::Coords(host->pimpl_netpoint, args->coord);
-
 }
 
 /** @brief Add a "router" to the network element list */
-simgrid::kernel::routing::NetPoint* sg_platf_new_router(const char* name, const char* coords)
+simgrid::kernel::routing::NetPoint* sg_platf_new_router(std::string name, const char* coords)
 {
   simgrid::kernel::routing::NetZoneImpl* current_routing = routing_get_current();
 
   if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
     current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::base;
   xbt_assert(nullptr == simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name),
-             "Refusing to create a router named '%s': this name already describes a node.", name);
+             "Refusing to create a router named '%s': this name already describes a node.", name.c_str());
 
   simgrid::kernel::routing::NetPoint* netpoint =
       new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
-  XBT_DEBUG("Router '%s' has the id %d", name, netpoint->id());
+  XBT_DEBUG("Router '%s' has the id %u", name.c_str(), netpoint->id());
 
   if (coords && strcmp(coords, ""))
     new simgrid::kernel::routing::vivaldi::Coords(netpoint, coords);
@@ -134,17 +129,13 @@ void sg_platf_new_link(LinkCreationArgs* link)
   } else {
     names.push_back(link->id);
   }
-  for (auto link_name : names) {
+  for (auto const& link_name : names) {
     simgrid::surf::LinkImpl* l =
-        surf_network_model->createLink(link_name.c_str(), link->bandwidth, link->latency, link->policy);
+        surf_network_model->createLink(link_name, link->bandwidth, link->latency, link->policy);
 
     if (link->properties) {
-      xbt_dict_cursor_t cursor = nullptr;
-      char* key;
-      char* data;
-      xbt_dict_foreach (link->properties, cursor, key, data)
-        l->setProperty(key, data);
-      xbt_dict_free(&link->properties);
+      for (auto const& elm : *link->properties)
+        l->setProperty(elm.first, elm.second);
     }
 
     if (link->latency_trace)
@@ -154,9 +145,10 @@ void sg_platf_new_link(LinkCreationArgs* link)
     if (link->state_trace)
       l->setStateTrace(link->state_trace);
   }
+  delete link->properties;
 }
 
-void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
+void sg_platf_new_cluster(ClusterCreationArgs* cluster)
 {
   using simgrid::kernel::routing::ClusterZone;
   using simgrid::kernel::routing::DragonflyZone;
@@ -166,54 +158,49 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
   int rankId=0;
 
   // What an inventive way of initializing the AS that I have as ancestor :-(
-  s_sg_platf_AS_cbarg_t AS;
-  AS.id = cluster->id;
+  ZoneCreationArgs zone;
+  zone.id = cluster->id;
   switch (cluster->topology) {
   case SURF_CLUSTER_TORUS:
-    AS.routing = A_surfxml_AS_routing_ClusterTorus;
+    zone.routing = A_surfxml_AS_routing_ClusterTorus;
     break;
   case SURF_CLUSTER_DRAGONFLY:
-    AS.routing = A_surfxml_AS_routing_ClusterDragonfly;
+    zone.routing = A_surfxml_AS_routing_ClusterDragonfly;
     break;
   case SURF_CLUSTER_FAT_TREE:
-    AS.routing = A_surfxml_AS_routing_ClusterFatTree;
+    zone.routing = A_surfxml_AS_routing_ClusterFatTree;
     break;
   default:
-    AS.routing = A_surfxml_AS_routing_Cluster;
+    zone.routing = A_surfxml_AS_routing_Cluster;
     break;
   }
-  sg_platf_new_AS_begin(&AS);
+  sg_platf_new_Zone_begin(&zone);
   simgrid::kernel::routing::ClusterZone* current_as = static_cast<ClusterZone*>(routing_get_current());
   current_as->parse_specific_arguments(cluster);
 
   if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
     current_as->linkCountPerNode_++;
-    current_as->hasLoopback_ = 1;
+    current_as->hasLoopback_ = true;
   }
 
   if(cluster->limiter_link > 0){
     current_as->linkCountPerNode_++;
-    current_as->hasLimiter_ = 1;
+    current_as->hasLimiter_ = true;
   }
 
-  for (int i : *cluster->radicals) {
-    char * host_id = bprintf("%s%d%s", cluster->prefix, i, cluster->suffix);
-    char * link_id = bprintf("%s_link_%d", cluster->id, i);
+  for (int const& i : *cluster->radicals) {
+    std::string host_id = std::string(cluster->prefix) + std::to_string(i) + cluster->suffix;
+    std::string link_id = std::string(cluster->id) + "_link_" + std::to_string(i);
 
-    XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, cluster->speeds.front());
+    XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id.c_str(), cluster->speeds.front());
 
     s_sg_platf_host_cbarg_t host;
-    memset(&host, 0, sizeof(host));
-    host.id = host_id;
-    if ((cluster->properties != nullptr) && (not xbt_dict_is_empty(cluster->properties))) {
-      xbt_dict_cursor_t cursor=nullptr;
-      char *key;
-      char* data;
-      host.properties = xbt_dict_new_homogeneous(free);
-
-      xbt_dict_foreach(cluster->properties,cursor,key,data) {
-        xbt_dict_set(host.properties, key, xbt_strdup(data), nullptr);
-      }
+    host.id = host_id.c_str();
+    if ((cluster->properties != nullptr) && (not cluster->properties->empty())) {
+      host.properties = new std::map<std::string, std::string>;
+
+      for (auto const& elm : *cluster->properties)
+        host.properties->insert({elm.first, elm.second});
     }
 
     host.speed_per_pstate = cluster->speeds;
@@ -223,7 +210,7 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
     sg_platf_new_host(&host);
     XBT_DEBUG("</host>");
 
-    XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id, cluster->bw, cluster->lat);
+    XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id.c_str(), cluster->bw, cluster->lat);
 
     // All links are saved in a matrix;
     // every row describes a single node; every node may have multiple links.
@@ -235,20 +222,20 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
     simgrid::surf::LinkImpl* linkUp   = nullptr;
     simgrid::surf::LinkImpl* linkDown = nullptr;
     if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
-      std::string tmp_link = std::string(link_id) + "_loopback";
+      std::string tmp_link = link_id + "_loopback";
       XBT_DEBUG("<loopback\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->loopback_bw);
 
       LinkCreationArgs link;
-      link.id        = tmp_link.c_str();
+      link.id        = tmp_link;
       link.bandwidth = cluster->loopback_bw;
       link.latency   = cluster->loopback_lat;
       link.policy    = SURF_LINK_FATPIPE;
       sg_platf_new_link(&link);
-      linkUp   = simgrid::surf::LinkImpl::byName(tmp_link.c_str());
-      linkDown = simgrid::surf::LinkImpl::byName(tmp_link.c_str());
+      linkUp   = simgrid::surf::LinkImpl::byName(tmp_link);
+      linkDown = simgrid::surf::LinkImpl::byName(tmp_link);
 
       auto as_cluster = static_cast<ClusterZone*>(current_as);
-      as_cluster->privateLinks_.insert({rankId * as_cluster->linkCountPerNode_, {linkUp, linkDown}});
+      as_cluster->privateLinks_.insert({as_cluster->nodePosition(rankId), {linkUp, linkDown}});
     }
 
     //add a limiter link (shared link to account for maximal bandwidth of the node)
@@ -259,37 +246,32 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
       XBT_DEBUG("<limiter\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->limiter_link);
 
       LinkCreationArgs link;
-      link.id        = tmp_link.c_str();
+      link.id        = tmp_link;
       link.bandwidth = cluster->limiter_link;
       link.latency = 0;
       link.policy = SURF_LINK_SHARED;
       sg_platf_new_link(&link);
-      linkDown = simgrid::surf::LinkImpl::byName(tmp_link.c_str());
+      linkDown = simgrid::surf::LinkImpl::byName(tmp_link);
       linkUp   = linkDown;
-      current_as->privateLinks_.insert(
-          {rankId * current_as->linkCountPerNode_ + current_as->hasLoopback_, {linkUp, linkDown}});
+      current_as->privateLinks_.insert({current_as->nodePositionWithLoopback(rankId), {linkUp, linkDown}});
     }
 
     //call the cluster function that adds the others links
     if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
       static_cast<FatTreeZone*>(current_as)->addProcessingNode(i);
     } else {
-      current_as->create_links_for_node(cluster, i, rankId,
-          rankId*current_as->linkCountPerNode_ + current_as->hasLoopback_ + current_as->hasLimiter_ );
+      current_as->create_links_for_node(cluster, i, rankId, current_as->nodePositionWithLimiter(rankId));
     }
-    xbt_free(link_id);
-    xbt_free(host_id);
     rankId++;
   }
-  xbt_dict_free(&cluster->properties);
+  delete cluster->properties;
 
   // Add a router.
   XBT_DEBUG(" ");
-  XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id);
-  if (not cluster->router_id || not strcmp(cluster->router_id, "")) {
-    char* newid         = bprintf("%s%s_router%s", cluster->prefix, cluster->id, cluster->suffix);
+  XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id.c_str());
+  if (cluster->router_id.empty()) {
+    std::string newid   = std::string(cluster->prefix) + cluster->id + "_router" + cluster->suffix;
     current_as->router_ = sg_platf_new_router(newid, NULL);
-    free(newid);
   } else {
     current_as->router_ = sg_platf_new_router(cluster->router_id, NULL);
   }
@@ -306,11 +288,11 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
     XBT_DEBUG("<link\tid=\"%s\" bw=\"%f\" lat=\"%f\"/>", link.id.c_str(), cluster->bb_bw, cluster->bb_lat);
     sg_platf_new_link(&link);
 
-    routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(link.id.c_str()));
+    routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(link.id));
   }
 
   XBT_DEBUG("</AS>");
-  sg_platf_new_AS_seal();
+  sg_platf_new_Zone_seal();
 
   simgrid::surf::on_cluster(cluster);
   delete cluster->radicals;
@@ -328,12 +310,11 @@ void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb)
   XBT_DEBUG("Add a backbone to AS '%s'", current_routing->getCname());
 }
 
-void sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet)
+void sg_platf_new_cabinet(CabinetCreationArgs* cabinet)
 {
-  for (int radical : *cabinet->radicals) {
-    std::string hostname = std::string(cabinet->prefix) + std::to_string(radical) + std::string(cabinet->suffix);
+  for (int const& radical : *cabinet->radicals) {
+    std::string hostname = cabinet->prefix + std::to_string(radical) + cabinet->suffix;
     s_sg_platf_host_cbarg_t host;
-    memset(&host, 0, sizeof(host));
     host.pstate           = 0;
     host.core_amount      = 1;
     host.id               = hostname.c_str();
@@ -347,82 +328,80 @@ void sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet)
     link.id        = "link_" + hostname;
     sg_platf_new_link(&link);
 
-    s_sg_platf_host_link_cbarg_t host_link;
-    memset(&host_link, 0, sizeof(host_link));
-    std::string tmp_link_up   = std::string("link_") + hostname + "_UP";
-    std::string tmp_link_down = std::string("link_") + hostname + "_DOWN";
-    host_link.id        = hostname.c_str();
-    host_link.link_up         = tmp_link_up.c_str();
-    host_link.link_down       = tmp_link_down.c_str();
+    HostLinkCreationArgs host_link;
+    host_link.id        = hostname;
+    host_link.link_up   = std::string("link_") + hostname + "_UP";
+    host_link.link_down = std::string("link_") + hostname + "_DOWN";
     sg_platf_new_hostlink(&host_link);
   }
   delete cabinet->radicals;
 }
 
-void sg_platf_new_storage(sg_platf_storage_cbarg_t storage)
+void sg_platf_new_storage(StorageCreationArgs* storage)
 {
   xbt_assert(std::find(known_storages.begin(), known_storages.end(), storage->id) == known_storages.end(),
-             "Refusing to add a second storage named \"%s\"", storage->id);
+             "Refusing to add a second storage named \"%s\"", storage->id.c_str());
 
-  xbt_assert(storage_types.find(storage->type_id) != storage_types.end(), "No storage type '%s'", storage->type_id);
-  storage_type_t stype = storage_types.at(storage->type_id);
+  simgrid::surf::StorageType* stype;
+  auto st = storage_types.find(storage->type_id);
+  if (st != storage_types.end()) {
+    stype = st->second;
+  } else {
+    xbt_die("No storage type '%s'", storage->type_id.c_str());
+  }
 
-  XBT_DEBUG("ROUTING Create a storage name '%s' with type_id '%s' and content '%s'", storage->id, storage->type_id,
-            storage->content);
+  XBT_DEBUG("ROUTING Create a storage name '%s' with type_id '%s' and content '%s'", storage->id.c_str(),
+            storage->type_id.c_str(), storage->content.c_str());
 
   known_storages.push_back(storage->id);
 
   // if storage content is not specified use the content of storage_type if any
-  if (not strcmp(storage->content, "") && strcmp(stype->content, "")) {
-    storage->content      = stype->content;
-    XBT_DEBUG("For disk '%s' content is empty, inherit the content (of type %s)", storage->id, stype->type_id);
+  if (storage->content.empty() && not stype->content.empty()) {
+    storage->content = stype->content;
+    XBT_DEBUG("For disk '%s' content is empty, inherit the content (of type %s)", storage->id.c_str(),
+              stype->id.c_str());
   }
 
   XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s' "
             "\n\t\tmodel '%s' \n\t\tcontent '%s' "
             "\n\t\tproperties '%p''\n",
-            storage->id, stype->model, stype->type_id, storage->content, storage->properties);
+            storage->id.c_str(), stype->model.c_str(), stype->id.c_str(), storage->content.c_str(),
+            storage->properties);
 
-  auto s = surf_storage_model->createStorage(storage->id, stype->type_id, storage->content, storage->attach);
+  auto s = surf_storage_model->createStorage(storage->id, stype->id, storage->content, storage->attach);
 
   if (storage->properties) {
-    xbt_dict_cursor_t cursor = nullptr;
-    char *key;
-    char* data;
-    xbt_dict_foreach (storage->properties, cursor, key, data)
-      s->setProperty(key, data);
-    xbt_dict_free(&storage->properties);
+    for (auto const& elm : *storage->properties)
+      s->setProperty(elm.first, elm.second);
+    delete storage->properties;
   }
 }
 
-void sg_platf_new_storage_type(sg_platf_storage_type_cbarg_t storage_type)
+void sg_platf_new_storage_type(StorageTypeCreationArgs* storage_type)
 {
   xbt_assert(storage_types.find(storage_type->id) == storage_types.end(),
-             "Reading a storage type, processing unit \"%s\" already exists", storage_type->id);
+             "Reading a storage type, processing unit \"%s\" already exists", storage_type->id.c_str());
 
-  storage_type_t stype = xbt_new0(s_storage_type_t, 1);
-  stype->model = xbt_strdup(storage_type->model);
-  stype->properties = storage_type->properties;
-  stype->content = xbt_strdup(storage_type->content);
-  stype->type_id = xbt_strdup(storage_type->id);
-  stype->size = storage_type->size;
-  stype->model_properties = storage_type->model_properties;
+  simgrid::surf::StorageType* stype =
+      new simgrid::surf::StorageType(storage_type->id, storage_type->model, storage_type->content,
+                                     storage_type->properties, storage_type->model_properties, storage_type->size);
 
-  XBT_DEBUG("ROUTING Create a storage type id '%s' with model '%s', content '%s'", stype->type_id, stype->model,
-            storage_type->content);
+  XBT_DEBUG("Create a storage type id '%s' with model '%s', content '%s'", storage_type->id.c_str(),
+            storage_type->model.c_str(), storage_type->content.c_str());
 
-  storage_types.insert({std::string(stype->type_id), stype});
+  storage_types[storage_type->id] = stype;
 }
 
-void sg_platf_new_mount(sg_platf_mount_cbarg_t mount){
+void sg_platf_new_mount(MountCreationArgs* mount)
+{
   xbt_assert(std::find(known_storages.begin(), known_storages.end(), mount->storageId) != known_storages.end(),
-             "Cannot mount non-existent disk \"%s\"", mount->storageId);
+             "Cannot mount non-existent disk \"%s\"", mount->storageId.c_str());
 
-  XBT_DEBUG("ROUTING Mount '%s' on '%s'",mount->storageId, mount->name);
+  XBT_DEBUG("Mount '%s' on '%s'", mount->storageId.c_str(), mount->name.c_str());
 
   if (mount_list.empty())
     XBT_DEBUG("Create a Mount list for %s", A_surfxml_host_id);
-  mount_list.insert({std::string(mount->name), simgrid::surf::StorageImpl::byName(mount->storageId)});
+  mount_list.insert({mount->name, simgrid::surf::StorageImpl::byName(mount->storageId.c_str())});
 }
 
 void sg_platf_new_route(sg_platf_route_cbarg_t route)
@@ -442,7 +421,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
     // The requested host does not exist. Do a nice message to the user
     std::string msg = std::string("Cannot create process '") + process->function + "': host '" + process->host +
                       "' does not exist\nExisting hosts: '";
-    for (auto kv : simgrid::s4u::host_list) {
+    for (auto const& kv : simgrid::s4u::host_list) {
       simgrid::s4u::Host* host = kv.second;
       msg += host->getName();
       msg += "', '";
@@ -461,35 +440,36 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
   double kill_time  = process->kill_time;
   int auto_restart = process->on_failure == SURF_ACTOR_ON_FAILURE_DIE ? 0 : 1;
 
-  std::vector<std::string> args(process->argv, process->argv + process->argc);
-  std::function<void()> code = factory(std::move(args));
+  std::string process_name   = process->args[0];
+  std::function<void()> code = factory(std::move(process->args));
+  std::shared_ptr<std::map<std::string, std::string>> properties(process->properties);
 
   smx_process_arg_t arg = nullptr;
 
   arg = new simgrid::simix::ProcessArg();
-  arg->name = std::string(process->argv[0]);
+  arg->name = process_name;
   arg->code = code;
   arg->data = nullptr;
   arg->host = host;
   arg->kill_time = kill_time;
-  arg->properties = current_property_set;
+  arg->properties = properties;
 
   host->extension<simgrid::simix::Host>()->boot_processes.push_back(arg);
 
   if (start_time > SIMIX_get_clock()) {
 
     arg = new simgrid::simix::ProcessArg();
-    arg->name = std::string(process->argv[0]);
+    arg->name = process_name;
     arg->code = std::move(code);
     arg->data = nullptr;
     arg->host = host;
     arg->kill_time = kill_time;
-    arg->properties = current_property_set;
+    arg->properties = properties;
 
     XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->getCname(), start_time);
     SIMIX_timer_set(start_time, [arg, auto_restart]() {
       smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), std::move(arg->code), arg->data,
-                                                                arg->host, arg->properties, nullptr);
+                                                                arg->host, arg->properties.get(), nullptr);
       if (arg->kill_time >= 0)
         simcall_process_set_kill_time(actor, arg->kill_time);
       if (auto_restart)
@@ -500,7 +480,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
     XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), host->getCname());
 
     smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), std::move(code), nullptr, host,
-                                                              current_property_set, nullptr);
+                                                              arg->properties.get(), nullptr);
 
     /* The actor creation will fail if the host is currently dead, but that's fine */
     if (actor != nullptr) {
@@ -510,17 +490,16 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
         SIMIX_process_auto_restart_set(actor, auto_restart);
     }
   }
-  current_property_set = nullptr;
 }
 
-void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
+void sg_platf_new_peer(PeerCreationArgs* peer)
 {
   simgrid::kernel::routing::VivaldiZone* as = dynamic_cast<simgrid::kernel::routing::VivaldiZone*>(current_routing);
   xbt_assert(as, "<peer> tag can only be used in Vivaldi netzones.");
 
   std::vector<double> speedPerPstate;
   speedPerPstate.push_back(peer->speed);
-  simgrid::s4u::Host* host = as->createHost(peer->id, &speedPerPstate, 1, nullptr);
+  simgrid::s4u::Host* host = as->createHost(peer->id.c_str(), &speedPerPstate, 1, nullptr);
 
   as->setPeerLink(host->pimpl_netpoint, peer->bw_in, peer->bw_out, peer->coord);
 
@@ -540,22 +519,22 @@ void sg_platf_end() {
 /* Pick the right models for CPU, net and host, and call their model_init_preparse */
 static void surf_config_models_setup()
 {
-  const char* host_model_name    = xbt_cfg_get_string("host/model");
-  const char* network_model_name = xbt_cfg_get_string("network/model");
-  const char* cpu_model_name     = xbt_cfg_get_string("cpu/model");
-  const char* storage_model_name = xbt_cfg_get_string("storage/model");
+  std::string host_model_name    = xbt_cfg_get_string("host/model");
+  std::string network_model_name = xbt_cfg_get_string("network/model");
+  std::string cpu_model_name     = xbt_cfg_get_string("cpu/model");
+  std::string storage_model_name = xbt_cfg_get_string("storage/model");
 
   /* The compound host model is needed when using non-default net/cpu models */
   if ((not xbt_cfg_is_default_value("network/model") || not xbt_cfg_is_default_value("cpu/model")) &&
       xbt_cfg_is_default_value("host/model")) {
     host_model_name = "compound";
-    xbt_cfg_set_string("host/model", host_model_name);
+    xbt_cfg_set_string("host/model", host_model_name.c_str());
   }
 
-  XBT_DEBUG("host model: %s", host_model_name);
-  if (not strcmp(host_model_name, "compound")) {
-    xbt_assert(cpu_model_name, "Set a cpu model to use with the 'compound' host model");
-    xbt_assert(network_model_name, "Set a network model to use with the 'compound' host model");
+  XBT_DEBUG("host model: %s", host_model_name.c_str());
+  if (host_model_name == "compound") {
+    xbt_assert(not cpu_model_name.empty(), "Set a cpu model to use with the 'compound' host model");
+    xbt_assert(not network_model_name.empty(), "Set a network model to use with the 'compound' host model");
 
     int cpu_id = find_model_description(surf_cpu_model_description, cpu_model_name);
     surf_cpu_model_description[cpu_id].model_init_preparse();
@@ -577,18 +556,16 @@ static void surf_config_models_setup()
 }
 
 /**
- * \brief Add an AS to the platform
+ * \brief Add a Zone to the platform
  *
- * Add a new autonomous system to the platform. Any elements (such as host,
- * router or sub-AS) added after this call and before the corresponding call
- * to sg_platf_new_AS_seal() will be added to this AS.
+ * Add a new autonomous system to the platform. Any elements (such as host, router or sub-Zone) added after this call
+ * and before the corresponding call to sg_platf_new_Zone_seal() will be added to this Zone.
  *
- * Once this function was called, the configuration concerning the used
- * models cannot be changed anymore.
+ * Once this function was called, the configuration concerning the used models cannot be changed anymore.
  *
- * @param AS the parameters defining the AS to build.
+ * @param zone the parameters defining the Zone to build.
  */
-simgrid::s4u::NetZone* sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
+simgrid::s4u::NetZone* sg_platf_new_Zone_begin(ZoneCreationArgs* zone)
 {
   if (not surf_parse_models_setup_already_called) {
     /* Initialize the surf models. That must be done after we got all config, and before we need the models.
@@ -606,37 +583,37 @@ simgrid::s4u::NetZone* sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
                             * any further config now that we created some real content */
 
   /* search the routing model */
-  simgrid::kernel::routing::NetZoneImpl* new_as = nullptr;
-  switch(AS->routing){
+  simgrid::kernel::routing::NetZoneImpl* new_zone = nullptr;
+  switch (zone->routing) {
     case A_surfxml_AS_routing_Cluster:
-      new_as = new simgrid::kernel::routing::ClusterZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::ClusterZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_ClusterDragonfly:
-      new_as = new simgrid::kernel::routing::DragonflyZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::DragonflyZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_ClusterTorus:
-      new_as = new simgrid::kernel::routing::TorusZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::TorusZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_ClusterFatTree:
-      new_as = new simgrid::kernel::routing::FatTreeZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::FatTreeZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_Dijkstra:
-      new_as = new simgrid::kernel::routing::DijkstraZone(current_routing, AS->id, 0);
+      new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, false);
       break;
     case A_surfxml_AS_routing_DijkstraCache:
-      new_as = new simgrid::kernel::routing::DijkstraZone(current_routing, AS->id, 1);
+      new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, true);
       break;
     case A_surfxml_AS_routing_Floyd:
-      new_as = new simgrid::kernel::routing::FloydZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::FloydZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_Full:
-      new_as = new simgrid::kernel::routing::FullZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::FullZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_None:
-      new_as = new simgrid::kernel::routing::EmptyZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::EmptyZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_Vivaldi:
-      new_as = new simgrid::kernel::routing::VivaldiZone(current_routing, AS->id);
+      new_zone = new simgrid::kernel::routing::VivaldiZone(current_routing, zone->id);
       break;
     default:
       xbt_die("Not a valid model!");
@@ -646,22 +623,22 @@ simgrid::s4u::NetZone* sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
   if (current_routing == nullptr) { /* it is the first one */
     xbt_assert(simgrid::s4u::Engine::getInstance()->pimpl->netRoot_ == nullptr,
                "All defined components must belong to a networking zone.");
-    simgrid::s4u::Engine::getInstance()->pimpl->netRoot_ = new_as;
+    simgrid::s4u::Engine::getInstance()->pimpl->netRoot_ = new_zone;
 
   } else {
     /* set the father behavior */
     if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
       current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::recursive;
     /* add to the sons dictionary */
-    current_routing->getChildren()->push_back(static_cast<simgrid::s4u::NetZone*>(new_as));
+    current_routing->getChildren()->push_back(static_cast<simgrid::s4u::NetZone*>(new_zone));
   }
 
   /* set the new current component of the tree */
-  current_routing = new_as;
+  current_routing = new_zone;
 
-  simgrid::s4u::NetZone::onCreation(*new_as); // notify the signal
+  simgrid::s4u::NetZone::onCreation(*new_zone); // notify the signal
 
-  return new_as;
+  return new_zone;
 }
 
 /**
@@ -670,7 +647,7 @@ simgrid::s4u::NetZone* sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
  * Once you've declared all the content of your AS, you have to seal
  * it with this call. Your AS is not usable until you call this function.
  */
-void sg_platf_new_AS_seal()
+void sg_platf_new_Zone_seal()
 {
   xbt_assert(current_routing, "Cannot seal the current AS: none under construction");
   current_routing->seal();
@@ -679,37 +656,37 @@ void sg_platf_new_AS_seal()
 }
 
 /** @brief Add a link connecting an host to the rest of its AS (which must be cluster or vivaldi) */
-void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink)
+void sg_platf_new_hostlink(HostLinkCreationArgs* hostlink)
 {
-  simgrid::kernel::routing::NetPoint* netpoint = sg_host_by_name(hostlink->id)->pimpl_netpoint;
-  xbt_assert(netpoint, "Host '%s' not found!", hostlink->id);
+  simgrid::kernel::routing::NetPoint* netpoint = sg_host_by_name(hostlink->id.c_str())->pimpl_netpoint;
+  xbt_assert(netpoint, "Host '%s' not found!", hostlink->id.c_str());
   xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
              "Only hosts from Cluster and Vivaldi ASes can get an host_link.");
 
   simgrid::surf::LinkImpl* linkUp   = simgrid::surf::LinkImpl::byName(hostlink->link_up);
   simgrid::surf::LinkImpl* linkDown = simgrid::surf::LinkImpl::byName(hostlink->link_down);
 
-  xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up);
-  xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down);
+  xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up.c_str());
+  xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down.c_str());
 
   auto as_cluster = static_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
 
   if (as_cluster->privateLinks_.find(netpoint->id()) != as_cluster->privateLinks_.end())
-    surf_parse_error("Host_link for '%s' is already defined!",hostlink->id);
+    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 %d", 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}});
 }
 
-void sg_platf_new_trace(sg_platf_trace_cbarg_t trace)
+void sg_platf_new_trace(TraceCreationArgs* trace)
 {
   tmgr_trace_t tmgr_trace;
-  if (trace->file && strcmp(trace->file, "") != 0) {
+  if (not trace->file.empty()) {
     tmgr_trace = tmgr_trace_new_from_file(trace->file);
   } else {
-    xbt_assert(strcmp(trace->pc_data, ""),
-        "Trace '%s' must have either a content, or point to a file on disk.",trace->id);
+    xbt_assert(not trace->pc_data.empty(), "Trace '%s' must have either a content, or point to a file on disk.",
+               trace->id.c_str());
     tmgr_trace = tmgr_trace_new_from_string(trace->id, trace->pc_data, trace->periodicity);
   }
-  xbt_dict_set(traces_set_list, trace->id, static_cast<void*>(tmgr_trace), nullptr);
+  traces_set_list.insert({trace->id, tmgr_trace});
 }
index dd44583..f016c1e 100644 (file)
@@ -6,22 +6,23 @@
 #include "storage_n11.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
-#include <math.h> /*ceil*/
+#include "surf/maxmin.hpp"
+#include <cmath> /*ceil*/
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage);
 
 /*************
  * CallBacks *
  *************/
-extern std::map<std::string, storage_type_t> storage_types;
+extern std::map<std::string, simgrid::surf::StorageType*> storage_types;
 
 static void check_disk_attachment()
 {
-  for (auto s : *simgrid::surf::StorageImpl::storagesMap()) {
+  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("Unable to attach storage %s: host %s does not exist.", s.second->cname(),
-                       s.second->getHost().c_str());
+      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());
   }
@@ -46,21 +47,22 @@ void surf_storage_model_init_default()
 namespace simgrid {
 namespace surf {
 
-StorageImpl* StorageN11Model::createStorage(const char* id, const char* type_id, const char* content_name,
-                                            const char* attach)
+StorageImpl* StorageN11Model::createStorage(std::string id, std::string type_id, std::string content_name,
+                                            std::string attach)
 {
-  storage_type_t storage_type = storage_types.at(type_id);
+  StorageType* storage_type = storage_types.at(type_id);
 
-  double Bread =
-      surf_parse_get_bandwidth(storage_type->model_properties->at("Bread").c_str(), "property Bread, storage", type_id);
+  double Bread = surf_parse_get_bandwidth(storage_type->model_properties->at("Bread").c_str(),
+                                          "property Bread, storage", type_id.c_str());
   double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(),
-                                           "property Bwrite, storage", type_id);
+                                           "property Bwrite, storage", type_id.c_str());
 
-  StorageImpl* storage = new StorageN11(this, id, maxminSystem_, Bread, Bwrite, type_id, (char*)content_name,
-                                        storage_type->size, (char*)attach);
+  StorageImpl* storage =
+      new StorageN11(this, id, maxminSystem_, Bread, Bwrite, type_id, content_name, storage_type->size, attach);
   storageCreatedCallbacks(storage);
 
-  XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tBread '%f'\n", id, type_id, Bread);
+  XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tBread '%f'\n", id.c_str(), type_id.c_str(),
+            Bread);
 
   p_storageList.push_back(storage);
 
@@ -74,35 +76,17 @@ double StorageN11Model::nextOccuringEvent(double now)
 
 void StorageN11Model::updateActionsState(double /*now*/, double delta)
 {
-  ActionList *actionSet = getRunningActionSet();
-  for (ActionList::iterator it(actionSet->begin()), itNext = it, itend(actionSet->end()); it != itend; it = itNext) {
-    ++itNext;
+  for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
+    StorageAction& action = static_cast<StorageAction&>(*it);
+    ++it; // increment iterator here since the following calls to action.finish() may invalidate it
+    action.updateRemains(lrint(action.getVariable()->get_value() * delta));
 
-    StorageAction *action = static_cast<StorageAction*>(&*it);
+    if (action.getMaxDuration() > NO_MAX_DURATION)
+      action.updateMaxDuration(delta);
 
-    double current_progress = lrint(lmm_variable_getvalue(action->getVariable()) * delta);
-
-    action->updateRemains(current_progress);
-    if (action->type_ == WRITE) {
-      action->storage_->usedSize_ += current_progress;
-      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()});
-    }
-
-    if (action->getMaxDuration() > NO_MAX_DURATION)
-      action->updateMaxDuration(delta);
-
-    if (action->getRemainsNoUpdate() > 0 && lmm_get_variable_weight(action->getVariable()) > 0 &&
-        action->storage_->usedSize_ == action->storage_->getSize()) {
-      action->finish();
-      action->setState(Action::State::failed);
-    } else if (((action->getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) ||
-               ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
-      action->finish();
-      action->setState(Action::State::done);
+    if (((action.getRemainsNoUpdate() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+      action.finish(Action::State::done);
     }
   }
 }
@@ -111,8 +95,8 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
  * Resource *
  ************/
 
-StorageN11::StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
-                       const char* type_id, char* content_name, sg_size_t size, char* attach)
+StorageN11::StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
+                       std::string type_id, std::string content_name, sg_size_t size, std::string attach)
     : StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)
 {
   XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
@@ -135,18 +119,18 @@ StorageAction* StorageN11::write(sg_size_t size)
 
 StorageN11Action::StorageN11Action(Model* model, double cost, bool failed, StorageImpl* storage,
                                    e_surf_action_storage_type_t type)
-    : StorageAction(model, cost, failed, lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0, 3), storage, type)
+    : StorageAction(model, cost, failed, model->getMaxminSystem()->variable_new(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);
+  model->getMaxminSystem()->expand(storage->constraint(), getVariable(), 1.0);
   switch(type) {
   case READ:
-    lmm_expand(model->getMaxminSystem(), storage->constraintRead_, getVariable(), 1.0);
+    model->getMaxminSystem()->expand(storage->constraintRead_, getVariable(), 1.0);
     break;
   case WRITE:
-    lmm_expand(model->getMaxminSystem(), storage->constraintWrite_, getVariable(), 1.0);
+    model->getMaxminSystem()->expand(storage->constraintWrite_, getVariable(), 1.0);
     break;
   default:
     THROW_UNIMPLEMENTED;
@@ -161,7 +145,7 @@ int StorageN11Action::unref()
     if (action_hook.is_linked())
       stateSet_->erase(stateSet_->iterator_to(*this));
     if (getVariable())
-      lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
+      getModel()->getMaxminSystem()->variable_free(getVariable());
     xbt_free(getCategory());
     delete this;
     return 1;
@@ -178,7 +162,7 @@ void StorageN11Action::suspend()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != 2) {
-    lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), 0.0);
+    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
     suspended_ = 1;
   }
   XBT_OUT();
index 42793eb..b6d8c4f 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <xbt/base.h>
 
-#include "FileImpl.hpp"
 #include "StorageImpl.hpp"
 
 #ifndef STORAGE_N11_HPP_
@@ -29,8 +28,8 @@ class XBT_PRIVATE StorageN11Action;
 
 class StorageN11Model : public StorageModel {
 public:
-  StorageImpl* createStorage(const char* id, const char* type_id, const char* content_name,
-                             const char* attach) override;
+  StorageImpl* createStorage(std::string id, std::string type_id, std::string content_name,
+                             std::string attach) override;
   double nextOccuringEvent(double now) override;
   void updateActionsState(double now, double delta) override;
 };
@@ -41,8 +40,8 @@ public:
 
 class StorageN11 : public StorageImpl {
 public:
-  StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
-             const char* type_id, char* content_name, sg_size_t size, char* attach);
+  StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
+             std::string type_id, std::string content_name, sg_size_t size, std::string attach);
   virtual ~StorageN11() = default;
   StorageAction* read(sg_size_t size);
   StorageAction* write(sg_size_t size);
index 46f00de..cac3a86 100644 (file)
@@ -4,8 +4,9 @@
  * 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"
+#include <algorithm>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_kernel);
 
@@ -34,8 +35,8 @@ void surf_presolve()
   }
 
   XBT_DEBUG ("Set every models in the right state by updating them to 0.");
-  for (auto model : *all_existing_models)
-      model->updateActionsState(NOW, 0.0);
+  for (auto const& model : *all_existing_models)
+    model->updateActionsState(NOW, 0.0);
 }
 
 double surf_solve(double max_date)
@@ -74,10 +75,10 @@ double surf_solve(double max_date)
     XBT_DEBUG("Next TRACE event: %f", next_event_date);
 
     if (not surf_network_model->nextOccuringEventIsIdempotent()) { // NS3, I see you
-      if (next_event_date!=-1.0 && time_delta!=-1.0) {
-        time_delta = MIN(next_event_date - NOW, time_delta);
+      if (next_event_date != -1.0) {
+        time_delta = std::min(next_event_date - NOW, time_delta);
       } else {
-        time_delta = MAX(next_event_date - NOW, time_delta); // Get the positive component
+        time_delta = std::max(next_event_date - NOW, time_delta); // Get the positive component
       }
 
       XBT_DEBUG("Run the NS3 network at most %fs", time_delta);
@@ -85,22 +86,20 @@ double surf_solve(double max_date)
       model_next_action_end = surf_network_model->nextOccuringEvent(time_delta);
 
       XBT_DEBUG("Min for network : %f", model_next_action_end);
-      if(model_next_action_end>=0.0)
+      if (model_next_action_end >= 0.0)
         time_delta = model_next_action_end;
     }
 
-    if (next_event_date < 0.0) {
-      XBT_DEBUG("no next TRACE event. Stop searching for it");
+    if (next_event_date < 0.0 || (next_event_date > NOW + time_delta)) {
+      // next event may have already occurred or will after the next resource change, then bail out
+      XBT_DEBUG("no next usable TRACE event. Stop searching for it");
       break;
     }
 
-    if ((time_delta == -1.0) || (next_event_date > NOW + time_delta))
-      break; // next event occurs after the next resource change, bail out
-
     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() || xbt_dict_get_or_null(watched_hosts_lib, resource->cname())) {
+      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 +108,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;
     }
@@ -129,12 +128,12 @@ double surf_solve(double max_date)
   NOW = NOW + time_delta;
 
   // Inform the models of the date change
-  for (auto model : *all_existing_models) {
+  for (auto const& model : *all_existing_models)
     model->updateActionsState(NOW, time_delta);
-  }
+
   simgrid::s4u::onTimeAdvance(time_delta);
 
-  TRACE_paje_dump_buffer (0);
+  TRACE_paje_dump_buffer(false);
 
   return time_delta;
 }
index cf5f486..cb5ed0e 100644 (file)
@@ -7,13 +7,19 @@
 #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"
 
 #include <fstream>
+#include <set>
+#include <string>
 #include <vector>
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf, "Logging specific to SURF (kernel)");
 
@@ -26,8 +32,9 @@ std::vector<surf_model_t> * all_existing_models = nullptr; /* to destroy models
 simgrid::trace_mgr::future_evt_set *future_evt_set = nullptr;
 std::vector<std::string> surf_path;
 std::vector<simgrid::s4u::Host*> host_that_restart;
-xbt_dict_t watched_hosts_lib;
-extern std::map<std::string, storage_type_t> storage_types;
+/**  set of hosts for which one want to be notified if they ever restart. */
+std::set<std::string> watched_hosts;
+extern std::map<std::string, simgrid::surf::StorageType*> storage_types;
 
 namespace simgrid {
 namespace surf {
@@ -36,8 +43,8 @@ simgrid::xbt::signal<void()> surfExitCallbacks;
 }
 }
 
-#include <simgrid/plugins/energy.h> // FIXME: this plugin should not be linked to the core
-#include <simgrid/plugins/load.h>   // FIXME: this plugin should not be linked to the core
+#include <simgrid/plugins/energy.h> // FIXME: this plug-in should not be linked to the core
+#include <simgrid/plugins/load.h>   // FIXME: this plug-in should not be linked to the core
 
 s_surf_model_description_t surf_plugin_description[] = {
     {"Energy", "Cpu energy consumption.", &sg_host_energy_plugin_init},
@@ -112,10 +119,6 @@ s_surf_model_description_t surf_storage_model_description[] = {
   {nullptr, nullptr,  nullptr}      /* this array must be nullptr terminated */
 };
 
-#if HAVE_THREAD_CONTEXTS
-static xbt_parmap_t surf_parmap = nullptr; /* parallel map on models */
-#endif
-
 double NOW = 0;
 
 double surf_get_clock()
@@ -129,16 +132,16 @@ double surf_get_clock()
 # define FILE_DELIM "/"         /* FIXME: move to better location */
 #endif
 
-std::ifstream* surf_ifsopen(const char* name)
+std::ifstream* surf_ifsopen(std::string name)
 {
   std::ifstream* fs = new std::ifstream();
-  xbt_assert(name);
-  if (__surf_is_absolute_file_path(name)) { /* don't mess with absolute file names */
-    fs->open(name, std::ifstream::in);
+  xbt_assert(not name.empty());
+  if (__surf_is_absolute_file_path(name.c_str())) { /* don't mess with absolute file names */
+    fs->open(name.c_str(), std::ifstream::in);
   }
 
   /* search relative files in the path */
-  for (auto path_elm : surf_path) {
+  for (auto const& path_elm : surf_path) {
     std::string buff = path_elm + FILE_DELIM + name;
     fs->open(buff.c_str(), std::ifstream::in);
 
@@ -150,6 +153,7 @@ std::ifstream* surf_ifsopen(const char* name)
 
   return fs;
 }
+
 FILE *surf_fopen(const char *name, const char *mode)
 {
   FILE *file = nullptr;
@@ -160,10 +164,9 @@ FILE *surf_fopen(const char *name, const char *mode)
     return fopen(name, mode);
 
   /* search relative files in the path */
-  for (auto path_elm : surf_path) {
-    char* buff = bprintf("%s" FILE_DELIM "%s", path_elm.c_str(), name);
-    file = fopen(buff, mode);
-    free(buff);
+  for (auto const& path_elm : surf_path) {
+    std::string buff = path_elm + FILE_DELIM + name;
+    file             = fopen(buff.c_str(), mode);
 
     if (file)
       return file;
@@ -171,47 +174,6 @@ FILE *surf_fopen(const char *name, const char *mode)
   return nullptr;
 }
 
-#ifdef _WIN32
-#include <windows.h>
-#define MAX_DRIVE 26
-static const char *disk_drives_letter_table[MAX_DRIVE] = {
-  "A:\\","B:\\","C:\\","D:\\","E:\\","F:\\","G:\\","H:\\","I:\\","J:\\","K:\\","L:\\","M:\\",
-  "N:\\","O:\\","P:\\","Q:\\","R:\\","S:\\","T:\\","U:\\","V:\\","W:\\","X:\\","Y:\\","Z:\\"
-};
-#endif
-
-/*
- * Returns the initial path. On Windows the initial path is
- * the current directory for the current process in the other
- * case the function returns "./" that represents the current
- * directory on Unix/Linux platforms.
- */
-
-const char *__surf_get_initial_path()
-{
-
-#ifdef _WIN32
-  unsigned i;
-  char current_directory[MAX_PATH + 1] = { 0 };
-  unsigned int len = GetCurrentDirectory(MAX_PATH + 1, current_directory);
-  char root[4] = { 0 };
-
-  if (not len)
-    return nullptr;
-
-  strncpy(root, current_directory, 3);
-
-  for (i = 0; i < MAX_DRIVE; i++) {
-    if (toupper(root[0]) == disk_drives_letter_table[i][0])
-      return disk_drives_letter_table[i];
-  }
-
-  return nullptr;
-#else
-  return "./";
-#endif
-}
-
 /* The __surf_is_absolute_file_path() returns 1 if
  * file_path is a absolute file path, in the other
  * case the function returns 0.
@@ -240,25 +202,20 @@ void model_help(const char *category, s_surf_model_description_t * table)
     printf("  %s: %s\n", table[i].name, table[i].description);
 }
 
-int find_model_description(s_surf_model_description_t * table,
-                           const char *name)
+int find_model_description(s_surf_model_description_t* table, std::string name)
 {
-  int i;
-  char *name_list = nullptr;
-
-  for (i = 0; table[i].name; i++)
-    if (not strcmp(name, table[i].name)) {
+  for (int i = 0; table[i].name; i++)
+    if (name == table[i].name)
       return i;
-    }
+
   if (not table[0].name)
     xbt_die("No model is valid! This is a bug.");
-  name_list = xbt_strdup(table[0].name);
-  for (i = 1; table[i].name; i++) {
-    name_list = (char *) xbt_realloc(name_list, strlen(name_list) + strlen(table[i].name) + 3);
-    strncat(name_list, ", ", 2);
-    strncat(name_list, table[i].name, strlen(table[i].name));
-  }
-  xbt_die("Model '%s' is invalid! Valid models are: %s.", name, name_list);
+
+  std::string name_list = std::string(table[0].name);
+  for (int i = 1; table[i].name; i++)
+    name_list = name_list + ", " + table[i].name;
+
+  xbt_die("Model '%s' is invalid! Valid models are: %s.", name.c_str(), name_list.c_str());
   return -1;
 }
 
@@ -346,17 +303,12 @@ void surf_init(int *argc, char **argv)
   XBT_DEBUG("Create all Libs");
   USER_HOST_LEVEL = simgrid::s4u::Host::extension_create(nullptr);
 
-  watched_hosts_lib = xbt_dict_new_homogeneous(nullptr);
-
   xbt_init(argc, argv);
   if (not all_existing_models)
     all_existing_models = new std::vector<simgrid::surf::Model*>();
   if (not future_evt_set)
     future_evt_set = new simgrid::trace_mgr::future_evt_set();
 
-  TRACE_surf_alloc();
-  simgrid::surf::surfExitCallbacks.connect(TRACE_surf_release);
-
   sg_config_init(argc, argv);
 
   if (MC_is_active())
@@ -369,21 +321,17 @@ void surf_exit()
 
   sg_host_exit();
   sg_link_exit();
-  xbt_dict_free(&watched_hosts_lib);
-  for (auto e : storage_types) {
-    storage_type_t stype = e.second;
-    free(stype->model);
-    free(stype->type_id);
-    free(stype->content);
-    xbt_dict_free(&(stype->properties));
+  for (auto const& e : storage_types) {
+    simgrid::surf::StorageType* stype = e.second;
+    delete stype->properties;
     delete stype->model_properties;
-    free(stype);
+    delete stype;
   }
-  for (auto s : *simgrid::surf::StorageImpl::storages)
+  for (auto const& s : *simgrid::surf::StorageImpl::storagesMap())
     delete s.second;
-  delete simgrid::surf::StorageImpl::storages;
+  delete simgrid::surf::StorageImpl::storagesMap();
 
-  for (auto model : *all_existing_models)
+  for (auto const& model : *all_existing_models)
     delete model;
   delete all_existing_models;
 
@@ -394,10 +342,6 @@ void surf_exit()
     future_evt_set = nullptr;
   }
 
-#if HAVE_THREAD_CONTEXTS
-  xbt_parmap_destroy(surf_parmap);
-#endif
-
   tmgr_finalize();
   sg_platf_exit();
   simgrid::s4u::Engine::shutdown();
@@ -421,7 +365,6 @@ Model::Model()
   doneActionSet_ = new ActionList();
 
   modifiedSet_ = nullptr;
-  actionHeap_ = nullptr;
   updateMechanism_ = UM_UNDEFINED;
   selectiveUpdate_ = 0;
 }
@@ -433,6 +376,14 @@ Model::~Model(){
   delete doneActionSet_;
 }
 
+Action* Model::actionHeapPop()
+{
+  Action* action = actionHeap_.top().second;
+  actionHeap_.pop();
+  action->clearHeapHandle();
+  return action;
+}
+
 double Model::nextOccuringEvent(double now)
 {
   //FIXME: set the good function once and for all
@@ -446,9 +397,9 @@ double Model::nextOccuringEvent(double now)
 
 double Model::nextOccuringEventLazy(double now)
 {
-  XBT_DEBUG("Before share resources, the size of modified actions set is %zd", modifiedSet_->size());
+  XBT_DEBUG("Before share resources, the size of modified actions set is %zu", modifiedSet_->size());
   lmm_solve(maxminSystem_);
-  XBT_DEBUG("After share resources, The size of modified actions set is %zd", modifiedSet_->size());
+  XBT_DEBUG("After share resources, The size of modified actions set is %zu", modifiedSet_->size());
 
   while (not modifiedSet_->empty()) {
     Action *action = &(modifiedSet_->front());
@@ -465,7 +416,7 @@ double Model::nextOccuringEventLazy(double now)
     action->updateRemainingLazy(now);
 
     double min = -1;
-    double share = lmm_variable_getvalue(action->getVariable());
+    double share = action->getVariable()->get_value();
 
     if (share > 0) {
       double time_to_completion;
@@ -498,8 +449,8 @@ double Model::nextOccuringEventLazy(double now)
   }
 
   //hereafter must have already the min value for this resource model
-  if (xbt_heap_size(actionHeap_) > 0) {
-    double min = xbt_heap_maxkey(actionHeap_) - now;
+  if (not actionHeapIsEmpty()) {
+    double min = actionHeapTopDate() - now;
     XBT_DEBUG("minimum with the HEAP %f", min);
     return min;
   } else {
@@ -512,22 +463,22 @@ double Model::nextOccuringEventFull(double /*now*/) {
   maxminSystem_->solve_fun(maxminSystem_);
 
   double min = -1;
-  for (auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; ++it) {
-    Action *action = &*it;
-    double value = lmm_variable_getvalue(action->getVariable());
+
+  for (Action& action : *getRunningActionSet()) {
+    double value = action.getVariable()->get_value();
     if (value > 0) {
-      if (action->getRemains() > 0)
-        value = action->getRemainsNoUpdate() / value;
+      if (action.getRemains() > 0)
+        value = action.getRemainsNoUpdate() / value;
       else
         value = 0.0;
       if (min < 0 || value < min) {
         min = value;
-        XBT_DEBUG("Updating min (value) with %p: %f", action, min);
+        XBT_DEBUG("Updating min (value) with %p: %f", &action, min);
       }
     }
-    if ((action->getMaxDuration() >= 0) && (min<0 || action->getMaxDuration() < min)) {
-      min = action->getMaxDuration();
-      XBT_DEBUG("Updating min (duration) with %p: %f", action, min);
+    if ((action.getMaxDuration() >= 0) && (min < 0 || action.getMaxDuration() < min)) {
+      min = action.getMaxDuration();
+      XBT_DEBUG("Updating min (duration) with %p: %f", &action, min);
     }
   }
   XBT_DEBUG("min value : %f", min);
@@ -565,7 +516,7 @@ void Model::updateActionsStateFull(double /*now*/, double /*delta*/)
 namespace simgrid {
 namespace surf {
 
-Resource::Resource(Model* model, const char* name, lmm_constraint_t constraint)
+Resource::Resource(Model* model, const std::string& name, lmm_constraint_t constraint)
     : name_(name), model_(model), constraint_(constraint)
 {}
 
@@ -593,7 +544,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();
 }
@@ -623,11 +579,6 @@ const char *surf_action_state_names[6] = {
   "SURF_ACTION_NOT_IN_THE_SYSTEM"
 };
 
-/* added to manage the communication action's heap */
-void surf_action_lmm_update_index_heap(void *action, int i) {
-  static_cast<simgrid::surf::Action*>(action)->updateIndexHeap(i);
-}
-
 namespace simgrid {
 namespace surf {
 
@@ -650,11 +601,13 @@ Action::~Action() {
   xbt_free(category_);
 }
 
-void Action::finish() {
-    finishTime_ = surf_get_clock();
+void Action::finish(Action::State state)
+{
+  finishTime_ = surf_get_clock();
+  setState(state);
 }
 
-Action::State Action::getState()
+Action::State Action::getState() const
 {
   if (stateSet_ == model_->getReadyActionSet())
     return Action::State::ready;
@@ -691,38 +644,22 @@ void Action::setState(Action::State state)
     stateSet_->push_back(*this);
 }
 
-double Action::getBound()
+double Action::getBound() const
 {
-  return (variable_) ? lmm_variable_getbound(variable_) : 0;
+  return variable_ ? variable_->get_bound() : 0;
 }
 
 void Action::setBound(double bound)
 {
   XBT_IN("(%p,%g)", this, bound);
   if (variable_)
-    lmm_update_variable_bound(getModel()->getMaxminSystem(), variable_, bound);
+    getModel()->getMaxminSystem()->update_variable_bound(variable_, bound);
 
   if (getModel()->getUpdateMechanism() == UM_LAZY && getLastUpdate() != surf_get_clock())
     heapRemove(getModel()->getActionHeap());
   XBT_OUT();
 }
 
-double Action::getStartTime()
-{
-  return start_;
-}
-
-double Action::getFinishTime()
-{
-  /* keep the function behavior, some models (cpu_ti) change the finish time before the action end */
-  return remains_ <= 0 ? finishTime_ : -1;
-}
-
-void Action::setData(void* data)
-{
-  data_ = data;
-}
-
 void Action::setCategory(const char *category)
 {
   category_ = xbt_strdup(category);
@@ -739,13 +676,11 @@ void Action::setMaxDuration(double duration)
     heapRemove(getModel()->getActionHeap());
 }
 
-void Action::gapRemove() {}
-
 void Action::setSharingWeight(double weight)
 {
   XBT_IN("(%p,%g)", this, weight);
   sharingWeight_ = weight;
-  lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), weight);
+  getModel()->getMaxminSystem()->update_variable_weight(getVariable(), weight);
 
   if (getModel()->getUpdateMechanism() == UM_LAZY)
     heapRemove(getModel()->getActionHeap());
@@ -767,7 +702,7 @@ int Action::unref(){
     if (action_hook.is_linked())
       stateSet_->erase(stateSet_->iterator_to(*this));
     if (getVariable())
-      lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
+      getModel()->getMaxminSystem()->variable_free(getVariable());
     if (getModel()->getUpdateMechanism() == UM_LAZY) {
       /* remove from heap */
       heapRemove(getModel()->getActionHeap());
@@ -784,7 +719,7 @@ void Action::suspend()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != 2) {
-    lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), 0.0);
+    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
     if (getModel()->getUpdateMechanism() == UM_LAZY){
       heapRemove(getModel()->getActionHeap());
       if (getModel()->getUpdateMechanism() == UM_LAZY && stateSet_ == getModel()->getRunningActionSet() &&
@@ -802,7 +737,7 @@ void Action::resume()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != 2) {
-    lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), sharingWeight_);
+    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), getPriority());
     suspended_ = 0;
     if (getModel()->getUpdateMechanism() == UM_LAZY)
       heapRemove(getModel()->getActionHeap());
@@ -821,34 +756,31 @@ bool Action::isSuspended()
  * LATENCY = this is a heap entry to warn us when the latency is payed
  * MAX_DURATION =this is a heap entry to warn us when the max_duration limit is reached
  */
-void Action::heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat)
+void Action::heapInsert(heap_type& heap, double key, enum heap_action_type hat)
 {
   hat_ = hat;
-  xbt_heap_push(heap, this, key);
+  heapHandle_ = heap.emplace(std::make_pair(key, this));
 }
 
-void Action::heapRemove(xbt_heap_t heap)
+void Action::heapRemove(heap_type& heap)
 {
   hat_ = NOTSET;
-  if (indexHeap_ >= 0) {
-    xbt_heap_remove(heap, indexHeap_);
+  if (heapHandle_) {
+    heap.erase(*heapHandle_);
+    clearHeapHandle();
   }
 }
 
-void Action::heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat)
+void Action::heapUpdate(heap_type& heap, double key, enum heap_action_type hat)
 {
   hat_ = hat;
-  if (indexHeap_ >= 0) {
-    xbt_heap_update(heap, indexHeap_, key);
-  }else{
-    xbt_heap_push(heap, this, key);
+  if (heapHandle_) {
+    heap.update(*heapHandle_, std::make_pair(key, this));
+  } else {
+    heapHandle_ = heap.emplace(std::make_pair(key, this));
   }
 }
 
-void Action::updateIndexHeap(int i) {
-  indexHeap_ = i;
-}
-
 double Action::getRemains()
 {
   XBT_IN("(%p)", this);
@@ -859,58 +791,5 @@ double Action::getRemains()
   return remains_;
 }
 
-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();
-      setState(Action::State::done);
-      heapRemove(getModel()->getActionHeap());
-    }
-  }
-
-  lastUpdate_ = now;
-  lastValue_ = lmm_variable_getvalue(getVariable());
-}
-
 }
 }
index b9e8b2c..3809ade 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. */
@@ -7,13 +7,19 @@
 #define SURF_MODEL_H_
 
 #include "xbt/signal.hpp"
+#include "xbt/utility.hpp"
 
-#include "src/surf/surf_private.h"
-#include "surf/surf.h"
+#include "src/surf/surf_private.hpp"
+#include "surf/surf.hpp"
 #include "xbt/str.h"
 
+#include <boost/heap/pairing_heap.hpp>
 #include <boost/intrusive/list.hpp>
+#include <boost/optional.hpp>
+#include <cmath>
+#include <set>
 #include <string>
+#include <unordered_map>
 
 #define NO_MAX_DURATION -1.0
 
  *********/
 
 /* user-visible parameters */
+XBT_PUBLIC_DATA(double) sg_maxmin_precision;
+XBT_PUBLIC_DATA(double) sg_surf_precision;
+XBT_PUBLIC_DATA(int) sg_concurrency_limit;
+
 extern XBT_PRIVATE double sg_tcp_gamma;
-extern XBT_PRIVATE double sg_sender_gap;
 extern XBT_PRIVATE double sg_latency_factor;
 extern XBT_PRIVATE double sg_bandwidth_factor;
 extern XBT_PRIVATE double sg_weight_S_parameter;
 extern XBT_PRIVATE int sg_network_crosstraffic;
 extern XBT_PRIVATE std::vector<std::string> surf_path;
+extern XBT_PRIVATE std::unordered_map<std::string, tmgr_trace_t> traces_set_list;
+extern XBT_PRIVATE std::set<std::string> watched_hosts;
+
+static inline void double_update(double* variable, 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);
+  *variable -= value;
+  if (*variable < precision)
+    *variable = 0.0;
+}
+
+static inline int double_positive(double value, double precision)
+{
+  return (value > precision);
+}
+
+static inline int double_equals(double value1, double value2, double precision)
+{
+  return (fabs(value1 - value2) < precision);
+}
 
 extern "C" {
 XBT_PUBLIC(double) surf_get_clock();
@@ -38,9 +71,6 @@ XBT_PUBLIC(double) surf_get_clock();
  */
 XBT_PUBLIC_DATA(std::vector<sg_host_t>) host_that_restart;
 
-
-extern XBT_PRIVATE double sg_sender_gap;
-
 namespace simgrid {
 namespace surf {
 
@@ -61,18 +91,10 @@ enum heap_action_type{
   NOTSET
 };
 
-/*********
- * Trace *
- *********/
-/* For the trace and trace:connect tag (store their content till the end of the parsing) */
-XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
-
 /**********
  * Action *
  **********/
 
-XBT_PRIVATE void surf_action_lmm_update_index_heap(void *action, int i);
-
 /** \ingroup SURF_models
  *  \brief List of initialized models
  */
@@ -81,6 +103,11 @@ XBT_PUBLIC_DATA(std::vector<surf_model_t>*) all_existing_models;
 namespace simgrid {
 namespace surf {
 
+typedef std::pair<double, simgrid::surf::Action*> heap_element_type;
+typedef boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_size<false>, boost::heap::stable<true>,
+                                  boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>
+    heap_type;
+
 /** @ingroup SURF_interface
  * @brief SURF action interface class
  * @details An action is an event generated by a resource (e.g.: a communication for the network)
@@ -124,31 +151,35 @@ public:
   /** @brief Destructor */
   virtual ~Action();
 
-  /** @brief Mark that the action is now finished */
-  void finish();
+  /**
+   * @brief Mark that the action is now finished
+   *
+   * @param state the new [state](\ref simgrid::surf::Action::State) of the current Action
+   */
+  void finish(Action::State state);
 
   /** @brief Get the [state](\ref simgrid::surf::Action::State) of the current Action */
-  Action::State getState(); /**< get the state*/
+  Action::State getState() const; /**< get the state*/
   /** @brief Set the [state](\ref simgrid::surf::Action::State) of the current Action */
   virtual void setState(Action::State state);
 
   /** @brief Get the bound of the current Action */
-  double getBound();
+  double getBound() const;
   /** @brief Set the bound of the current Action */
   void setBound(double bound);
 
   /** @brief Get the start time of the current action */
-  double getStartTime();
+  double getStartTime() const { return start_; }
   /** @brief Get the finish time of the current action */
-  double getFinishTime();
+  double getFinishTime() const { return finishTime_; }
 
   /** @brief Get the user data associated to the current action */
-  void *getData() {return data_;}
+  void* getData() const { return data_; }
   /** @brief Set the user data associated to the current action */
-  void setData(void* data);
+  void setData(void* data) { data_ = data; }
 
   /** @brief Get the cost of the current action */
-  double getCost() {return cost_;}
+  double getCost() const { return cost_; }
   /** @brief Set the cost of the current action */
   void setCost(double cost) {cost_ = cost;}
 
@@ -165,7 +196,7 @@ public:
   /** @brief Get the remaining time of the current action after updating the resource */
   virtual double getRemains();
   /** @brief Get the remaining time of the current action without updating the resource */
-  double getRemainsNoUpdate();
+  double getRemainsNoUpdate() const { return remains_; }
 
   /** @brief Set the finish time of the current action */
   void setFinishTime(double value) {finishTime_ = value;}
@@ -190,64 +221,68 @@ public:
   virtual bool isSuspended();
 
   /** @brief Get the maximum duration of the current action */
-  double getMaxDuration() {return maxDuration_;}
+  double getMaxDuration() const { return maxDuration_; }
   /** @brief Set the maximum duration of the current Action */
   virtual void setMaxDuration(double duration);
 
   /** @brief Get the tracing category associated to the current action */
-  char *getCategory() {return category_;}
+  char* getCategory() const { return category_; }
   /** @brief Set the tracing category of the current Action */
   void setCategory(const char *category);
 
   /** @brief Get the priority of the current Action */
-  double getPriority() { return sharingWeight_; };
+  double getPriority() const { return sharingWeight_; };
   /** @brief Set the priority of the current Action */
   virtual void setSharingWeight(double priority);
+  void setSharingWeightNoUpdate(double weight) { sharingWeight_ = weight; }
 
   /** @brief Get the state set in which the action is */
-  ActionList* getStateSet() {return stateSet_;};
+  ActionList* getStateSet() const { return stateSet_; };
 
   s_xbt_swag_hookup_t stateHookup_ = {nullptr,nullptr};
 
-  simgrid::surf::Model* getModel() { return model_; }
+  simgrid::surf::Model* getModel() const { return model_; }
 
 protected:
   ActionList* stateSet_;
-  double sharingWeight_ = 1.0; /**< priority (1.0 by default) */
   int    refcount_ = 1;
-  double remains_; /**< How much of that cost remains to be done in the currently running task */
-  double maxDuration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
-  double finishTime_ = -1; /**< finish time : this is modified during the run and fluctuates until the task is completed */
 
 private:
+  double sharingWeight_ = 1.0;             /**< priority (1.0 by default) */
+  double maxDuration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
+  double remains_;                       /**< How much of that cost remains to be done in the currently running task */
   double start_; /**< start time  */
   char *category_ = nullptr;            /**< tracing category for categorized resource utilization monitoring */
+  double finishTime_ =
+      -1; /**< finish time : this is modified during the run and fluctuates until the task is completed */
 
   double    cost_;
   simgrid::surf::Model *model_;
   void *data_ = nullptr; /**< for your convenience */
 
   /* LMM */
+  double lastUpdate_         = 0;
+  double lastValue_          = 0;
+  lmm_variable_t variable_   = nullptr;
+  enum heap_action_type hat_ = NOTSET;
+  boost::optional<heap_type::handle_type> heapHandle_ = boost::none;
+
 public:
-  virtual void updateRemainingLazy(double now);
-  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);
-  void updateIndexHeap(int i);
-  lmm_variable_t getVariable() {return variable_;}
-  double getLastUpdate() {return lastUpdate_;}
+  virtual void updateRemainingLazy(double now) { THROW_IMPOSSIBLE; };
+  void heapInsert(heap_type& heap, double key, enum heap_action_type hat);
+  void heapRemove(heap_type& heap);
+  void heapUpdate(heap_type& heap, double key, enum heap_action_type hat);
+  void clearHeapHandle() { heapHandle_ = boost::none; }
+  lmm_variable_t getVariable() const { return variable_; }
+  void setVariable(lmm_variable_t var) { variable_ = var; }
+  double getLastUpdate() const { return lastUpdate_; }
   void refreshLastUpdate() {lastUpdate_ = surf_get_clock();}
-  enum heap_action_type getHat() {return hat_;}
-  bool is_linked() {return action_lmm_hook.is_linked();}
-  void gapRemove();
-
+  double getLastValue() const { return lastValue_; }
+  void setLastValue(double val) { lastValue_ = val; }
+  enum heap_action_type getHat() const { return hat_; }
+  bool is_linked() const { return action_lmm_hook.is_linked(); }
 protected:
-  lmm_variable_t variable_ = nullptr;
-  double lastValue_ = 0;
-  double lastUpdate_ = 0;
   int suspended_ = 0;
-  int indexHeap_;
-  enum heap_action_type hat_ = NOTSET;
 };
 
 typedef Action::ActionList ActionList;
@@ -271,31 +306,36 @@ public:
   virtual ~Model();
 
   /** @brief Get the set of [actions](@ref Action) in *ready* state */
-  virtual ActionList* getReadyActionSet() {return readyActionSet_;}
+  virtual ActionList* getReadyActionSet() const { return readyActionSet_; }
 
   /** @brief Get the set of [actions](@ref Action) in *running* state */
-  virtual ActionList* getRunningActionSet() {return runningActionSet_;}
+  virtual ActionList* getRunningActionSet() const { return runningActionSet_; }
 
   /** @brief Get the set of [actions](@ref Action) in *failed* state */
-  virtual ActionList* getFailedActionSet() {return failedActionSet_;}
+  virtual ActionList* getFailedActionSet() const { return failedActionSet_; }
 
   /** @brief Get the set of [actions](@ref Action) in *done* state */
-  virtual ActionList* getDoneActionSet() {return doneActionSet_;}
+  virtual ActionList* getDoneActionSet() const { return doneActionSet_; }
 
   /** @brief Get the set of modified [actions](@ref Action) */
-  virtual ActionLmmListPtr getModifiedSet() {return modifiedSet_;}
+  virtual ActionLmmListPtr getModifiedSet() const { return modifiedSet_; }
 
   /** @brief Get the maxmin system of the current Model */
-  lmm_system_t getMaxminSystem() {return maxminSystem_;}
+  lmm_system_t getMaxminSystem() const { return maxminSystem_; }
 
   /**
    * @brief Get the update mechanism of the current Model
    * @see e_UM_t
    */
-  e_UM_t getUpdateMechanism() {return updateMechanism_;}
+  e_UM_t getUpdateMechanism() const { return updateMechanism_; }
+  void setUpdateMechanism(e_UM_t mechanism) { updateMechanism_ = mechanism; }
 
   /** @brief Get Action heap */
-  xbt_heap_t getActionHeap() {return actionHeap_;}
+  heap_type& getActionHeap() { return actionHeap_; }
+
+  double actionHeapTopDate() const { return actionHeap_.top().first; }
+  Action* actionHeapPop();
+  bool actionHeapIsEmpty() const { return actionHeap_.empty(); }
 
   /**
    * @brief Share the resources between the actions
@@ -327,15 +367,15 @@ public:
 protected:
   ActionLmmListPtr modifiedSet_;
   lmm_system_t maxminSystem_ = nullptr;
-  e_UM_t updateMechanism_ = UM_UNDEFINED;
   bool selectiveUpdate_;
-  xbt_heap_t actionHeap_;
 
 private:
+  e_UM_t updateMechanism_ = UM_UNDEFINED;
   ActionList* readyActionSet_; /**< Actions in state SURF_ACTION_READY */
   ActionList* runningActionSet_; /**< Actions in state SURF_ACTION_RUNNING */
   ActionList* failedActionSet_; /**< Actions in state SURF_ACTION_FAILED */
   ActionList* doneActionSet_; /**< Actions in state SURF_ACTION_DONE */
+  heap_type actionHeap_;
 };
 
 }
@@ -348,11 +388,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 {
@@ -370,7 +410,7 @@ public:
    * @param name The name of the Resource
    * @param constraint The lmm constraint associated to this Resource if it is part of a LMM component
    */
-  Resource(Model *model, const char *name, lmm_constraint_t constraint);
+  Resource(Model * model, const std::string& name, lmm_constraint_t constraint);
 
   virtual ~Resource();
 
@@ -378,7 +418,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;
 
@@ -419,14 +461,10 @@ protected:
 }
 
 namespace std {
-  template <>
-  struct hash<simgrid::surf::Resource>
-  {
-    std::size_t operator()(const simgrid::surf::Resource& r) const
-    {
-      return (std::size_t) xbt_str_hash(r.cname());
-    }
-  };
+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.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 5a53d7a..0000000
+++ /dev/null
@@ -1,59 +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()
-
-XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib;
-
-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(const char* 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..41c5540
--- /dev/null
@@ -0,0 +1,53 @@
+/* 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/surf.hpp"
+
+#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_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 7771715..d5e70c1 100644 (file)
@@ -1,23 +1,21 @@
-/* Copyright (c) 2004-2005, 2007, 2009-2014. The SimGrid Team.
+/* Copyright (c) 2004-2005, 2007, 2009-2014, 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. */
 
 #include "xbt/sysdep.h"
-#include "xbt/dict.h"
 #include "xbt/log.h"
-#include "xbt/str.h"
 
 #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>
 #include <boost/algorithm/string/split.hpp>
+#include <cmath>
 #include <fstream>
-#include <math.h>
 #include <sstream>
 #include <unordered_map>
 
@@ -25,7 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_trace, surf, "Surf trace management");
 
 namespace tmgr = simgrid::trace_mgr;
 
-static std::unordered_map<const char*, tmgr::trace*> trace_list;
+static std::unordered_map<std::string, tmgr::trace*> trace_list;
 
 static inline bool doubleEq(double d1, double d2)
 {
@@ -52,20 +50,23 @@ trace::trace()
 }
 trace::~trace()                  = default;
 future_evt_set::future_evt_set() = default;
-simgrid::trace_mgr::future_evt_set::~future_evt_set()
+future_evt_set::~future_evt_set()
 {
-  xbt_heap_free(heap_);
+  while (not heap_.empty()) {
+    delete heap_.top().second;
+    heap_.pop();
+  }
 }
 }
 }
 
-tmgr_trace_t tmgr_trace_new_from_string(const char* name, std::string input, double periodicity)
+tmgr_trace_t tmgr_trace_new_from_string(std::string name, std::string input, double periodicity)
 {
   int linecount = 0;
   tmgr_trace_t trace           = new simgrid::trace_mgr::trace();
   tmgr::DatedValue* last_event = &(trace->event_list.back());
 
-  xbt_assert(trace_list.find(name) == trace_list.end(), "Refusing to define trace %s twice", name);
+  xbt_assert(trace_list.find(name) == trace_list.end(), "Refusing to define trace %s twice", name.c_str());
 
   std::vector<std::string> list;
   boost::split(list, input, boost::is_any_of("\n\r"));
@@ -81,10 +82,10 @@ tmgr_trace_t tmgr_trace_new_from_string(const char* name, std::string input, dou
       continue;
 
     xbt_assert(sscanf(val.c_str(), "%lg  %lg\n", &event.date_, &event.value_) == 2, "%s:%d: Syntax error in trace\n%s",
-               name, linecount, input.c_str());
+               name.c_str(), linecount, input.c_str());
 
     xbt_assert(last_event->date_ <= event.date_,
-               "%s:%d: Invalid trace: Events must be sorted, but time %g > time %g.\n%s", name, linecount,
+               "%s:%d: Invalid trace: Events must be sorted, but time %g > time %g.\n%s", name.c_str(), linecount,
                last_event->date_, event.date_, input.c_str());
     last_event->date_ = event.date_ - last_event->date_;
 
@@ -99,18 +100,18 @@ tmgr_trace_t tmgr_trace_new_from_string(const char* name, std::string input, dou
     }
   }
 
-  trace_list.insert({xbt_strdup(name), trace});
+  trace_list.insert({name, trace});
 
   return trace;
 }
 
-tmgr_trace_t tmgr_trace_new_from_file(const char *filename)
+tmgr_trace_t tmgr_trace_new_from_file(std::string filename)
 {
-  xbt_assert(filename && filename[0], "Cannot parse a trace from the null or empty filename");
-  xbt_assert(trace_list.find(filename) == trace_list.end(), "Refusing to define trace %s twice", filename);
+  xbt_assert(not filename.empty(), "Cannot parse a trace from an empty filename");
+  xbt_assert(trace_list.find(filename) == trace_list.end(), "Refusing to define trace %s twice", filename.c_str());
 
   std::ifstream* f = surf_ifsopen(filename);
-  xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", filename, (boost::join(surf_path, ":")).c_str());
+  xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", filename.c_str(), (boost::join(surf_path, ":")).c_str());
 
   std::stringstream buffer;
   buffer << f->rdbuf();
@@ -124,14 +125,15 @@ tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::add_trace(tmgr_trace_t tr
 {
   tmgr_trace_event_t trace_iterator = nullptr;
 
-  trace_iterator = xbt_new0(s_tmgr_trace_event_t, 1);
-  trace_iterator->trace = trace;
-  trace_iterator->idx = 0;
+  trace_iterator           = new s_tmgr_trace_event_t;
+  trace_iterator->trace    = trace;
+  trace_iterator->idx      = 0;
   trace_iterator->resource = resource;
+  trace_iterator->free_me  = false;
 
   xbt_assert((trace_iterator->idx < trace->event_list.size()), "Your trace should have at least one event!");
 
-  xbt_heap_push(heap_, trace_iterator, 0. /*start_time*/);
+  heap_.emplace(0.0 /* start time */, trace_iterator);
 
   return trace_iterator;
 }
@@ -139,9 +141,7 @@ tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::add_trace(tmgr_trace_t tr
 /** @brief returns the date of the next occurring event (pure function) */
 double simgrid::trace_mgr::future_evt_set::next_date() const
 {
-  if (xbt_heap_size(heap_))
-    return (xbt_heap_maxkey(heap_));
-  return -1.0;
+  return heap_.empty() ? -1.0 : heap_.top().first;
 }
 
 /** @brief Retrieves the next occurring event, or nullptr if none happens before #date */
@@ -152,9 +152,10 @@ tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::pop_leq(double date, doub
   if (event_date > date)
     return nullptr;
 
-  tmgr_trace_event_t trace_iterator = (tmgr_trace_event_t)xbt_heap_pop(heap_);
-  if (trace_iterator == nullptr)
+  if (heap_.empty())
     return nullptr;
+  tmgr_trace_event_t trace_iterator = heap_.top().second;
+  heap_.pop();
 
   tmgr_trace_t trace = trace_iterator->trace;
   *resource = trace_iterator->resource;
@@ -164,13 +165,13 @@ tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::pop_leq(double date, doub
   *value = dateVal.value_;
 
   if (trace_iterator->idx < trace->event_list.size() - 1) {
-    xbt_heap_push(heap_, trace_iterator, event_date + dateVal.date_);
+    heap_.emplace(event_date + dateVal.date_, trace_iterator);
     trace_iterator->idx++;
   } else if (dateVal.date_ > 0) { /* Last element. Shall we loop? */
-    xbt_heap_push(heap_, trace_iterator, event_date + dateVal.date_);
+    heap_.emplace(event_date + dateVal.date_, trace_iterator);
     trace_iterator->idx = 1; /* idx=0 is a placeholder to store when events really start */
   } else {                   /* If we don't loop, we don't need this trace_event anymore */
-    trace_iterator->free_me = 1;
+    trace_iterator->free_me = true;
   }
 
   return trace_iterator;
@@ -178,17 +179,15 @@ tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::pop_leq(double date, doub
 
 void tmgr_finalize()
 {
-  for (auto kv : trace_list) {
-    xbt_free((char*)kv.first);
+  for (auto const& kv : trace_list)
     delete kv.second;
-  }
   trace_list.clear();
 }
 
 void tmgr_trace_event_unref(tmgr_trace_event_t* trace_event)
 {
   if ((*trace_event)->free_me) {
-    xbt_free(*trace_event);
+    delete *trace_event;
     *trace_event = nullptr;
   }
 }
index d78d4de..955ff2a 100644 (file)
@@ -7,20 +7,20 @@
 #define SURF_TMGR_H
 
 #include "simgrid/forward.h"
-#include "xbt/heap.h"
 #include "xbt/sysdep.h"
+#include <queue>
 #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;
+  bool free_me;
+};
+typedef s_tmgr_trace_event_t* tmgr_trace_event_t;
 
 /**
  * \brief Free a trace event structure
@@ -33,12 +33,10 @@ XBT_PUBLIC(void) tmgr_trace_event_unref(tmgr_trace_event_t* trace_event);
 
 XBT_PUBLIC(void) tmgr_finalize();
 
-XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(const char* filename);
-XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char* id, std::string input, double periodicity);
-
-SG_END_DECL()
+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);
+}
 
-#ifdef __cplusplus
 namespace simgrid {
 /** @brief Modeling of the availability profile (due to an external load) or the churn
  *
@@ -93,11 +91,10 @@ public:
   tmgr_trace_event_t add_trace(tmgr_trace_t trace, simgrid::surf::Resource * resource);
 
 private:
-  // TODO: use a boost type for the heap (or a ladder queue)
-  xbt_heap_t heap_ = xbt_heap_new(8, xbt_free_f); /* Content: only trace_events (yep, 8 is an arbitrary value) */
+  typedef std::pair<double, tmgr_trace_event_t> Qelt;
+  std::priority_queue<Qelt, std::vector<Qelt>, std::greater<Qelt>> heap_;
 };
 
 }} // namespace simgrid::trace_mgr
-#endif /* C++ only */
 
 #endif /* SURF_TMGR_H */
index 30b261e..823baf8 100644 (file)
@@ -15,7 +15,7 @@ bool init_unit_test(); // boost forget to give this prototype on NetBSD, which d
 #include "xbt/log.h"
 #include "xbt/misc.h"
 
-#include <math.h>
+#include <cmath>
 
 namespace utf  = boost::unit_test;
 namespace tmgr = simgrid::trace_mgr;
@@ -28,7 +28,7 @@ public:
   explicit MockedResource() : simgrid::surf::Resource(nullptr, "fake", nullptr) {}
   void apply_event(tmgr_trace_event_t event, double value)
   {
-    XBT_VERB("t=%.1f: Change value to %lg (idx: %d)", thedate, value, event->idx);
+    XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", thedate, value, event->idx);
     tmgr_trace_event_unref(&event);
   }
   bool isUsed() { return true; }
@@ -39,7 +39,7 @@ static void trace2vector(const char* str, std::vector<tmgr::DatedValue>* whereto
   simgrid::trace_mgr::trace* trace = tmgr_trace_new_from_string("TheName", str, 0);
   XBT_VERB("---------------------------------------------------------");
   XBT_VERB("data>>\n%s<<data\n", str);
-  for (auto evt : trace->event_list)
+  for (auto const& evt : trace->event_list)
     XBT_VERB("event: d:%lg v:%lg", evt.date_, evt.value_);
 
   MockedResource daResource;
@@ -59,7 +59,7 @@ static void trace2vector(const char* str, std::vector<tmgr::DatedValue>* whereto
       res->apply_event(it, value);
       whereto->push_back(tmgr::DatedValue(thedate, value));
     } else {
-      XBT_DEBUG("%.1f: ignore an event (idx: %d)\n", thedate, it->idx);
+      XBT_DEBUG("%.1f: ignore an event (idx: %u)\n", thedate, it->idx);
     }
   }
   tmgr_finalize();
@@ -157,6 +157,7 @@ static bool init_function()
 
 int main(int argc, char** argv)
 {
+  XBT_LOG_CONNECT(unit);
   xbt_log_init(&argc, argv);
   return ::boost::unit_test::unit_test_main(&init_function, argc, argv);
 }
index 3d29ba4..51b7cc3 100644 (file)
@@ -3,15 +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 SURF_SURFXML_PARSE_H
-#define SURF_SURFXML_PARSE_H
+#ifndef SURF_SURFXML_PARSE_HPP
+#define SURF_SURFXML_PARSE_HPP
 
-#include <xbt/dict.h>
-#include <xbt/function_types.h>
-#include <xbt/misc.h>
 #include <xbt/signal.hpp>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Module management functions */
 XBT_PUBLIC(void) sg_platf_init();;
@@ -19,20 +16,19 @@ XBT_PUBLIC(void) sg_platf_exit();
 
 XBT_PUBLIC(void) surf_parse_open(const char *file);
 XBT_PUBLIC(void) surf_parse_close();
-XBT_PUBLIC(void) surf_parse_assert(bool cond, const char *fmt, ...) XBT_ATTRIB_PRINTF(2,3);
-XBT_PUBLIC(void) XBT_ATTRIB_NORETURN surf_parse_error(const char *msg,...) XBT_ATTRIB_PRINTF(1,2);
-XBT_PUBLIC(void) surf_parse_assert_netpoint(char* hostname, const char* pre, const char* post);
-XBT_PUBLIC(void) surf_parse_warn(const char *msg,...) XBT_ATTRIB_PRINTF(1,2);
-
-XBT_PUBLIC(double) surf_parse_get_double(const char *string);
-XBT_PUBLIC(int) surf_parse_get_int(const char *string);
-XBT_PUBLIC(double) surf_parse_get_time(const char *string, const char *entity_kind, const char *name);
-XBT_PUBLIC(double) surf_parse_get_size(const char *string, const char *entity_kind, const char *name);
-XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string, const char *entity_kind, const char *name);
-XBT_PUBLIC(double) surf_parse_get_speed(const char *string, const char *entity_kind, const char *name);
+XBT_PUBLIC(void) surf_parse_assert(bool cond, std::string msg);
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void) surf_parse_error(std::string msg);
+XBT_PUBLIC(void) surf_parse_assert_netpoint(std::string hostname, std::string pre, std::string post);
+XBT_PUBLIC(void) surf_parse_warn(std::string msg);
+
+XBT_PUBLIC(double) surf_parse_get_double(std::string s);
+XBT_PUBLIC(int) surf_parse_get_int(std::string s);
+XBT_PUBLIC(double) surf_parse_get_time(const char* string, const char* entity_kind, std::string name);
+XBT_PUBLIC(double) surf_parse_get_size(const char* string, const char* entity_kind, std::string name);
+XBT_PUBLIC(double) surf_parse_get_bandwidth(const char* string, const char* entity_kind, std::string name);
+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 d6b4dd8..13b3012 100644 (file)
@@ -1,6 +1,6 @@
 /* platf_private.h - Interface to the SimGrid platforms which visibility should be limited to this directory */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* Copyright (c) 2004-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 <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,24 +41,24 @@ typedef enum {
  * used, instead of malloced structures.
  */
 
-typedef struct {
-  const char* id;
+struct s_sg_platf_host_cbarg_t {
+  const char* id = nullptr;
   std::vector<double> speed_per_pstate;
-  int pstate;
-  int core_amount;
-  tmgr_trace_t speed_trace;
-  tmgr_trace_t state_trace;
-  const char* coord;
-  xbt_dict_t properties;
-} s_sg_platf_host_cbarg_t;
+  int pstate               = 0;
+  int core_amount          = 0;
+  tmgr_trace_t speed_trace = nullptr;
+  tmgr_trace_t state_trace = nullptr;
+  const char* coord        = nullptr;
+  std::map<std::string, std::string>* properties = nullptr;
+};
 typedef s_sg_platf_host_cbarg_t* sg_platf_host_cbarg_t;
 
-typedef struct {
-  const char* id;
-  const char* link_up;
-  const char* link_down;
-} s_sg_platf_host_link_cbarg_t;
-typedef s_sg_platf_host_link_cbarg_t* sg_platf_host_link_cbarg_t;
+class HostLinkCreationArgs {
+public:
+  std::string id;
+  std::string link_up;
+  std::string link_down;
+};
 
 class LinkCreationArgs {
 public:
@@ -69,129 +69,126 @@ public:
   tmgr_trace_t latency_trace          = nullptr;
   tmgr_trace_t state_trace            = nullptr;
   e_surf_link_sharing_policy_t policy = SURF_LINK_FATPIPE;
-  xbt_dict_t properties               = nullptr;
+  std::map<std::string, std::string>* properties = nullptr;
 };
 
-typedef struct s_sg_platf_peer_cbarg *sg_platf_peer_cbarg_t;
-typedef struct s_sg_platf_peer_cbarg {
-  const char* id;
+class PeerCreationArgs {
+public:
+  std::string id;
   double speed;
   double bw_in;
   double bw_out;
-  const char* coord;
+  std::string coord;
   tmgr_trace_t speed_trace;
   tmgr_trace_t state_trace;
-} s_sg_platf_peer_cbarg_t;
-
-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;
-
-typedef struct s_sg_platf_cluster_cbarg *sg_platf_cluster_cbarg_t;
-typedef struct s_sg_platf_cluster_cbarg {
-  const char* id;
-  const char* prefix;
-  const char* suffix;
-  std::vector<int>* radicals;
+};
+
+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;
+};
+typedef s_sg_platf_route_cbarg_t* sg_platf_route_cbarg_t;
+
+class ClusterCreationArgs {
+public:
+  std::string id;
+  std::string prefix;
+  std::string suffix;
+  std::vector<int>* radicals = nullptr;
   std::vector<double> speeds;
-  int core_amount;
-  double bw;
-  double lat;
-  double bb_bw;
-  double bb_lat;
-  double loopback_bw;
-  double loopback_lat;
-  double limiter_link;
+  int core_amount     = 0;
+  double bw           = 0;
+  double lat          = 0;
+  double bb_bw        = 0;
+  double bb_lat       = 0;
+  double loopback_bw  = 0;
+  double loopback_lat = 0;
+  double limiter_link = 0;
   e_surf_cluster_topology_t topology;
-  const char* topo_parameters;
-  xbt_dict_t properties;
-  const char* router_id;
+  std::string topo_parameters;
+  std::map<std::string, std::string>* properties;
+  std::string router_id;
   e_surf_link_sharing_policy_t sharing_policy;
   e_surf_link_sharing_policy_t bb_sharing_policy;
-} s_sg_platf_cluster_cbarg_t;
+};
 
-typedef struct s_sg_platf_cabinet_cbarg* sg_platf_cabinet_cbarg_t;
-typedef struct s_sg_platf_cabinet_cbarg {
-  const char* id;
-  const char* prefix;
-  const char* suffix;
+class CabinetCreationArgs {
+public:
+  std::string id;
+  std::string prefix;
+  std::string suffix;
   std::vector<int>* radicals;
   double speed;
   double bw;
   double lat;
-} s_sg_platf_cabinet_cbarg_t;
-
-typedef struct s_sg_platf_storage_cbarg* sg_platf_storage_cbarg_t;
-typedef struct s_sg_platf_storage_cbarg {
-  const char* id;
-  const char* type_id;
-  const char* content;
-  xbt_dict_t properties;
-  const char* attach;
-} s_sg_platf_storage_cbarg_t;
-
-typedef struct s_sg_platf_storage_type_cbarg* sg_platf_storage_type_cbarg_t;
-typedef struct s_sg_platf_storage_type_cbarg {
-  const char* id;
-  const char* model;
-  const char* content;
-  xbt_dict_t properties;
+};
+
+class StorageCreationArgs {
+public:
+  std::string id;
+  std::string type_id;
+  std::string content;
+  std::map<std::string, std::string>* properties;
+  std::string attach;
+};
+
+class StorageTypeCreationArgs {
+public:
+  std::string id;
+  std::string model;
+  std::string content;
+  std::map<std::string, std::string>* properties;
   std::map<std::string, std::string>* model_properties;
   sg_size_t size;
-} s_sg_platf_storage_type_cbarg_t;
+};
 
-typedef struct s_sg_platf_mount_cbarg* sg_platf_mount_cbarg_t;
-typedef struct s_sg_platf_mount_cbarg {
-  const char* storageId;
-  const char* name;
-} s_sg_platf_mount_cbarg_t;
+class MountCreationArgs {
+public:
+  std::string storageId;
+  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;
 
-typedef struct s_sg_platf_trace_cbarg *sg_platf_trace_cbarg_t;
-typedef struct s_sg_platf_trace_cbarg {
-  const char *id;
-  const char *file;
+class TraceCreationArgs {
+public:
+  std::string id;
+  std::string file;
   double periodicity;
-  const char *pc_data;
-} s_sg_platf_trace_cbarg_t;
+  std::string pc_data;
+};
 
-typedef struct s_sg_platf_trace_connect_cbarg *sg_platf_trace_connect_cbarg_t;
-typedef struct s_sg_platf_trace_connect_cbarg {
+class TraceConnectCreationArgs {
+public:
   e_surf_trace_connect_kind_t kind;
-  const char *trace;
-  const char *element;
-} s_sg_platf_trace_connect_cbarg_t;
-
-typedef struct s_sg_platf_process_cbarg *sg_platf_process_cbarg_t;
-typedef struct s_sg_platf_process_cbarg {
-  const char **argv;
-  int argc;
-  xbt_dict_t properties;
-  const char *host;
-  const char *function;
-  double start_time;
-  double kill_time;
-  e_surf_process_on_failure_t on_failure;
-} s_sg_platf_process_cbarg_t;
-
-typedef struct s_sg_platf_AS_cbarg *sg_platf_AS_cbarg_t;
-typedef struct s_sg_platf_AS_cbarg {
-  const char *id;
-  int routing;
-} s_sg_platf_AS_cbarg_t;
+  std::string trace;
+  std::string element;
+};
+
+struct s_sg_platf_process_cbarg_t {
+  std::vector<std::string> args;
+  std::map<std::string, std::string>* properties = nullptr;
+  const char* host                       = nullptr;
+  const char* function                   = nullptr;
+  double start_time                      = 0.0;
+  double kill_time                       = 0.0;
+  e_surf_process_on_failure_t on_failure = {};
+};
+typedef s_sg_platf_process_cbarg_t* sg_platf_process_cbarg_t;
 
-#define SG_PLATF_AS_INITIALIZER {nullptr,0}
+class ZoneCreationArgs {
+public:
+  std::string id;
+  int routing;
+};
 
 /********** Routing **********/
 void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb);
@@ -200,29 +197,29 @@ void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb);
 XBT_PUBLIC(void) sg_platf_begin();  // Start a new platform
 XBT_PUBLIC(void) sg_platf_end(); // Finish the creation of the platform
 
-XBT_PUBLIC(simgrid::s4u::NetZone*) sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS); // Begin description of new AS
-XBT_PUBLIC(void) sg_platf_new_AS_seal();                     // That AS is fully described
+XBT_PUBLIC(simgrid::s4u::NetZone*) sg_platf_new_Zone_begin(ZoneCreationArgs* zone); // Begin description of new Zone
+XBT_PUBLIC(void) sg_platf_new_Zone_seal();                                          // That Zone is fully described
 
-XBT_PUBLIC(void) sg_platf_new_host   (sg_platf_host_cbarg_t   host);   // Add an host   to the currently described AS
-XBT_PUBLIC(void) sg_platf_new_hostlink(sg_platf_host_link_cbarg_t h); // Add an host_link to the currently described AS
-XBT_PUBLIC(simgrid::kernel::routing::NetPoint*)
-sg_platf_new_router(const char* name, const char* coords);             // Add a router  to the currently described AS
-XBT_PUBLIC(void) sg_platf_new_link(LinkCreationArgs* link);            // Add a link    to the currently described AS
-XBT_PUBLIC(void) sg_platf_new_peer   (sg_platf_peer_cbarg_t peer);     // Add a peer    to the currently described AS
-XBT_PUBLIC(void) sg_platf_new_cluster(sg_platf_cluster_cbarg_t clust); // Add a cluster to the currently described AS
-XBT_PUBLIC(void) sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet); // Add a cabinet to the currently described AS
+XBT_PUBLIC(void) sg_platf_new_host(sg_platf_host_cbarg_t host);        // Add a host      to the current Zone
+XBT_PUBLIC(void) sg_platf_new_hostlink(HostLinkCreationArgs* h);       // Add a host_link to the current Zone
+XBT_PUBLIC(void) sg_platf_new_link(LinkCreationArgs* link);            // Add a link      to the current Zone
+XBT_PUBLIC(void) sg_platf_new_peer(PeerCreationArgs* peer);            // Add a peer      to the current Zone
+XBT_PUBLIC(void) sg_platf_new_cluster(ClusterCreationArgs* clust);     // Add a cluster   to the current Zone
+XBT_PUBLIC(void) sg_platf_new_cabinet(CabinetCreationArgs* cabinet);   // Add a cabinet   to the current Zone
+XBT_PUBLIC(simgrid::kernel::routing::NetPoint*)                        // Add a router    to the current Zone
+sg_platf_new_router(std::string, const char* coords);
 
 XBT_PUBLIC(void) sg_platf_new_route (sg_platf_route_cbarg_t route); // Add a route
 XBT_PUBLIC(void) sg_platf_new_bypassRoute (sg_platf_route_cbarg_t bypassroute); // Add a bypassRoute
 
-XBT_PUBLIC(void) sg_platf_new_trace(sg_platf_trace_cbarg_t trace);
+XBT_PUBLIC(void) sg_platf_new_trace(TraceCreationArgs* trace);
 
-XBT_PUBLIC(void) sg_platf_new_storage(sg_platf_storage_cbarg_t storage); // Add a storage to the currently described AS
-XBT_PUBLIC(void) sg_platf_new_storage_type(sg_platf_storage_type_cbarg_t storage_type);
-XBT_PUBLIC(void) sg_platf_new_mount(sg_platf_mount_cbarg_t mount);
+XBT_PUBLIC(void) sg_platf_new_storage(StorageCreationArgs* storage); // Add a storage to the current Zone
+XBT_PUBLIC(void) sg_platf_new_storage_type(StorageTypeCreationArgs* storage_type);
+XBT_PUBLIC(void) sg_platf_new_mount(MountCreationArgs* mount);
 
 XBT_PUBLIC(void) sg_platf_new_process(sg_platf_process_cbarg_t process);
-XBT_PRIVATE void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect);
+XBT_PRIVATE void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect);
 
 /* Prototypes of the functions offered by flex */
 XBT_PUBLIC(int) surf_parse_lex();
@@ -237,16 +234,12 @@ XBT_PUBLIC(void) surf_parse_set_out(FILE * out_str);
 XBT_PUBLIC(int) surf_parse_get_debug();
 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 {
 
-extern XBT_PRIVATE simgrid::xbt::signal<void(sg_platf_cluster_cbarg_t)> on_cluster;
-
+extern XBT_PRIVATE simgrid::xbt::signal<void(ClusterCreationArgs*)> on_cluster;
 }
 }
 
index 475388f..07d6a11 100644 (file)
@@ -4,11 +4,17 @@
 More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
 To upgrade your files, use the tool simgrid_update_xml
 
+* Things that will change in upcoming version 5 (TODO):
+  - The following tags will be removed:
+    - <include> spits an error since v3.18
+    - <random> does nothing since a very long time
+    - <as>, <asroute>, <bypassZoneRoute> and <process>, deprecated in DTD4.1
+
 * New in DTD version 4.1 (in SimGrid 3.16): backward compatible change (v4 files are valid v4.1 files)
    - <zone> can be used as a synonym for the now deprecated <as>
    - <zoneRoute> can be used as a synonym for the now deprecated <asroute>
    - <bypassZoneRoute> an be used as a synonym for the now deprecated <bypassAsRoute>
-   - <actor>  can be used as a synonym for the now deprecated <process>
+   - <actor> can be used as a synonym for the now deprecated <process>
 
 * New in DTD version 4 (in SimGrid 3.13):
    - Rename (power->speed) the attributes describing the amount of flop
index 361af31..ac9cb57 100644 (file)
@@ -50,7 +50,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types. 
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -67,7 +67,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -200,86 +200,86 @@ extern FILE *surf_parse_in, *surf_parse_out;
                     if ( *p == '\n' )\
                         --surf_parse_lineno;\
             }while(0)
-
+    
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
-  do \
-    { \
-    /* Undo effects of setting up surf_parse_text. */ \
+       do \
+               { \
+               /* Undo effects of setting up surf_parse_text. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-    *yy_cp = (yy_hold_char); \
-    YY_RESTORE_YY_MORE_OFFSET \
-    (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-    YY_DO_BEFORE_ACTION; /* set up surf_parse_text again */ \
-    } \
-  while ( 0 )
+               *yy_cp = (yy_hold_char); \
+               YY_RESTORE_YY_MORE_OFFSET \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+               YY_DO_BEFORE_ACTION; /* set up surf_parse_text again */ \
+               } \
+       while ( 0 )
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
-  {
-  FILE *yy_input_file;
-
-  char *yy_ch_buf;    /* input buffer */
-  char *yy_buf_pos;    /* current position in input buffer */
-
-  /* Size of input buffer in bytes, not including room for EOB
-   * characters.
-   */
-  int yy_buf_size;
-
-  /* Number of characters read into yy_ch_buf, not including EOB
-   * characters.
-   */
-  int yy_n_chars;
-
-  /* Whether we "own" the buffer - i.e., we know we created it,
-   * and can realloc() it to grow it, and should free() it to
-   * delete it.
-   */
-  int yy_is_our_buffer;
-
-  /* Whether this is an "interactive" input source; if so, and
-   * if we're using stdio for input, then we want to use getc()
-   * instead of fread(), to make sure we stop fetching input after
-   * each newline.
-   */
-  int yy_is_interactive;
-
-  /* Whether we're considered to be at the beginning of a line.
-   * If so, '^' rules will be active on the next match, otherwise
-   * not.
-   */
-  int yy_at_bol;
+       {
+       FILE *yy_input_file;
+
+       char *yy_ch_buf;                /* input buffer */
+       char *yy_buf_pos;               /* current position in input buffer */
+
+       /* Size of input buffer in bytes, not including room for EOB
+        * characters.
+        */
+       int yy_buf_size;
+
+       /* Number of characters read into yy_ch_buf, not including EOB
+        * characters.
+        */
+       int yy_n_chars;
+
+       /* Whether we "own" the buffer - i.e., we know we created it,
+        * and can realloc() it to grow it, and should free() it to
+        * delete it.
+        */
+       int yy_is_our_buffer;
+
+       /* Whether this is an "interactive" input source; if so, and
+        * if we're using stdio for input, then we want to use getc()
+        * instead of fread(), to make sure we stop fetching input after
+        * each newline.
+        */
+       int yy_is_interactive;
+
+       /* Whether we're considered to be at the beginning of a line.
+        * If so, '^' rules will be active on the next match, otherwise
+        * not.
+        */
+       int yy_at_bol;
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
 
-  /* Whether to try to fill the input buffer when we reach the
-   * end of it.
-   */
-  int yy_fill_buffer;
+       /* Whether to try to fill the input buffer when we reach the
+        * end of it.
+        */
+       int yy_fill_buffer;
 
-  int yy_buffer_status;
+       int yy_buffer_status;
 
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
-  /* When an EOF's been seen but there's still some text to process
-   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-   * shouldn't try reading from the input source any more.  We might
-   * still have a bunch of tokens to match, though, because of
-   * possible backing-up.
-   *
-   * When we actually see the EOF, we change the status to "new"
-   * (via surf_parse_restart()), so that the user can continue scanning by
-   * just pointing surf_parse_in at a new input file.
-   */
+       /* When an EOF's been seen but there's still some text to process
+        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+        * shouldn't try reading from the input source any more.  We might
+        * still have a bunch of tokens to match, though, because of
+        * possible backing-up.
+        *
+        * When we actually see the EOF, we change the status to "new"
+        * (via surf_parse_restart()), so that the user can continue scanning by
+        * just pointing surf_parse_in at a new input file.
+        */
 #define YY_BUFFER_EOF_PENDING 2
 
-  };
+       };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* Stack of input buffers. */
@@ -304,13 +304,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when surf_parse_text is formed. */
 static char yy_hold_char;
-static int yy_n_chars;    /* number of characters read into yy_ch_buf */
+static int yy_n_chars;         /* number of characters read into yy_ch_buf */
 unsigned int surf_parse_leng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = NULL;
-static int yy_init = 0;    /* whether we need to initialize */
-static int yy_start = 0;  /* start state number */
+static int yy_init = 0;                /* whether we need to initialize */
+static int yy_start = 0;       /* start state number */
 
 /* Flag which is used to allow surf_parse_wrap()'s to do buffer switches
  * instead of setting up a fresh surf_parse_in.  A bit of a hack ...
@@ -342,24 +342,24 @@ void surf_parse_free (void *  );
 #define yy_new_buffer surf_parse__create_buffer
 
 #define yy_set_interactive(is_interactive) \
-  { \
-  if ( ! YY_CURRENT_BUFFER ){ \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){ \
         surf_parse_ensure_buffer_stack (); \
-    YY_CURRENT_BUFFER_LVALUE =    \
+               YY_CURRENT_BUFFER_LVALUE =    \
             surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); \
-  } \
-  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-  }
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+       }
 
 #define yy_set_bol(at_bol) \
-  { \
-  if ( ! YY_CURRENT_BUFFER ){\
+       { \
+       if ( ! YY_CURRENT_BUFFER ){\
         surf_parse_ensure_buffer_stack (); \
-    YY_CURRENT_BUFFER_LVALUE =    \
+               YY_CURRENT_BUFFER_LVALUE =    \
             surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); \
-  } \
-  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-  }
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+       }
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
@@ -393,21 +393,21 @@ static void yynoreturn yy_fatal_error (yyconst char* msg  );
  * corresponding action - sets up surf_parse_text.
  */
 #define YY_DO_BEFORE_ACTION \
-  (yytext_ptr) = yy_bp; \
-  surf_parse_leng = (int) (yy_cp - yy_bp); \
-  (yy_hold_char) = *yy_cp; \
-  *yy_cp = '\0'; \
-  (yy_c_buf_p) = yy_cp;
+       (yytext_ptr) = yy_bp; \
+       surf_parse_leng = (int) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
+       *yy_cp = '\0'; \
+       (yy_c_buf_p) = yy_cp;
 
 #define YY_NUM_RULES 647
 #define YY_END_OF_BUFFER 648
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
-  {
-  flex_int32_t yy_verify;
-  flex_int32_t yy_nxt;
-  };
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
 static yyconst flex_int16_t yy_accept[3886] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -4940,38 +4940,38 @@ static yyconst flex_int16_t yy_chk[13918] =
 /* Table of booleans, true if rule could match eol. */
 static yyconst flex_int32_t yy_rule_can_match_eol[648] =
     {   0,
-0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0,
-    1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0,
-    0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
-    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
-    0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
-    1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1,
-    1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1,
-    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-    0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1,
-    1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1,
-    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
-    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
-    1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1,
-    1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
-    0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-    0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0,
+0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 
+    1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 
+    0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 
+    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 
+    0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 
+    1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 
+    1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 
+    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 
+    0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 
+    1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 
+    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 
+    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 
+    1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 
+    1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 
+    0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 
+    0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 
     0, 0, 1, 0, 0, 0, 1, 0,     };
 
 static yy_state_type yy_last_accepting_state;
@@ -4994,13 +4994,13 @@ char *surf_parse_text;
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  * FleXML is Copyright (C) 2003-2013 Martin Quinson.  All rights reserved.
  * (1.9.6).
- *
+ * 
  * There are two, intertwined parts to this program, part A and part B.
  *
  * Part A
  * ------
- *
- * Some parts, here collectively called "Part A", are found in the
+ * 
+ * Some parts, here collectively called "Part A", are found in the 
  * FleXML package.  They are Copyright (C) 1999-2005 Kristoffer Rose
  * and Copyright (C) 2003-2013 Martin Quinson. All rights reserved.
  *
@@ -5018,20 +5018,20 @@ char *surf_parse_text;
  * Notice that these are explicit rights granted to you for files
  * generated by the FleXML system.  For your rights in connection with
  * the FleXML system itself please consult the GNU General Public License.
- *
+ * 
  * Part B
  * ------
- *
- * The other parts, here collectively called "Part B", and which came
- * from the DTD used by FleXML to generate this program, can be
+ * 
+ * The other parts, here collectively called "Part B", and which came 
+ * from the DTD used by FleXML to generate this program, can be 
  * distributed (or not, as the case may be) under the terms of whoever
- * wrote them, provided these terms respect and obey the two conditions
+ * wrote them, provided these terms respect and obey the two conditions 
  * above under the heading "Part A".
  *
  * The author of and contributors to FleXML specifically disclaim
- * any copyright interest in "Part B", unless "Part B" was written
+ * any copyright interest in "Part B", unless "Part B" was written 
  * by the author of or contributors to FleXML.
- *
+ * 
  */
 
 /* Version strings. */
@@ -5044,7 +5044,7 @@ const char surfxml_flexml_version[] = "1.9.6";
 #include <assert.h>
 #include <stdarg.h>
 #include <ctype.h>
-
+     
 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
 # ifndef __STRICT_ANSI__
 #  include <io.h>
@@ -5053,7 +5053,7 @@ const char surfxml_flexml_version[] = "1.9.6";
 #else
 # include <unistd.h>
 #endif
-
+     
 #ifndef FLEXML_INDEXSTACKSIZE
 #define FLEXML_INDEXSTACKSIZE 1000
 #endif
@@ -5451,23 +5451,23 @@ short int surfxml_zoneRoute_symmetrical_isset;
 
 /* XML state. */
 #ifdef FLEX_DEBUG
-# define ENTER(state)  debug_enter(state,#state)
-# define LEAVE    debug_leave()
-# define SET(state)  debug_set(state,#state)
+# define ENTER(state)  debug_enter(state,#state)
+# define LEAVE         debug_leave()
+# define SET(state)    debug_set(state,#state)
   static void debug_enter(int, const char*);
   static void debug_leave(void);
   static void debug_set(int, const char*);
 #else
-# define ENTER(state)  (yy_push_state(state))
-# define LEAVE    (yy_pop_state())
-# define SET(state)  BEGIN(state)
+# define ENTER(state)  (yy_push_state(state))
+# define LEAVE         (yy_pop_state())
+# define SET(state)    BEGIN(state)
 #endif
 
 /* Generic actions. */
-#define SKIP  /*skip*/
+#define SKIP   /*skip*/
 #define SUCCEED        CLEANUP; return 0
 
-#define FAIL  return fail
+#define FAIL   return fail
 static int fail(const char*, ...);
 
 enum {flexml_max_err_msg_size = 512};
@@ -5504,12 +5504,12 @@ static int inext = 1;
 static int ck_blimit()
 {
      if (bnext >= blimit) {
-   blimit += FLEXML_BUFFERSTACKSIZE + 2;
-   {
-       char *temp = (char *) realloc(surfxml_bufferstack, blimit);
-       assert(temp);
-       surfxml_bufferstack = temp;
-   }
+        blimit += FLEXML_BUFFERSTACKSIZE + 2;
+        {
+            char *temp = (char *) realloc(surfxml_bufferstack, blimit);
+            assert(temp);
+            surfxml_bufferstack = temp;
+        }
      }
      return 0;
 }
@@ -5518,12 +5518,12 @@ static int ck_blimit()
 static int ck_ilimit()
 {
      if (inext >= ilimit) {
-   ilimit += FLEXML_INDEXSTACKSIZE + 2;
-   {
-       int *temp = (int *) realloc(indexstack, ilimit);
-       assert(temp);
-       indexstack = temp;
-   }
+        ilimit += FLEXML_INDEXSTACKSIZE + 2;
+        {
+            int *temp = (int *) realloc(indexstack, ilimit);
+            assert(temp);
+            indexstack = temp;
+        }
      }
      return 0;
 }
@@ -5537,16 +5537,16 @@ static void surfxml_bufferliteral(char c, int* pp, const char* text)
       assert(s && e && s <= e);
       ++s;
       while (s < e) {
-   if (isspace(*s)) {
-      BUFFERPUTC(' ');
-      do ++s; while (s < e && isspace(*s));
-   } else
-     BUFFERPUTC(*s++);
+        if (isspace(*s)) {
+           BUFFERPUTC(' ');
+           do ++s; while (s < e && isspace(*s));
+        } else
+          BUFFERPUTC(*s++);
       }
    } else {
       const char *s = text;
       while (*s)
-  BUFFERPUTC(*s++);
+       BUFFERPUTC(*s++);
    }
    BUFFERDONE;
 }
@@ -5556,7 +5556,7 @@ static void pushbuffer(int p)
 {
     ck_ilimit();
     indexstack[inext++] = p;
-    indexstack[inext++] = bnext;
+    indexstack[inext++] = bnext;    
 }
 
 static int popbuffer(void)
@@ -5580,18 +5580,18 @@ static int popbuffer(void)
 /* Miscellaneous. */
 /* Parser states (flex `exclusive start conditions'):
  *
- * PROLOG  the XML prolog of the document before <?xml...>
- * DOCTYPE  the XML prolog of the document after <?xml...>
- * EPILOG  after the root element
- * INCOMMENT  inside an XML comment <!--....-->
- * INPI    inside an XML PI <?...?>
- * VALUE1  inside a '...'-delimited literal
- * VALUE2  inside a "..."-delimited literal
- * CDATA  inside a <![CDATA[...] ]> section.
- * ROOT_<tag>  expect root element <tag>
- * AL_<tag>  inside the attribute list for <tag>
- * IN_<tag>  inside a <tag> with element contents (ready for end tag)
- * IMPOSSIBLE  dummy to permit disabling rules; must be last
+ * PROLOG      the XML prolog of the document before <?xml...>
+ * DOCTYPE     the XML prolog of the document after <?xml...>
+ * EPILOG      after the root element
+ * INCOMMENT   inside an XML comment <!--....-->
+ * INPI                inside an XML PI <?...?>
+ * VALUE1      inside a '...'-delimited literal
+ * VALUE2      inside a "..."-delimited literal
+ * CDATA       inside a <![CDATA[...] ]> section.
+ * ROOT_<tag>  expect root element <tag>
+ * AL_<tag>    inside the attribute list for <tag>
+ * IN_<tag>    inside a <tag> with element contents (ready for end tag)
+ * IMPOSSIBLE  dummy to permit disabling rules; must be last
  */
 
 /* State names. */
@@ -5785,7 +5785,7 @@ FILE *surf_parse_get_out (void );
 
 void surf_parse_set_out  (FILE * _out_str  );
 
-      int surf_parse_get_leng (void );
+                       int surf_parse_get_leng (void );
 
 char *surf_parse_get_text (void );
 
@@ -5806,7 +5806,7 @@ extern int surf_parse_wrap (void );
 #endif
 
 #ifndef YY_NO_UNPUT
-
+    
 #endif
 
 #ifndef yytext_ptr
@@ -5830,11 +5830,11 @@ static int input (void );
         static int yy_start_stack_ptr = 0;
         static int yy_start_stack_depth = 0;
         static int *yy_start_stack = NULL;
-
+    
     static void yy_push_state (int _new_state );
-
+    
     static void yy_pop_state (void );
-
+    
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
 #ifdef __ia64__
@@ -5858,33 +5858,33 @@ static int input (void );
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-    { \
-    int c = '*'; \
-    size_t n; \
-    for ( n = 0; n < ( size_t ) max_size && \
-           (c = getc( surf_parse_in )) != EOF && c != '\n'; ++n ) \
-      buf[n] = (char) c; \
-    if ( c == '\n' ) \
-      buf[n++] = (char) c; \
-    if ( c == EOF && ferror( surf_parse_in ) ) \
-      YY_FATAL_ERROR( "input in flex scanner failed" ); \
-    result = n; \
-    } \
-  else \
-    { \
-    errno=0; \
-    while ( (result = (int) fread(buf, 1, max_size, surf_parse_in))==0 && ferror(surf_parse_in)) \
-      { \
-      if( errno != EINTR) \
-        { \
-        YY_FATAL_ERROR( "input in flex scanner failed" ); \
-        break; \
-        } \
-      errno=0; \
-      clearerr(surf_parse_in); \
-      } \
-    }\
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+               { \
+               int c = '*'; \
+               size_t n; \
+               for ( n = 0; n < ( size_t ) max_size && \
+                            (c = getc( surf_parse_in )) != EOF && c != '\n'; ++n ) \
+                       buf[n] = (char) c; \
+               if ( c == '\n' ) \
+                       buf[n++] = (char) c; \
+               if ( c == EOF && ferror( surf_parse_in ) ) \
+                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
+               result = n; \
+               } \
+       else \
+               { \
+               errno=0; \
+               while ( (result = (int) fread(buf, 1, max_size, surf_parse_in))==0 && ferror(surf_parse_in)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(surf_parse_in); \
+                       } \
+               }\
 \
 
 #endif
@@ -5933,43 +5933,43 @@ extern int surf_parse_lex (void);
 #endif
 
 #define YY_RULE_SETUP \
-  YY_USER_ACTION
+       YY_USER_ACTION
 
 /** The main scanner function which does all the work.
  */
 YY_DECL
 {
-  yy_state_type yy_current_state;
-  char *yy_cp, *yy_bp;
-  int yy_act;
-
-  if ( !(yy_init) )
-    {
-    (yy_init) = 1;
+       yy_state_type yy_current_state;
+       char *yy_cp, *yy_bp;
+       int yy_act;
+    
+       if ( !(yy_init) )
+               {
+               (yy_init) = 1;
 
 #ifdef YY_USER_INIT
-    YY_USER_INIT;
+               YY_USER_INIT;
 #endif
 
-    if ( ! (yy_start) )
-      (yy_start) = 1;  /* first start state */
+               if ( ! (yy_start) )
+                       (yy_start) = 1; /* first start state */
 
-    if ( ! surf_parse_in )
-      surf_parse_in = stdin;
+               if ( ! surf_parse_in )
+                       surf_parse_in = stdin;
 
-    if ( ! surf_parse_out )
-      surf_parse_out = stdout;
+               if ( ! surf_parse_out )
+                       surf_parse_out = stdout;
 
-    if ( ! YY_CURRENT_BUFFER ) {
-      surf_parse_ensure_buffer_stack ();
-      YY_CURRENT_BUFFER_LVALUE =
-        surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE );
-    }
+               if ( ! YY_CURRENT_BUFFER ) {
+                       surf_parse_ensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE );
+               }
 
-    surf_parse__load_buffer_state( );
-    }
+               surf_parse__load_buffer_state( );
+               }
 
-  {
+       {
 
  /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
  SET(PROLOG);
@@ -6150,153 +6150,153 @@ YY_DECL
 
  /* COMMENTS and PIs: handled uniformly for efficiency. */
 
-  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
-    {
-    yy_cp = (yy_c_buf_p);
+       while ( /*CONSTCOND*/1 )                /* loops until end-of-file is reached */
+               {
+               yy_cp = (yy_c_buf_p);
 
-    /* Support of surf_parse_text. */
-    *yy_cp = (yy_hold_char);
+               /* Support of surf_parse_text. */
+               *yy_cp = (yy_hold_char);
 
-    /* yy_bp points to the position in yy_ch_buf of the start of
-     * the current run.
-     */
-    yy_bp = yy_cp;
+               /* yy_bp points to the position in yy_ch_buf of the start of
+                * the current run.
+                */
+               yy_bp = yy_cp;
 
-    yy_current_state = (yy_start);
+               yy_current_state = (yy_start);
 yy_match:
-    do
-      {
-      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
-      if ( yy_accept[yy_current_state] )
-        {
-        (yy_last_accepting_state) = yy_current_state;
-        (yy_last_accepting_cpos) = yy_cp;
-        }
-      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-        {
-        yy_current_state = (int) yy_def[yy_current_state];
-        if ( yy_current_state >= 3886 )
-          yy_c = yy_meta[(unsigned int) yy_c];
-        }
-      yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
-      ++yy_cp;
-      }
-    while ( yy_base[yy_current_state] != 13842 );
+               do
+                       {
+                       YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+                       if ( yy_accept[yy_current_state] )
+                               {
+                               (yy_last_accepting_state) = yy_current_state;
+                               (yy_last_accepting_cpos) = yy_cp;
+                               }
+                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                               {
+                               yy_current_state = (int) yy_def[yy_current_state];
+                               if ( yy_current_state >= 3886 )
+                                       yy_c = yy_meta[(unsigned int) yy_c];
+                               }
+                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+                       ++yy_cp;
+                       }
+               while ( yy_base[yy_current_state] != 13842 );
 
 yy_find_action:
-    yy_act = yy_accept[yy_current_state];
-    if ( yy_act == 0 )
-      { /* have to back up */
-      yy_cp = (yy_last_accepting_cpos);
-      yy_current_state = (yy_last_accepting_state);
-      yy_act = yy_accept[yy_current_state];
-      }
-
-    YY_DO_BEFORE_ACTION;
-
-    if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-      {
-      unsigned int yyl;
-      for ( yyl = 0; yyl < surf_parse_leng; ++yyl )
-        if ( surf_parse_text[yyl] == '\n' )
-
+               yy_act = yy_accept[yy_current_state];
+               if ( yy_act == 0 )
+                       { /* have to back up */
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
+                       yy_act = yy_accept[yy_current_state];
+                       }
+
+               YY_DO_BEFORE_ACTION;
+
+               if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+                       {
+                       unsigned int yyl;
+                       for ( yyl = 0; yyl < surf_parse_leng; ++yyl )
+                               if ( surf_parse_text[yyl] == '\n' )
+                                       
     surf_parse_lineno++;
 ;
-      }
+                       }
 
-do_action:  /* This label is used only to access EOF actions. */
+do_action:     /* This label is used only to access EOF actions. */
 
-    switch ( yy_act )
-  { /* beginning of action switch */
-      case 0: /* must back up */
-      /* undo the effects of YY_DO_BEFORE_ACTION */
-      *yy_cp = (yy_hold_char);
-      yy_cp = (yy_last_accepting_cpos);
-      yy_current_state = (yy_last_accepting_state);
-      goto yy_find_action;
+               switch ( yy_act )
+       { /* beginning of action switch */
+                       case 0: /* must back up */
+                       /* undo the effects of YY_DO_BEFORE_ACTION */
+                       *yy_cp = (yy_hold_char);
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
+                       goto yy_find_action;
 
 case 1:
 YY_RULE_SETUP
 ENTER(INCOMMENT);
-  YY_BREAK
+       YY_BREAK
 case 2:
 YY_RULE_SETUP
 ENTER(INPI);
-  YY_BREAK
+       YY_BREAK
 
 case 3:
 YY_RULE_SETUP
 LEAVE;
-  YY_BREAK
+       YY_BREAK
 case 4:
 case 5:
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
 SKIP;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(INCOMMENT):
 FAIL("EOF in comment.");
-  YY_BREAK
+       YY_BREAK
 
 case 7:
 YY_RULE_SETUP
 LEAVE;
-  YY_BREAK
+       YY_BREAK
 case 8:
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
 SKIP;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(INPI):
 FAIL("EOF in PI (processing instruction).");
-  YY_BREAK
+       YY_BREAK
 
 /* SPACES: skipped uniformly */
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
 SKIP;
-  YY_BREAK
+       YY_BREAK
 /* PROLOG: determine root element and process it. */
 
 case 11:
 /* rule 11 can match eol */
 YY_RULE_SETUP
-SET(DOCTYPE);
-  YY_BREAK
+SET(DOCTYPE); 
+       YY_BREAK
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
 FAIL("Bad declaration %s.\nIf your are using a XML v3 file (check the version attribute in <platform>), please update it with tools/simgrid_update_xml.pl",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 
 case 13:
 /* rule 13 can match eol */
 YY_RULE_SETUP
 SET(ROOT_surfxml_platform);
-  YY_BREAK
+       YY_BREAK
 case 14:
 /* rule 14 can match eol */
 YY_RULE_SETUP
 FAIL("Bad declaration %s.\nIf your are using a XML v3 file (check the version attribute in <platform>), please update it with tools/simgrid_update_xml.pl",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 15:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in prolog.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(PROLOG):
 case YY_STATE_EOF(DOCTYPE):
 FAIL("EOF in prolog.");
-  YY_BREAK
+       YY_BREAK
 
 /* RULES DERIVED FROM DTD. */
 case 16:
 /* rule 16 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <AS> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 17:
 /* rule 17 can match eol */
 YY_RULE_SETUP
@@ -6307,88 +6307,88 @@ YY_RULE_SETUP
   surfxml_AS_routing_isset = 0;
   ENTER(AL_surfxml_AS); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 18:
 /* rule 18 can match eol */
 YY_RULE_SETUP
 if (surfxml_AS_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_AS>");} surfxml_AS_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_AS_id);
-  YY_BREAK
+       YY_BREAK
 case 19:
 /* rule 19 can match eol */
 YY_RULE_SETUP
 if (surfxml_AS_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_AS>");}  surfxml_AS_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_AS_id);
-  YY_BREAK
+       YY_BREAK
 case 20:
 /* rule 20 can match eol */
 case 21:
 /* rule 21 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_Full;
-  YY_BREAK
+       YY_BREAK
 case 22:
 /* rule 22 can match eol */
 case 23:
 /* rule 23 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_Floyd;
-  YY_BREAK
+       YY_BREAK
 case 24:
 /* rule 24 can match eol */
 case 25:
 /* rule 25 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_Dijkstra;
-  YY_BREAK
+       YY_BREAK
 case 26:
 /* rule 26 can match eol */
 case 27:
 /* rule 27 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_DijkstraCache;
-  YY_BREAK
+       YY_BREAK
 case 28:
 /* rule 28 can match eol */
 case 29:
 /* rule 29 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_None;
-  YY_BREAK
+       YY_BREAK
 case 30:
 /* rule 30 can match eol */
 case 31:
 /* rule 31 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_Vivaldi;
-  YY_BREAK
+       YY_BREAK
 case 32:
 /* rule 32 can match eol */
 case 33:
 /* rule 33 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_Cluster;
-  YY_BREAK
+       YY_BREAK
 case 34:
 /* rule 34 can match eol */
 case 35:
 /* rule 35 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_ClusterTorus;
-  YY_BREAK
+       YY_BREAK
 case 36:
 /* rule 36 can match eol */
 case 37:
 /* rule 37 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_ClusterFatTree;
-  YY_BREAK
+       YY_BREAK
 case 38:
 /* rule 38 can match eol */
 case 39:
 /* rule 39 can match eol */
 YY_RULE_SETUP
 A_surfxml_AS_routing = A_surfxml_AS_routing_ClusterDragonfly;
-  YY_BREAK
+       YY_BREAK
 case 40:
 YY_RULE_SETUP
 {
@@ -6396,7 +6396,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_AS_routing) FAIL("Required attribute `routing' not set for `AS' element.");
   LEAVE; STag_surfxml_AS();surfxml_pcdata_ix = 0; ENTER(S_surfxml_AS);
  }
-  YY_BREAK
+       YY_BREAK
 case 41:
 YY_RULE_SETUP
 {
@@ -6410,18 +6410,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 42:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of AS element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 43:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `AS' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_AS):
 FAIL("EOF in attribute list of `AS' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 44:
 /* rule 44 can match eol */
@@ -6437,16 +6437,16 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 45:
 /* rule 45 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</AS>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 46:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</AS>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_AS):
 case YY_STATE_EOF(S_surfxml_AS):
 case YY_STATE_EOF(S_surfxml_AS_1):
@@ -6454,14 +6454,14 @@ case YY_STATE_EOF(S_surfxml_AS_3):
 case YY_STATE_EOF(S_surfxml_AS_4):
 case YY_STATE_EOF(S_surfxml_AS_6):
 case YY_STATE_EOF(S_surfxml_AS_8):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</AS>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</AS>' expected.");
+       YY_BREAK
 
 case 47:
 /* rule 47 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <ASroute> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 48:
 /* rule 48 can match eol */
 YY_RULE_SETUP
@@ -6478,62 +6478,62 @@ YY_RULE_SETUP
   surfxml_ASroute_symmetrical_isset = 0;
   ENTER(AL_surfxml_ASroute); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 49:
 /* rule 49 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_ASroute>");} surfxml_ASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_dst);
-  YY_BREAK
+       YY_BREAK
 case 50:
 /* rule 50 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_ASroute>");}  surfxml_ASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_dst);
-  YY_BREAK
+       YY_BREAK
 case 51:
 /* rule 51 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_ASroute>");} surfxml_ASroute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 52:
 /* rule 52 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_ASroute>");}  surfxml_ASroute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 53:
 /* rule 53 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_ASroute>");} surfxml_ASroute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 54:
 /* rule 54 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_ASroute>");}  surfxml_ASroute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 55:
 /* rule 55 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_ASroute>");} surfxml_ASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_src);
-  YY_BREAK
+       YY_BREAK
 case 56:
 /* rule 56 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_ASroute>");}  surfxml_ASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_src);
-  YY_BREAK
+       YY_BREAK
 case 57:
 /* rule 57 can match eol */
 case 58:
 /* rule 58 can match eol */
 YY_RULE_SETUP
 A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_YES;
-  YY_BREAK
+       YY_BREAK
 case 59:
 /* rule 59 can match eol */
 case 60:
 /* rule 60 can match eol */
 YY_RULE_SETUP
 A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_NO;
-  YY_BREAK
+       YY_BREAK
 case 61:
 YY_RULE_SETUP
 {
@@ -6543,7 +6543,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
   LEAVE; STag_surfxml_ASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_ASroute);
  }
-  YY_BREAK
+       YY_BREAK
 case 62:
 YY_RULE_SETUP
 {
@@ -6553,24 +6553,24 @@ YY_RULE_SETUP
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
   LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
+   case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 63:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of ASroute element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 64:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `ASroute' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_ASroute):
 FAIL("EOF in attribute list of `ASroute' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 65:
 /* rule 65 can match eol */
@@ -6580,33 +6580,33 @@ YY_RULE_SETUP
   ETag_surfxml_ASroute();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
+   case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 66:
 /* rule 66 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</ASroute>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 67:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</ASroute>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_ASroute):
 case YY_STATE_EOF(S_surfxml_ASroute):
 case YY_STATE_EOF(S_surfxml_ASroute_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</ASroute>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</ASroute>' expected.");
+       YY_BREAK
 
 case 68:
 /* rule 68 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <actor> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 69:
 /* rule 69 can match eol */
 YY_RULE_SETUP
@@ -6623,62 +6623,62 @@ YY_RULE_SETUP
   surfxml_actor_start___time_isset = 0;
   ENTER(AL_surfxml_actor); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 70:
 /* rule 70 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_actor>");} surfxml_actor_function_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_actor_function);
-  YY_BREAK
+       YY_BREAK
 case 71:
 /* rule 71 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_actor>");}  surfxml_actor_function_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_actor_function);
-  YY_BREAK
+       YY_BREAK
 case 72:
 /* rule 72 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_actor>");} surfxml_actor_host_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_actor_host);
-  YY_BREAK
+       YY_BREAK
 case 73:
 /* rule 73 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_actor>");}  surfxml_actor_host_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_actor_host);
-  YY_BREAK
+       YY_BREAK
 case 74:
 /* rule 74 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_actor>");} surfxml_actor_kill___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_actor_kill___time);
-  YY_BREAK
+       YY_BREAK
 case 75:
 /* rule 75 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_actor>");}  surfxml_actor_kill___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_actor_kill___time);
-  YY_BREAK
+       YY_BREAK
 case 76:
 /* rule 76 can match eol */
 case 77:
 /* rule 77 can match eol */
 YY_RULE_SETUP
 A_surfxml_actor_on___failure = A_surfxml_actor_on___failure_DIE;
-  YY_BREAK
+       YY_BREAK
 case 78:
 /* rule 78 can match eol */
 case 79:
 /* rule 79 can match eol */
 YY_RULE_SETUP
 A_surfxml_actor_on___failure = A_surfxml_actor_on___failure_RESTART;
-  YY_BREAK
+       YY_BREAK
 case 80:
 /* rule 80 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_actor>");} surfxml_actor_start___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_actor_start___time);
-  YY_BREAK
+       YY_BREAK
 case 81:
 /* rule 81 can match eol */
 YY_RULE_SETUP
 if (surfxml_actor_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_actor>");}  surfxml_actor_start___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_actor_start___time);
-  YY_BREAK
+       YY_BREAK
 case 82:
 YY_RULE_SETUP
 {
@@ -6686,7 +6686,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_actor_host) FAIL("Required attribute `host' not set for `actor' element.");
   LEAVE; STag_surfxml_actor();surfxml_pcdata_ix = 0; ENTER(S_surfxml_actor);
  }
-  YY_BREAK
+       YY_BREAK
 case 83:
 YY_RULE_SETUP
 {
@@ -6697,18 +6697,18 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 84:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of actor element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 85:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `actor' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_actor):
 FAIL("EOF in attribute list of `actor' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 86:
 /* rule 86 can match eol */
@@ -6721,27 +6721,27 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 87:
 /* rule 87 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</actor>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 88:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</actor>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_actor):
 case YY_STATE_EOF(S_surfxml_actor):
 case YY_STATE_EOF(S_surfxml_actor_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</actor>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</actor>' expected.");
+       YY_BREAK
 
 case 89:
 /* rule 89 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <argument> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 90:
 /* rule 90 can match eol */
 YY_RULE_SETUP
@@ -6750,25 +6750,25 @@ YY_RULE_SETUP
   surfxml_argument_value_isset = 0;
   ENTER(AL_surfxml_argument); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 91:
 /* rule 91 can match eol */
 YY_RULE_SETUP
 if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_argument>");} surfxml_argument_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
-  YY_BREAK
+       YY_BREAK
 case 92:
 /* rule 92 can match eol */
 YY_RULE_SETUP
 if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_argument>");}  surfxml_argument_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
-  YY_BREAK
+       YY_BREAK
 case 93:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
   LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
  }
-  YY_BREAK
+       YY_BREAK
 case 94:
 YY_RULE_SETUP
 {
@@ -6779,18 +6779,18 @@ YY_RULE_SETUP
    case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 95:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of argument element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 96:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `argument' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_argument):
 FAIL("EOF in attribute list of `argument' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 97:
 /* rule 97 can match eol */
@@ -6804,25 +6804,25 @@ YY_RULE_SETUP
    case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 98:
 /* rule 98 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</argument>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 99:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</argument>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_argument):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</argument>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</argument>' expected.");
+       YY_BREAK
 
 case 100:
 /* rule 100 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <backbone> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 101:
 /* rule 101 can match eol */
 YY_RULE_SETUP
@@ -6835,38 +6835,38 @@ YY_RULE_SETUP
   surfxml_backbone_latency_isset = 0;
   ENTER(AL_surfxml_backbone); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 102:
 /* rule 102 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_backbone>");} surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_bandwidth);
-  YY_BREAK
+       YY_BREAK
 case 103:
 /* rule 103 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_backbone>");}  surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_bandwidth);
-  YY_BREAK
+       YY_BREAK
 case 104:
 /* rule 104 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_backbone>");} surfxml_backbone_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_id);
-  YY_BREAK
+       YY_BREAK
 case 105:
 /* rule 105 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_backbone>");}  surfxml_backbone_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_id);
-  YY_BREAK
+       YY_BREAK
 case 106:
 /* rule 106 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_backbone>");} surfxml_backbone_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_latency);
-  YY_BREAK
+       YY_BREAK
 case 107:
 /* rule 107 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_backbone>");}  surfxml_backbone_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_latency);
-  YY_BREAK
+       YY_BREAK
 case 108:
 YY_RULE_SETUP
 {
@@ -6875,7 +6875,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_backbone_latency) FAIL("Required attribute `latency' not set for `backbone' element.");
   LEAVE; STag_surfxml_backbone();surfxml_pcdata_ix = 0; ENTER(E_surfxml_backbone);
  }
-  YY_BREAK
+       YY_BREAK
 case 109:
 YY_RULE_SETUP
 {
@@ -6888,18 +6888,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 110:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of backbone element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 111:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `backbone' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_backbone):
 FAIL("EOF in attribute list of `backbone' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 112:
 /* rule 112 can match eol */
@@ -6913,25 +6913,25 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 113:
 /* rule 113 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</backbone>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 114:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</backbone>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_backbone):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</backbone>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</backbone>' expected.");
+       YY_BREAK
 
 case 115:
 /* rule 115 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <bypassASroute> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 116:
 /* rule 116 can match eol */
 YY_RULE_SETUP
@@ -6946,48 +6946,48 @@ YY_RULE_SETUP
   surfxml_bypassASroute_src_isset = 0;
   ENTER(AL_surfxml_bypassASroute); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 117:
 /* rule 117 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_dst);
-  YY_BREAK
+       YY_BREAK
 case 118:
 /* rule 118 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassASroute>");}  surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_dst);
-  YY_BREAK
+       YY_BREAK
 case 119:
 /* rule 119 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 120:
 /* rule 120 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassASroute>");}  surfxml_bypassASroute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 121:
 /* rule 121 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 122:
 /* rule 122 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassASroute>");}  surfxml_bypassASroute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 123:
 /* rule 123 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassASroute>");} surfxml_bypassASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_src);
-  YY_BREAK
+       YY_BREAK
 case 124:
 /* rule 124 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassASroute>");}  surfxml_bypassASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_src);
-  YY_BREAK
+       YY_BREAK
 case 125:
 YY_RULE_SETUP
 {
@@ -6997,7 +6997,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_bypassASroute_src) FAIL("Required attribute `src' not set for `bypassASroute' element.");
   LEAVE; STag_surfxml_bypassASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassASroute);
  }
-  YY_BREAK
+       YY_BREAK
 case 126:
 YY_RULE_SETUP
 {
@@ -7011,18 +7011,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 127:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of bypassASroute element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 128:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `bypassASroute' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_bypassASroute):
 FAIL("EOF in attribute list of `bypassASroute' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 129:
 /* rule 129 can match eol */
@@ -7036,27 +7036,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 130:
 /* rule 130 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</bypassASroute>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 131:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</bypassASroute>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_bypassASroute):
 case YY_STATE_EOF(S_surfxml_bypassASroute):
 case YY_STATE_EOF(S_surfxml_bypassASroute_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassASroute>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</bypassASroute>' expected.");
+       YY_BREAK
 
 case 132:
 /* rule 132 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <bypassRoute> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 133:
 /* rule 133 can match eol */
 YY_RULE_SETUP
@@ -7067,28 +7067,28 @@ YY_RULE_SETUP
   surfxml_bypassRoute_src_isset = 0;
   ENTER(AL_surfxml_bypassRoute); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 134:
 /* rule 134 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassRoute>");} surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_dst);
-  YY_BREAK
+       YY_BREAK
 case 135:
 /* rule 135 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassRoute>");}  surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_dst);
-  YY_BREAK
+       YY_BREAK
 case 136:
 /* rule 136 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassRoute>");} surfxml_bypassRoute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_src);
-  YY_BREAK
+       YY_BREAK
 case 137:
 /* rule 137 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassRoute>");}  surfxml_bypassRoute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_src);
-  YY_BREAK
+       YY_BREAK
 case 138:
 YY_RULE_SETUP
 {
@@ -7096,7 +7096,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_bypassRoute_src) FAIL("Required attribute `src' not set for `bypassRoute' element.");
   LEAVE; STag_surfxml_bypassRoute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassRoute);
  }
-  YY_BREAK
+       YY_BREAK
 case 139:
 YY_RULE_SETUP
 {
@@ -7108,18 +7108,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 140:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of bypassRoute element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 141:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `bypassRoute' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_bypassRoute):
 FAIL("EOF in attribute list of `bypassRoute' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 142:
 /* rule 142 can match eol */
@@ -7133,27 +7133,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 143:
 /* rule 143 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</bypassRoute>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 144:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</bypassRoute>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_bypassRoute):
 case YY_STATE_EOF(S_surfxml_bypassRoute):
 case YY_STATE_EOF(S_surfxml_bypassRoute_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassRoute>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</bypassRoute>' expected.");
+       YY_BREAK
 
 case 145:
 /* rule 145 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <bypassZoneRoute> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 146:
 /* rule 146 can match eol */
 YY_RULE_SETUP
@@ -7168,48 +7168,48 @@ YY_RULE_SETUP
   surfxml_bypassZoneRoute_src_isset = 0;
   ENTER(AL_surfxml_bypassZoneRoute); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 147:
 /* rule 147 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassZoneRoute>");} surfxml_bypassZoneRoute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassZoneRoute_dst);
-  YY_BREAK
+       YY_BREAK
 case 148:
 /* rule 148 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassZoneRoute>");}  surfxml_bypassZoneRoute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassZoneRoute_dst);
-  YY_BREAK
+       YY_BREAK
 case 149:
 /* rule 149 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassZoneRoute>");} surfxml_bypassZoneRoute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassZoneRoute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 150:
 /* rule 150 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassZoneRoute>");}  surfxml_bypassZoneRoute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassZoneRoute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 151:
 /* rule 151 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassZoneRoute>");} surfxml_bypassZoneRoute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassZoneRoute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 152:
 /* rule 152 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassZoneRoute>");}  surfxml_bypassZoneRoute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassZoneRoute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 153:
 /* rule 153 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassZoneRoute>");} surfxml_bypassZoneRoute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassZoneRoute_src);
-  YY_BREAK
+       YY_BREAK
 case 154:
 /* rule 154 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassZoneRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassZoneRoute>");}  surfxml_bypassZoneRoute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassZoneRoute_src);
-  YY_BREAK
+       YY_BREAK
 case 155:
 YY_RULE_SETUP
 {
@@ -7219,7 +7219,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_bypassZoneRoute_src) FAIL("Required attribute `src' not set for `bypassZoneRoute' element.");
   LEAVE; STag_surfxml_bypassZoneRoute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassZoneRoute);
  }
-  YY_BREAK
+       YY_BREAK
 case 156:
 YY_RULE_SETUP
 {
@@ -7233,18 +7233,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 157:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of bypassZoneRoute element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 158:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `bypassZoneRoute' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_bypassZoneRoute):
 FAIL("EOF in attribute list of `bypassZoneRoute' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 159:
 /* rule 159 can match eol */
@@ -7258,27 +7258,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 160:
 /* rule 160 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</bypassZoneRoute>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 161:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</bypassZoneRoute>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_bypassZoneRoute):
 case YY_STATE_EOF(S_surfxml_bypassZoneRoute):
 case YY_STATE_EOF(S_surfxml_bypassZoneRoute_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassZoneRoute>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</bypassZoneRoute>' expected.");
+       YY_BREAK
 
 case 162:
 /* rule 162 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <cabinet> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 163:
 /* rule 163 can match eol */
 YY_RULE_SETUP
@@ -7299,78 +7299,78 @@ YY_RULE_SETUP
   surfxml_cabinet_suffix_isset = 0;
   ENTER(AL_surfxml_cabinet); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 164:
 /* rule 164 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cabinet>");} surfxml_cabinet_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_bw);
-  YY_BREAK
+       YY_BREAK
 case 165:
 /* rule 165 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cabinet>");}  surfxml_cabinet_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_bw);
-  YY_BREAK
+       YY_BREAK
 case 166:
 /* rule 166 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cabinet>");} surfxml_cabinet_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_id);
-  YY_BREAK
+       YY_BREAK
 case 167:
 /* rule 167 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cabinet>");}  surfxml_cabinet_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_id);
-  YY_BREAK
+       YY_BREAK
 case 168:
 /* rule 168 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cabinet>");} surfxml_cabinet_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_lat);
-  YY_BREAK
+       YY_BREAK
 case 169:
 /* rule 169 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cabinet>");}  surfxml_cabinet_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_lat);
-  YY_BREAK
+       YY_BREAK
 case 170:
 /* rule 170 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cabinet>");} surfxml_cabinet_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_prefix);
-  YY_BREAK
+       YY_BREAK
 case 171:
 /* rule 171 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cabinet>");}  surfxml_cabinet_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_prefix);
-  YY_BREAK
+       YY_BREAK
 case 172:
 /* rule 172 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cabinet>");} surfxml_cabinet_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_radical);
-  YY_BREAK
+       YY_BREAK
 case 173:
 /* rule 173 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cabinet>");}  surfxml_cabinet_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_radical);
-  YY_BREAK
+       YY_BREAK
 case 174:
 /* rule 174 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_cabinet>");} surfxml_cabinet_speed_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_speed);
-  YY_BREAK
+       YY_BREAK
 case 175:
 /* rule 175 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_cabinet>");}  surfxml_cabinet_speed_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_speed);
-  YY_BREAK
+       YY_BREAK
 case 176:
 /* rule 176 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cabinet>");} surfxml_cabinet_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_suffix);
-  YY_BREAK
+       YY_BREAK
 case 177:
 /* rule 177 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cabinet>");}  surfxml_cabinet_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_suffix);
-  YY_BREAK
+       YY_BREAK
 case 178:
 YY_RULE_SETUP
 {
@@ -7383,7 +7383,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_cabinet_suffix) FAIL("Required attribute `suffix' not set for `cabinet' element.");
   LEAVE; STag_surfxml_cabinet();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cabinet);
  }
-  YY_BREAK
+       YY_BREAK
 case 179:
 YY_RULE_SETUP
 {
@@ -7402,18 +7402,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 180:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of cabinet element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 181:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `cabinet' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_cabinet):
 FAIL("EOF in attribute list of `cabinet' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 182:
 /* rule 182 can match eol */
@@ -7429,25 +7429,25 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 183:
 /* rule 183 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</cabinet>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 184:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</cabinet>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_cabinet):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</cabinet>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</cabinet>' expected.");
+       YY_BREAK
 
 case 185:
 /* rule 185 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <cluster> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 186:
 /* rule 186 can match eol */
 YY_RULE_SETUP
@@ -7490,221 +7490,221 @@ YY_RULE_SETUP
   surfxml_cluster_topology_isset = 0;
   ENTER(AL_surfxml_cluster); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 187:
 /* rule 187 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");} surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___bw);
-  YY_BREAK
+       YY_BREAK
 case 188:
 /* rule 188 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");}  surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___bw);
-  YY_BREAK
+       YY_BREAK
 case 189:
 /* rule 189 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");} surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___lat);
-  YY_BREAK
+       YY_BREAK
 case 190:
 /* rule 190 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");}  surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___lat);
-  YY_BREAK
+       YY_BREAK
 case 191:
 /* rule 191 can match eol */
 case 192:
 /* rule 192 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_SHARED;
-  YY_BREAK
+       YY_BREAK
 case 193:
 /* rule 193 can match eol */
 case 194:
 /* rule 194 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_FATPIPE;
-  YY_BREAK
+       YY_BREAK
 case 195:
 /* rule 195 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");} surfxml_cluster_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw);
-  YY_BREAK
+       YY_BREAK
 case 196:
 /* rule 196 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");}  surfxml_cluster_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw);
-  YY_BREAK
+       YY_BREAK
 case 197:
 /* rule 197 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");} surfxml_cluster_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_core);
-  YY_BREAK
+       YY_BREAK
 case 198:
 /* rule 198 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");}  surfxml_cluster_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_core);
-  YY_BREAK
+       YY_BREAK
 case 199:
 /* rule 199 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");} surfxml_cluster_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id);
-  YY_BREAK
+       YY_BREAK
 case 200:
 /* rule 200 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");}  surfxml_cluster_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id);
-  YY_BREAK
+       YY_BREAK
 case 201:
 /* rule 201 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");} surfxml_cluster_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat);
-  YY_BREAK
+       YY_BREAK
 case 202:
 /* rule 202 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");}  surfxml_cluster_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat);
-  YY_BREAK
+       YY_BREAK
 case 203:
 /* rule 203 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");} surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_limiter___link);
-  YY_BREAK
+       YY_BREAK
 case 204:
 /* rule 204 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");}  surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_limiter___link);
-  YY_BREAK
+       YY_BREAK
 case 205:
 /* rule 205 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");} surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___bw);
-  YY_BREAK
+       YY_BREAK
 case 206:
 /* rule 206 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");}  surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___bw);
-  YY_BREAK
+       YY_BREAK
 case 207:
 /* rule 207 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");} surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___lat);
-  YY_BREAK
+       YY_BREAK
 case 208:
 /* rule 208 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");}  surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___lat);
-  YY_BREAK
+       YY_BREAK
 case 209:
 /* rule 209 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");} surfxml_cluster_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix);
-  YY_BREAK
+       YY_BREAK
 case 210:
 /* rule 210 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");}  surfxml_cluster_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix);
-  YY_BREAK
+       YY_BREAK
 case 211:
 /* rule 211 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");} surfxml_cluster_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical);
-  YY_BREAK
+       YY_BREAK
 case 212:
 /* rule 212 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");}  surfxml_cluster_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical);
-  YY_BREAK
+       YY_BREAK
 case 213:
 /* rule 213 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");} surfxml_cluster_router___id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_router___id);
-  YY_BREAK
+       YY_BREAK
 case 214:
 /* rule 214 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");}  surfxml_cluster_router___id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_router___id);
-  YY_BREAK
+       YY_BREAK
 case 215:
 /* rule 215 can match eol */
 case 216:
 /* rule 216 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_SHARED;
-  YY_BREAK
+       YY_BREAK
 case 217:
 /* rule 217 can match eol */
 case 218:
 /* rule 218 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FULLDUPLEX;
-  YY_BREAK
+       YY_BREAK
 case 219:
 /* rule 219 can match eol */
 case 220:
 /* rule 220 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FATPIPE;
-  YY_BREAK
+       YY_BREAK
 case 221:
 /* rule 221 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_cluster>");} surfxml_cluster_speed_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_speed);
-  YY_BREAK
+       YY_BREAK
 case 222:
 /* rule 222 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_cluster>");}  surfxml_cluster_speed_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_speed);
-  YY_BREAK
+       YY_BREAK
 case 223:
 /* rule 223 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");} surfxml_cluster_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix);
-  YY_BREAK
+       YY_BREAK
 case 224:
 /* rule 224 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");}  surfxml_cluster_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix);
-  YY_BREAK
+       YY_BREAK
 case 225:
 /* rule 225 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_topo___parameters_isset != 0) {FAIL("Multiple definition of attribute topo_parameters in <surfxml_cluster>");} surfxml_cluster_topo___parameters_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_topo___parameters);
-  YY_BREAK
+       YY_BREAK
 case 226:
 /* rule 226 can match eol */
 YY_RULE_SETUP
 if (surfxml_cluster_topo___parameters_isset != 0) {FAIL("Multiple definition of attribute topo_parameters in <surfxml_cluster>");}  surfxml_cluster_topo___parameters_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_topo___parameters);
-  YY_BREAK
+       YY_BREAK
 case 227:
 /* rule 227 can match eol */
 case 228:
 /* rule 228 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_topology = A_surfxml_cluster_topology_FLAT;
-  YY_BREAK
+       YY_BREAK
 case 229:
 /* rule 229 can match eol */
 case 230:
 /* rule 230 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_topology = A_surfxml_cluster_topology_TORUS;
-  YY_BREAK
+       YY_BREAK
 case 231:
 /* rule 231 can match eol */
 case 232:
 /* rule 232 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_topology = A_surfxml_cluster_topology_FAT___TREE;
-  YY_BREAK
+       YY_BREAK
 case 233:
 /* rule 233 can match eol */
 case 234:
 /* rule 234 can match eol */
 YY_RULE_SETUP
 A_surfxml_cluster_topology = A_surfxml_cluster_topology_DRAGONFLY;
-  YY_BREAK
+       YY_BREAK
 case 235:
 YY_RULE_SETUP
 {
@@ -7717,7 +7717,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_cluster_suffix) FAIL("Required attribute `suffix' not set for `cluster' element.");
   LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(S_surfxml_cluster);
  }
-  YY_BREAK
+       YY_BREAK
 case 236:
 YY_RULE_SETUP
 {
@@ -7736,18 +7736,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 237:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of cluster element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 238:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `cluster' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_cluster):
 FAIL("EOF in attribute list of `cluster' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 239:
 /* rule 239 can match eol */
@@ -7763,27 +7763,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 240:
 /* rule 240 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</cluster>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 241:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</cluster>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_cluster):
 case YY_STATE_EOF(S_surfxml_cluster):
 case YY_STATE_EOF(S_surfxml_cluster_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</cluster>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</cluster>' expected.");
+       YY_BREAK
 
 case 242:
 /* rule 242 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <config> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 243:
 /* rule 243 can match eol */
 YY_RULE_SETUP
@@ -7792,24 +7792,24 @@ YY_RULE_SETUP
   surfxml_config_id_isset = 0;
   ENTER(AL_surfxml_config); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 244:
 /* rule 244 can match eol */
 YY_RULE_SETUP
 if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_config>");} surfxml_config_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_config_id);
-  YY_BREAK
+       YY_BREAK
 case 245:
 /* rule 245 can match eol */
 YY_RULE_SETUP
 if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_config>");}  surfxml_config_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_config_id);
-  YY_BREAK
+       YY_BREAK
 case 246:
 YY_RULE_SETUP
 {
   LEAVE; STag_surfxml_config();surfxml_pcdata_ix = 0; ENTER(S_surfxml_config);
  }
-  YY_BREAK
+       YY_BREAK
 case 247:
 YY_RULE_SETUP
 {
@@ -7818,18 +7818,18 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 248:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of config element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 249:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `config' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_config):
 FAIL("EOF in attribute list of `config' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 250:
 /* rule 250 can match eol */
@@ -7842,27 +7842,27 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 251:
 /* rule 251 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</config>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 252:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</config>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_config):
 case YY_STATE_EOF(S_surfxml_config):
 case YY_STATE_EOF(S_surfxml_config_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</config>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</config>' expected.");
+       YY_BREAK
 
 case 253:
 /* rule 253 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <host> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 254:
 /* rule 254 can match eol */
 YY_RULE_SETUP
@@ -7883,78 +7883,78 @@ YY_RULE_SETUP
   surfxml_host_state___file_isset = 0;
   ENTER(AL_surfxml_host); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 255:
 /* rule 255 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");} surfxml_host_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability___file);
-  YY_BREAK
+       YY_BREAK
 case 256:
 /* rule 256 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");}  surfxml_host_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability___file);
-  YY_BREAK
+       YY_BREAK
 case 257:
 /* rule 257 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");} surfxml_host_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_coordinates);
-  YY_BREAK
+       YY_BREAK
 case 258:
 /* rule 258 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");}  surfxml_host_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_coordinates);
-  YY_BREAK
+       YY_BREAK
 case 259:
 /* rule 259 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");} surfxml_host_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_core);
-  YY_BREAK
+       YY_BREAK
 case 260:
 /* rule 260 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");}  surfxml_host_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_core);
-  YY_BREAK
+       YY_BREAK
 case 261:
 /* rule 261 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");} surfxml_host_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
-  YY_BREAK
+       YY_BREAK
 case 262:
 /* rule 262 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");}  surfxml_host_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
-  YY_BREAK
+       YY_BREAK
 case 263:
 /* rule 263 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");} surfxml_host_pstate_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_pstate);
-  YY_BREAK
+       YY_BREAK
 case 264:
 /* rule 264 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");}  surfxml_host_pstate_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_pstate);
-  YY_BREAK
+       YY_BREAK
 case 265:
 /* rule 265 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_host>");} surfxml_host_speed_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_speed);
-  YY_BREAK
+       YY_BREAK
 case 266:
 /* rule 266 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_host>");}  surfxml_host_speed_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_speed);
-  YY_BREAK
+       YY_BREAK
 case 267:
 /* rule 267 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");} surfxml_host_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state___file);
-  YY_BREAK
+       YY_BREAK
 case 268:
 /* rule 268 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");}  surfxml_host_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state___file);
-  YY_BREAK
+       YY_BREAK
 case 269:
 YY_RULE_SETUP
 {
@@ -7962,7 +7962,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_host_speed) FAIL("Required attribute `speed' not set for `host' element.");
   LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
  }
-  YY_BREAK
+       YY_BREAK
 case 270:
 YY_RULE_SETUP
 {
@@ -7974,18 +7974,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 271:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of host element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 272:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `host' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_host):
 FAIL("EOF in attribute list of `host' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 273:
 /* rule 273 can match eol */
@@ -7999,27 +7999,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 274:
 /* rule 274 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</host>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 275:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</host>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_host):
 case YY_STATE_EOF(S_surfxml_host):
 case YY_STATE_EOF(S_surfxml_host_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</host>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</host>' expected.");
+       YY_BREAK
 
 case 276:
 /* rule 276 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <host_link> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 277:
 /* rule 277 can match eol */
 YY_RULE_SETUP
@@ -8032,38 +8032,38 @@ YY_RULE_SETUP
   surfxml_host___link_up_isset = 0;
   ENTER(AL_surfxml_host___link); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 278:
 /* rule 278 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");} surfxml_host___link_down_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_down);
-  YY_BREAK
+       YY_BREAK
 case 279:
 /* rule 279 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");}  surfxml_host___link_down_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_down);
-  YY_BREAK
+       YY_BREAK
 case 280:
 /* rule 280 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");} surfxml_host___link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_id);
-  YY_BREAK
+       YY_BREAK
 case 281:
 /* rule 281 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");}  surfxml_host___link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_id);
-  YY_BREAK
+       YY_BREAK
 case 282:
 /* rule 282 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");} surfxml_host___link_up_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_up);
-  YY_BREAK
+       YY_BREAK
 case 283:
 /* rule 283 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");}  surfxml_host___link_up_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_up);
-  YY_BREAK
+       YY_BREAK
 case 284:
 YY_RULE_SETUP
 {
@@ -8072,7 +8072,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_host___link_up) FAIL("Required attribute `up' not set for `host_link' element.");
   LEAVE; STag_surfxml_host___link();surfxml_pcdata_ix = 0; ENTER(E_surfxml_host___link);
  }
-  YY_BREAK
+       YY_BREAK
 case 285:
 YY_RULE_SETUP
 {
@@ -8085,18 +8085,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 286:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of host_link element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 287:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `host_link' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_host___link):
 FAIL("EOF in attribute list of `host_link' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 288:
 /* rule 288 can match eol */
@@ -8110,26 +8110,26 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 289:
 /* rule 289 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</host_link>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 290:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</host_link>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_host___link):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</host_link>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</host_link>' expected.");
+       YY_BREAK
 
 /* <!-- tag include is deprecated. Not documented, and soon removed -->  */
 case 291:
 /* rule 291 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <include> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 292:
 /* rule 292 can match eol */
 YY_RULE_SETUP
@@ -8138,25 +8138,25 @@ YY_RULE_SETUP
   surfxml_include_file_isset = 0;
   ENTER(AL_surfxml_include); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 293:
 /* rule 293 can match eol */
 YY_RULE_SETUP
 if (surfxml_include_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_include>");} surfxml_include_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
-  YY_BREAK
+       YY_BREAK
 case 294:
 /* rule 294 can match eol */
 YY_RULE_SETUP
 if (surfxml_include_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_include>");}  surfxml_include_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
-  YY_BREAK
+       YY_BREAK
 case 295:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
   LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(S_surfxml_include);
  }
-  YY_BREAK
+       YY_BREAK
 case 296:
 YY_RULE_SETUP
 {
@@ -8169,18 +8169,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 297:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of include element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 298:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `include' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_include):
 FAIL("EOF in attribute list of `include' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 299:
 /* rule 299 can match eol */
@@ -8196,27 +8196,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 300:
 /* rule 300 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</include>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 301:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</include>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_include):
 case YY_STATE_EOF(S_surfxml_include):
 case YY_STATE_EOF(S_surfxml_include_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</include>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</include>' expected.");
+       YY_BREAK
 
 case 302:
 /* rule 302 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <link> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 303:
 /* rule 303 can match eol */
 YY_RULE_SETUP
@@ -8237,89 +8237,89 @@ YY_RULE_SETUP
   surfxml_link_state___file_isset = 0;
   ENTER(AL_surfxml_link); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 304:
 /* rule 304 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
-  YY_BREAK
+       YY_BREAK
 case 305:
 /* rule 305 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");}  surfxml_link_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
-  YY_BREAK
+       YY_BREAK
 case 306:
 /* rule 306 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");} surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth___file);
-  YY_BREAK
+       YY_BREAK
 case 307:
 /* rule 307 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");}  surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth___file);
-  YY_BREAK
+       YY_BREAK
 case 308:
 /* rule 308 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");} surfxml_link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
-  YY_BREAK
+       YY_BREAK
 case 309:
 /* rule 309 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");}  surfxml_link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
-  YY_BREAK
+       YY_BREAK
 case 310:
 /* rule 310 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");} surfxml_link_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
-  YY_BREAK
+       YY_BREAK
 case 311:
 /* rule 311 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");}  surfxml_link_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
-  YY_BREAK
+       YY_BREAK
 case 312:
 /* rule 312 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");} surfxml_link_latency___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency___file);
-  YY_BREAK
+       YY_BREAK
 case 313:
 /* rule 313 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");}  surfxml_link_latency___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency___file);
-  YY_BREAK
+       YY_BREAK
 case 314:
 /* rule 314 can match eol */
 case 315:
 /* rule 315 can match eol */
 YY_RULE_SETUP
 A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SHARED;
-  YY_BREAK
+       YY_BREAK
 case 316:
 /* rule 316 can match eol */
 case 317:
 /* rule 317 can match eol */
 YY_RULE_SETUP
 A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FATPIPE;
-  YY_BREAK
+       YY_BREAK
 case 318:
 /* rule 318 can match eol */
 case 319:
 /* rule 319 can match eol */
 YY_RULE_SETUP
 A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FULLDUPLEX;
-  YY_BREAK
+       YY_BREAK
 case 320:
 /* rule 320 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");} surfxml_link_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state___file);
-  YY_BREAK
+       YY_BREAK
 case 321:
 /* rule 321 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");}  surfxml_link_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state___file);
-  YY_BREAK
+       YY_BREAK
 case 322:
 YY_RULE_SETUP
 {
@@ -8327,7 +8327,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
   LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
  }
-  YY_BREAK
+       YY_BREAK
 case 323:
 YY_RULE_SETUP
 {
@@ -8339,18 +8339,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 324:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of link element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 325:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `link' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_link):
 FAIL("EOF in attribute list of `link' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 326:
 /* rule 326 can match eol */
@@ -8364,27 +8364,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 327:
 /* rule 327 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</link>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 328:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</link>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_link):
 case YY_STATE_EOF(S_surfxml_link):
 case YY_STATE_EOF(S_surfxml_link_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</link>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</link>' expected.");
+       YY_BREAK
 
 case 329:
 /* rule 329 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <link_ctn> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 330:
 /* rule 330 can match eol */
 YY_RULE_SETUP
@@ -8395,7 +8395,7 @@ YY_RULE_SETUP
   surfxml_link___ctn_id_isset = 0;
   ENTER(AL_surfxml_link___ctn); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 331:
 /* rule 331 can match eol */
@@ -8403,38 +8403,38 @@ case 332:
 /* rule 332 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_UP;
-  YY_BREAK
+       YY_BREAK
 case 333:
 /* rule 333 can match eol */
 case 334:
 /* rule 334 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_DOWN;
-  YY_BREAK
+       YY_BREAK
 case 335:
 /* rule 335 can match eol */
 case 336:
 /* rule 336 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_NONE;
-  YY_BREAK
+       YY_BREAK
 case 337:
 /* rule 337 can match eol */
 YY_RULE_SETUP
 if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link___ctn>");} surfxml_link___ctn_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link___ctn_id);
-  YY_BREAK
+       YY_BREAK
 case 338:
 /* rule 338 can match eol */
 YY_RULE_SETUP
 if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link___ctn>");}  surfxml_link___ctn_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link___ctn_id);
-  YY_BREAK
+       YY_BREAK
 case 339:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link___ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element.");
   LEAVE; STag_surfxml_link___ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link___ctn);
  }
-  YY_BREAK
+       YY_BREAK
 case 340:
 YY_RULE_SETUP
 {
@@ -8449,18 +8449,18 @@ YY_RULE_SETUP
    case S_surfxml_zoneRoute: case S_surfxml_zoneRoute_1: case S_surfxml_zoneRoute_2: SET(S_surfxml_zoneRoute_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 341:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of link_ctn element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 342:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `link_ctn' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_link___ctn):
 FAIL("EOF in attribute list of `link_ctn' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 343:
 /* rule 343 can match eol */
@@ -8478,19 +8478,19 @@ YY_RULE_SETUP
    case S_surfxml_zoneRoute: case S_surfxml_zoneRoute_1: case S_surfxml_zoneRoute_2: SET(S_surfxml_zoneRoute_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 344:
 /* rule 344 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</link_ctn>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 345:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</link_ctn>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_link___ctn):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</link_ctn>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</link_ctn>' expected.");
+       YY_BREAK
 
 /* <!-- <!ATTLIST model_prop key CDATA #REQUIRED> -->
   * <!-- <!ATTLIST model_prop key CDATA #REQUIRED> -->  */
@@ -8498,7 +8498,7 @@ case 346:
 /* rule 346 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <model_prop> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 347:
 /* rule 347 can match eol */
 YY_RULE_SETUP
@@ -8509,28 +8509,28 @@ YY_RULE_SETUP
   surfxml_model___prop_value_isset = 0;
   ENTER(AL_surfxml_model___prop); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 348:
 /* rule 348 can match eol */
 YY_RULE_SETUP
 if (surfxml_model___prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_model___prop>");} surfxml_model___prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_model___prop_id);
-  YY_BREAK
+       YY_BREAK
 case 349:
 /* rule 349 can match eol */
 YY_RULE_SETUP
 if (surfxml_model___prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_model___prop>");}  surfxml_model___prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_model___prop_id);
-  YY_BREAK
+       YY_BREAK
 case 350:
 /* rule 350 can match eol */
 YY_RULE_SETUP
 if (surfxml_model___prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_model___prop>");} surfxml_model___prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_model___prop_value);
-  YY_BREAK
+       YY_BREAK
 case 351:
 /* rule 351 can match eol */
 YY_RULE_SETUP
 if (surfxml_model___prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_model___prop>");}  surfxml_model___prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_model___prop_value);
-  YY_BREAK
+       YY_BREAK
 case 352:
 YY_RULE_SETUP
 {
@@ -8538,7 +8538,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_model___prop_value) FAIL("Required attribute `value' not set for `model_prop' element.");
   LEAVE; STag_surfxml_model___prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_model___prop);
  }
-  YY_BREAK
+       YY_BREAK
 case 353:
 YY_RULE_SETUP
 {
@@ -8549,18 +8549,18 @@ YY_RULE_SETUP
    case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 354:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of model_prop element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 355:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `model_prop' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_model___prop):
 FAIL("EOF in attribute list of `model_prop' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 356:
 /* rule 356 can match eol */
@@ -8573,25 +8573,25 @@ YY_RULE_SETUP
    case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 357:
 /* rule 357 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</model_prop>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 358:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</model_prop>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_model___prop):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</model_prop>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</model_prop>' expected.");
+       YY_BREAK
 
 case 359:
 /* rule 359 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <mount> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 360:
 /* rule 360 can match eol */
 YY_RULE_SETUP
@@ -8602,28 +8602,28 @@ YY_RULE_SETUP
   surfxml_mount_storageId_isset = 0;
   ENTER(AL_surfxml_mount); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 361:
 /* rule 361 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");} surfxml_mount_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_name);
-  YY_BREAK
+       YY_BREAK
 case 362:
 /* rule 362 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");}  surfxml_mount_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_name);
-  YY_BREAK
+       YY_BREAK
 case 363:
 /* rule 363 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in <surfxml_mount>");} surfxml_mount_storageId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_storageId);
-  YY_BREAK
+       YY_BREAK
 case 364:
 /* rule 364 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in <surfxml_mount>");}  surfxml_mount_storageId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_storageId);
-  YY_BREAK
+       YY_BREAK
 case 365:
 YY_RULE_SETUP
 {
@@ -8631,7 +8631,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_mount_storageId) FAIL("Required attribute `storageId' not set for `mount' element.");
   LEAVE; STag_surfxml_mount();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mount);
  }
-  YY_BREAK
+       YY_BREAK
 case 366:
 YY_RULE_SETUP
 {
@@ -8642,18 +8642,18 @@ YY_RULE_SETUP
    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 367:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of mount element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 368:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `mount' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_mount):
 FAIL("EOF in attribute list of `mount' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 369:
 /* rule 369 can match eol */
@@ -8666,25 +8666,25 @@ YY_RULE_SETUP
    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 370:
 /* rule 370 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</mount>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 371:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</mount>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_mount):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</mount>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</mount>' expected.");
+       YY_BREAK
 
 case 372:
 /* rule 372 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <peer> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 373:
 /* rule 373 can match eol */
 YY_RULE_SETUP
@@ -8707,88 +8707,88 @@ YY_RULE_SETUP
   surfxml_peer_state___file_isset = 0;
   ENTER(AL_surfxml_peer); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 374:
 /* rule 374 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");} surfxml_peer_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_availability___file);
-  YY_BREAK
+       YY_BREAK
 case 375:
 /* rule 375 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");}  surfxml_peer_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_availability___file);
-  YY_BREAK
+       YY_BREAK
 case 376:
 /* rule 376 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");} surfxml_peer_bw___in_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___in);
-  YY_BREAK
+       YY_BREAK
 case 377:
 /* rule 377 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");}  surfxml_peer_bw___in_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___in);
-  YY_BREAK
+       YY_BREAK
 case 378:
 /* rule 378 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");} surfxml_peer_bw___out_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___out);
-  YY_BREAK
+       YY_BREAK
 case 379:
 /* rule 379 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");}  surfxml_peer_bw___out_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___out);
-  YY_BREAK
+       YY_BREAK
 case 380:
 /* rule 380 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");} surfxml_peer_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_coordinates);
-  YY_BREAK
+       YY_BREAK
 case 381:
 /* rule 381 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");}  surfxml_peer_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_coordinates);
-  YY_BREAK
+       YY_BREAK
 case 382:
 /* rule 382 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");} surfxml_peer_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_id);
-  YY_BREAK
+       YY_BREAK
 case 383:
 /* rule 383 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");}  surfxml_peer_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_id);
-  YY_BREAK
+       YY_BREAK
 case 384:
 /* rule 384 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");} surfxml_peer_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_lat);
-  YY_BREAK
+       YY_BREAK
 case 385:
 /* rule 385 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");}  surfxml_peer_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_lat);
-  YY_BREAK
+       YY_BREAK
 case 386:
 /* rule 386 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_peer>");} surfxml_peer_speed_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_speed);
-  YY_BREAK
+       YY_BREAK
 case 387:
 /* rule 387 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_speed_isset != 0) {FAIL("Multiple definition of attribute speed in <surfxml_peer>");}  surfxml_peer_speed_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_speed);
-  YY_BREAK
+       YY_BREAK
 case 388:
 /* rule 388 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");} surfxml_peer_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_state___file);
-  YY_BREAK
+       YY_BREAK
 case 389:
 /* rule 389 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");}  surfxml_peer_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_state___file);
-  YY_BREAK
+       YY_BREAK
 case 390:
 YY_RULE_SETUP
 {
@@ -8798,7 +8798,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_peer_speed) FAIL("Required attribute `speed' not set for `peer' element.");
   LEAVE; STag_surfxml_peer();surfxml_pcdata_ix = 0; ENTER(E_surfxml_peer);
  }
-  YY_BREAK
+       YY_BREAK
 case 391:
 YY_RULE_SETUP
 {
@@ -8814,18 +8814,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 392:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of peer element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 393:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `peer' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_peer):
 FAIL("EOF in attribute list of `peer' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 394:
 /* rule 394 can match eol */
@@ -8841,21 +8841,21 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 395:
 /* rule 395 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</peer>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 396:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</peer>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_peer):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</peer>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</peer>' expected.");
+       YY_BREAK
 
-/* <!--
+/* <!-- 
   *              DTD of SimGrid platform and deployment files.
   * More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
   * To upgrade your files, use the tool simgrid_update_xml
@@ -8868,15 +8868,15 @@ if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</peer>' expected.");
   *    - Rename (power->speed) the attributes describing the amount of flop
   *      that a <host>, <peer>, <cluster> or <cabinet> can deliver per second.
   *    - In <trace_connect>, attribute kind="POWER" is now kind="SPEED".
-  *
+  *    
   *    - In <host> and <link>, attributes availability and state are gone.
   *      It was redundent with state and availability traces, and with peak values.
-  *
-  *    - In <cluster>, cannot set the availability nor state traces.
+  *      
+  *    - In <cluster>, cannot set the availability nor state traces. 
   *      This was too complex and unused.
   *    - The DOCTYPE points to the right URL (this file):
   *      http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd
-  *
+  *      
   *    - Kill <gpu>. Was not doing anything.
   *    - A warning is emitted for unit-less values (they are still accepted).
   *      - speed. Default: 'f' or 'flops'. Also defined:
@@ -8905,7 +8905,7 @@ if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</peer>' expected.");
   *      - PLATFORM_DESCRIPTION -> PLATFORM
   * * New in DTD version 1 (in SimGrid 3.3):
   *    - DTD is now versionned with the version attribute of platform
-  *    - Unit change:
+  *    - Unit change: 
   *      - Link bandwidth: from Mb/s to b/s
   *      - CPU speed: from MFlop/s to Flop/s
   * -->  */
@@ -8913,7 +8913,7 @@ case 397:
 /* rule 397 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <platform> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 398:
 /* rule 398 can match eol */
 YY_RULE_SETUP
@@ -8922,24 +8922,24 @@ YY_RULE_SETUP
   surfxml_platform_version_isset = 0;
   ENTER(AL_surfxml_platform); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 399:
 /* rule 399 can match eol */
 YY_RULE_SETUP
 if (surfxml_platform_version_isset != 0) {FAIL("Multiple definition of attribute version in <surfxml_platform>");} surfxml_platform_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version);
-  YY_BREAK
+       YY_BREAK
 case 400:
 /* rule 400 can match eol */
 YY_RULE_SETUP
 if (surfxml_platform_version_isset != 0) {FAIL("Multiple definition of attribute version in <surfxml_platform>");}  surfxml_platform_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version);
-  YY_BREAK
+       YY_BREAK
 case 401:
 YY_RULE_SETUP
 {
   LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
  }
-  YY_BREAK
+       YY_BREAK
 case 402:
 YY_RULE_SETUP
 {
@@ -8948,18 +8948,18 @@ YY_RULE_SETUP
    case ROOT_surfxml_platform: SET(EPILOG); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 403:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of platform element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 404:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `platform' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_platform):
 FAIL("EOF in attribute list of `platform' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 405:
 /* rule 405 can match eol */
@@ -8972,16 +8972,16 @@ YY_RULE_SETUP
    case ROOT_surfxml_platform: SET(EPILOG); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 406:
 /* rule 406 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</platform>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 407:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</platform>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_platform):
 case YY_STATE_EOF(S_surfxml_platform):
 case YY_STATE_EOF(S_surfxml_platform_1):
@@ -8989,14 +8989,14 @@ case YY_STATE_EOF(S_surfxml_platform_3):
 case YY_STATE_EOF(S_surfxml_platform_4):
 case YY_STATE_EOF(S_surfxml_platform_6):
 case YY_STATE_EOF(S_surfxml_platform_8):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</platform>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</platform>' expected.");
+       YY_BREAK
 
 case 408:
 /* rule 408 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <process> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 409:
 /* rule 409 can match eol */
 YY_RULE_SETUP
@@ -9013,62 +9013,62 @@ YY_RULE_SETUP
   surfxml_process_start___time_isset = 0;
   ENTER(AL_surfxml_process); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 410:
 /* rule 410 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");} surfxml_process_function_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
-  YY_BREAK
+       YY_BREAK
 case 411:
 /* rule 411 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");}  surfxml_process_function_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
-  YY_BREAK
+       YY_BREAK
 case 412:
 /* rule 412 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");} surfxml_process_host_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
-  YY_BREAK
+       YY_BREAK
 case 413:
 /* rule 413 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");}  surfxml_process_host_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
-  YY_BREAK
+       YY_BREAK
 case 414:
 /* rule 414 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");} surfxml_process_kill___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill___time);
-  YY_BREAK
+       YY_BREAK
 case 415:
 /* rule 415 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");}  surfxml_process_kill___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill___time);
-  YY_BREAK
+       YY_BREAK
 case 416:
 /* rule 416 can match eol */
 case 417:
 /* rule 417 can match eol */
 YY_RULE_SETUP
 A_surfxml_process_on___failure = A_surfxml_process_on___failure_DIE;
-  YY_BREAK
+       YY_BREAK
 case 418:
 /* rule 418 can match eol */
 case 419:
 /* rule 419 can match eol */
 YY_RULE_SETUP
 A_surfxml_process_on___failure = A_surfxml_process_on___failure_RESTART;
-  YY_BREAK
+       YY_BREAK
 case 420:
 /* rule 420 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");} surfxml_process_start___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start___time);
-  YY_BREAK
+       YY_BREAK
 case 421:
 /* rule 421 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");}  surfxml_process_start___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start___time);
-  YY_BREAK
+       YY_BREAK
 case 422:
 YY_RULE_SETUP
 {
@@ -9076,7 +9076,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
   LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
  }
-  YY_BREAK
+       YY_BREAK
 case 423:
 YY_RULE_SETUP
 {
@@ -9087,18 +9087,18 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 424:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of process element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 425:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `process' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_process):
 FAIL("EOF in attribute list of `process' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 426:
 /* rule 426 can match eol */
@@ -9111,21 +9111,21 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 427:
 /* rule 427 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</process>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 428:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</process>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_process):
 case YY_STATE_EOF(S_surfxml_process):
 case YY_STATE_EOF(S_surfxml_process_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</process>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</process>' expected.");
+       YY_BREAK
 
 /* <!-- <!ATTLIST prop key CDATA #REQUIRED> -->
   * <!-- <!ATTLIST prop key CDATA #REQUIRED> -->  */
@@ -9133,7 +9133,7 @@ case 429:
 /* rule 429 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <prop> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 430:
 /* rule 430 can match eol */
 YY_RULE_SETUP
@@ -9144,28 +9144,28 @@ YY_RULE_SETUP
   surfxml_prop_value_isset = 0;
   ENTER(AL_surfxml_prop); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 431:
 /* rule 431 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");} surfxml_prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
-  YY_BREAK
+       YY_BREAK
 case 432:
 /* rule 432 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");}  surfxml_prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
-  YY_BREAK
+       YY_BREAK
 case 433:
 /* rule 433 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");} surfxml_prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
-  YY_BREAK
+       YY_BREAK
 case 434:
 /* rule 434 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");}  surfxml_prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
-  YY_BREAK
+       YY_BREAK
 case 435:
 YY_RULE_SETUP
 {
@@ -9173,7 +9173,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
   LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
  }
-  YY_BREAK
+       YY_BREAK
 case 436:
 YY_RULE_SETUP
 {
@@ -9193,18 +9193,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_2: case S_surfxml_zone_3: SET(S_surfxml_zone_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 437:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of prop element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 438:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `prop' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_prop):
 FAIL("EOF in attribute list of `prop' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 439:
 /* rule 439 can match eol */
@@ -9226,25 +9226,25 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_2: case S_surfxml_zone_3: SET(S_surfxml_zone_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 440:
 /* rule 440 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</prop>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 441:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</prop>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_prop):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</prop>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</prop>' expected.");
+       YY_BREAK
 
 case 442:
 /* rule 442 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <random> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 443:
 /* rule 443 can match eol */
 YY_RULE_SETUP
@@ -9267,7 +9267,7 @@ YY_RULE_SETUP
   surfxml_random_std___deviation_isset = 0;
   ENTER(AL_surfxml_random); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 444:
 /* rule 444 can match eol */
@@ -9275,98 +9275,98 @@ case 445:
 /* rule 445 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
-  YY_BREAK
+       YY_BREAK
 case 446:
 /* rule 446 can match eol */
 case 447:
 /* rule 447 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_RAND;
-  YY_BREAK
+       YY_BREAK
 case 448:
 /* rule 448 can match eol */
 case 449:
 /* rule 449 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_RNGSTREAM;
-  YY_BREAK
+       YY_BREAK
 case 450:
 /* rule 450 can match eol */
 case 451:
 /* rule 451 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_NONE;
-  YY_BREAK
+       YY_BREAK
 case 452:
 /* rule 452 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_random>");} surfxml_random_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_id);
-  YY_BREAK
+       YY_BREAK
 case 453:
 /* rule 453 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_random>");}  surfxml_random_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_id);
-  YY_BREAK
+       YY_BREAK
 case 454:
 /* rule 454 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_max_isset != 0) {FAIL("Multiple definition of attribute max in <surfxml_random>");} surfxml_random_max_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_max);
-  YY_BREAK
+       YY_BREAK
 case 455:
 /* rule 455 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_max_isset != 0) {FAIL("Multiple definition of attribute max in <surfxml_random>");}  surfxml_random_max_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_max);
-  YY_BREAK
+       YY_BREAK
 case 456:
 /* rule 456 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_mean_isset != 0) {FAIL("Multiple definition of attribute mean in <surfxml_random>");} surfxml_random_mean_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_mean);
-  YY_BREAK
+       YY_BREAK
 case 457:
 /* rule 457 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_mean_isset != 0) {FAIL("Multiple definition of attribute mean in <surfxml_random>");}  surfxml_random_mean_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_mean);
-  YY_BREAK
+       YY_BREAK
 case 458:
 /* rule 458 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_min_isset != 0) {FAIL("Multiple definition of attribute min in <surfxml_random>");} surfxml_random_min_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_min);
-  YY_BREAK
+       YY_BREAK
 case 459:
 /* rule 459 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_min_isset != 0) {FAIL("Multiple definition of attribute min in <surfxml_random>");}  surfxml_random_min_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_min);
-  YY_BREAK
+       YY_BREAK
 case 460:
 /* rule 460 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_random>");} surfxml_random_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_radical);
-  YY_BREAK
+       YY_BREAK
 case 461:
 /* rule 461 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_random>");}  surfxml_random_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_radical);
-  YY_BREAK
+       YY_BREAK
 case 462:
 /* rule 462 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_seed_isset != 0) {FAIL("Multiple definition of attribute seed in <surfxml_random>");} surfxml_random_seed_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_seed);
-  YY_BREAK
+       YY_BREAK
 case 463:
 /* rule 463 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_seed_isset != 0) {FAIL("Multiple definition of attribute seed in <surfxml_random>");}  surfxml_random_seed_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_seed);
-  YY_BREAK
+       YY_BREAK
 case 464:
 /* rule 464 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_std___deviation_isset != 0) {FAIL("Multiple definition of attribute std_deviation in <surfxml_random>");} surfxml_random_std___deviation_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_std___deviation);
-  YY_BREAK
+       YY_BREAK
 case 465:
 /* rule 465 can match eol */
 YY_RULE_SETUP
 if (surfxml_random_std___deviation_isset != 0) {FAIL("Multiple definition of attribute std_deviation in <surfxml_random>");}  surfxml_random_std___deviation_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_std___deviation);
-  YY_BREAK
+       YY_BREAK
 case 466:
 YY_RULE_SETUP
 {
@@ -9377,7 +9377,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_random_std___deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
   LEAVE; STag_surfxml_random();surfxml_pcdata_ix = 0; ENTER(E_surfxml_random);
  }
-  YY_BREAK
+       YY_BREAK
 case 467:
 YY_RULE_SETUP
 {
@@ -9391,18 +9391,18 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 468:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of random element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 469:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `random' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_random):
 FAIL("EOF in attribute list of `random' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 470:
 /* rule 470 can match eol */
@@ -9415,25 +9415,25 @@ YY_RULE_SETUP
    case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 471:
 /* rule 471 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</random>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 472:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</random>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_random):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</random>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</random>' expected.");
+       YY_BREAK
 
 case 473:
 /* rule 473 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <route> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 474:
 /* rule 474 can match eol */
 YY_RULE_SETUP
@@ -9446,42 +9446,42 @@ YY_RULE_SETUP
   surfxml_route_symmetrical_isset = 0;
   ENTER(AL_surfxml_route); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 475:
 /* rule 475 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");} surfxml_route_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
-  YY_BREAK
+       YY_BREAK
 case 476:
 /* rule 476 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");}  surfxml_route_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
-  YY_BREAK
+       YY_BREAK
 case 477:
 /* rule 477 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");} surfxml_route_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
-  YY_BREAK
+       YY_BREAK
 case 478:
 /* rule 478 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");}  surfxml_route_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
-  YY_BREAK
+       YY_BREAK
 case 479:
 /* rule 479 can match eol */
 case 480:
 /* rule 480 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
-  YY_BREAK
+       YY_BREAK
 case 481:
 /* rule 481 can match eol */
 case 482:
 /* rule 482 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
-  YY_BREAK
+       YY_BREAK
 case 483:
 YY_RULE_SETUP
 {
@@ -9489,7 +9489,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
   LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
  }
-  YY_BREAK
+       YY_BREAK
 case 484:
 YY_RULE_SETUP
 {
@@ -9501,18 +9501,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 485:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of route element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 486:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `route' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_route):
 FAIL("EOF in attribute list of `route' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 487:
 /* rule 487 can match eol */
@@ -9526,27 +9526,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 488:
 /* rule 488 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</route>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 489:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</route>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_route):
 case YY_STATE_EOF(S_surfxml_route):
 case YY_STATE_EOF(S_surfxml_route_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</route>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</route>' expected.");
+       YY_BREAK
 
 case 490:
 /* rule 490 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <router> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 491:
 /* rule 491 can match eol */
 YY_RULE_SETUP
@@ -9557,35 +9557,35 @@ YY_RULE_SETUP
   surfxml_router_id_isset = 0;
   ENTER(AL_surfxml_router); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 492:
 /* rule 492 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");} surfxml_router_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_coordinates);
-  YY_BREAK
+       YY_BREAK
 case 493:
 /* rule 493 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");}  surfxml_router_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_coordinates);
-  YY_BREAK
+       YY_BREAK
 case 494:
 /* rule 494 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");} surfxml_router_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
-  YY_BREAK
+       YY_BREAK
 case 495:
 /* rule 495 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");}  surfxml_router_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
-  YY_BREAK
+       YY_BREAK
 case 496:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
   LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
  }
-  YY_BREAK
+       YY_BREAK
 case 497:
 YY_RULE_SETUP
 {
@@ -9596,18 +9596,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 498:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of router element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 499:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `router' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_router):
 FAIL("EOF in attribute list of `router' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 500:
 /* rule 500 can match eol */
@@ -9621,25 +9621,25 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 501:
 /* rule 501 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</router>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 502:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</router>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_router):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</router>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</router>' expected.");
+       YY_BREAK
 
 case 503:
 /* rule 503 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <storage> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 504:
 /* rule 504 can match eol */
 YY_RULE_SETUP
@@ -9654,48 +9654,48 @@ YY_RULE_SETUP
   surfxml_storage_typeId_isset = 0;
   ENTER(AL_surfxml_storage); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 505:
 /* rule 505 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_attach_isset != 0) {FAIL("Multiple definition of attribute attach in <surfxml_storage>");} surfxml_storage_attach_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_attach);
-  YY_BREAK
+       YY_BREAK
 case 506:
 /* rule 506 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_attach_isset != 0) {FAIL("Multiple definition of attribute attach in <surfxml_storage>");}  surfxml_storage_attach_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_attach);
-  YY_BREAK
+       YY_BREAK
 case 507:
 /* rule 507 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");} surfxml_storage_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content);
-  YY_BREAK
+       YY_BREAK
 case 508:
 /* rule 508 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");}  surfxml_storage_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content);
-  YY_BREAK
+       YY_BREAK
 case 509:
 /* rule 509 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");} surfxml_storage_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_id);
-  YY_BREAK
+       YY_BREAK
 case 510:
 /* rule 510 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");}  surfxml_storage_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_id);
-  YY_BREAK
+       YY_BREAK
 case 511:
 /* rule 511 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");} surfxml_storage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_typeId);
-  YY_BREAK
+       YY_BREAK
 case 512:
 /* rule 512 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");}  surfxml_storage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_typeId);
-  YY_BREAK
+       YY_BREAK
 case 513:
 YY_RULE_SETUP
 {
@@ -9704,7 +9704,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_storage_typeId) FAIL("Required attribute `typeId' not set for `storage' element.");
   LEAVE; STag_surfxml_storage();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage);
  }
-  YY_BREAK
+       YY_BREAK
 case 514:
 YY_RULE_SETUP
 {
@@ -9717,18 +9717,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 515:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of storage element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 516:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `storage' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_storage):
 FAIL("EOF in attribute list of `storage' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 517:
 /* rule 517 can match eol */
@@ -9742,27 +9742,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 518:
 /* rule 518 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</storage>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 519:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</storage>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_storage):
 case YY_STATE_EOF(S_surfxml_storage):
 case YY_STATE_EOF(S_surfxml_storage_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</storage>' expected.");
+       YY_BREAK
 
 case 520:
 /* rule 520 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <storage_type> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 521:
 /* rule 521 can match eol */
 YY_RULE_SETUP
@@ -9777,48 +9777,48 @@ YY_RULE_SETUP
   surfxml_storage___type_size_isset = 0;
   ENTER(AL_surfxml_storage___type); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 522:
 /* rule 522 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage___type>");} surfxml_storage___type_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_content);
-  YY_BREAK
+       YY_BREAK
 case 523:
 /* rule 523 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage___type>");}  surfxml_storage___type_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_content);
-  YY_BREAK
+       YY_BREAK
 case 524:
 /* rule 524 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage___type>");} surfxml_storage___type_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_id);
-  YY_BREAK
+       YY_BREAK
 case 525:
 /* rule 525 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage___type>");}  surfxml_storage___type_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_id);
-  YY_BREAK
+       YY_BREAK
 case 526:
 /* rule 526 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_model_isset != 0) {FAIL("Multiple definition of attribute model in <surfxml_storage___type>");} surfxml_storage___type_model_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_model);
-  YY_BREAK
+       YY_BREAK
 case 527:
 /* rule 527 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_model_isset != 0) {FAIL("Multiple definition of attribute model in <surfxml_storage___type>");}  surfxml_storage___type_model_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_model);
-  YY_BREAK
+       YY_BREAK
 case 528:
 /* rule 528 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_size_isset != 0) {FAIL("Multiple definition of attribute size in <surfxml_storage___type>");} surfxml_storage___type_size_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_size);
-  YY_BREAK
+       YY_BREAK
 case 529:
 /* rule 529 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage___type_size_isset != 0) {FAIL("Multiple definition of attribute size in <surfxml_storage___type>");}  surfxml_storage___type_size_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_size);
-  YY_BREAK
+       YY_BREAK
 case 530:
 YY_RULE_SETUP
 {
@@ -9826,7 +9826,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_storage___type_size) FAIL("Required attribute `size' not set for `storage_type' element.");
   LEAVE; STag_surfxml_storage___type();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage___type);
  }
-  YY_BREAK
+       YY_BREAK
 case 531:
 YY_RULE_SETUP
 {
@@ -9838,18 +9838,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 532:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of storage_type element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 533:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `storage_type' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_storage___type):
 FAIL("EOF in attribute list of `storage_type' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 534:
 /* rule 534 can match eol */
@@ -9863,27 +9863,27 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 535:
 /* rule 535 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</storage_type>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 536:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</storage_type>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_storage___type):
 case YY_STATE_EOF(S_surfxml_storage___type):
 case YY_STATE_EOF(S_surfxml_storage___type_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage_type>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</storage_type>' expected.");
+       YY_BREAK
 
 case 537:
 /* rule 537 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <trace> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 538:
 /* rule 538 can match eol */
 YY_RULE_SETUP
@@ -9896,38 +9896,38 @@ YY_RULE_SETUP
   surfxml_trace_periodicity_isset = 0;
   ENTER(AL_surfxml_trace); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 539:
 /* rule 539 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_trace>");} surfxml_trace_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_file);
-  YY_BREAK
+       YY_BREAK
 case 540:
 /* rule 540 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_trace>");}  surfxml_trace_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_file);
-  YY_BREAK
+       YY_BREAK
 case 541:
 /* rule 541 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_trace>");} surfxml_trace_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_id);
-  YY_BREAK
+       YY_BREAK
 case 542:
 /* rule 542 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_trace>");}  surfxml_trace_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_id);
-  YY_BREAK
+       YY_BREAK
 case 543:
 /* rule 543 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace_periodicity_isset != 0) {FAIL("Multiple definition of attribute periodicity in <surfxml_trace>");} surfxml_trace_periodicity_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_periodicity);
-  YY_BREAK
+       YY_BREAK
 case 544:
 /* rule 544 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace_periodicity_isset != 0) {FAIL("Multiple definition of attribute periodicity in <surfxml_trace>");}  surfxml_trace_periodicity_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_periodicity);
-  YY_BREAK
+       YY_BREAK
 case 545:
 YY_RULE_SETUP
 {
@@ -9935,7 +9935,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
   LEAVE; STag_surfxml_trace();pushbuffer(surfxml_pcdata_ix); BUFFERSET(surfxml_pcdata_ix);; ENTER(IN_trace);
  }
-  YY_BREAK
+       YY_BREAK
 case 546:
 YY_RULE_SETUP
 {
@@ -9949,18 +9949,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 547:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of trace element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 548:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `trace' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_trace):
 FAIL("EOF in attribute list of `trace' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 549:
 /* rule 549 can match eol */
@@ -9978,21 +9978,21 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 550:
 /* rule 550 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</trace>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(IN_trace):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</trace>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</trace>' expected.");
+       YY_BREAK
 
 case 551:
 /* rule 551 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <trace_connect> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 552:
 /* rule 552 can match eol */
 YY_RULE_SETUP
@@ -10005,63 +10005,63 @@ YY_RULE_SETUP
   surfxml_trace___connect_trace_isset = 0;
   ENTER(AL_surfxml_trace___connect); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 553:
 /* rule 553 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace___connect_element_isset != 0) {FAIL("Multiple definition of attribute element in <surfxml_trace___connect>");} surfxml_trace___connect_element_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace___connect_element);
-  YY_BREAK
+       YY_BREAK
 case 554:
 /* rule 554 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace___connect_element_isset != 0) {FAIL("Multiple definition of attribute element in <surfxml_trace___connect>");}  surfxml_trace___connect_element_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace___connect_element);
-  YY_BREAK
+       YY_BREAK
 case 555:
 /* rule 555 can match eol */
 case 556:
 /* rule 556 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_HOST___AVAIL;
-  YY_BREAK
+       YY_BREAK
 case 557:
 /* rule 557 can match eol */
 case 558:
 /* rule 558 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_SPEED;
-  YY_BREAK
+       YY_BREAK
 case 559:
 /* rule 559 can match eol */
 case 560:
 /* rule 560 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_LINK___AVAIL;
-  YY_BREAK
+       YY_BREAK
 case 561:
 /* rule 561 can match eol */
 case 562:
 /* rule 562 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_BANDWIDTH;
-  YY_BREAK
+       YY_BREAK
 case 563:
 /* rule 563 can match eol */
 case 564:
 /* rule 564 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_LATENCY;
-  YY_BREAK
+       YY_BREAK
 case 565:
 /* rule 565 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace___connect_trace_isset != 0) {FAIL("Multiple definition of attribute trace in <surfxml_trace___connect>");} surfxml_trace___connect_trace_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace___connect_trace);
-  YY_BREAK
+       YY_BREAK
 case 566:
 /* rule 566 can match eol */
 YY_RULE_SETUP
 if (surfxml_trace___connect_trace_isset != 0) {FAIL("Multiple definition of attribute trace in <surfxml_trace___connect>");}  surfxml_trace___connect_trace_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace___connect_trace);
-  YY_BREAK
+       YY_BREAK
 case 567:
 YY_RULE_SETUP
 {
@@ -10069,7 +10069,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_trace___connect_trace) FAIL("Required attribute `trace' not set for `trace_connect' element.");
   LEAVE; STag_surfxml_trace___connect();surfxml_pcdata_ix = 0; ENTER(E_surfxml_trace___connect);
  }
-  YY_BREAK
+       YY_BREAK
 case 568:
 YY_RULE_SETUP
 {
@@ -10083,18 +10083,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 569:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of trace_connect element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 570:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `trace_connect' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_trace___connect):
 FAIL("EOF in attribute list of `trace_connect' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 571:
 /* rule 571 can match eol */
@@ -10110,25 +10110,25 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 572:
 /* rule 572 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</trace_connect>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 573:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</trace_connect>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_trace___connect):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</trace_connect>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</trace_connect>' expected.");
+       YY_BREAK
 
 case 574:
 /* rule 574 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <zone> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 575:
 /* rule 575 can match eol */
 YY_RULE_SETUP
@@ -10139,88 +10139,88 @@ YY_RULE_SETUP
   surfxml_zone_routing_isset = 0;
   ENTER(AL_surfxml_zone); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 576:
 /* rule 576 can match eol */
 YY_RULE_SETUP
 if (surfxml_zone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_zone>");} surfxml_zone_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_zone_id);
-  YY_BREAK
+       YY_BREAK
 case 577:
 /* rule 577 can match eol */
 YY_RULE_SETUP
 if (surfxml_zone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_zone>");}  surfxml_zone_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_zone_id);
-  YY_BREAK
+       YY_BREAK
 case 578:
 /* rule 578 can match eol */
 case 579:
 /* rule 579 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Full;
-  YY_BREAK
+       YY_BREAK
 case 580:
 /* rule 580 can match eol */
 case 581:
 /* rule 581 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Floyd;
-  YY_BREAK
+       YY_BREAK
 case 582:
 /* rule 582 can match eol */
 case 583:
 /* rule 583 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Dijkstra;
-  YY_BREAK
+       YY_BREAK
 case 584:
 /* rule 584 can match eol */
 case 585:
 /* rule 585 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_DijkstraCache;
-  YY_BREAK
+       YY_BREAK
 case 586:
 /* rule 586 can match eol */
 case 587:
 /* rule 587 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_None;
-  YY_BREAK
+       YY_BREAK
 case 588:
 /* rule 588 can match eol */
 case 589:
 /* rule 589 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Vivaldi;
-  YY_BREAK
+       YY_BREAK
 case 590:
 /* rule 590 can match eol */
 case 591:
 /* rule 591 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Cluster;
-  YY_BREAK
+       YY_BREAK
 case 592:
 /* rule 592 can match eol */
 case 593:
 /* rule 593 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_ClusterTorus;
-  YY_BREAK
+       YY_BREAK
 case 594:
 /* rule 594 can match eol */
 case 595:
 /* rule 595 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_ClusterFatTree;
-  YY_BREAK
+       YY_BREAK
 case 596:
 /* rule 596 can match eol */
 case 597:
 /* rule 597 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_ClusterDragonfly;
-  YY_BREAK
+       YY_BREAK
 case 598:
 YY_RULE_SETUP
 {
@@ -10228,7 +10228,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_zone_routing) FAIL("Required attribute `routing' not set for `zone' element.");
   LEAVE; STag_surfxml_zone();surfxml_pcdata_ix = 0; ENTER(S_surfxml_zone);
  }
-  YY_BREAK
+       YY_BREAK
 case 599:
 YY_RULE_SETUP
 {
@@ -10242,18 +10242,18 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 600:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of zone element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 601:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `zone' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_zone):
 FAIL("EOF in attribute list of `zone' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 602:
 /* rule 602 can match eol */
@@ -10269,16 +10269,16 @@ YY_RULE_SETUP
    case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 603:
 /* rule 603 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</zone>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 604:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</zone>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_zone):
 case YY_STATE_EOF(S_surfxml_zone):
 case YY_STATE_EOF(S_surfxml_zone_1):
@@ -10286,14 +10286,14 @@ case YY_STATE_EOF(S_surfxml_zone_3):
 case YY_STATE_EOF(S_surfxml_zone_4):
 case YY_STATE_EOF(S_surfxml_zone_6):
 case YY_STATE_EOF(S_surfxml_zone_8):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</zone>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</zone>' expected.");
+       YY_BREAK
 
 case 605:
 /* rule 605 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <zoneRoute> is not allowed here.");
-  YY_BREAK
+       YY_BREAK
 case 606:
 /* rule 606 can match eol */
 YY_RULE_SETUP
@@ -10310,62 +10310,62 @@ YY_RULE_SETUP
   surfxml_zoneRoute_symmetrical_isset = 0;
   ENTER(AL_surfxml_zoneRoute); pushbuffer(0);
   }
-  YY_BREAK
+       YY_BREAK
 
 case 607:
 /* rule 607 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_zoneRoute>");} surfxml_zoneRoute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_zoneRoute_dst);
-  YY_BREAK
+       YY_BREAK
 case 608:
 /* rule 608 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_zoneRoute>");}  surfxml_zoneRoute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_zoneRoute_dst);
-  YY_BREAK
+       YY_BREAK
 case 609:
 /* rule 609 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_zoneRoute>");} surfxml_zoneRoute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_zoneRoute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 610:
 /* rule 610 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_zoneRoute>");}  surfxml_zoneRoute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_zoneRoute_gw___dst);
-  YY_BREAK
+       YY_BREAK
 case 611:
 /* rule 611 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_zoneRoute>");} surfxml_zoneRoute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_zoneRoute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 612:
 /* rule 612 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_zoneRoute>");}  surfxml_zoneRoute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_zoneRoute_gw___src);
-  YY_BREAK
+       YY_BREAK
 case 613:
 /* rule 613 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_zoneRoute>");} surfxml_zoneRoute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_zoneRoute_src);
-  YY_BREAK
+       YY_BREAK
 case 614:
 /* rule 614 can match eol */
 YY_RULE_SETUP
 if (surfxml_zoneRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_zoneRoute>");}  surfxml_zoneRoute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_zoneRoute_src);
-  YY_BREAK
+       YY_BREAK
 case 615:
 /* rule 615 can match eol */
 case 616:
 /* rule 616 can match eol */
 YY_RULE_SETUP
 A_surfxml_zoneRoute_symmetrical = A_surfxml_zoneRoute_symmetrical_YES;
-  YY_BREAK
+       YY_BREAK
 case 617:
 /* rule 617 can match eol */
 case 618:
 /* rule 618 can match eol */
 YY_RULE_SETUP
 A_surfxml_zoneRoute_symmetrical = A_surfxml_zoneRoute_symmetrical_NO;
-  YY_BREAK
+       YY_BREAK
 case 619:
 YY_RULE_SETUP
 {
@@ -10375,7 +10375,7 @@ YY_RULE_SETUP
   if (!AX_surfxml_zoneRoute_src) FAIL("Required attribute `src' not set for `zoneRoute' element.");
   LEAVE; STag_surfxml_zoneRoute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_zoneRoute);
  }
-  YY_BREAK
+       YY_BREAK
 case 620:
 YY_RULE_SETUP
 {
@@ -10385,24 +10385,24 @@ YY_RULE_SETUP
   if (!AX_surfxml_zoneRoute_src) FAIL("Required attribute `src' not set for `zoneRoute' element.");
   LEAVE; STag_surfxml_zoneRoute(); surfxml_pcdata_ix = 0; ETag_surfxml_zoneRoute(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
+   case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 621:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of zoneRoute element.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 622:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `zoneRoute' element start tag.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(AL_surfxml_zoneRoute):
 FAIL("EOF in attribute list of `zoneRoute' element.");
-  YY_BREAK
+       YY_BREAK
 
 case 623:
 /* rule 623 can match eol */
@@ -10412,37 +10412,37 @@ YY_RULE_SETUP
   ETag_surfxml_zoneRoute();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
+   case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break;
   }
  }
-  YY_BREAK
+       YY_BREAK
 case 624:
 /* rule 624 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</zoneRoute>' expected.",surf_parse_text);
-  YY_BREAK
+       YY_BREAK
 case 625:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</zoneRoute>' expected.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(E_surfxml_zoneRoute):
 case YY_STATE_EOF(S_surfxml_zoneRoute):
 case YY_STATE_EOF(S_surfxml_zoneRoute_2):
-if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</zoneRoute>' expected.");
-  YY_BREAK
+FAIL("Premature EOF: `</zoneRoute>' expected.");
+       YY_BREAK
 
 /* EPILOG: after the root element. */
 
 case 626:
 YY_RULE_SETUP
 {SET(PROLOG); yyless(0); CLEANUP; return -1;}
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(EPILOG):
 SUCCEED;
-  YY_BREAK
+       YY_BREAK
 
 /* CHARACTER DATA. */
 
@@ -10450,32 +10450,32 @@ SUCCEED;
 case 627:
 YY_RULE_SETUP
 BUFFERPUTC('&');
-  YY_BREAK
+       YY_BREAK
 case 628:
 YY_RULE_SETUP
 BUFFERPUTC('<');
-  YY_BREAK
+       YY_BREAK
 case 629:
 YY_RULE_SETUP
 BUFFERPUTC('>');
-  YY_BREAK
+       YY_BREAK
 case 630:
 YY_RULE_SETUP
 BUFFERPUTC('\'');
-  YY_BREAK
+       YY_BREAK
 case 631:
 YY_RULE_SETUP
 BUFFERPUTC('"');
-  YY_BREAK
+       YY_BREAK
 /* Character entities. */
 case 632:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)atoi(surf_parse_text+2));
-  YY_BREAK
+       YY_BREAK
 case 633:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)strtol(surf_parse_text+3,NULL,16));
-  YY_BREAK
+       YY_BREAK
 
 case 634:
 /* rule 634 can match eol */
@@ -10487,55 +10487,55 @@ case 637:
 /* rule 637 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC('\n');
-  YY_BREAK
+       YY_BREAK
 
 case 638:
 YY_RULE_SETUP
 ENTER(CDATA);
-  YY_BREAK
+       YY_BREAK
 case 639:
 YY_RULE_SETUP
 FAIL("Unexpected `]""]>' in character data.");
-  YY_BREAK
+       YY_BREAK
 
 case 640:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(VALUE1):
 FAIL("EOF in literal (\"'\" expected).");
-  YY_BREAK
+       YY_BREAK
 
 case 641:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(VALUE2):
 FAIL("EOF in literal (`\"' expected).");
-  YY_BREAK
+       YY_BREAK
 
 case 642:
 /* rule 642 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC(surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case 643:
 YY_RULE_SETUP
 FAIL("Spurious `%c' in character data.",surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 
 case 644:
 YY_RULE_SETUP
 LEAVE;
-  YY_BREAK
-/* "]""]"    BUFFERPUTC(surf_parse_text[0]); BUFFERPUTC(surf_parse_text[1]); */
+       YY_BREAK
+/* "]""]"              BUFFERPUTC(surf_parse_text[0]); BUFFERPUTC(surf_parse_text[1]); */
 case 645:
 YY_RULE_SETUP
 BUFFERPUTC(surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(CDATA):
 FAIL("EOF in CDATA section.");
-  YY_BREAK
+       YY_BREAK
 
 /* Impossible rules to avoid warnings from flex(1). */
 /* Ideally, this should be replaced by code in flexml.pl that
@@ -10545,12 +10545,12 @@ case 646:
 /* rule 646 can match eol */
 YY_RULE_SETUP
 FAIL("Syntax error on character `%c'.", surf_parse_text[0]);
-  YY_BREAK
+       YY_BREAK
 
 case 647:
 YY_RULE_SETUP
 ECHO;
-  YY_BREAK
+       YY_BREAK
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(S_surfxml_AS_2):
 case YY_STATE_EOF(S_surfxml_AS_5):
@@ -10578,332 +10578,332 @@ case YY_STATE_EOF(S_surfxml_zone_5):
 case YY_STATE_EOF(S_surfxml_zone_7):
 case YY_STATE_EOF(S_surfxml_zoneRoute_1):
 case YY_STATE_EOF(IMPOSSIBLE):
-  yyterminate();
-
-  case YY_END_OF_BUFFER:
-    {
-    /* Amount of text matched not including the EOB char. */
-    int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-    *yy_cp = (yy_hold_char);
-    YY_RESTORE_YY_MORE_OFFSET
-
-    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-      {
-      /* We're scanning a new file or input source.  It's
-       * possible that this happened because the user
-       * just pointed surf_parse_in at a new source and called
-       * surf_parse_lex().  If so, then we have to assure
-       * consistency between YY_CURRENT_BUFFER and our
-       * globals.  Here is the right place to do so, because
-       * this is the first action (other than possibly a
-       * back-up) that will match for the new input source.
-       */
-      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-      YY_CURRENT_BUFFER_LVALUE->yy_input_file = surf_parse_in;
-      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-      }
-
-    /* Note that here we test for yy_c_buf_p "<=" to the position
-     * of the first EOB in the buffer, since yy_c_buf_p will
-     * already have been incremented past the NUL character
-     * (since all states make transitions on EOB to the
-     * end-of-buffer state).  Contrast this with the test
-     * in input().
-     */
-    if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-      { /* This was really a NUL. */
-      yy_state_type yy_next_state;
-
-      (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-      yy_current_state = yy_get_previous_state(  );
-
-      /* Okay, we're now positioned to make the NUL
-       * transition.  We couldn't have
-       * yy_get_previous_state() go ahead and do it
-       * for us because it doesn't know how to deal
-       * with the possibility of jamming (and we don't
-       * want to build jamming into it because then it
-       * will run more slowly).
-       */
-
-      yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-      yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-      if ( yy_next_state )
-        {
-        /* Consume the NUL. */
-        yy_cp = ++(yy_c_buf_p);
-        yy_current_state = yy_next_state;
-        goto yy_match;
-        }
-
-      else
-        {
-        yy_cp = (yy_c_buf_p);
-        goto yy_find_action;
-        }
-      }
-
-    else switch ( yy_get_next_buffer(  ) )
-      {
-      case EOB_ACT_END_OF_FILE:
-        {
-        (yy_did_buffer_switch_on_eof) = 0;
-
-        if ( surf_parse_wrap( ) )
-          {
-          /* Note: because we've taken care in
-           * yy_get_next_buffer() to have set up
-           * surf_parse_text, we can now set up
-           * yy_c_buf_p so that if some total
-           * hoser (like flex itself) wants to
-           * call the scanner after we return the
-           * YY_NULL, it'll still work - another
-           * YY_NULL will get returned.
-           */
-          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-          yy_act = YY_STATE_EOF(YY_START);
-          goto do_action;
-          }
-
-        else
-          {
-          if ( ! (yy_did_buffer_switch_on_eof) )
-            YY_NEW_FILE;
-          }
-        break;
-        }
-
-      case EOB_ACT_CONTINUE_SCAN:
-        (yy_c_buf_p) =
-          (yytext_ptr) + yy_amount_of_matched_text;
-
-        yy_current_state = yy_get_previous_state(  );
-
-        yy_cp = (yy_c_buf_p);
-        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-        goto yy_match;
-
-      case EOB_ACT_LAST_MATCH:
-        (yy_c_buf_p) =
-        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-        yy_current_state = yy_get_previous_state(  );
-
-        yy_cp = (yy_c_buf_p);
-        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-        goto yy_find_action;
-      }
-    break;
-    }
-
-  default:
-    YY_FATAL_ERROR(
-      "fatal flex scanner internal error--no action found" );
-  } /* end of action switch */
-    } /* end of scanning one token */
-  } /* end of user's declarations */
+       yyterminate();
+
+       case YY_END_OF_BUFFER:
+               {
+               /* Amount of text matched not including the EOB char. */
+               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+               /* Undo the effects of YY_DO_BEFORE_ACTION. */
+               *yy_cp = (yy_hold_char);
+               YY_RESTORE_YY_MORE_OFFSET
+
+               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+                       {
+                       /* We're scanning a new file or input source.  It's
+                        * possible that this happened because the user
+                        * just pointed surf_parse_in at a new source and called
+                        * surf_parse_lex().  If so, then we have to assure
+                        * consistency between YY_CURRENT_BUFFER and our
+                        * globals.  Here is the right place to do so, because
+                        * this is the first action (other than possibly a
+                        * back-up) that will match for the new input source.
+                        */
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = surf_parse_in;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+                       }
+
+               /* Note that here we test for yy_c_buf_p "<=" to the position
+                * of the first EOB in the buffer, since yy_c_buf_p will
+                * already have been incremented past the NUL character
+                * (since all states make transitions on EOB to the
+                * end-of-buffer state).  Contrast this with the test
+                * in input().
+                */
+               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       { /* This was really a NUL. */
+                       yy_state_type yy_next_state;
+
+                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+                       yy_current_state = yy_get_previous_state(  );
+
+                       /* Okay, we're now positioned to make the NUL
+                        * transition.  We couldn't have
+                        * yy_get_previous_state() go ahead and do it
+                        * for us because it doesn't know how to deal
+                        * with the possibility of jamming (and we don't
+                        * want to build jamming into it because then it
+                        * will run more slowly).
+                        */
+
+                       yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+                       if ( yy_next_state )
+                               {
+                               /* Consume the NUL. */
+                               yy_cp = ++(yy_c_buf_p);
+                               yy_current_state = yy_next_state;
+                               goto yy_match;
+                               }
+
+                       else
+                               {
+                               yy_cp = (yy_c_buf_p);
+                               goto yy_find_action;
+                               }
+                       }
+
+               else switch ( yy_get_next_buffer(  ) )
+                       {
+                       case EOB_ACT_END_OF_FILE:
+                               {
+                               (yy_did_buffer_switch_on_eof) = 0;
+
+                               if ( surf_parse_wrap( ) )
+                                       {
+                                       /* Note: because we've taken care in
+                                        * yy_get_next_buffer() to have set up
+                                        * surf_parse_text, we can now set up
+                                        * yy_c_buf_p so that if some total
+                                        * hoser (like flex itself) wants to
+                                        * call the scanner after we return the
+                                        * YY_NULL, it'll still work - another
+                                        * YY_NULL will get returned.
+                                        */
+                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+                                       yy_act = YY_STATE_EOF(YY_START);
+                                       goto do_action;
+                                       }
+
+                               else
+                                       {
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
+                                       }
+                               break;
+                               }
+
+                       case EOB_ACT_CONTINUE_SCAN:
+                               (yy_c_buf_p) =
+                                       (yytext_ptr) + yy_amount_of_matched_text;
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_match;
+
+                       case EOB_ACT_LAST_MATCH:
+                               (yy_c_buf_p) =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_find_action;
+                       }
+               break;
+               }
+
+       default:
+               YY_FATAL_ERROR(
+                       "fatal flex scanner internal error--no action found" );
+       } /* end of action switch */
+               } /* end of scanning one token */
+       } /* end of user's declarations */
 } /* end of surf_parse_lex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
  * Returns a code representing an action:
- *  EOB_ACT_LAST_MATCH -
- *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *  EOB_ACT_END_OF_FILE - end of file
+ *     EOB_ACT_LAST_MATCH -
+ *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *     EOB_ACT_END_OF_FILE - end of file
  */
 static int yy_get_next_buffer (void)
 {
-      char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-  char *source = (yytext_ptr);
-  int number_to_move, i;
-  int ret_val;
-
-  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-    YY_FATAL_ERROR(
-    "fatal flex scanner internal error--end of buffer missed" );
-
-  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-    { /* Don't try to fill the buffer, so this is an EOF. */
-    if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-      {
-      /* We matched a single character, the EOB, so
-       * treat this as a final EOF.
-       */
-      return EOB_ACT_END_OF_FILE;
-      }
-
-    else
-      {
-      /* We matched some text prior to the EOB, first
-       * process it.
-       */
-      return EOB_ACT_LAST_MATCH;
-      }
-    }
-
-  /* Try to read more data. */
-
-  /* First move last chars to start of buffer. */
-  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
-
-  for ( i = 0; i < number_to_move; ++i )
-    *(dest++) = *(source++);
-
-  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-    /* don't do the read, it's not guaranteed to return an EOF,
-     * just force an EOF
-     */
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-  else
-    {
-      int num_to_read =
-      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-    while ( num_to_read <= 0 )
-      { /* Not enough room in the buffer - grow it. */
-
-      /* just a shorter name for the current buffer */
-      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
-
-      int yy_c_buf_p_offset =
-        (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-      if ( b->yy_is_our_buffer )
-        {
-        int new_size = b->yy_buf_size * 2;
-
-        if ( new_size <= 0 )
-          b->yy_buf_size += b->yy_buf_size / 8;
-        else
-          b->yy_buf_size *= 2;
-
-        b->yy_ch_buf = (char *)
-          /* Include room in for 2 EOB chars. */
-          surf_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-        }
-      else
-        /* Can't grow it, we don't own it. */
-        b->yy_ch_buf = NULL;
-
-      if ( ! b->yy_ch_buf )
-        YY_FATAL_ERROR(
-        "fatal error - scanner input buffer overflow" );
-
-      (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-            number_to_move - 1;
-
-      }
-
-    if ( num_to_read > YY_READ_BUF_SIZE )
-      num_to_read = YY_READ_BUF_SIZE;
-
-    /* Read in more data. */
-    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-      (yy_n_chars), num_to_read );
-
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-    }
-
-  if ( (yy_n_chars) == 0 )
-    {
-    if ( number_to_move == YY_MORE_ADJ )
-      {
-      ret_val = EOB_ACT_END_OF_FILE;
-      surf_parse_restart(surf_parse_in  );
-      }
-
-    else
-      {
-      ret_val = EOB_ACT_LAST_MATCH;
-      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-        YY_BUFFER_EOF_PENDING;
-      }
-    }
-
-  else
-    ret_val = EOB_ACT_CONTINUE_SCAN;
-
-  if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-    /* Extend the array by 50%, plus the number we really need. */
-    int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) surf_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-  }
-
-  (yy_n_chars) += number_to_move;
-  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+       char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       char *source = (yytext_ptr);
+       int number_to_move, i;
+       int ret_val;
+
+       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+               YY_FATAL_ERROR(
+               "fatal flex scanner internal error--end of buffer missed" );
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+               { /* Don't try to fill the buffer, so this is an EOF. */
+               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+                       {
+                       /* We matched a single character, the EOB, so
+                        * treat this as a final EOF.
+                        */
+                       return EOB_ACT_END_OF_FILE;
+                       }
+
+               else
+                       {
+                       /* We matched some text prior to the EOB, first
+                        * process it.
+                        */
+                       return EOB_ACT_LAST_MATCH;
+                       }
+               }
+
+       /* Try to read more data. */
+
+       /* First move last chars to start of buffer. */
+       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
+
+       for ( i = 0; i < number_to_move; ++i )
+               *(dest++) = *(source++);
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+               /* don't do the read, it's not guaranteed to return an EOF,
+                * just force an EOF
+                */
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+       else
+               {
+                       int num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+               while ( num_to_read <= 0 )
+                       { /* Not enough room in the buffer - grow it. */
+
+                       /* just a shorter name for the current buffer */
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
+
+                       int yy_c_buf_p_offset =
+                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+                       if ( b->yy_is_our_buffer )
+                               {
+                               int new_size = b->yy_buf_size * 2;
+
+                               if ( new_size <= 0 )
+                                       b->yy_buf_size += b->yy_buf_size / 8;
+                               else
+                                       b->yy_buf_size *= 2;
+
+                               b->yy_ch_buf = (char *)
+                                       /* Include room in for 2 EOB chars. */
+                                       surf_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+                               }
+                       else
+                               /* Can't grow it, we don't own it. */
+                               b->yy_ch_buf = NULL;
+
+                       if ( ! b->yy_ch_buf )
+                               YY_FATAL_ERROR(
+                               "fatal error - scanner input buffer overflow" );
+
+                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+                                               number_to_move - 1;
+
+                       }
+
+               if ( num_to_read > YY_READ_BUF_SIZE )
+                       num_to_read = YY_READ_BUF_SIZE;
+
+               /* Read in more data. */
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), num_to_read );
+
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       if ( (yy_n_chars) == 0 )
+               {
+               if ( number_to_move == YY_MORE_ADJ )
+                       {
+                       ret_val = EOB_ACT_END_OF_FILE;
+                       surf_parse_restart(surf_parse_in  );
+                       }
+
+               else
+                       {
+                       ret_val = EOB_ACT_LAST_MATCH;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+                               YY_BUFFER_EOF_PENDING;
+                       }
+               }
+
+       else
+               ret_val = EOB_ACT_CONTINUE_SCAN;
+
+       if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+               /* Extend the array by 50%, plus the number we really need. */
+               int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) surf_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+       }
+
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
-  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-  return ret_val;
+       return ret_val;
 }
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
     static yy_state_type yy_get_previous_state (void)
 {
-  yy_state_type yy_current_state;
-  char *yy_cp;
-
-  yy_current_state = (yy_start);
-
-  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-    {
-    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-    if ( yy_accept[yy_current_state] )
-      {
-      (yy_last_accepting_state) = yy_current_state;
-      (yy_last_accepting_cpos) = yy_cp;
-      }
-    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-      {
-      yy_current_state = (int) yy_def[yy_current_state];
-      if ( yy_current_state >= 3886 )
-        yy_c = yy_meta[(unsigned int) yy_c];
-      }
-    yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
-    }
-
-  return yy_current_state;
+       yy_state_type yy_current_state;
+       char *yy_cp;
+    
+       yy_current_state = (yy_start);
+
+       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+               {
+               YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+               if ( yy_accept[yy_current_state] )
+                       {
+                       (yy_last_accepting_state) = yy_current_state;
+                       (yy_last_accepting_cpos) = yy_cp;
+                       }
+               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                       {
+                       yy_current_state = (int) yy_def[yy_current_state];
+                       if ( yy_current_state >= 3886 )
+                               yy_c = yy_meta[(unsigned int) yy_c];
+                       }
+               yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+               }
+
+       return yy_current_state;
 }
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
- *  next_state = yy_try_NUL_trans( current_state );
+ *     next_state = yy_try_NUL_trans( current_state );
  */
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
 {
-  int yy_is_jam;
-      char *yy_cp = (yy_c_buf_p);
-
-  YY_CHAR yy_c = 1;
-  if ( yy_accept[yy_current_state] )
-    {
-    (yy_last_accepting_state) = yy_current_state;
-    (yy_last_accepting_cpos) = yy_cp;
-    }
-  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-    {
-    yy_current_state = (int) yy_def[yy_current_state];
-    if ( yy_current_state >= 3886 )
-      yy_c = yy_meta[(unsigned int) yy_c];
-    }
-  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
-  yy_is_jam = (yy_current_state == 3885);
-
-    return yy_is_jam ? 0 : yy_current_state;
+       int yy_is_jam;
+       char *yy_cp = (yy_c_buf_p);
+
+       YY_CHAR yy_c = 1;
+       if ( yy_accept[yy_current_state] )
+               {
+               (yy_last_accepting_state) = yy_current_state;
+               (yy_last_accepting_cpos) = yy_cp;
+               }
+       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+               {
+               yy_current_state = (int) yy_def[yy_current_state];
+               if ( yy_current_state >= 3886 )
+                       yy_c = yy_meta[(unsigned int) yy_c];
+               }
+       yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+       yy_is_jam = (yy_current_state == 3885);
+
+               return yy_is_jam ? 0 : yy_current_state;
 }
 
 #ifndef YY_NO_UNPUT
@@ -10918,185 +10918,185 @@ static int yy_get_next_buffer (void)
 #endif
 
 {
-  int c;
-
-  *(yy_c_buf_p) = (yy_hold_char);
-
-  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-    {
-    /* yy_c_buf_p now points to the character we want to return.
-     * If this occurs *before* the EOB characters, then it's a
-     * valid NUL; if not, then we've hit the end of the buffer.
-     */
-    if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-      /* This was really a NUL. */
-      *(yy_c_buf_p) = '\0';
-
-    else
-      { /* need more input */
-      int offset = (yy_c_buf_p) - (yytext_ptr);
-      ++(yy_c_buf_p);
-
-      switch ( yy_get_next_buffer(  ) )
-        {
-        case EOB_ACT_LAST_MATCH:
-          /* This happens because yy_g_n_b()
-           * sees that we've accumulated a
-           * token and flags that we need to
-           * try matching the token before
-           * proceeding.  But for input(),
-           * there's no matching to consider.
-           * So convert the EOB_ACT_LAST_MATCH
-           * to EOB_ACT_END_OF_FILE.
-           */
-
-          /* Reset buffer status. */
-          surf_parse_restart(surf_parse_in );
-
-          /*FALLTHROUGH*/
-
-        case EOB_ACT_END_OF_FILE:
-          {
-          if ( surf_parse_wrap( ) )
-            return 0;
-
-          if ( ! (yy_did_buffer_switch_on_eof) )
-            YY_NEW_FILE;
+       int c;
+    
+       *(yy_c_buf_p) = (yy_hold_char);
+
+       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+               {
+               /* yy_c_buf_p now points to the character we want to return.
+                * If this occurs *before* the EOB characters, then it's a
+                * valid NUL; if not, then we've hit the end of the buffer.
+                */
+               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       /* This was really a NUL. */
+                       *(yy_c_buf_p) = '\0';
+
+               else
+                       { /* need more input */
+                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       ++(yy_c_buf_p);
+
+                       switch ( yy_get_next_buffer(  ) )
+                               {
+                               case EOB_ACT_LAST_MATCH:
+                                       /* This happens because yy_g_n_b()
+                                        * sees that we've accumulated a
+                                        * token and flags that we need to
+                                        * try matching the token before
+                                        * proceeding.  But for input(),
+                                        * there's no matching to consider.
+                                        * So convert the EOB_ACT_LAST_MATCH
+                                        * to EOB_ACT_END_OF_FILE.
+                                        */
+
+                                       /* Reset buffer status. */
+                                       surf_parse_restart(surf_parse_in );
+
+                                       /*FALLTHROUGH*/
+
+                               case EOB_ACT_END_OF_FILE:
+                                       {
+                                       if ( surf_parse_wrap( ) )
+                                               return 0;
+
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
 #ifdef __cplusplus
-          return yyinput();
+                                       return yyinput();
 #else
-          return input();
+                                       return input();
 #endif
-          }
+                                       }
 
-        case EOB_ACT_CONTINUE_SCAN:
-          (yy_c_buf_p) = (yytext_ptr) + offset;
-          break;
-        }
-      }
-    }
+                               case EOB_ACT_CONTINUE_SCAN:
+                                       (yy_c_buf_p) = (yytext_ptr) + offset;
+                                       break;
+                               }
+                       }
+               }
 
-  c = *(unsigned char *) (yy_c_buf_p);  /* cast for 8-bit char's */
-  *(yy_c_buf_p) = '\0';  /* preserve surf_parse_text */
-  (yy_hold_char) = *++(yy_c_buf_p);
-
-  if ( c == '\n' )
+       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
+       *(yy_c_buf_p) = '\0';   /* preserve surf_parse_text */
+       (yy_hold_char) = *++(yy_c_buf_p);
 
+       if ( c == '\n' )
+               
     surf_parse_lineno++;
 ;
 
-  return c;
+       return c;
 }
-#endif  /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
- *
+ * 
  * @note This function does not reset the start condition to @c INITIAL .
  */
     void surf_parse_restart  (FILE * input_file )
 {
-
-  if ( ! YY_CURRENT_BUFFER ){
+    
+       if ( ! YY_CURRENT_BUFFER ){
         surf_parse_ensure_buffer_stack ();
-    YY_CURRENT_BUFFER_LVALUE =
+               YY_CURRENT_BUFFER_LVALUE =
             surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE );
-  }
+       }
 
-  surf_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
-  surf_parse__load_buffer_state( );
+       surf_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
+       surf_parse__load_buffer_state( );
 }
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
- *
+ * 
  */
     void surf_parse__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
-
-  /* TODO. We should be able to replace this entire function body
-   * with
-   *    surf_parse_pop_buffer_state();
-   *    surf_parse_push_buffer_state(new_buffer);
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              surf_parse_pop_buffer_state();
+        *              surf_parse_push_buffer_state(new_buffer);
      */
-  surf_parse_ensure_buffer_stack ();
-  if ( YY_CURRENT_BUFFER == new_buffer )
-    return;
-
-  if ( YY_CURRENT_BUFFER )
-    {
-    /* Flush out information for old buffer. */
-    *(yy_c_buf_p) = (yy_hold_char);
-    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-    }
-
-  YY_CURRENT_BUFFER_LVALUE = new_buffer;
-  surf_parse__load_buffer_state( );
-
-  /* We don't actually know whether we did this switch during
-   * EOF (surf_parse_wrap()) processing, but the only time this flag
-   * is looked at is after surf_parse_wrap() is called, so it's safe
-   * to go ahead and always set it.
-   */
-  (yy_did_buffer_switch_on_eof) = 1;
+       surf_parse_ensure_buffer_stack ();
+       if ( YY_CURRENT_BUFFER == new_buffer )
+               return;
+
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       surf_parse__load_buffer_state( );
+
+       /* We don't actually know whether we did this switch during
+        * EOF (surf_parse_wrap()) processing, but the only time this flag
+        * is looked at is after surf_parse_wrap() is called, so it's safe
+        * to go ahead and always set it.
+        */
+       (yy_did_buffer_switch_on_eof) = 1;
 }
 
 static void surf_parse__load_buffer_state  (void)
 {
-      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-  surf_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-  (yy_hold_char) = *(yy_c_buf_p);
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       surf_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
 }
 
 /** Allocate and initialize an input buffer state.
  * @param file A readable stream.
  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ * 
  * @return the allocated buffer state.
  */
     YY_BUFFER_STATE surf_parse__create_buffer  (FILE * file, int  size )
 {
-  YY_BUFFER_STATE b;
-
-  b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state )  );
-  if ( ! b )
-    YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
+       YY_BUFFER_STATE b;
+    
+       b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
 
-  b->yy_buf_size = (yy_size_t)size;
+       b->yy_buf_size = (yy_size_t)size;
 
-  /* yy_ch_buf has to be 2 characters longer than the size given because
-   * we need to put in 2 end-of-buffer characters.
-   */
-  b->yy_ch_buf = (char *) surf_parse_alloc(b->yy_buf_size + 2  );
-  if ( ! b->yy_ch_buf )
-    YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
+       /* yy_ch_buf has to be 2 characters longer than the size given because
+        * we need to put in 2 end-of-buffer characters.
+        */
+       b->yy_ch_buf = (char *) surf_parse_alloc(b->yy_buf_size + 2  );
+       if ( ! b->yy_ch_buf )
+               YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
 
-  b->yy_is_our_buffer = 1;
+       b->yy_is_our_buffer = 1;
 
-  surf_parse__init_buffer(b,file );
+       surf_parse__init_buffer(b,file );
 
-  return b;
+       return b;
 }
 
 /** Destroy the buffer.
  * @param b a buffer created with surf_parse__create_buffer()
- *
+ * 
  */
     void surf_parse__delete_buffer (YY_BUFFER_STATE  b )
 {
+    
+       if ( ! b )
+               return;
 
-  if ( ! b )
-    return;
-
-  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
-  if ( b->yy_is_our_buffer )
-    surf_parse_free((void *) b->yy_ch_buf  );
+       if ( b->yy_is_our_buffer )
+               surf_parse_free((void *) b->yy_ch_buf  );
 
-  surf_parse_free((void *) b  );
+       surf_parse_free((void *) b  );
 }
 
 /* Initializes or reinitializes a buffer.
@@ -11106,12 +11106,12 @@ static void surf_parse__load_buffer_state  (void)
     static void surf_parse__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
 {
-  int oerrno = errno;
-
-  surf_parse__flush_buffer(b );
+       int oerrno = errno;
+    
+       surf_parse__flush_buffer(b );
 
-  b->yy_input_file = file;
-  b->yy_fill_buffer = 1;
+       b->yy_input_file = file;
+       b->yy_fill_buffer = 1;
 
     /* If b is the current buffer, then surf_parse__init_buffer was _probably_
      * called from surf_parse_restart() or through yy_get_next_buffer.
@@ -11123,87 +11123,87 @@ static void surf_parse__load_buffer_state  (void)
     }
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
-  errno = oerrno;
+    
+       errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ * 
  */
     void surf_parse__flush_buffer (YY_BUFFER_STATE  b )
 {
-      if ( ! b )
-    return;
+       if ( ! b )
+               return;
 
-  b->yy_n_chars = 0;
+       b->yy_n_chars = 0;
 
-  /* We always need two end-of-buffer characters.  The first causes
-   * a transition to the end-of-buffer state.  The second causes
-   * a jam in that state.
-   */
-  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+       /* We always need two end-of-buffer characters.  The first causes
+        * a transition to the end-of-buffer state.  The second causes
+        * a jam in that state.
+        */
+       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
-  b->yy_buf_pos = &b->yy_ch_buf[0];
+       b->yy_buf_pos = &b->yy_ch_buf[0];
 
-  b->yy_at_bol = 1;
-  b->yy_buffer_status = YY_BUFFER_NEW;
+       b->yy_at_bol = 1;
+       b->yy_buffer_status = YY_BUFFER_NEW;
 
-  if ( b == YY_CURRENT_BUFFER )
-    surf_parse__load_buffer_state( );
+       if ( b == YY_CURRENT_BUFFER )
+               surf_parse__load_buffer_state( );
 }
 
 /** Pushes the new state onto the stack. The new state becomes
  *  the current state. This function will allocate the stack
  *  if necessary.
  *  @param new_buffer The new state.
- *
+ *  
  */
 void surf_parse_push_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-      if (new_buffer == NULL)
-    return;
+       if (new_buffer == NULL)
+               return;
 
-  surf_parse_ensure_buffer_stack();
+       surf_parse_ensure_buffer_stack();
 
-  /* This block is copied from surf_parse__switch_to_buffer. */
-  if ( YY_CURRENT_BUFFER )
-    {
-    /* Flush out information for old buffer. */
-    *(yy_c_buf_p) = (yy_hold_char);
-    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-    }
+       /* This block is copied from surf_parse__switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
 
-  /* Only push if top exists. Otherwise, replace top. */
-  if (YY_CURRENT_BUFFER)
-    (yy_buffer_stack_top)++;
-  YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
-  /* copied from surf_parse__switch_to_buffer. */
-  surf_parse__load_buffer_state( );
-  (yy_did_buffer_switch_on_eof) = 1;
+       /* copied from surf_parse__switch_to_buffer. */
+       surf_parse__load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
 }
 
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
- *
+ *  
  */
 void surf_parse_pop_buffer_state (void)
 {
-      if (!YY_CURRENT_BUFFER)
-    return;
+       if (!YY_CURRENT_BUFFER)
+               return;
 
-  surf_parse__delete_buffer(YY_CURRENT_BUFFER );
-  YY_CURRENT_BUFFER_LVALUE = NULL;
-  if ((yy_buffer_stack_top) > 0)
-    --(yy_buffer_stack_top);
+       surf_parse__delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
 
-  if (YY_CURRENT_BUFFER) {
-    surf_parse__load_buffer_state( );
-    (yy_did_buffer_switch_on_eof) = 1;
-  }
+       if (YY_CURRENT_BUFFER) {
+               surf_parse__load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
+       }
 }
 
 /* Allocates the stack if it does not exist.
@@ -11211,163 +11211,163 @@ void surf_parse_pop_buffer_state (void)
  */
 static void surf_parse_ensure_buffer_stack (void)
 {
-  int num_to_alloc;
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
 
-  if (!(yy_buffer_stack)) {
-
-    /* First allocation is just for 2 elements, since we don't know if this
-     * scanner will even need a stack. We use 2 instead of 1 to avoid an
-     * immediate realloc on the next call.
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
          */
       num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
-    (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_alloc
-                (num_to_alloc * sizeof(struct yy_buffer_state*)
-                );
-    if ( ! (yy_buffer_stack) )
-      YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
-
-    memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
-    (yy_buffer_stack_max) = num_to_alloc;
-    (yy_buffer_stack_top) = 0;
-    return;
-  }
-
-  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-    /* Increase the buffer to prepare for a possible push. */
-    yy_size_t grow_size = 8 /* arbitrary grow size */;
-
-    num_to_alloc = (yy_buffer_stack_max) + grow_size;
-    (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_realloc
-                ((yy_buffer_stack),
-                num_to_alloc * sizeof(struct yy_buffer_state*)
-                );
-    if ( ! (yy_buffer_stack) )
-      YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
-
-    /* zero only the new slots.*/
-    memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-    (yy_buffer_stack_max) = num_to_alloc;
-  }
+               (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_alloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
+
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
+       }
+
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+               /* Increase the buffer to prepare for a possible push. */
+               yy_size_t grow_size = 8 /* arbitrary grow size */;
+
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_realloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
+
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
 }
 
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
- *
+ * 
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE surf_parse__scan_buffer  (char * base, yy_size_t  size )
 {
-  YY_BUFFER_STATE b;
-
-  if ( size < 2 ||
-       base[size-2] != YY_END_OF_BUFFER_CHAR ||
-       base[size-1] != YY_END_OF_BUFFER_CHAR )
-    /* They forgot to leave room for the EOB's. */
-    return NULL;
-
-  b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state )  );
-  if ( ! b )
-    YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_buffer()" );
-
-  b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
-  b->yy_buf_pos = b->yy_ch_buf = base;
-  b->yy_is_our_buffer = 0;
-  b->yy_input_file = NULL;
-  b->yy_n_chars = b->yy_buf_size;
-  b->yy_is_interactive = 0;
-  b->yy_at_bol = 1;
-  b->yy_fill_buffer = 0;
-  b->yy_buffer_status = YY_BUFFER_NEW;
-
-  surf_parse__switch_to_buffer(b  );
-
-  return b;
+       YY_BUFFER_STATE b;
+    
+       if ( size < 2 ||
+            base[size-2] != YY_END_OF_BUFFER_CHAR ||
+            base[size-1] != YY_END_OF_BUFFER_CHAR )
+               /* They forgot to leave room for the EOB's. */
+               return NULL;
+
+       b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_buffer()" );
+
+       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
+       b->yy_buf_pos = b->yy_ch_buf = base;
+       b->yy_is_our_buffer = 0;
+       b->yy_input_file = NULL;
+       b->yy_n_chars = b->yy_buf_size;
+       b->yy_is_interactive = 0;
+       b->yy_at_bol = 1;
+       b->yy_fill_buffer = 0;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       surf_parse__switch_to_buffer(b  );
+
+       return b;
 }
 
 /** Setup the input buffer state to scan a string. The next call to surf_parse_lex() will
  * scan from a @e copy of @a str.
  * @param yystr a NUL-terminated string to scan
- *
+ * 
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
  *       surf_parse__scan_bytes() instead.
  */
 YY_BUFFER_STATE surf_parse__scan_string (yyconst char * yystr )
 {
-
-  return surf_parse__scan_bytes(yystr,(int) strlen(yystr) );
+    
+       return surf_parse__scan_bytes(yystr,(int) strlen(yystr) );
 }
 
 /** Setup the input buffer state to scan the given bytes. The next call to surf_parse_lex() will
  * scan from a @e copy of @a bytes.
  * @param yybytes the byte buffer to scan
  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- *
+ * 
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE surf_parse__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 {
-  YY_BUFFER_STATE b;
-  char *buf;
-  yy_size_t n;
-  int i;
-
-  /* Get memory for full buffer, including space for trailing EOB's. */
-  n = (yy_size_t) (_yybytes_len + 2);
-  buf = (char *) surf_parse_alloc(n  );
-  if ( ! buf )
-    YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_bytes()" );
+       YY_BUFFER_STATE b;
+       char *buf;
+       yy_size_t n;
+       int i;
+    
+       /* Get memory for full buffer, including space for trailing EOB's. */
+       n = (yy_size_t) (_yybytes_len + 2);
+       buf = (char *) surf_parse_alloc(n  );
+       if ( ! buf )
+               YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_bytes()" );
 
-  for ( i = 0; i < _yybytes_len; ++i )
-    buf[i] = yybytes[i];
+       for ( i = 0; i < _yybytes_len; ++i )
+               buf[i] = yybytes[i];
 
-  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-  b = surf_parse__scan_buffer(buf,n );
-  if ( ! b )
-    YY_FATAL_ERROR( "bad buffer in surf_parse__scan_bytes()" );
+       b = surf_parse__scan_buffer(buf,n );
+       if ( ! b )
+               YY_FATAL_ERROR( "bad buffer in surf_parse__scan_bytes()" );
 
-  /* It's okay to grow etc. this buffer, and we should throw it
-   * away when we're done.
-   */
-  b->yy_is_our_buffer = 1;
+       /* It's okay to grow etc. this buffer, and we should throw it
+        * away when we're done.
+        */
+       b->yy_is_our_buffer = 1;
 
-  return b;
+       return b;
 }
 
     static void yy_push_state (int  _new_state )
 {
-      if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
-    {
-    yy_size_t new_size;
+       if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
+               {
+               yy_size_t new_size;
 
-    (yy_start_stack_depth) += YY_START_STACK_INCR;
-    new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int );
+               (yy_start_stack_depth) += YY_START_STACK_INCR;
+               new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int );
 
-    if ( ! (yy_start_stack) )
-      (yy_start_stack) = (int *) surf_parse_alloc(new_size  );
+               if ( ! (yy_start_stack) )
+                       (yy_start_stack) = (int *) surf_parse_alloc(new_size  );
 
-    else
-      (yy_start_stack) = (int *) surf_parse_realloc((void *) (yy_start_stack),new_size  );
+               else
+                       (yy_start_stack) = (int *) surf_parse_realloc((void *) (yy_start_stack),new_size  );
 
-    if ( ! (yy_start_stack) )
-      YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
-    }
+               if ( ! (yy_start_stack) )
+                       YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
+               }
 
-  (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
+       (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
 
-  BEGIN(_new_state);
+       BEGIN(_new_state);
 }
 
     static void yy_pop_state  (void)
 {
-      if ( --(yy_start_stack_ptr) < 0 )
-    YY_FATAL_ERROR( "start-condition stack underflow" );
+       if ( --(yy_start_stack_ptr) < 0 )
+               YY_FATAL_ERROR( "start-condition stack underflow" );
 
-  BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
+       BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
 }
 
 #ifndef YY_EXIT_FAILURE
@@ -11376,40 +11376,40 @@ YY_BUFFER_STATE surf_parse__scan_bytes  (yyconst char * yybytes, int  _yybytes_l
 
 static void yynoreturn yy_fatal_error (yyconst char* msg )
 {
-      (void) fprintf( stderr, "%s\n", msg );
-  exit( YY_EXIT_FAILURE );
+                       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
 }
 
 /* Redefine yyless() so it works in section 3 code. */
 
 #undef yyless
 #define yyless(n) \
-  do \
-    { \
-    /* Undo effects of setting up surf_parse_text. */ \
+       do \
+               { \
+               /* Undo effects of setting up surf_parse_text. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-    surf_parse_text[surf_parse_leng] = (yy_hold_char); \
-    (yy_c_buf_p) = surf_parse_text + yyless_macro_arg; \
-    (yy_hold_char) = *(yy_c_buf_p); \
-    *(yy_c_buf_p) = '\0'; \
-    surf_parse_leng = yyless_macro_arg; \
-    } \
-  while ( 0 )
+               surf_parse_text[surf_parse_leng] = (yy_hold_char); \
+               (yy_c_buf_p) = surf_parse_text + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               surf_parse_leng = yyless_macro_arg; \
+               } \
+       while ( 0 )
 
 /* Accessor  methods (get/set functions) to struct members. */
 
 /** Get the current line number.
- *
+ * 
  */
 int surf_parse_get_lineno  (void)
 {
-
+    
     return surf_parse_lineno;
 }
 
 /** Get the input stream.
- *
+ * 
  */
 FILE *surf_parse_get_in  (void)
 {
@@ -11417,7 +11417,7 @@ FILE *surf_parse_get_in  (void)
 }
 
 /** Get the output stream.
- *
+ * 
  */
 FILE *surf_parse_get_out  (void)
 {
@@ -11425,7 +11425,7 @@ FILE *surf_parse_get_out  (void)
 }
 
 /** Get the length of the current token.
- *
+ * 
  */
 int surf_parse_get_leng  (void)
 {
@@ -11433,7 +11433,7 @@ int surf_parse_get_leng  (void)
 }
 
 /** Get the current token.
- *
+ * 
  */
 
 char *surf_parse_get_text  (void)
@@ -11443,18 +11443,18 @@ char *surf_parse_get_text  (void)
 
 /** Set the current line number.
  * @param _line_number line number
- *
+ * 
  */
 void surf_parse_set_lineno (int  _line_number )
 {
-
+    
     surf_parse_lineno = _line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param _in_str A readable stream.
- *
+ * 
  * @see surf_parse__switch_to_buffer
  */
 void surf_parse_set_in (FILE *  _in_str )
@@ -11485,7 +11485,7 @@ static int yy_init_globals (void)
 
     /* We do not touch surf_parse_lineno unless the option is enabled. */
     surf_parse_lineno =  1;
-
+    
     (yy_buffer_stack) = NULL;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
@@ -11515,17 +11515,17 @@ static int yy_init_globals (void)
 /* surf_parse_lex_destroy is for both reentrant and non-reentrant scanners. */
 int surf_parse_lex_destroy  (void)
 {
-
+    
     /* Pop the buffer stack, destroying each element. */
-  while(YY_CURRENT_BUFFER){
-    surf_parse__delete_buffer(YY_CURRENT_BUFFER  );
-    YY_CURRENT_BUFFER_LVALUE = NULL;
-    surf_parse_pop_buffer_state();
-  }
+       while(YY_CURRENT_BUFFER){
+               surf_parse__delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               surf_parse_pop_buffer_state();
+       }
 
-  /* Destroy the stack itself. */
-  surf_parse_free((yy_buffer_stack) );
-  (yy_buffer_stack) = NULL;
+       /* Destroy the stack itself. */
+       surf_parse_free((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
 
     /* Destroy the start condition stack. */
         surf_parse_free((yy_start_stack)  );
@@ -11545,45 +11545,45 @@ int surf_parse_lex_destroy  (void)
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
 {
-
-  int i;
-  for ( i = 0; i < n; ++i )
-    s1[i] = s2[i];
+               
+       int i;
+       for ( i = 0; i < n; ++i )
+               s1[i] = s2[i];
 }
 #endif
 
 #ifdef YY_NEED_STRLEN
 static int yy_flex_strlen (yyconst char * s )
 {
-  int n;
-  for ( n = 0; s[n]; ++n )
-    ;
+       int n;
+       for ( n = 0; s[n]; ++n )
+               ;
 
-  return n;
+       return n;
 }
 #endif
 
 void *surf_parse_alloc (yy_size_t  size )
 {
-      return malloc(size);
+                       return malloc(size);
 }
 
 void *surf_parse_realloc  (void * ptr, yy_size_t  size )
 {
-
-  /* The cast to (char *) in the following accommodates both
-   * implementations that use char* generic pointers, and those
-   * that use void* generic pointers.  It works with the latter
-   * because both ANSI C and C++ allow castless assignment from
-   * any pointer type to void*, and deal with argument conversions
-   * as though doing an assignment.
-   */
-  return realloc(ptr, size);
+               
+       /* The cast to (char *) in the following accommodates both
+        * implementations that use char* generic pointers, and those
+        * that use void* generic pointers.  It works with the latter
+        * because both ANSI C and C++ allow castless assignment from
+        * any pointer type to void*, and deal with argument conversions
+        * as though doing an assignment.
+        */
+       return realloc(ptr, size);
 }
 
 void surf_parse_free (void * ptr )
 {
-      free( (char *) ptr );  /* see surf_parse_realloc() for (char *) cast */
+                       free( (char *) ptr );   /* see surf_parse_realloc() for (char *) cast */
 }
 
 #define YYTABLES_NAME "yytables"
@@ -11592,8 +11592,8 @@ void surf_parse_free (void * ptr )
 int surfxml_element_context(int i)
 {
   return (0<i && i<yy_start_stack_depth
-    ? yy_start_stack[yy_start_stack_ptr - i]
-    : 0);
+         ? yy_start_stack[yy_start_stack_ptr - i]
+         : 0);
 }
 
 #ifdef FLEX_DEBUG
@@ -11632,7 +11632,7 @@ static void debug_enter(int state, const char* statename) {
 static void debug_leave(void) {
     if (surf_parse__flex_debug) {
         print_yy_stack("--LEAVE : ");
-  print_surfxml_bufferstack();
+       print_surfxml_bufferstack();
     }
   yy_pop_state();
 }
@@ -11647,7 +11647,7 @@ static void cleanup(void)
 {
     if (surfxml_statenames) {
         free(surfxml_statenames);
-  surfxml_statenames = NULL;
+       surfxml_statenames = NULL;
     }
     free(surfxml_bufferstack);
     surfxml_bufferstack = NULL;
@@ -11662,12 +11662,12 @@ static int fail(const char* fmt, ...)
     va_list ap; va_start(ap, fmt);
 #ifdef FLEXML_yylineno
     used = snprintf(flexml_err_msg,flexml_max_err_msg_size,
-       "Invalid XML (XML input line %d, state %d): ",
-       surf_parse_lineno, YY_START);
+                  "Invalid XML (XML input line %d, state %d): ",
+                  surf_parse_lineno, YY_START);
 #else
     used = snprintf(flexml_err_msg,flexml_max_err_msg_size,
-       "Invalid XML (state %d): ",
-       YY_START);
+                  "Invalid XML (state %d): ",
+                  YY_START);
 #endif
     chars_left = flexml_max_err_msg_size - used - 1;
     vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
index 60cd6ff..fe1abe2 100644 (file)
@@ -4,13 +4,13 @@
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  * FleXML is Copyright (C) 2003-2013 Martin Quinson.  All rights reserved.
  * (1.9.6).
- *
+ * 
  * There are two, intertwined parts to this program, part A and part B.
  *
  * Part A
  * ------
- *
- * Some parts, here collectively called "Part A", are found in the
+ * 
+ * Some parts, here collectively called "Part A", are found in the 
  * FleXML package.  They are Copyright (C) 1999-2005 Kristoffer Rose
  * and Copyright (C) 2003-2013 Martin Quinson. All rights reserved.
  *
  * Notice that these are explicit rights granted to you for files
  * generated by the FleXML system.  For your rights in connection with
  * the FleXML system itself please consult the GNU General Public License.
- *
+ * 
  * Part B
  * ------
- *
- * The other parts, here collectively called "Part B", and which came
- * from the DTD used by FleXML to generate this program, can be
+ * 
+ * The other parts, here collectively called "Part B", and which came 
+ * from the DTD used by FleXML to generate this program, can be 
  * distributed (or not, as the case may be) under the terms of whoever
- * wrote them, provided these terms respect and obey the two conditions
+ * wrote them, provided these terms respect and obey the two conditions 
  * above under the heading "Part A".
  *
  * The author of and contributors to FleXML specifically disclaim
- * any copyright interest in "Part B", unless "Part B" was written
+ * any copyright interest in "Part B", unless "Part B" was written 
  * by the author of or contributors to FleXML.
- *
+ * 
  */
 
 #ifndef _FLEXML_simgrid_H
index 5f02c52..d534780 100644 (file)
@@ -1,23 +1,21 @@
-/* Copyright (c) 2006-2015. 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
  * 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/dict.h"
 #include "xbt/log.h"
 #include "xbt/misc.h"
-#include "xbt/str.h"
 #include <vector>
 
 #include "src/surf/xml/platf_private.hpp"
 
 #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 */
@@ -27,21 +25,20 @@ extern "C" {
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
 
-SG_BEGIN_DECL()
-
 /* Trace related stuff */
-
-xbt_dict_t traces_set_list = nullptr;
+XBT_PRIVATE std::unordered_map<std::string, tmgr_trace_t> traces_set_list;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_avail;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_speed;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_avail;
 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;
 
-void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
+extern "C" {
+void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect)
 {
-  xbt_assert(xbt_dict_get_or_null(traces_set_list, trace_connect->trace),
-             "Cannot connect trace %s to %s: trace unknown", trace_connect->trace, trace_connect->element);
+  xbt_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(),
+             "Cannot connect trace %s to %s: trace unknown", trace_connect->trace.c_str(),
+             trace_connect->element.c_str());
 
   switch (trace_connect->kind) {
   case SURF_TRACE_CONNECT_KIND_HOST_AVAIL:
@@ -60,8 +57,8 @@ void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
     trace_connect_list_link_lat.insert({trace_connect->trace, trace_connect->element});
     break;
   default:
-    surf_parse_error("Cannot connect trace %s to %s: kind of trace unknown", trace_connect->trace,
-                     trace_connect->element);
+    surf_parse_error(std::string("Cannot connect trace ") + trace_connect->trace + " to " + trace_connect->element +
+                     ": unknown kind of trace");
     break;
   }
 }
@@ -105,78 +102,72 @@ void parse_platform_file(const char *file)
       xbt_die("Lua call failed. See Log");
     }
     lua_close(L);
+    return;
   }
-  else
 #endif
-  { // Use XML parser
 
-    int parse_status;
+  // Use XML parser
 
-    /* init the flex parser */
-    after_config_done = 0;
-    surf_parse_open(file);
+  int parse_status;
 
-    traces_set_list = xbt_dict_new_homogeneous(nullptr);
+  /* init the flex parser */
+  after_config_done = 0;
+  surf_parse_open(file);
 
-    /* Do the actual parsing */
-    parse_status = surf_parse();
+  /* Do the actual parsing */
+  parse_status = surf_parse();
 
-    /* connect all traces relative to hosts */
-    for (auto elm : trace_connect_list_host_avail) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+  /* connect all traces relative to hosts */
+  for (auto const& elm : trace_connect_list_host_avail) {
+    xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+    tmgr_trace_t trace = traces_set_list.at(elm.first);
 
-      simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
-      xbt_assert(host, "Host %s undefined", elm.second.c_str());
-      simgrid::surf::Cpu *cpu = host->pimpl_cpu;
-
-      cpu->setStateTrace(trace);
-    }
+    simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
+    xbt_assert(host, "Host %s undefined", elm.second.c_str());
+    simgrid::surf::Cpu* cpu = host->pimpl_cpu;
 
-    for (auto elm : trace_connect_list_host_speed) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+    cpu->setStateTrace(trace);
+  }
 
-      simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
-      xbt_assert(host, "Host %s undefined", elm.second.c_str());
-      simgrid::surf::Cpu *cpu = host->pimpl_cpu;
+  for (auto const& elm : trace_connect_list_host_speed) {
+    xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+    tmgr_trace_t trace = traces_set_list.at(elm.first);
 
-      cpu->setSpeedTrace(trace);
-    }
+    simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
+    xbt_assert(host, "Host %s undefined", elm.second.c_str());
+    simgrid::surf::Cpu* cpu = host->pimpl_cpu;
 
-    for (auto elm : trace_connect_list_link_avail) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
+    cpu->setSpeedTrace(trace);
+  }
 
-      sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
-      xbt_assert(link, "Link %s undefined", elm.second.c_str());
-      link->setStateTrace(trace);
-    }
+  for (auto const& elm : trace_connect_list_link_avail) {
+    xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+    tmgr_trace_t trace = traces_set_list.at(elm.first);
 
-    for (auto elm : trace_connect_list_link_bw) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
-      sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
-      xbt_assert(link, "Link %s undefined", elm.second.c_str());
-      link->setBandwidthTrace(trace);
-    }
+    sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
+    xbt_assert(link, "Link %s undefined", elm.second.c_str());
+    link->setStateTrace(trace);
+  }
 
-    for (auto elm : trace_connect_list_link_lat) {
-      tmgr_trace_t trace = (tmgr_trace_t)xbt_dict_get_or_null(traces_set_list, elm.first.c_str());
-      xbt_assert(trace, "Trace %s undefined", elm.first.c_str());
-      sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
-      xbt_assert(link, "Link %s undefined", elm.second.c_str());
-      link->setLatencyTrace(trace);
-    }
+  for (auto const& elm : trace_connect_list_link_bw) {
+    xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+    tmgr_trace_t trace = traces_set_list.at(elm.first);
+    sg_link_t link     = simgrid::s4u::Link::byName(elm.second.c_str());
+    xbt_assert(link, "Link %s undefined", elm.second.c_str());
+    link->setBandwidthTrace(trace);
+  }
 
-    /* Free my data */
-    xbt_dict_free(&traces_set_list);
+  for (auto const& elm : trace_connect_list_link_lat) {
+    xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
+    tmgr_trace_t trace = traces_set_list.at(elm.first);
+    sg_link_t link     = simgrid::s4u::Link::byName(elm.second.c_str());
+    xbt_assert(link, "Link %s undefined", elm.second.c_str());
+    link->setLatencyTrace(trace);
+  }
 
-    surf_parse_close();
+  surf_parse_close();
 
-    if (parse_status)
-      surf_parse_error("Parse error in %s", file);
-  }
+  if (parse_status)
+    surf_parse_error(std::string("Parse error in ") + file);
+}
 }
-
-SG_END_DECL()
index b82863a..3d6ead1 100644 (file)
 #include "simgrid/sg_config.h"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
-#include "xbt/file.h"
+#include "xbt/file.hpp"
 
 #include "src/surf/xml/platf_private.hpp"
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
+#include <initializer_list>
 #include <string>
+#include <tuple>
+#include <unordered_map>
+#include <vector>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module");
 
-SG_BEGIN_DECL()
-
-int ETag_surfxml_include_state();
+extern "C" {
 
 #include "simgrid_dtd.c"
 
-char* surf_parsed_filename = nullptr; // to locate parse error messages
-
+static const char* surf_parsed_filename; // Currently parsed file (for the error messages)
 std::vector<simgrid::surf::LinkImpl*> parsed_link_list; /* temporary store of current list link of a route */
 
 /*
  * Helping functions
  */
-void surf_parse_assert(bool cond, const char *fmt, ...) {
+void surf_parse_assert(bool cond, std::string msg)
+{
   if (not cond) {
-    va_list va;
-    va_start(va,fmt);
     int lineno = surf_parse_lineno;
-    char *msg = bvprintf(fmt,va);
-    va_end(va);
     cleanup();
-    XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename, lineno, msg);
+    XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename, lineno, msg.c_str());
     surf_exit();
     xbt_die("Exiting now");
   }
 }
-void surf_parse_error(const char *fmt, ...) {
-  va_list va;
-  va_start(va,fmt);
+
+void surf_parse_error(std::string msg)
+{
   int lineno = surf_parse_lineno;
-  char *msg = bvprintf(fmt,va);
-  va_end(va);
   cleanup();
-  XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename, lineno, msg);
+  XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename, lineno, msg.c_str());
   surf_exit();
   xbt_die("Exiting now");
 }
-void surf_parse_assert_netpoint(char* hostname, const char* pre, const char* post)
+
+void surf_parse_assert_netpoint(std::string hostname, std::string pre, std::string post)
 {
-  if (sg_netpoint_by_name_or_null(hostname) != nullptr) // found
+  if (sg_netpoint_by_name_or_null(hostname.c_str()) != nullptr) // found
     return;
 
-  std::string msg = std::string(pre);
-  msg += hostname;
-  msg += post;
-  msg += " Existing netpoints: \n";
+  std::string msg = pre + hostname + post + " Existing netpoints: \n";
 
   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 np : list) {
+  for (auto const& np : list) {
     if (np->isNetZone())
       continue;
 
     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)......";
       break;
     }
   }
-  surf_parse_error("%s", msg.c_str());
+  surf_parse_error(msg);
 }
 
-void surf_parse_warn(const char *fmt, ...) {
-  va_list va;
-  va_start(va,fmt);
-  char *msg = bvprintf(fmt,va);
-  va_end(va);
-    XBT_WARN("%s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg);
-    free(msg);
+void surf_parse_warn(std::string msg)
+{
+  XBT_WARN("%s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg.c_str());
 }
 
-double surf_parse_get_double(const char *string) {
-  double res;
-  int ret = sscanf(string, "%lg", &res);
-  if (ret != 1)
-    surf_parse_error("%s is not a double", string);
-  return res;
+double surf_parse_get_double(std::string s)
+{
+  try {
+    return std::stod(s);
+  } catch (std::invalid_argument& ia) {
+    surf_parse_error(s + " is not a double");
+    return -1;
+  }
 }
 
-int surf_parse_get_int(const char *string) {
-  int res;
-  int ret = sscanf(string, "%d", &res);
-  if (ret != 1)
-    surf_parse_error("%s is not an integer", string);
-  return res;
+int surf_parse_get_int(std::string s)
+{
+  try {
+    return std::stoi(s);
+  } catch (std::invalid_argument& ia) {
+    surf_parse_error(s + " is not a double");
+    return -1;
+  }
+}
 }
 
+namespace {
+
 /* Turn something like "1-4,6,9-11" into the vector {1,2,3,4,6,9,10,11} */
-static std::vector<int>* explodesRadical(const char* radicals)
+std::vector<int>* explodesRadical(std::string radicals)
 {
   std::vector<int>* exploded = new std::vector<int>();
 
   // Make all hosts
   std::vector<std::string> radical_elements;
   boost::split(radical_elements, radicals, boost::is_any_of(","));
-  for (auto group : radical_elements) {
+  for (auto const& group : radical_elements) {
     std::vector<std::string> radical_ends;
     boost::split(radical_ends, group, boost::is_any_of("-"));
-    int start                = surf_parse_get_int((radical_ends.front()).c_str());
-    int end                  = 0;
+    int start = surf_parse_get_int(radical_ends.front());
+    int end   = 0;
 
     switch (radical_ends.size()) {
       case 1:
         end = start;
         break;
       case 2:
-        end = surf_parse_get_int((radical_ends.back()).c_str());
+        end = surf_parse_get_int(radical_ends.back());
         break;
       default:
-        surf_parse_error("Malformed radical: %s", group.c_str());
+        surf_parse_error(std::string("Malformed radical: ") + group);
         break;
     }
     for (int i = start; i <= end; i++)
@@ -145,153 +141,111 @@ static std::vector<int>* explodesRadical(const char* radicals)
   return exploded;
 }
 
-struct unit_scale {
-  const char *unit;
-  double scale;
+class unit_scale : public std::unordered_map<std::string, double> {
+public:
+  using std::unordered_map<std::string, double>::unordered_map;
+  // tuples are : <unit, value for unit, base (2 or 10), true if abbreviated>
+  explicit unit_scale(std::initializer_list<std::tuple<const std::string, double, int, bool>> generators);
 };
 
+unit_scale::unit_scale(std::initializer_list<std::tuple<const std::string, double, int, bool>> generators)
+{
+  for (const auto& gen : generators) {
+    const std::string& unit = std::get<0>(gen);
+    double value            = std::get<1>(gen);
+    const int base          = std::get<2>(gen);
+    const bool abbrev       = std::get<3>(gen);
+    double mult;
+    std::vector<std::string> prefixes;
+    switch (base) {
+      case 2:
+        mult     = 1024.0;
+        prefixes = abbrev ? std::vector<std::string>{"Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi"}
+                          : std::vector<std::string>{"kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"};
+        break;
+      case 10:
+        mult     = 1000.0;
+        prefixes = abbrev ? std::vector<std::string>{"k", "M", "G", "T", "P", "E", "Z", "Y"}
+                          : std::vector<std::string>{"kilo", "mega", "giga", "tera", "peta", "exa", "zeta", "yotta"};
+        break;
+      default:
+        THROW_IMPOSSIBLE;
+    }
+    emplace(unit, value);
+    for (const auto& prefix : prefixes) {
+      value *= mult;
+      emplace(prefix + unit, value);
+    }
+  }
+}
+
 /* 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, const char *name, const char *error_msg, const char *default_unit)
+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;
   errno = 0;
   double res   = strtod(string, &ptr);
   if (errno == ERANGE)
-    surf_parse_error("value out of range: %s", string);
+    surf_parse_error(std::string("value out of range: ") + string);
   if (ptr == string)
-    surf_parse_error("cannot parse number: %s", string);
+    surf_parse_error(std::string("cannot parse number:") + string);
   if (ptr[0] == '\0') {
     if (res == 0)
       return res; // Ok, 0 can be unit-less
 
-    XBT_WARN("Deprecated unit-less value '%s' for %s %s. %s",string, entity_kind, name, error_msg);
+    XBT_WARN("Deprecated unit-less value '%s' for %s %s. %s", string, entity_kind, name.c_str(), error_msg);
     ptr = (char*)default_unit;
   }
-  for (i = 0; units[i].unit != nullptr && strcmp(ptr, units[i].unit) != 0; i++);
-
-  if (units[i].unit != nullptr)
-    res *= units[i].scale;
-  else
-    surf_parse_error("unknown unit: %s", ptr);
-  return res;
+  auto u = units.find(ptr);
+  if (u == units.end())
+    surf_parse_error(std::string("unknown unit: ") + ptr);
+  return res * u->second;
 }
+}
+
+extern "C" {
 
-double surf_parse_get_time(const char *string, const char *entity_kind, const char *name)
+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 }
-  };
+  static const unit_scale units{std::make_pair("w", 7 * 24 * 60 * 60),
+                                std::make_pair("d", 24 * 60 * 60),
+                                std::make_pair("h", 60 * 60),
+                                std::make_pair("m", 60),
+                                std::make_pair("s", 1.0),
+                                std::make_pair("ms", 1e-3),
+                                std::make_pair("us", 1e-6),
+                                std::make_pair("ns", 1e-9),
+                                std::make_pair("ps", 1e-12)};
   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, const char *name)
+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 }
-  };
+  static const unit_scale units{std::make_tuple("b", 0.125, 2, true), std::make_tuple("b", 0.125, 10, true),
+                                std::make_tuple("B", 1.0, 2, true), std::make_tuple("B", 1.0, 10, true)};
   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, const char *name)
+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 }
-  };
+  static const unit_scale units{std::make_tuple("bps", 0.125, 2, true), std::make_tuple("bps", 0.125, 10, true),
+                                std::make_tuple("Bps", 1.0, 2, true), std::make_tuple("Bps", 1.0, 10, true)};
   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, const char *name)
+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 }
-  };
+  static const unit_scale units{std::make_tuple("f", 1.0, 10, true), std::make_tuple("flops", 1.0, 10, false)};
   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");
 }
 
-static std::vector<double> surf_parse_get_all_speeds(char* speeds, const char* entity_kind, const char* id){
+static std::vector<double> surf_parse_get_all_speeds(char* speeds, const char* entity_kind, std::string id)
+{
 
   std::vector<double> speed_per_pstate;
 
@@ -319,29 +273,23 @@ static std::vector<double> surf_parse_get_all_speeds(char* speeds, const char* e
 /* make sure these symbols are defined as strong ones in this file so that the linker can resolve them */
 
 /* The default current property receiver. Setup in the corresponding opening callbacks. */
-xbt_dict_t current_property_set = nullptr;
+std::map<std::string, std::string>* current_property_set       = nullptr;
 std::map<std::string, std::string>* current_model_property_set = nullptr;
 int ZONE_TAG                            = 0; // Whether we just opened a zone tag (to see what to do with the properties)
 
-/* dictionary of random generator data */
-xbt_dict_t random_data_list = nullptr;
-
-YY_BUFFER_STATE surf_input_buffer;
 FILE *surf_file_to_parse = nullptr;
 
-/*
- * Stuff relative to storage
- */
+/* Stuff relative to storage */
 void STag_surfxml_storage()
 {
   ZONE_TAG = 0;
   XBT_DEBUG("STag_surfxml_storage");
   xbt_assert(current_property_set == nullptr, "Someone forgot to reset the property set to nullptr in its closing tag (or XML malformed)");
 }
+
 void ETag_surfxml_storage()
 {
-  s_sg_platf_storage_cbarg_t storage;
-  memset(&storage,0,sizeof(storage));
+  StorageCreationArgs storage;
 
   storage.properties   = current_property_set;
   current_property_set = nullptr;
@@ -349,8 +297,8 @@ void ETag_surfxml_storage()
   storage.id           = A_surfxml_storage_id;
   storage.type_id      = A_surfxml_storage_typeId;
   storage.content      = A_surfxml_storage_content;
-
   storage.attach       = A_surfxml_storage_attach;
+
   sg_platf_new_storage(&storage);
 }
 void STag_surfxml_storage___type()
@@ -362,8 +310,7 @@ void STag_surfxml_storage___type()
 }
 void ETag_surfxml_storage___type()
 {
-  s_sg_platf_storage_type_cbarg_t storage_type;
-  memset(&storage_type,0,sizeof(storage_type));
+  StorageTypeCreationArgs storage_type;
 
   storage_type.properties = current_property_set;
   current_property_set    = nullptr;
@@ -371,92 +318,39 @@ void ETag_surfxml_storage___type()
   storage_type.model_properties = current_model_property_set;
   current_model_property_set    = nullptr;
 
-  storage_type.content          = A_surfxml_storage___type_content;
-  storage_type.id               = A_surfxml_storage___type_id;
-  storage_type.model            = A_surfxml_storage___type_model;
-  storage_type.size             = surf_parse_get_size(A_surfxml_storage___type_size,
-        "size of storage type", storage_type.id);
+  storage_type.content = A_surfxml_storage___type_content;
+  storage_type.id      = A_surfxml_storage___type_id;
+  storage_type.model   = A_surfxml_storage___type_model;
+  storage_type.size =
+      surf_parse_get_size(A_surfxml_storage___type_size, "size of storage type", storage_type.id.c_str());
   sg_platf_new_storage_type(&storage_type);
 }
+
 void STag_surfxml_mount()
 {
   XBT_DEBUG("STag_surfxml_mount");
 }
+
 void ETag_surfxml_mount()
 {
-  s_sg_platf_mount_cbarg_t mount;
-  memset(&mount,0,sizeof(mount));
+  MountCreationArgs mount;
 
   mount.name      = A_surfxml_mount_name;
   mount.storageId = A_surfxml_mount_storageId;
   sg_platf_new_mount(&mount);
 }
 
-/*
- * Stuff relative to the <include> tag
- */
-static std::vector<YY_BUFFER_STATE> surf_input_buffer_stack;
-static std::vector<FILE*> surf_file_to_parse_stack;
-static std::vector<char*> surf_parsed_filename_stack;
-
 void STag_surfxml_include()
 {
-  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
-  surf_parsed_filename = xbt_strdup(A_surfxml_include_file);
-
-  surf_file_to_parse_stack.push_back(surf_file_to_parse); // save old file descriptor
-
-  surf_file_to_parse = surf_fopen(A_surfxml_include_file, "r"); // read new file descriptor
-  xbt_assert((surf_file_to_parse), "Unable to open \"%s\"\n", A_surfxml_include_file);
-
-  surf_input_buffer_stack.push_back(surf_input_buffer);
-  surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE);
-  surf_parse_push_buffer_state(surf_input_buffer);
-
-  fflush(nullptr);
-}
-
-void ETag_surfxml_include() {
-/* Nothing to do when done with reading the include tag.
- * Instead, the handling should be deferred until the EOF of current buffer -- see below */
+  xbt_die("<include> tag was removed in SimGrid v3.18. Please stop using it now.");
 }
 
-/** @brief When reaching EOF, check whether we are in an include tag, and behave accordingly if yes
- *
- * This function is called automatically by sedding the parser in tools/cmake/MaintainerMode.cmake
- * Every FAIL on "Premature EOF" is preceded by a call to this function, which role is to restore the
- * previous buffer if we reached the EOF /of an include file/. Its return code is used to avoid the
- * error message in that case.
- *
- * Yeah, that's terribly hackish, but it works. A better solution should be dealed with in flexml
- * directly: a command line flag could instruct it to do the correct thing when the include directive is encountered
- * on a line. One day maybe, if the maya allow it.
- */
-int ETag_surfxml_include_state()
+void ETag_surfxml_include()
 {
-  fflush(nullptr);
-  XBT_DEBUG("ETag_surfxml_include_state '%s'",A_surfxml_include_file);
-
-  if (surf_input_buffer_stack.empty()) // nope, that's a true premature EOF. Let the parser die verbosely.
-    return 0;
-
-  // Yeah, we were in an <include> Restore state and proceed.
-  fclose(surf_file_to_parse);
-  surf_file_to_parse_stack.pop_back();
-  surf_parse_pop_buffer_state();
-  surf_input_buffer_stack.pop_back();
-
-  // Restore the filename for error messages
-  free(surf_parsed_filename);
-  surf_parsed_filename_stack.pop_back();
-
-  return 1;
+  /* Won't happen since <include> is now removed since v3.18. */
 }
 
 /* Stag and Etag parse functions */
-
 void STag_surfxml_platform() {
   XBT_ATTRIB_UNUSED double version = surf_parse_get_double(A_surfxml_platform_version);
 
@@ -522,11 +416,10 @@ void STag_surfxml_prop()
     simgrid::s4u::NetZone* netzone = simgrid::s4u::Engine::getInstance()->getNetzoneByNameOrNull(A_surfxml_zone_id);
 
     netzone->setProperty(A_surfxml_prop_id, A_surfxml_prop_value);
-  }
-  else{
+  } else {
     if (not current_property_set)
-      current_property_set = xbt_dict_new_homogeneous(&xbt_free_f); // Maybe, it should raise an error
-    xbt_dict_set(current_property_set, A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value), nullptr);
+      current_property_set = new std::map<std::string, std::string>; // Maybe, it should raise an error
+    current_property_set->insert({A_surfxml_prop_id, A_surfxml_prop_value});
     XBT_DEBUG("add prop %s=%s into current property set %p", A_surfxml_prop_id, A_surfxml_prop_value,
               current_property_set);
   }
@@ -534,7 +427,6 @@ void STag_surfxml_prop()
 
 void ETag_surfxml_host()    {
   s_sg_platf_host_cbarg_t host;
-  memset(&host,0,sizeof(host));
 
   host.properties = current_property_set;
   current_property_set = nullptr;
@@ -555,8 +447,7 @@ void ETag_surfxml_host()    {
 
 void STag_surfxml_host___link(){
   XBT_DEBUG("Create a Host_link for %s",A_surfxml_host___link_id);
-  s_sg_platf_host_link_cbarg_t host_link;
-  memset(&host_link,0,sizeof(host_link));
+  HostLinkCreationArgs host_link;
 
   host_link.id        = A_surfxml_host___link_id;
   host_link.link_up   = A_surfxml_host___link_up;
@@ -569,9 +460,8 @@ void STag_surfxml_router(){
 }
 
 void ETag_surfxml_cluster(){
-  s_sg_platf_cluster_cbarg_t cluster;
-  memset(&cluster,0,sizeof(cluster));
-  cluster.properties = current_property_set;
+  ClusterCreationArgs cluster;
+  cluster.properties   = current_property_set;
   current_property_set = nullptr;
 
   cluster.id          = A_surfxml_cluster_id;
@@ -607,8 +497,7 @@ void ETag_surfxml_cluster(){
     cluster.topology= SURF_CLUSTER_DRAGONFLY ;
     break;
   default:
-    surf_parse_error("Invalid cluster topology for cluster %s",
-                     cluster.id);
+    surf_parse_error(std::string("Invalid cluster topology for cluster ") + cluster.id);
     break;
   }
   cluster.topo_parameters = A_surfxml_cluster_topo___parameters;
@@ -625,7 +514,7 @@ void ETag_surfxml_cluster(){
     cluster.sharing_policy = SURF_LINK_FATPIPE;
     break;
   default:
-    surf_parse_error("Invalid cluster sharing policy for cluster %s", cluster.id);
+    surf_parse_error(std::string("Invalid cluster sharing policy for cluster ") + cluster.id);
     break;
   }
   switch (AX_surfxml_cluster_bb___sharing___policy) {
@@ -636,7 +525,7 @@ void ETag_surfxml_cluster(){
     cluster.bb_sharing_policy = SURF_LINK_SHARED;
     break;
   default:
-    surf_parse_error("Invalid bb sharing policy in cluster %s", cluster.id);
+    surf_parse_error(std::string("Invalid bb sharing policy in cluster ") + cluster.id);
     break;
   }
 
@@ -651,14 +540,13 @@ void STag_surfxml_cluster(){
 
 void STag_surfxml_cabinet(){
   parse_after_config();
-  s_sg_platf_cabinet_cbarg_t cabinet;
-  memset(&cabinet,0,sizeof(cabinet));
+  CabinetCreationArgs cabinet;
   cabinet.id      = A_surfxml_cabinet_id;
   cabinet.prefix  = A_surfxml_cabinet_prefix;
   cabinet.suffix  = A_surfxml_cabinet_suffix;
-  cabinet.speed   = surf_parse_get_speed(A_surfxml_cabinet_speed, "speed of cabinet", cabinet.id);
-  cabinet.bw      = surf_parse_get_bandwidth(A_surfxml_cabinet_bw, "bw of cabinet", cabinet.id);
-  cabinet.lat     = surf_parse_get_time(A_surfxml_cabinet_lat, "lat of cabinet", cabinet.id);
+  cabinet.speed    = surf_parse_get_speed(A_surfxml_cabinet_speed, "speed of cabinet", cabinet.id.c_str());
+  cabinet.bw       = surf_parse_get_bandwidth(A_surfxml_cabinet_bw, "bw of cabinet", cabinet.id.c_str());
+  cabinet.lat      = surf_parse_get_time(A_surfxml_cabinet_lat, "lat of cabinet", cabinet.id.c_str());
   cabinet.radicals = explodesRadical(A_surfxml_cabinet_radical);
 
   sg_platf_new_cabinet(&cabinet);
@@ -666,12 +554,12 @@ void STag_surfxml_cabinet(){
 
 void STag_surfxml_peer(){
   parse_after_config();
-  s_sg_platf_peer_cbarg_t peer;
-  memset(&peer,0,sizeof(peer));
-  peer.id          = A_surfxml_peer_id;
-  peer.speed       = surf_parse_get_speed(A_surfxml_peer_speed, "speed of peer", peer.id);
-  peer.bw_in       = surf_parse_get_bandwidth(A_surfxml_peer_bw___in, "bw_in of peer", peer.id);
-  peer.bw_out      = surf_parse_get_bandwidth(A_surfxml_peer_bw___out, "bw_out of peer", peer.id);
+  PeerCreationArgs peer;
+
+  peer.id          = std::string(A_surfxml_peer_id);
+  peer.speed       = surf_parse_get_speed(A_surfxml_peer_speed, "speed of peer", peer.id.c_str());
+  peer.bw_in       = surf_parse_get_bandwidth(A_surfxml_peer_bw___in, "bw_in of peer", peer.id.c_str());
+  peer.bw_out      = surf_parse_get_bandwidth(A_surfxml_peer_bw___out, "bw_out of peer", peer.id.c_str());
   peer.coord       = A_surfxml_peer_coordinates;
   peer.speed_trace = A_surfxml_peer_availability___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_availability___file) : nullptr;
   peer.state_trace = A_surfxml_peer_state___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_state___file) : nullptr;
@@ -712,35 +600,31 @@ void ETag_surfxml_link(){
      link.policy = SURF_LINK_FULLDUPLEX;
      break;
   default:
-    surf_parse_error("Invalid sharing policy in link %s", link.id.c_str());
+    surf_parse_error(std::string("Invalid sharing policy in link ") + link.id);
     break;
   }
 
   sg_platf_new_link(&link);
 }
 
-void STag_surfxml_link___ctn(){
-
+void STag_surfxml_link___ctn()
+{
   simgrid::surf::LinkImpl* link = nullptr;
-  char *link_name=nullptr;
   switch (A_surfxml_link___ctn_direction) {
   case AU_surfxml_link___ctn_direction:
   case A_surfxml_link___ctn_direction_NONE:
     link = simgrid::surf::LinkImpl::byName(A_surfxml_link___ctn_id);
     break;
   case A_surfxml_link___ctn_direction_UP:
-    link_name = bprintf("%s_UP", A_surfxml_link___ctn_id);
-    link      = simgrid::surf::LinkImpl::byName(link_name);
+    link = simgrid::surf::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_UP");
     break;
   case A_surfxml_link___ctn_direction_DOWN:
-    link_name = bprintf("%s_DOWN", A_surfxml_link___ctn_id);
-    link      = simgrid::surf::LinkImpl::byName(link_name);
+    link = simgrid::surf::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_DOWN");
     break;
   default:
-    surf_parse_error("Invalid direction for link %s", link_name);
+    surf_parse_error(std::string("Invalid direction for link ") + A_surfxml_link___ctn_id);
     break;
   }
-  xbt_free(link_name); // no-op if it's already nullptr
 
   const char* dirname = "";
   switch (A_surfxml_link___ctn_direction) {
@@ -753,7 +637,7 @@ void STag_surfxml_link___ctn(){
     default:
       dirname = "";
   }
-  surf_parse_assert(link != nullptr, "No such link: '%s'%s", A_surfxml_link___ctn_id, dirname);
+  surf_parse_assert(link != nullptr, std::string("No such link: '") + A_surfxml_link___ctn_id + "'" + dirname);
   parsed_link_list.push_back(link);
 }
 
@@ -809,21 +693,16 @@ void STag_surfxml_bypassZoneRoute(){
 
 void ETag_surfxml_route(){
   s_sg_platf_route_cbarg_t route;
-  memset(&route,0,sizeof(route));
 
   route.src         = sg_netpoint_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
   route.dst         = sg_netpoint_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
   route.gw_src    = nullptr;
   route.gw_dst    = nullptr;
-  route.link_list   = new std::vector<simgrid::surf::LinkImpl*>();
   route.symmetrical = (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES);
 
-  for (auto link: parsed_link_list)
-    route.link_list->push_back(link);
-  parsed_link_list.clear();
+  route.link_list.swap(parsed_link_list);
 
   sg_platf_new_route(&route);
-  delete route.link_list;
 }
 
 void ETag_surfxml_ASroute()
@@ -838,7 +717,6 @@ void ETag_surfxml_ASroute()
 void ETag_surfxml_zoneRoute()
 {
   s_sg_platf_route_cbarg_t ASroute;
-  memset(&ASroute,0,sizeof(ASroute));
 
   ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_src); // tested to not be nullptr in start tag
   ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_dst); // tested to not be nullptr in start tag
@@ -846,11 +724,7 @@ void ETag_surfxml_zoneRoute()
   ASroute.gw_src = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_gw___src); // tested to not be nullptr in start tag
   ASroute.gw_dst = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_gw___dst); // tested to not be nullptr in start tag
 
-  ASroute.link_list = new std::vector<simgrid::surf::LinkImpl*>();
-
-  for (auto link: parsed_link_list)
-    ASroute.link_list->push_back(link);
-  parsed_link_list.clear();
+  ASroute.link_list.swap(parsed_link_list);
 
   switch (A_surfxml_zoneRoute_symmetrical) {
   case AU_surfxml_zoneRoute_symmetrical:
@@ -860,29 +734,25 @@ void ETag_surfxml_zoneRoute()
   case A_surfxml_zoneRoute_symmetrical_NO:
     ASroute.symmetrical = false;
     break;
+  default:
+    THROW_IMPOSSIBLE;
   }
 
   sg_platf_new_route(&ASroute);
-  delete ASroute.link_list;
 }
 
 void ETag_surfxml_bypassRoute(){
   s_sg_platf_route_cbarg_t route;
-  memset(&route,0,sizeof(route));
 
   route.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
   route.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
   route.gw_src = nullptr;
   route.gw_dst = nullptr;
   route.symmetrical = false;
-  route.link_list   = new std::vector<simgrid::surf::LinkImpl*>();
 
-  for (auto link: parsed_link_list)
-    route.link_list->push_back(link);
-  parsed_link_list.clear();
+  route.link_list.swap(parsed_link_list);
 
   sg_platf_new_bypassRoute(&route);
-  delete route.link_list;
 }
 
 void ETag_surfxml_bypassASroute()
@@ -896,14 +766,10 @@ void ETag_surfxml_bypassASroute()
 void ETag_surfxml_bypassZoneRoute()
 {
   s_sg_platf_route_cbarg_t ASroute;
-  memset(&ASroute,0,sizeof(ASroute));
 
   ASroute.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_src);
   ASroute.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_dst);
-  ASroute.link_list   = new std::vector<simgrid::surf::LinkImpl*>();
-  for (auto link: parsed_link_list)
-    ASroute.link_list->push_back(link);
-  parsed_link_list.clear();
+  ASroute.link_list.swap(parsed_link_list);
 
   ASroute.symmetrical = false;
 
@@ -911,12 +777,10 @@ void ETag_surfxml_bypassZoneRoute()
   ASroute.gw_dst = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_gw___dst);
 
   sg_platf_new_bypassRoute(&ASroute);
-  delete ASroute.link_list;
 }
 
 void ETag_surfxml_trace(){
-  s_sg_platf_trace_cbarg_t trace;
-  memset(&trace,0,sizeof(trace));
+  TraceCreationArgs trace;
 
   trace.id = A_surfxml_trace_id;
   trace.file = A_surfxml_trace_file;
@@ -929,8 +793,7 @@ void ETag_surfxml_trace(){
 void STag_surfxml_trace___connect()
 {
   parse_after_config();
-  s_sg_platf_trace_connect_cbarg_t trace_connect;
-  memset(&trace_connect,0,sizeof(trace_connect));
+  TraceConnectCreationArgs trace_connect;
 
   trace_connect.element = A_surfxml_trace___connect_element;
   trace_connect.trace = A_surfxml_trace___connect_trace;
@@ -975,20 +838,23 @@ void STag_surfxml_zone()
 {
   parse_after_config();
   ZONE_TAG                 = 1;
-  s_sg_platf_AS_cbarg_t AS = {A_surfxml_zone_id, (int)A_surfxml_zone_routing};
+  ZoneCreationArgs zone;
+  zone.id      = A_surfxml_zone_id;
+  zone.routing = static_cast<int>(A_surfxml_zone_routing);
 
-  sg_platf_new_AS_begin(&AS);
+  sg_platf_new_Zone_begin(&zone);
 }
 
 void ETag_surfxml_zone()
 {
-  sg_platf_new_AS_seal();
+  sg_platf_new_Zone_seal();
 }
 
 void STag_surfxml_config()
 {
   ZONE_TAG = 0;
-  xbt_assert(current_property_set == nullptr, "Someone forgot to reset the property set to nullptr in its closing tag (or XML malformed)");
+  xbt_assert(current_property_set == nullptr,
+             "Someone forgot to reset the property set to nullptr in its closing tag (or XML malformed)");
   XBT_DEBUG("START configuration name = %s",A_surfxml_config_id);
   if (_sg_cfg_init_status == 2) {
     surf_parse_error("All <config> tags must be given before any platform elements (such as <zone>, <host>, <cluster>, "
@@ -998,36 +864,31 @@ void STag_surfxml_config()
 
 void ETag_surfxml_config()
 {
-  xbt_dict_cursor_t cursor = nullptr;
-  char *key;
-  char *elem;
-  xbt_dict_foreach(current_property_set, cursor, key, elem) {
-    if (xbt_cfg_is_default_value(key)) {
-      std::string cfg = std::string(key) + ":" + elem;
+  for (auto const& elm : *current_property_set) {
+    if (xbt_cfg_is_default_value(elm.first.c_str())) {
+      std::string cfg = elm.first + ":" + elm.second;
       xbt_cfg_set_parse(cfg.c_str());
     } else
-      XBT_INFO("The custom configuration '%s' is already defined by user!",key);
+      XBT_INFO("The custom configuration '%s' is already defined by user!", elm.first.c_str());
   }
   XBT_DEBUG("End configuration name = %s",A_surfxml_config_id);
 
-  xbt_dict_free(&current_property_set);
+  delete current_property_set;
   current_property_set = nullptr;
 }
 
-static int argc;
-static char **argv;
+static std::vector<std::string> arguments;
 
 void STag_surfxml_process()
 {
   AX_surfxml_actor_function = AX_surfxml_process_function;
   STag_surfxml_actor();
 }
+
 void STag_surfxml_actor()
 {
   ZONE_TAG  = 0;
-  argc    = 1;
-  argv    = xbt_new(char *, 1);
-  argv[0] = xbt_strdup(A_surfxml_actor_function);
+  arguments.assign(1, A_surfxml_actor_function);
   xbt_assert(current_property_set == nullptr, "Someone forgot to reset the property set to nullptr in its closing tag (or XML malformed)");
 }
 
@@ -1040,14 +901,15 @@ void ETag_surfxml_process()
   AX_surfxml_actor_on___failure = (AT_surfxml_actor_on___failure)AX_surfxml_process_on___failure;
   ETag_surfxml_actor();
 }
+
 void ETag_surfxml_actor()
 {
   s_sg_platf_process_cbarg_t actor;
-  memset(&actor,0,sizeof(actor));
 
-  actor.argc       = argc;
-  actor.argv       = (const char **)argv;
-  actor.properties = current_property_set;
+  actor.properties     = current_property_set;
+  current_property_set = nullptr;
+
+  actor.args.swap(arguments);
   actor.host       = A_surfxml_actor_host;
   actor.function   = A_surfxml_actor_function;
   actor.start_time = surf_parse_get_double(A_surfxml_actor_start___time);
@@ -1067,27 +929,17 @@ void ETag_surfxml_actor()
   }
 
   sg_platf_new_process(&actor);
-
-  for (int i = 0; i != argc; ++i)
-    xbt_free(argv[i]);
-  xbt_free(argv);
-  argv = nullptr;
-
-  current_property_set = nullptr;
 }
 
 void STag_surfxml_argument(){
-  argc++;
-  argv = (char**)xbt_realloc(argv, (argc) * sizeof(char **));
-  argv[(argc) - 1] = xbt_strdup(A_surfxml_argument_value);
+  arguments.push_back(A_surfxml_argument_value);
 }
 
 void STag_surfxml_model___prop(){
   if (not current_model_property_set)
     current_model_property_set = new std::map<std::string, std::string>();
 
-  current_model_property_set->insert(
-      {std::string(A_surfxml_model___prop_id), std::string(A_surfxml_model___prop_value)});
+  current_model_property_set->insert({A_surfxml_model___prop_id, A_surfxml_model___prop_value});
 }
 
 void ETag_surfxml_prop(){/* Nothing to do */}
@@ -1105,14 +957,15 @@ void ETag_surfxml_argument(){/* Nothing to do */}
 void ETag_surfxml_model___prop(){/* Nothing to do */}
 
 /* Open and Close parse file */
+YY_BUFFER_STATE surf_input_buffer;
+
 void surf_parse_open(const char *file)
 {
   xbt_assert(file, "Cannot parse the nullptr file. Bypassing the parser is strongly deprecated nowadays.");
 
-  surf_parsed_filename = xbt_strdup(file);
-  char* dir            = xbt_dirname(file);
-  surf_path.push_back(std::string(dir));
-  xbt_free(dir);
+  surf_parsed_filename = file;
+  std::string dir      = simgrid::xbt::Path(file).getDirname();
+  surf_path.push_back(dir);
 
   surf_file_to_parse = surf_fopen(file, "r");
   if (surf_file_to_parse == nullptr)
@@ -1124,12 +977,7 @@ void surf_parse_open(const char *file)
 
 void surf_parse_close()
 {
-  if (surf_parsed_filename) {
-    surf_path.pop_back();
-  }
-
-  free(surf_parsed_filename);
-  surf_parsed_filename = nullptr;
+  surf_path.pop_back(); // remove the dirname of the opened file, that was added in surf_parse_open()
 
   if (surf_file_to_parse) {
     surf_parse__delete_buffer(surf_input_buffer);
@@ -1143,5 +991,4 @@ int surf_parse()
 {
   return surf_parse_lex();
 }
-
-SG_END_DECL()
+}
index 7f3c746..9fde6ed 100644 (file)
@@ -7,6 +7,9 @@
 
 #include "xbt/automaton.h"
 #include <stdio.h> /* printf */
+#include <xbt/log.h>
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_automaton, xbt, "Automaton");
 
 struct xbt_automaton_propositional_symbol{
   char* pred;
@@ -82,6 +85,13 @@ xbt_automaton_exp_label_t xbt_automaton_exp_label_new(int type, ...){
     p = va_arg(ap, char*);
     label->u.predicat = xbt_strdup(p);
     break;
+  case 4:
+    break;
+  default:
+    XBT_DEBUG("Invalid type: %d", type);
+    xbt_free(label);
+    label = NULL;
+    break;
   }
   va_end(ap);
   return label;
@@ -95,7 +105,9 @@ xbt_dynar_t xbt_automaton_get_transitions(xbt_automaton_t a){
   return a->transitions;
 }
 
-xbt_automaton_transition_t xbt_automaton_get_transition(xbt_automaton_t a, xbt_automaton_state_t src, xbt_automaton_state_t dst){
+xbt_automaton_transition_t xbt_automaton_get_transition(XBT_ATTRIB_UNUSED xbt_automaton_t a, xbt_automaton_state_t src,
+                                                        xbt_automaton_state_t dst)
+{
   xbt_automaton_transition_t transition;
   unsigned int cursor;
   xbt_dynar_foreach(src->out, cursor, transition){
@@ -395,7 +407,6 @@ void xbt_automaton_propositional_symbol_free_voidp(void *ps){
   xbt_automaton_propositional_symbol_t symbol = (xbt_automaton_propositional_symbol_t) * (void **) ps;
   if (symbol->free_function)
     symbol->free_function(symbol->data);
-  xbt_free(symbol->pred);
   xbt_automaton_propositional_symbol_free(symbol);
 }
 
index dffb34e..c6abfb5 100644 (file)
 #if HAVE_UNISTD_H
 # include <unistd.h>   /* isatty */
 #endif
+#include <xbt/log.h>
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_automaton);
 
 static xbt_automaton_t parsed_automaton;
 char* state_id_src;
 
 static void new_state(char* id, int src){
-
+  char* saveptr = NULL; // for strtok_r()
   char* id_copy = xbt_strdup(id);
-  char* first_part = strtok(id_copy,"_");
+  char* first_part = strtok_r(id_copy, "_", &saveptr);
   int type = 0 ; // -1=initial state; 0=intermediate state; 1=final state
 
   if(strcmp(first_part,"accept")==0){
     type = 1;
   }else{
-    char* second_part = strtok(NULL,"_");
+    char* second_part = strtok_r(NULL, "_", &saveptr);
     if(strcmp(second_part,"init")==0){
       type = -1;
     }
@@ -89,6 +92,9 @@ static xbt_automaton_exp_label_t new_label(int type, ...){
   case 4 :
     label = xbt_automaton_exp_label_new(type);
     break;
+  default:
+    XBT_DEBUG("Invalid type: %d", type);
+    break;
   }
   va_end(ap);
   return label;
index 8760a89..4096676 100644 (file)
@@ -6,6 +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 <cerrno>
+#include <cstring>
+#include <fstream>
 #include <sstream>
 #include <string>
 #include <vector>
@@ -21,7 +24,6 @@
 #include <xbt/backtrace.hpp>
 #include "xbt/ex.h"
 #include "xbt/log.h"
-#include "xbt/str.h"
 #include "xbt/module.h"         /* xbt_binary_name */
 #include "src/xbt_modinter.h"       /* backtrace initialization headers */
 #if SIMGRID_HAVE_MC
@@ -39,10 +41,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.  */
@@ -166,7 +167,7 @@ std::vector<std::string> resolveBacktrace(
   std::vector<std::string> addrs(count);
   for (std::size_t i = 0; i < count; i++) {
     /* retrieve this address */
-    XBT_DEBUG("Retrieving address number %zd from '%s'", i, backtrace_syms[i]);
+    XBT_DEBUG("Retrieving address number %zu from '%s'", i, backtrace_syms[i]);
     char buff[256];
     snprintf(buff, 256, "%s", strchr(backtrace_syms[i], '[') + 1);
     char* p = strchr(buff, ']');
@@ -175,7 +176,7 @@ std::vector<std::string> resolveBacktrace(
       addrs[i] = buff;
     else
       addrs[i] = "0x0";
-    XBT_DEBUG("Set up a new address: %zd, '%s'", i, addrs[i].c_str());
+    XBT_DEBUG("Set up a new address: %zu, '%s'", i, addrs[i].c_str());
     /* Add it to the command line args */
     stream << addrs[i] << ' ';
   }
@@ -194,17 +195,17 @@ std::vector<std::string> resolveBacktrace(
   char line_func[1024];
   char line_pos[1024];
   for (std::size_t i = 0; i < count; i++) {
-    XBT_DEBUG("Looking for symbol %zd, addr = '%s'", i, addrs[i].c_str());
+    XBT_DEBUG("Looking for symbol %zu, addr = '%s'", i, addrs[i].c_str());
     if (fgets(line_func, 1024, pipe)) {
       line_func[strlen(line_func) - 1] = '\0';
     } else {
-      XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str());
+      XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str());
       strncpy(line_func, "???",3);
     }
     if (fgets(line_pos, 1024, pipe)) {
       line_pos[strlen(line_pos) - 1] = '\0';
     } else {
-      XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str());
+      XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str());
       strncpy(line_pos, backtrace_syms[i],1024);
     }
 
@@ -217,36 +218,36 @@ std::vector<std::string> resolveBacktrace(
     } else {
       /* Damn. The symbol is in a dynamic library. Let's get wild */
 
-      char maps_buff[512];
-      long int offset = 0;
-      char* p;
+      unsigned long int offset = 0;
       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");
-
-      long int addr = strtol(addrs[i].c_str(), &p, 16);
-      if (*p != '\0') {
-        XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)",
-          addrs[i].c_str(), addr);
+      std::string maps_name = std::string("/proc/") + std::to_string(getpid()) + "/maps";
+      std::ifstream maps(maps_name);
+      if (not maps) {
+        XBT_CRITICAL("open(\"%s\") failed: %s", maps_name.c_str(), strerror(errno));
+        continue;
+      }
+      size_t pos;
+      unsigned long int addr = std::stoul(addrs[i], &pos, 16);
+      if (pos != addrs[i].length()) {
+        XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)", addrs[i].c_str(), addr);
       }
-      XBT_DEBUG("addr=%s (as string) =%#lx (as number)",
-        addrs[i].c_str(), addr);
+      XBT_DEBUG("addr=%s (as string) =%#lx (as number)", addrs[i].c_str(), addr);
 
       while (not found) {
-        long int first;
-        long int last;
+        unsigned long int first;
+        unsigned long int last;
 
-        if (fgets(maps_buff, 512, maps) == nullptr)
+        std::string maps_buff;
+        if (not std::getline(maps, maps_buff))
           break;
         if (i == 0) {
-          maps_buff[strlen(maps_buff) - 1] = '\0';
-          XBT_DEBUG("map line: %s", maps_buff);
+          XBT_DEBUG("map line: %s", maps_buff.c_str());
         }
-        sscanf(maps_buff, "%lx", &first);
-        p = strchr(maps_buff, '-') + 1;
-        sscanf(p, "%lx", &last);
+        first = std::stoul(maps_buff, &pos, 16);
+        maps_buff.erase(0, pos + 1);
+        last = std::stoul(maps_buff, nullptr, 16);
         if (first < addr && addr < last) {
           offset = first;
           found = 1;
@@ -256,8 +257,7 @@ std::vector<std::string> resolveBacktrace(
           XBT_DEBUG("Symbol found, map lines not further displayed (even if looking for next ones)");
         }
       }
-      fclose(maps);
-      free(maps_name);
+      maps.close();
       addrs[i].clear();
 
       if (not found) {
@@ -275,41 +275,35 @@ std::vector<std::string> resolveBacktrace(
       XBT_DEBUG("offset=%#lx new addr=%s", offset, addrs[i].c_str());
 
       /* Got it. We have our new address. Let's get the library path and we are set */
-      p = xbt_strdup(backtrace_syms[i]);
+      std::string p(backtrace_syms[i]);
       if (p[0] == '[') {
         /* library path not displayed in the map file either... */
-        free(p);
-        snprintf(line_func,3, "??");
+        snprintf(line_func, 3, "??");
       } else {
-        char* p2 = strrchr(p, '(');
-        if (p2)
-          *p2 = '\0';
-        p2 = strrchr(p, ' ');
-        if (p2)
-          *p2 = '\0';
+        size_t p2 = p.find_first_of("( ");
+        if (p2 != std::string::npos)
+          p.erase(p2);
 
         /* Here we go, fire an addr2line up */
-        char* subcmd = bprintf("%s -f -e %s %s", ADDR2LINE, p, addrs[i].c_str());
-        free(p);
-        XBT_VERB("Fire a new command: '%s'", subcmd);
-        FILE* subpipe = popen(subcmd, "r");
+        std::string subcmd = std::string(ADDR2LINE) + " -f -e " + p + " " + addrs[i];
+        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 */
@@ -328,9 +322,19 @@ std::vector<std::string> resolveBacktrace(
     addrs[i].clear();
 
     /* Mask the bottom of the stack */
-    if (not strncmp("main", line_func, strlen("main")) ||
-        not strncmp("xbt_thread_context_wrapper", line_func, strlen("xbt_thread_context_wrapper")) ||
-        not strncmp("smx_ctx_sysv_wrapper", line_func, strlen("smx_ctx_sysv_wrapper")))
+    const char* const breakers[] = {
+        "main",
+        "_ZN7simgrid6kernel7context13ThreadContext7wrapperE", // simgrid::kernel::context::ThreadContext::wrapper
+        "_ZN7simgrid6kernel7context8UContext7wrapperE"        // simgrid::kernel::context::UContext::wrapper
+    };
+    bool do_break = false;
+    for (const char* b : breakers) {
+      if (strncmp(b, line_func, strlen(b)) == 0) {
+        do_break = true;
+        break;
+      }
+    }
+    if (do_break)
       break;
   }
   pclose(pipe);
index 9b3fedb..cb26929 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (c) 2004-2014,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 <stdio.h>
+#include <cstdio>
 
 #include <algorithm>
 #include <cerrno>
 #include <climits>
 
 #include <functional>
+#include <map>
 #include <stdexcept>
 #include <string>
-#include <typeinfo>
+#include <string>
 #include <type_traits>
+#include <typeinfo>
 #include <vector>
 
 #include <xbt/ex.hpp>
 #include "xbt/misc.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
-#include "xbt/ex.h"
 #include "xbt/dynar.h"
-#include "xbt/dict.h"
-
-// *****
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
 
@@ -41,8 +39,6 @@ namespace config {
 
 missing_key_error::~missing_key_error() = default;
 
-class Config;
-
 namespace {
 
 const char* true_values[] = {
@@ -54,10 +50,10 @@ const char* false_values[] = {
 
 static bool parseBool(const char* value)
 {
-  for (const char* true_value : true_values)
+  for (const char* const& true_value : true_values)
     if (std::strcmp(true_value, value) == 0)
       return true;
-  for (const char* false_value : false_values)
+  for (const char* const& false_value : false_values)
     if (std::strcmp(false_value, value) == 0)
       return false;
   throw std::range_error("not a boolean");
@@ -99,30 +95,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)
   {
@@ -138,18 +138,16 @@ template<class T> class TypedConfigurationElement;
 // **** ConfigurationElement ****
 
 class ConfigurationElement {
-protected:
+private:
   std::string key;
   std::string desc;
   bool isdefault = true;
 
 public:
-
   /* Callback */
   xbt_cfg_cb_t old_callback = nullptr;
 
-  ConfigurationElement(const char* key, const char* desc)
-    : key(key ? key : ""), desc(desc ? desc : "") {}
+  ConfigurationElement(const char* key, const char* desc) : key(key ? key : ""), desc(desc ? desc : "") {}
   ConfigurationElement(const char* key, const char* desc, xbt_cfg_cb_t cb)
     : key(key ? key : ""), desc(desc ? desc : ""), old_callback(cb) {}
 
@@ -174,9 +172,11 @@ public:
   {
     dynamic_cast<TypedConfigurationElement<T>&>(*this).setDefaultValue(std::move(value));
   }
+  void unsetDefault() { isdefault = false; }
   bool isDefault() const { return isdefault; }
 
   std::string const& getDescription() const { return desc; }
+  std::string const& getKey() const { return key; }
 };
 
 // **** TypedConfigurationElement<T> ****
@@ -192,16 +192,13 @@ public:
   TypedConfigurationElement(const char* key, const char* desc, T value = T())
     : ConfigurationElement(key, desc), content(std::move(value))
   {}
-  TypedConfigurationElement(const char* key, const char* desc, T value,
-      xbt_cfg_cb_t cb)
-    : ConfigurationElement(key, desc, cb), content(std::move(value))
+  TypedConfigurationElement(const char* key, const char* desc, T value, xbt_cfg_cb_t cb)
+      : ConfigurationElement(key, desc, cb), content(std::move(value))
   {}
-  TypedConfigurationElement(const char* key, const char* desc, T value,
-      std::function<void(T&)> callback)
-    : ConfigurationElement(key, desc), content(std::move(value)),
-      callback(std::move(callback))
+  TypedConfigurationElement(const char* key, const char* desc, T value, std::function<void(T&)> callback)
+      : ConfigurationElement(key, desc), content(std::move(value)), callback(std::move(callback))
   {}
-  ~TypedConfigurationElement()=default;
+  ~TypedConfigurationElement() = default;
 
   std::string getStringValue() override;
   const char* getTypeName() override;
@@ -210,7 +207,7 @@ public:
   void update()
   {
     if (old_callback)
-      this->old_callback(key.c_str());
+      this->old_callback(getKey().c_str());
     if (this->callback)
       this->callback(this->content);
   }
@@ -225,12 +222,12 @@ public:
 
   void setDefaultValue(T value)
   {
-    if (this->isdefault) {
+    if (this->isDefault()) {
       this->content = std::move(value);
       this->update();
     } else {
-      XBT_DEBUG("Do not override configuration variable '%s' with value '%s'"
-        " because it was already set.", key.c_str(), to_string(value).c_str());
+      XBT_DEBUG("Do not override configuration variable '%s' with value '%s' because it was already set.",
+                getKey().c_str(), to_string(value).c_str());
     }
   }
 };
@@ -245,7 +242,7 @@ template<class T>
 void TypedConfigurationElement<T>::setStringValue(const char* value) // override
 {
   this->content = ConfigType<T>::parse(value);
-  this->isdefault = false;
+  this->unsetDefault();
   this->update();
 }
 
@@ -262,12 +259,13 @@ const char* TypedConfigurationElement<T>::getTypeName() // override
 class Config {
 private:
   // name -> ConfigElement:
-  xbt_dict_t options;
-  // alias -> xbt_dict_elm_t from options:
-  xbt_dict_t aliases;
+  std::map<std::string, simgrid::config::ConfigurationElement*> options;
+  // alias -> ConfigElement from options:
+  std::map<std::string, simgrid::config::ConfigurationElement*> aliases;
+  bool warn_for_aliases = true;
 
 public:
-  Config();
+  Config() = default;
   ~Config();
 
   // No copy:
@@ -283,15 +281,11 @@ public:
   simgrid::config::TypedConfigurationElement<T>*
     registerOption(const char* name, A&&... a)
   {
-    xbt_assert(xbt_dict_get_or_null(this->options, name) == nullptr,
-      "Refusing to register the config element '%s' twice.", name);
-    TypedConfigurationElement<T>* variable =
-      new TypedConfigurationElement<T>(name, std::forward<A>(a)...);
-    XBT_DEBUG("Register cfg elm %s (%s) of type %s @%p in set %p)",
-              name,
-              variable->getDescription().c_str(),
+    xbt_assert(options.find(name) == options.end(), "Refusing to register the config element '%s' twice.", name);
+    TypedConfigurationElement<T>* variable = new TypedConfigurationElement<T>(name, std::forward<A>(a)...);
+    XBT_DEBUG("Register cfg elm %s (%s) of type %s @%p in set %p)", name, variable->getDescription().c_str(),
               variable->getTypeName(), variable, this);
-    xbt_dict_set(this->options, name, variable, nullptr);
+    options.insert({name, variable});
     variable->update();
     return variable;
   }
@@ -302,57 +296,45 @@ public:
   void help();
 
 protected:
-  xbt_dictelm_t getDictElement(const char* name);
+  ConfigurationElement* getDictElement(const char* name);
 };
 
-/* Internal stuff used in cache to free a variable */
-static void xbt_cfgelm_free(void *data)
-{
-  if (data)
-    delete (simgrid::config::ConfigurationElement*) data;
-}
-
-Config::Config() :
-  options(xbt_dict_new_homogeneous(xbt_cfgelm_free)),
-  aliases(xbt_dict_new_homogeneous(nullptr))
-{}
-
 Config::~Config()
 {
   XBT_DEBUG("Frees cfg set %p", this);
-  xbt_dict_free(&this->options);
-  xbt_dict_free(&this->aliases);
-}
-
-inline
-xbt_dictelm_t Config::getDictElement(const char* name)
-{
-  // We are interested in the options dictelm:
-  xbt_dictelm_t res = xbt_dict_get_elm_or_null(options, name);
-  if (res)
-    return res;
-  // The aliases dict stores pointers to the options dictelm:
-  res = (xbt_dictelm_t) xbt_dict_get_or_null(aliases, name);
-  if (res)
-    XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->key);
-  return res;
+  for (auto const& elm : options)
+    delete elm.second;
+}
+
+inline ConfigurationElement* Config::getDictElement(const char* name)
+{
+  auto opt = options.find(name);
+  if (opt != options.end()) {
+    return opt->second;
+  } else {
+    auto als = aliases.find(name);
+    if (als != aliases.end()) {
+      ConfigurationElement* res = als->second;
+      if (warn_for_aliases)
+        XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->getKey().c_str());
+      return res;
+    } else {
+      throw simgrid::config::missing_key_error(std::string("Bad config key: ") + name);
+    }
+  }
 }
 
-inline
-ConfigurationElement& Config::operator[](const char* name)
+inline ConfigurationElement& Config::operator[](const char* name)
 {
-  xbt_dictelm_t elm = getDictElement(name);
-  if (elm == nullptr)
-    throw simgrid::config::missing_key_error(std::string("Bad config key, ") + name);
-  return *(ConfigurationElement*)elm->content;
+  return *(getDictElement(name));
 }
 
 void Config::alias(const char* realname, const char* aliasname)
 {
-  xbt_assert(this->getDictElement(aliasname) == nullptr, "Alias '%s' already.", aliasname);
-  xbt_dictelm_t element = this->getDictElement(realname);
+  xbt_assert(aliases.find(aliasname) == aliases.end(), "Alias '%s' already.", aliasname);
+  ConfigurationElement* element = this->getDictElement(realname);
   xbt_assert(element, "Cannot define an alias to the non-existing option '%s'.", realname);
-  xbt_dict_set(this->aliases, aliasname, element, nullptr);
+  this->aliases.insert({aliasname, element});
 }
 
 /** @brief Dump a config set for debuging purpose
@@ -362,57 +344,34 @@ void Config::alias(const char* realname, const char* aliasname)
  */
 void Config::dump(const char *name, const char *indent)
 {
-  xbt_dict_t dict = this->options;
-  xbt_dict_cursor_t cursor = nullptr;
-  simgrid::config::ConfigurationElement* variable = nullptr;
-  char *key = nullptr;
-
   if (name)
     printf("%s>> Dumping of the config set '%s':\n", indent, name);
 
-  xbt_dict_foreach(dict, cursor, key, variable)
-    printf("%s  %s: ()%s) %s", indent, key,
-      variable->getTypeName(),
-      variable->getStringValue().c_str());
+  for (auto const& elm : options)
+    printf("%s  %s: ()%s) %s", indent, elm.first.c_str(), elm.second->getTypeName(),
+           elm.second->getStringValue().c_str());
 
   if (name)
     printf("%s<< End of the config set '%s'\n", indent, name);
   fflush(stdout);
-
-  xbt_dict_cursor_free(&cursor);
 }
 
 /** @brief Displays the declared aliases and their description */
 void Config::showAliases()
 {
-  xbt_dict_cursor_t dict_cursor;
-  xbt_dictelm_t dictel;
-  char *name;
-  std::vector<char*> names;
-
-  xbt_dict_foreach(this->aliases, dict_cursor, name, dictel)
-    names.push_back(name);
-  std::sort(names.begin(), names.end());
-
-  for (auto name : names)
-    printf("   %s: %s\n", name, (*this)[name].getDescription().c_str());
+  bool old_warn_for_aliases = false;
+  std::swap(warn_for_aliases, old_warn_for_aliases);
+  for (auto const& elm : aliases)
+    printf("   %s: %s\n", elm.first.c_str(), (*this)[elm.first.c_str()].getDescription().c_str());
+  std::swap(warn_for_aliases, old_warn_for_aliases);
 }
 
 /** @brief Displays the declared options and their description */
 void Config::help()
 {
-  xbt_dict_cursor_t dict_cursor;
-  simgrid::config::ConfigurationElement* variable;
-  char *name;
-  std::vector<char*> names;
-
-  xbt_dict_foreach(this->options, dict_cursor, name, variable)
-    names.push_back(name);
-  std::sort(names.begin(), names.end());
-
-  for (auto name : names) {
-    variable = (simgrid::config::ConfigurationElement*) xbt_dict_get(this->options, name);
-    printf("   %s: %s\n", name, variable->getDescription().c_str());
+  for (auto const& elm : options) {
+    simgrid::config::ConfigurationElement* variable = this->options.at(elm.first);
+    printf("   %s: %s\n", elm.first.c_str(), variable->getDescription().c_str());
     printf("       Type: %s; ", variable->getTypeName());
     printf("Current value: %s\n", variable->getStringValue().c_str());
   }
@@ -499,8 +458,7 @@ void xbt_cfg_register_string(const char *name, const char *default_value, xbt_cf
     simgrid_config = xbt_cfg_new();
     atexit(sg_config_finalize);
   }
-  simgrid_config->registerOption<std::string>(name, desc,
-    default_value ? default_value : "", cb_set);
+  simgrid_config->registerOption<std::string>(name, desc, default_value ? default_value : "", cb_set);
 }
 
 void xbt_cfg_register_boolean(const char *name, const char*default_value,xbt_cfg_cb_t cb_set, const char *desc)
@@ -539,53 +497,37 @@ void xbt_cfg_set_parse(const char *options)
   if (not options || not strlen(options)) { /* nothing to do */
     return;
   }
-  char *optionlist_cpy = xbt_strdup(options);
 
   XBT_DEBUG("List to parse and set:'%s'", options);
-  char *option = optionlist_cpy;
-  while (1) {                   /* breaks in the code */
-    if (not option)
-      break;
-    char *name = option;
-    int len = strlen(name);
-    XBT_DEBUG("Still to parse and set: '%s'. len=%d; option-name=%ld", name, len, (long) (option - name));
-
-    /* Pass the value */
-    while (option - name <= (len - 1) && *option != ' ' && *option != '\n' && *option != '\t' && *option != ',') {
-      XBT_DEBUG("Take %c.", *option);
-      option++;
-    }
-    if (option - name == len) {
-      XBT_DEBUG("Boundary=EOL");
-      option = nullptr;            /* don't do next iteration */
-    } else {
-      XBT_DEBUG("Boundary on '%c'. len=%d;option-name=%ld", *option, len, (long) (option - name));
-      /* Pass the following blank chars */
-      *(option++) = '\0';
-      while (option - name < (len - 1) && (*option == ' ' || *option == '\n' || *option == '\t')) {
-        /*      fprintf(stderr,"Ignore a blank char.\n"); */
-        option++;
-      }
-      if (option - name == len - 1)
-        option = nullptr;          /* don't do next iteration */
-    }
-    XBT_DEBUG("parse now:'%s'; parse later:'%s'", name, option);
-
-    if (name[0] == ' ' || name[0] == '\n' || name[0] == '\t')
+  std::string optionlist(options);
+  while (not optionlist.empty()) {
+    XBT_DEBUG("Still to parse and set: '%s'", optionlist.c_str());
+
+    // skip separators
+    size_t pos = optionlist.find_first_not_of(" \t\n,");
+    optionlist.erase(0, pos);
+    // find option
+    pos              = optionlist.find_first_of(" \t\n,");
+    std::string name = optionlist.substr(0, pos);
+    optionlist.erase(0, pos);
+    XBT_DEBUG("parse now:'%s'; parse later:'%s'", name.c_str(), optionlist.c_str());
+
+    if (name.empty())
       continue;
-    if (not strlen(name))
-      break;
 
-    char *val = strchr(name, ':');
-    xbt_assert(val, "Option '%s' badly formatted. Should be of the form 'name:value'", name);
-    /* don't free(optionlist_cpy) if the assert fails, 'name' points inside it */
-    *(val++) = '\0';
+    pos = name.find(':');
+    xbt_assert(pos != std::string::npos, "Option '%s' badly formatted. Should be of the form 'name:value'",
+               name.c_str());
 
-    if (strncmp(name, "path", strlen("path")))
-      XBT_INFO("Configuration change: Set '%s' to '%s'", name, val);
+    std::string val = name.substr(pos + 1);
+    name.erase(pos);
+
+    const std::string path("path");
+    if (name.compare(0, path.length(), path) != 0)
+      XBT_INFO("Configuration change: Set '%s' to '%s'", name.c_str(), val.c_str());
 
     try {
-      (*simgrid_config)[name].setStringValue(val);
+      (*simgrid_config)[name.c_str()].setStringValue(val.c_str());
     }
     catch (simgrid::config::missing_key_error& e) {
       goto on_missing_key;
@@ -594,23 +536,17 @@ void xbt_cfg_set_parse(const char *options)
       goto on_exception;
     }
   }
-
-  free(optionlist_cpy);
   return;
 
   /* Do not THROWF from a C++ exception catching context, or some cleanups will be missing */
 on_missing_key:
-  free(optionlist_cpy);
   THROWF(not_found_error, 0, "Could not set variables %s", options);
-  return;
 on_exception:
-  free(optionlist_cpy);
   THROWF(unknown_error, 0, "Could not set variables %s", options);
 }
 
 // Horrible mess to translate C++ exceptions to C exceptions:
-// Exit from the catch blog (and do the correct exceptio cleaning)
-// before attempting to THROWF.
+// Exit from the catch block (and do the correct exception cleaning) before attempting to THROWF.
 #define TRANSLATE_EXCEPTIONS(...) \
   catch(simgrid::config::missing_key_error& e) { THROWF(not_found_error, 0, __VA_ARGS__); abort(); } \
   catch(...) { THROWF(not_found_error, 0, __VA_ARGS__); abort(); }
@@ -641,8 +577,7 @@ void xbt_cfg_setdefault_int(const char *key, int value)
     (*simgrid_config)[key].setDefaultValue<int>(value);
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to default integer %i",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to default integer %i", key, value);
 }
 
 /** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
@@ -656,8 +591,7 @@ void xbt_cfg_setdefault_double(const char *key, double value)
     (*simgrid_config)[key].setDefaultValue<double>(value);
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to default double %f",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to default double %f", key, value);
 }
 
 /** @brief Set a string value to \a name within \a cfg if it wasn't changed yet
@@ -671,8 +605,7 @@ void xbt_cfg_setdefault_string(const char *key, const char *value)
     (*simgrid_config)[key].setDefaultValue<std::string>(value ? value : "");
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to default string %s",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to default string %s", key, value);
 }
 
 /** @brief Set an boolean value to \a name within \a cfg if it wasn't changed yet
@@ -686,8 +619,7 @@ void xbt_cfg_setdefault_boolean(const char *key, const char *value)
     (*simgrid_config)[key].setDefaultValue<bool>(simgrid::config::parseBool(value));
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to default boolean %s",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to default boolean %s", key, value);
 }
 
 /** @brief Set an integer value to \a name within \a cfg
@@ -701,8 +633,7 @@ void xbt_cfg_set_int(const char *key, int value)
     (*simgrid_config)[key].setValue<int>(value);
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to integer %i",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to integer %i", key, value);
 }
 
 /** @brief Set or add a double value to \a name within \a cfg
@@ -716,8 +647,7 @@ void xbt_cfg_set_double(const char *key, double value)
     (*simgrid_config)[key].setValue<double>(value);
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to double %f",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to double %f", key, value);
 }
 
 /** @brief Set or add a string value to \a name within \a cfg
@@ -726,14 +656,13 @@ void xbt_cfg_set_double(const char *key, double value)
  * @param value the value to be added
  *
  */
-void xbt_cfg_set_string(const char *key, const char *value)
+void xbt_cfg_set_string(const char* key, const char* value)
 {
   try {
-    (*simgrid_config)[key].setValue<std::string>(value ? value : "");
+    (*simgrid_config)[key].setValue<std::string>(value);
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to string %s",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to string %s", key, value);
 }
 
 /** @brief Set or add a boolean value to \a name within \a cfg
@@ -747,8 +676,7 @@ void xbt_cfg_set_boolean(const char *key, const char *value)
     (*simgrid_config)[key].setValue<bool>(simgrid::config::parseBool(value));
     return;
   }
-  TRANSLATE_EXCEPTIONS("Could not set variable %s to boolean %s",
-    key, value);
+  TRANSLATE_EXCEPTIONS("Could not set variable %s to boolean %s", key, value);
 }
 
 
@@ -800,10 +728,10 @@ double xbt_cfg_get_double(const char *key)
  *
  * \warning the returned value is the actual content of the config set
  */
-char *xbt_cfg_get_string(const char *key)
+std::string xbt_cfg_get_string(const char* key)
 {
   try {
-    return (char*) (*simgrid_config)[key].getValue<std::string>().c_str();
+    return (*simgrid_config)[key].getValue<std::string>();
   }
   TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
 }
@@ -865,10 +793,8 @@ XBT_TEST_UNIT("use", test_config_use, "Data retrieving tests")
   xbt_test_add("Get a single value");
   {
     /* get_single_value */
-    int ival;
-
     xbt_cfg_set_parse("peername:toto:42 speed:42");
-    ival = xbt_cfg_get_int("speed");
+    int ival = xbt_cfg_get_int("speed");
     if (ival != 42)
       xbt_test_fail("Speed value = %d, I expected 42", ival);
   }
index eac5f1a..7cdedb8 100644 (file)
@@ -9,15 +9,20 @@
 /* At some point we should use https://github.com/google/googletest instead */
 
 #include "src/internal_config.h"
-#include <stdio.h>
+#include <algorithm>
+#include <iostream>
+#include <string>
+#include <vector>
 
+#include <xbt/cunit.h>
 #include <xbt/ex.hpp>
-#include "xbt/sysdep.h"         /* bvprintf */
-#include "xbt/cunit.h"
-#include "xbt/dynar.h"
+#include <xbt/string.hpp>
+
+/* output stream to use everywhere */
+static std::ostream& _xbt_test_out = std::cerr;
 
 /* collection of all suites */
-static xbt_dynar_t _xbt_test_suites = nullptr;
+static std::vector<xbt_test_suite_t> _xbt_test_suites;
 /* global statistics */
 static int _xbt_test_nb_tests = 0;
 static int _xbt_test_test_failed = 0;
@@ -38,515 +43,413 @@ 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 {
-  char *text;
-  const char *file;
-  int line;
-} *xbt_test_log_t;
+class s_xbt_test_log {
+public:
+  s_xbt_test_log(std::string text, std::string file, int line)
+      : text_(std::move(text)), file_(std::move(file)), line_(line)
+  {
+  }
+  void dump() const;
+
+  std::string text_;
+  std::string file_;
+  int line_;
+};
 
-static void xbt_test_log_dump(xbt_test_log_t log)
+void s_xbt_test_log::dump() const
 {
-  if (log)
-    fprintf(stderr, "      log %p(%s:%d)=%s\n", log, log->file, log->line, log->text);
-  else
-    fprintf(stderr, "      log=nullptr\n");
+  _xbt_test_out << "      log " << this << "(" << file_ << ":" << line_ << ")=" << text_ << "\n";
 }
 
 /* test suite test check */
-typedef struct s_xbt_test_test {
-  char *title;
-  int failed;
-  int expected_failure;
-  int ignored;
-  const char *file;
-  int line;
-  xbt_dynar_t logs;
-} *xbt_test_test_t;
-
-static void xbt_test_test_dump(xbt_test_test_t test)
+class s_xbt_test_test {
+public:
+  s_xbt_test_test(std::string title, std::string file, int line)
+      : title_(std::move(title)), file_(std::move(file)), line_(line)
+  {
+  }
+  void dump() const;
+
+  std::string title_;
+  bool failed_           = false;
+  bool expected_failure_ = false;
+  bool ignored_          = false;
+  std::string file_;
+  int line_;
+  std::vector<s_xbt_test_log> logs_;
+};
+
+void s_xbt_test_test::dump() const
 {
-  if (test) {
-    xbt_test_log_t log;
-    unsigned int it_log;
-    fprintf(stderr, "    test %p(%s:%d)=%s (%s)\n", test, test->file, test->line, test->title,
-            test->failed ? "failed" : "not failed");
-    xbt_dynar_foreach(test->logs, it_log, log)
-        xbt_test_log_dump(log);
-  } else
-    fprintf(stderr, "    test=nullptr\n");
+  _xbt_test_out << "    test " << this << "(" << file_ << ":" << line_ << ")=" << title_ << " ("
+                << (failed_ ? "failed" : "not failed") << ")\n";
+  for (s_xbt_test_log const& log : this->logs_)
+    log.dump();
 }
 
 /* test suite test unit */
-struct s_xbt_test_unit {
-  int enabled;
-  char *name;
-  char *title;
-  ts_test_cb_t func;
-  const char *file;
-  int line;
-  xbt_dynar_t tests;            /* of xbt_test_test_t */
-
-  int nb_tests;
-  int test_failed;
-  int test_ignore;
-  int test_expect;
+class s_xbt_test_unit {
+public:
+  s_xbt_test_unit(std::string name, std::string title, ts_test_cb_t func)
+      : name_(std::move(name)), title_(std::move(title)), func_(func)
+  {
+  }
+  void dump() const;
+
+  std::string name_;
+  std::string title_;
+  ts_test_cb_t func_;
+  std::vector<s_xbt_test_test> tests_;
+
+  bool enabled_    = true;
+  int nb_tests_    = 0;
+  int test_failed_ = 0;
+  int test_ignore_ = 0;
+  int test_expect_ = 0;
 };
 
-static void xbt_test_unit_dump(xbt_test_unit_t unit)
+void s_xbt_test_unit::dump() const
 {
-  if (unit) {
-    fprintf(stderr, "  UNIT %s: %s (%s)\n", unit->name, unit->title, (unit->enabled ? "enabled" : "disabled"));
-    if (unit->enabled) {
-      xbt_test_test_t test;
-      unsigned int it_test;
-      xbt_dynar_foreach(unit->tests, it_test, test)
-          xbt_test_test_dump(test);
-    }
-  } else {
-    fprintf(stderr, "  unit=nullptr\n");
+  _xbt_test_out << "  UNIT " << name_ << ": " << title_ << " (" << (this->enabled_ ? "enabled" : "disabled") << ")\n";
+  if (this->enabled_) {
+    for (s_xbt_test_test const& test : this->tests_)
+      test.dump();
   }
 }
 
 /* test suite */
-struct s_xbt_test_suite {
-  int enabled;
-  const char *name;
-  char *title;
-  xbt_dynar_t units;            /* of xbt_test_unit_t */
-
-  int nb_tests;
-  int nb_units;
-  int test_failed;
-  int test_ignore;
-  int test_expect;
-  int unit_failed;
-  int unit_ignore;
-  int unit_disabled;
+class s_xbt_test_suite {
+public:
+  s_xbt_test_suite(std::string name, std::string title) : name_(std::move(name)), title_(std::move(title)) {}
+  void dump() const;
+  void push(s_xbt_test_unit unit) { units_.emplace_back(std::move(unit)); }
+  int run(int verbosity);
+
+  std::string name_;
+  std::string title_;
+  std::vector<s_xbt_test_unit> units_;
+
+  bool enabled_      = true;
+  int nb_tests_      = 0;
+  int nb_units_      = 0;
+  int test_failed_   = 0;
+  int test_ignore_   = 0;
+  int test_expect_   = 0;
+  int unit_failed_   = 0;
+  int unit_ignore_   = 0;
+  int unit_disabled_ = 0;
 };
 
-/* destroy test suite */
-static void xbt_test_suite_free(void *s)
-{
-  xbt_test_suite_t suite = *(xbt_test_suite_t *) s;
-
-  if (suite == nullptr)
-    return;
-  xbt_dynar_free(&suite->units);
-  free(suite->title);
-  free(suite);
-}
-
-static void xbt_test_unit_free(void *unit)
-{
-  xbt_test_unit_t u = *(xbt_test_unit_t *) unit;
-  /* name is static */
-  free(u->title);
-  xbt_dynar_free(&u->tests);
-  free(u);
-}
-
-static void xbt_test_test_free(void *test)
-{
-  xbt_test_test_t t = *(xbt_test_test_t *) test;
-  free(t->title);
-  xbt_dynar_free(&(t->logs));
-  free(t);
-}
-
-static void xbt_test_log_free(void *log)
-{
-  xbt_test_log_t l = *(xbt_test_log_t *) log;
-  free(l->text);
-  free(l);
-}
-
-/** @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);
-  va_list ap;
-
-  if (_xbt_test_suites == nullptr)
-    _xbt_test_suites = xbt_dynar_new(sizeof(xbt_test_suite_t), xbt_test_suite_free);
-
-  va_start(ap, fmt);
-  suite->title = bvprintf(fmt, ap);
-  suite->units = xbt_dynar_new(sizeof(xbt_test_unit_t), &xbt_test_unit_free);
-  va_end(ap);
-  suite->name = name;
-  suite->enabled = 1;
-
-  xbt_dynar_push(_xbt_test_suites, &suite);
-
-  return suite;
-}
-
 /** @brief retrieve a testsuite from name, or create a new one */
 xbt_test_suite_t xbt_test_suite_by_name(const char *name, const char *fmt, ...)
 {
-  xbt_test_suite_t suite;
-  char *bufname;
-  va_list ap;
-
-  if (_xbt_test_suites) {
-    unsigned int it_suite;
-    xbt_dynar_foreach(_xbt_test_suites, it_suite, suite)
-      if (not strcmp(suite->name, name))
-        return suite;
-  }
+  auto res = std::find_if(begin(_xbt_test_suites), end(_xbt_test_suites),
+                          [&name](xbt_test_suite_t const& suite) { return suite->name_ == name; });
+  if (res != end(_xbt_test_suites))
+    return *res;
 
+  va_list ap;
   va_start(ap, fmt);
-  bufname = bvprintf(fmt, ap);
+  xbt_test_suite_t suite = new s_xbt_test_suite(name, simgrid::xbt::string_vprintf(fmt, ap));
   va_end(ap);
-  suite = xbt_test_suite_new(name, bufname, nullptr);
-  free(bufname);
+
+  _xbt_test_suites.push_back(suite);
 
   return suite;
 }
 
-void xbt_test_suite_dump(xbt_test_suite_t suite)
+void s_xbt_test_suite::dump() const
 {
-  if (suite) {
-    fprintf(stderr, "TESTSUITE %s: %s (%s)\n", suite->name, suite->title, suite->enabled ? "enabled" : "disabled");
-    if (suite->enabled) {
-      xbt_test_unit_t unit;
-      unsigned int it_unit;
-      xbt_dynar_foreach(suite->units, it_unit, unit)
-          xbt_test_unit_dump(unit);
-    }
-  } else {
-    fprintf(stderr, "TESTSUITE IS NULL!\n");
+  _xbt_test_out << "TESTSUITE " << name_ << ": " << title_ << " (" << (this->enabled_ ? "enabled" : "disabled")
+                << ")\n";
+  if (this->enabled_) {
+    for (s_xbt_test_unit const& unit : this->units_)
+      unit.dump();
   }
 }
 
 /* add test case to test suite */
 void xbt_test_suite_push(xbt_test_suite_t suite, const char *name, ts_test_cb_t func, const char *fmt, ...)
 {
-  xbt_test_unit_t unit;
-  va_list ap;
-
   xbt_assert(suite);
   xbt_assert(func);
   xbt_assert(fmt);
 
-  unit = xbt_new0(struct s_xbt_test_unit, 1);
+  va_list ap;
   va_start(ap, fmt);
-  unit->title = bvprintf(fmt, ap);
+  s_xbt_test_unit unit(name, simgrid::xbt::string_vprintf(fmt, ap), func);
   va_end(ap);
-  unit->name = (char *) name;
-  unit->func = func;
-  unit->file = nullptr;
-  unit->line = 0;
-  unit->enabled = 1;
-  unit->tests = xbt_dynar_new(sizeof(xbt_test_test_t), xbt_test_test_free);
-
-  xbt_dynar_push(suite->units, &unit);
+  suite->push(unit);
 }
 
 /* run test one suite */
-static int xbt_test_suite_run(xbt_test_suite_t suite, int verbosity)
+int s_xbt_test_suite::run(int verbosity)
 {
-  xbt_test_unit_t unit;
-  xbt_test_test_t test;
-  xbt_test_log_t log;
-
-  if (suite == nullptr)
-    return 0;
-
   /* suite title pretty-printing */
-  char suite_title[81];
-  int suite_len = strlen(suite->title);
-
-  xbt_assert(suite_len < 68, "suite title \"%s\" too long (%d should be less than 68", suite->title, suite_len);
-
-  suite_title[0] = ' ';
-  for (int i = 1; i < 79; i++)
-    suite_title[i] = '=';
-  suite_title[79]  = '\n';
-  suite_title[80]  = '\0';
-
-  snprintf(suite_title + 40 - (suite_len + 4) / 2, 81 - (40 - (suite_len + 4) / 2), "[ %s ]", suite->title);
-  suite_title[40 + (suite_len + 5) / 2] = '=';
-  if (not suite->enabled)
-    snprintf(suite_title + 70, 11, " DISABLED ");
-  fprintf(stderr, "\n%s\n", suite_title);
-
-  if (suite->enabled) {
+  int suite_len = this->title_.length();
+  xbt_assert(suite_len < 68, "suite title \"%s\" too long (%d should be less than 68", this->title_.c_str(), suite_len);
+
+  std::string suite_title = " ";
+  suite_title.resize(40 - (suite_len + 4) / 2, '=');
+  suite_title += std::string("[ ") + this->title_ + " ]";
+  suite_title.resize(79, '=');
+  if (not this->enabled_)
+    suite_title.replace(70, std::string::npos, " DISABLED");
+  _xbt_test_out << "\n" << suite_title << "\n";
+
+  if (this->enabled_) {
     /* iterate through all tests */
-    unsigned int it_unit;
-    xbt_dynar_foreach(suite->units, it_unit, unit) {
+    for (s_xbt_test_unit& unit : this->units_) {
       /* init unit case counters */
-      unit->nb_tests = 0;
-      unit->test_ignore = 0;
-      unit->test_failed = 0;
-      unit->test_expect = 0;
+      unit.nb_tests_    = 0;
+      unit.test_ignore_ = 0;
+      unit.test_failed_ = 0;
+      unit.test_expect_ = 0;
 
       /* display unit title */
-      char* cp = bprintf(" Unit: %s ......................................"
-                         "......................................",
-                         unit->title);
-      cp[70] = '\0';
-      fprintf(stderr, "%s", cp);
-      free(cp);
+      std::string cp = std::string(" Unit: ") + unit.title_ + " ";
+      cp.resize(70, '.');
+      _xbt_test_out << cp;
 
       /* run the test case function */
-      _xbt_test_current_unit = unit;
-      if (unit->enabled)
-        unit->func();
+      _xbt_test_current_unit = &unit;
+      if (unit.enabled_)
+        unit.func_();
 
       /* iterate through all performed tests to determine status */
-      unsigned int it_test;
-      xbt_dynar_foreach(unit->tests, it_test, test) {
-        if (test->ignored) {
-          unit->test_ignore++;
+      for (s_xbt_test_test const& test : unit.tests_) {
+        if (test.ignored_) {
+          unit.test_ignore_++;
         } else {
-          unit->nb_tests++;
-
-          if (test->failed && not test->expected_failure)
-            unit->test_failed++;
-          if (not test->failed && test->expected_failure)
-            unit->test_failed++;
-          if (test->expected_failure)
-            unit->test_expect++;
+          unit.nb_tests_++;
+
+          if ((test.failed_ && not test.expected_failure_) || (not test.failed_ && test.expected_failure_))
+            unit.test_failed_++;
+          if (test.expected_failure_)
+            unit.test_expect_++;
         }
       }
       /* Display whether this unit went well */
-      if (unit->test_failed > 0 || unit->test_expect || (verbosity && unit->nb_tests > 0)) {
+      if (unit.test_failed_ > 0 || unit.test_expect_ || (verbosity && unit.nb_tests_ > 0)) {
         /* some tests failed (or were supposed to), so do detailed reporting of test case */
-        if (unit->test_failed > 0) {
-          fprintf(stderr, ".. failed\n");
-        } else if (unit->nb_tests) {
-          fprintf(stderr, "...... ok\n");       /* successful, but show about expected */
+        if (unit.test_failed_ > 0) {
+          _xbt_test_out << ".. failed\n";
+        } else if (unit.nb_tests_) {
+          _xbt_test_out << "...... ok\n"; /* successful, but show about expected */
         } else {
-          fprintf(stderr, ".... skip\n");       /* shouldn't happen, but I'm a bit lost with this logic */
+          _xbt_test_out << ".... skip\n"; /* shouldn't happen, but I'm a bit lost with this logic */
         }
-        xbt_dynar_foreach(unit->tests, it_test, test) {
-          const char* file = (test->file != nullptr ? test->file : unit->file);
-          int line         = (test->line != 0 ? test->line : unit->line);
-          const char* resname;
-          if (test->ignored)
+        for (s_xbt_test_test const& test : unit.tests_) {
+          std::string file = test.file_;
+          int line         = test.line_;
+          std::string resname;
+          if (test.ignored_)
             resname = " SKIP";
-          else if (test->expected_failure) {
-            if (test->failed)
+          else if (test.expected_failure_) {
+            if (test.failed_)
               resname = "EFAIL";
             else
               resname = "EPASS";
           } else {
-            if (test->failed)
+            if (test.failed_)
               resname = " FAIL";
             else
               resname = " PASS";
           }
-          fprintf(stderr, "      %s: %s [%s:%d]\n", resname, test->title, file, line);
-
-          if ((test->expected_failure && not test->failed) || (not test->expected_failure && test->failed)) {
-            unsigned int it_log;
-            xbt_dynar_foreach(test->logs, it_log, log) {
-              file = (log->file != nullptr ? log->file : file);
-              line = (log->line != 0 ? log->line : line);
-              fprintf(stderr, "             %s:%d: %s\n", file, line, log->text);
+          _xbt_test_out << "      " << resname << ": " << test.title_ << " [" << file << ":" << line << "]\n";
+
+          if ((test.expected_failure_ && not test.failed_) || (not test.expected_failure_ && test.failed_)) {
+            for (s_xbt_test_log const& log : test.logs_) {
+              file = (log.file_.empty() ? file : log.file_);
+              line = (log.line_ == 0 ? line : log.line_);
+              _xbt_test_out << "             " << file << ":" << line << ": " << log.text_ << "\n";
             }
           }
         }
-        fprintf(stderr, "    Summary: %d of %d tests failed", unit->test_failed, unit->nb_tests);
-        if (unit->test_ignore) {
-          fprintf(stderr, " (%d tests ignored)\n", unit->test_ignore);
+        _xbt_test_out << "    Summary: " << unit.test_failed_ << " of " << unit.nb_tests_ << " tests failed";
+        if (unit.test_ignore_) {
+          _xbt_test_out << " (" << unit.test_ignore_ << " tests ignored)\n";
         } else {
-          fprintf(stderr, "\n");
+          _xbt_test_out << "\n";
         }
-      } else if (not unit->enabled) {
-        fprintf(stderr, " disabled\n"); /* no test were run */
-      } else if (unit->nb_tests) {
-        fprintf(stderr, "...... ok\n"); /* successful */
+      } else if (not unit.enabled_) {
+        _xbt_test_out << " disabled\n"; /* no test were run */
+      } else if (unit.nb_tests_) {
+        _xbt_test_out << "...... ok\n"; /* successful */
       } else {
-        fprintf(stderr, ".... skip\n"); /* no test were run */
+        _xbt_test_out << ".... skip\n"; /* no test were run */
       }
 
       /* Accumulate test counts into the suite */
-      suite->nb_tests += unit->nb_tests;
-      suite->test_failed += unit->test_failed;
-      suite->test_ignore += unit->test_ignore;
-      suite->test_expect += unit->test_expect;
+      this->nb_tests_ += unit.nb_tests_;
+      this->test_failed_ += unit.test_failed_;
+      this->test_ignore_ += unit.test_ignore_;
+      this->test_expect_ += unit.test_expect_;
 
-      _xbt_test_nb_tests += unit->nb_tests;
-      _xbt_test_test_failed += unit->test_failed;
-      _xbt_test_test_ignore += unit->test_ignore;
-      _xbt_test_test_expect += unit->test_expect;
+      _xbt_test_nb_tests += unit.nb_tests_;
+      _xbt_test_test_failed += unit.test_failed_;
+      _xbt_test_test_ignore += unit.test_ignore_;
+      _xbt_test_test_expect += unit.test_expect_;
 
       /* What's the conclusion of this test anyway? */
-      if (unit->nb_tests) {
-        suite->nb_units++;
-        if (unit->test_failed)
-          suite->unit_failed++;
-      } else if (not unit->enabled) {
-        suite->unit_disabled++;
+      if (unit.nb_tests_) {
+        this->nb_units_++;
+        if (unit.test_failed_)
+          this->unit_failed_++;
+      } else if (not unit.enabled_) {
+        this->unit_disabled_++;
       } else {
-        suite->unit_ignore++;
+        this->unit_ignore_++;
       }
     }
   }
-  _xbt_test_nb_units += suite->nb_units;
-  _xbt_test_unit_failed += suite->unit_failed;
-  _xbt_test_unit_ignore += suite->unit_ignore;
-  _xbt_test_unit_disabled += suite->unit_disabled;
+  _xbt_test_nb_units += this->nb_units_;
+  _xbt_test_unit_failed += this->unit_failed_;
+  _xbt_test_unit_ignore += this->unit_ignore_;
+  _xbt_test_unit_disabled += this->unit_disabled_;
 
-  if (suite->nb_units) {
+  if (this->nb_units_) {
     _xbt_test_nb_suites++;
-    if (suite->test_failed)
+    if (this->test_failed_)
       _xbt_test_suite_failed++;
-  } else if (not suite->enabled) {
+  } else if (not this->enabled_) {
     _xbt_test_suite_disabled++;
   } else {
     _xbt_test_suite_ignore++;
   }
 
   /* print test suite summary */
-  if (suite->enabled) {
-    int first = 1; /* for result pretty printing */
-
-    fprintf(stderr," =====================================================================%s\n",
-            (suite->nb_units ? (suite->unit_failed ? "== FAILED" : "====== OK") :
-                               (suite->unit_disabled ? " DISABLED" : "==== SKIP")));
-    fprintf(stderr, " Summary: Units: %.0f%% ok (%d units: ", suite->nb_units
-            ? ((1 - (double) suite->unit_failed / (double) suite->nb_units) * 100.0) : 100.0, suite->nb_units);
-
-    if (suite->nb_units != suite->unit_failed) {
-      fprintf(stderr, "%s%d ok", (first ? "" : ", "), suite->nb_units - suite->unit_failed);
-      first = 0;
+  if (this->enabled_) {
+    bool first = true; /* for result pretty printing */
+
+    _xbt_test_out << " ====================================================================="
+                  << (this->nb_units_ ? (this->unit_failed_ ? "== FAILED" : "====== OK")
+                                      : (this->unit_disabled_ ? " DISABLED" : "==== SKIP"))
+                  << "\n";
+    _xbt_test_out.setf(std::ios::fixed);
+    _xbt_test_out.precision(0);
+    _xbt_test_out << " Summary: Units: "
+                  << (this->nb_units_ ? ((1 - (double)this->unit_failed_ / (double)this->nb_units_) * 100.0) : 100.0)
+                  << "% ok (" << this->nb_units_ << " units: ";
+    if (this->nb_units_ != this->unit_failed_) {
+      _xbt_test_out << (first ? "" : ", ") << (this->nb_units_ - this->unit_failed_) << " ok";
+      first = false;
     }
-    if (suite->unit_failed) {
-      fprintf(stderr, "%s%d failed", (first ? "" : ", "), suite->unit_failed);
-      first = 0;
+    if (this->unit_failed_) {
+      _xbt_test_out << (first ? "" : ", ") << this->unit_failed_ << " failed";
+      first = false;
     }
-    if (suite->unit_ignore) {
-      fprintf(stderr, "%s%d ignored", (first ? "" : ", "), suite->unit_ignore);
-      first = 0;
+    if (this->unit_ignore_) {
+      _xbt_test_out << (first ? "" : ", ") << this->unit_ignore_ << " ignored";
+      first = false;
     }
-    if (suite->unit_disabled) {
-      fprintf(stderr, "%s%d disabled", (first ? "" : ", "), suite->unit_disabled);
+    if (this->unit_disabled_) {
+      _xbt_test_out << (first ? "" : ", ") << this->unit_disabled_ << " disabled";
     }
-    fprintf(stderr, ")\n          Tests: %.0f%% ok (%d tests: ", suite->nb_tests
-            ? ((1 - (double) suite->test_failed / (double) suite->nb_tests) * 100.0) : 100.0, suite->nb_tests);
-
-    first = 1;
-    if (suite->nb_tests != suite->test_failed) {
-      fprintf(stderr, "%s%d ok", (first ? "" : ", "), suite->nb_tests - suite->test_failed);
-      first = 0;
+    _xbt_test_out << ")\n          Tests: "
+                  << (this->nb_tests_ ? ((1 - (double)this->test_failed_ / (double)this->nb_tests_) * 100.0) : 100.0)
+                  << "% ok (" << this->nb_tests_ << " tests: ";
+    first = true;
+    if (this->nb_tests_ != this->test_failed_) {
+      _xbt_test_out << (first ? "" : ", ") << (this->nb_tests_ - this->test_failed_) << " ok";
+      first = false;
     }
-    if (suite->test_failed) {
-      fprintf(stderr, "%s%d failed", (first ? "" : ", "), suite->test_failed);
-      first = 0;
+    if (this->test_failed_) {
+      _xbt_test_out << (first ? "" : ", ") << this->test_failed_ << " failed";
+      first = false;
     }
-    if (suite->test_ignore) {
-      fprintf(stderr, "%s%d ignored", (first ? "" : "; "), suite->test_ignore);
-      first = 0;
+    if (this->test_ignore_) {
+      _xbt_test_out << (first ? "" : "; ") << this->test_ignore_ << " ignored";
+      first = false;
     }
-    if (suite->test_expect) {
-      fprintf(stderr, "%s%d expected to fail", (first ? "" : "; "), suite->test_expect);
+    if (this->test_expect_) {
+      _xbt_test_out << (first ? "" : "; ") << this->test_expect_ << " expected to fail";
     }
-    fprintf(stderr, ")\n");
+    _xbt_test_out << ")\n";
   }
-  return suite->unit_failed;
+  return this->unit_failed_;
 }
 
 static void apply_selection(char *selection)
 {
-  /* for the parsing */
-  char *sel = selection;
-  int done = 0;
-  char dir[1024];               /* the directive */
-  /* iterators */
-  unsigned int it_suite;
-  xbt_test_suite_t suite;
-  xbt_test_unit_t unit;
-  unsigned int it_unit;
-
-  char suitename[512];
-  char unitname[512];
-
   if (not selection || selection[0] == '\0')
     return;
 
-  /*printf("Test selection: %s\n", selection); */
+  /* for the parsing */
+  std::string sel = selection;
+  bool done       = false;
+  std::string dir; /* the directive */
+  std::string suitename;
+  std::string unitname;
 
   /* First apply the selection */
+  size_t p0 = 0;
   while (not done) {
-    int enabling = 1;
+    bool enabling = true;
 
-    char *p = strchr(sel, ',');
-    if (p) {
-      strncpy(dir, sel, p - sel);
-      dir[p - sel] = '\0';
-      sel = p + 1;
+    size_t p = sel.find(',', p0);
+    if (p != std::string::npos) {
+      dir = sel.substr(p0, p - p0);
+      p0  = p + 1;
     } else {
-      strncpy(dir, sel,1024);
-      done = 1;
+      dir  = sel.substr(p0);
+      done = true;
     }
 
     if (dir[0] == '-') {
-      enabling = 0;
-      memmove(dir, dir + 1, strlen(dir));
+      enabling = false;
+      dir.erase(0, 1);
     }
     if (dir[0] == '+') {
-      enabling = 1;
-      memmove(dir, dir + 1, strlen(dir));
+      enabling = true;
+      dir.erase(0, 1);
     }
 
-    p = strchr(dir, ':');
-    if (p) {
-      strncpy(unitname, p + 1,512);
-      strncpy(suitename, dir, p - dir);
-      suitename[p - dir] = '\0';
+    p = dir.find(':');
+    if (p != std::string::npos) {
+      suitename = dir.substr(0, p);
+      unitname  = dir.substr(p + 1);
     } else {
-      strncpy(suitename, dir,512);
-      unitname[0] = '\0';
+      suitename = dir;
+      unitname  = "";
     }
 
     /* Deal with the specific case of 'all' pseudo serie */
-    if (not strcmp("all", suitename)) {
-      xbt_assert(unitname[0] == '\0', "The 'all' pseudo-suite does not accept any unit specification\n");
+    if (suitename == "all") {
+      xbt_assert(unitname.empty(), "The 'all' pseudo-suite does not accept any unit specification\n");
 
-      xbt_dynar_foreach(_xbt_test_suites, it_suite, suite) {
-        xbt_dynar_foreach(suite->units, it_unit, unit) {
-          unit->enabled = enabling;
+      for (xbt_test_suite_t& suite : _xbt_test_suites) {
+        for (s_xbt_test_unit& unit : suite->units_) {
+          unit.enabled_ = enabling;
         }
-        suite->enabled = enabling;
+        suite->enabled_ = enabling;
       }
     } else {
-      unsigned int it;
-      for (it = 0; it < xbt_dynar_length(_xbt_test_suites); it++) {
-        xbt_test_suite_t thissuite =
-            xbt_dynar_get_as(_xbt_test_suites, it, xbt_test_suite_t);
-        if (not strcmp(suitename, thissuite->name)) {
+      bool suitefound = false;
+      for (xbt_test_suite_t& thissuite : _xbt_test_suites) {
+        if (suitename == thissuite->name_) {
           /* Do not disable the whole suite when we just want to disable a child */
-          if (enabling || (unitname[0] == '\0'))
-            thissuite->enabled = enabling;
+          if (enabling || unitname.empty())
+            thissuite->enabled_ = enabling;
 
-          if (unitname[0] == '\0') {
-            xbt_dynar_foreach(thissuite->units, it_unit, unit) {
-              unit->enabled = enabling;
+          if (unitname.empty()) {
+            for (s_xbt_test_unit& unit : thissuite->units_) {
+              unit.enabled_ = enabling;
             }
           } else {              /* act on one child only */
-            unsigned int it2_unit;
-            /* search it, first (we won't reuse it for external loop which gets broken) */
-            for (it2_unit = 0;
-                 it2_unit < xbt_dynar_length(thissuite->units);
-                 it2_unit++) {
-              xbt_test_unit_t thisunit = xbt_dynar_get_as(thissuite->units, it2_unit, xbt_test_unit_t);
-              if (not strcmp(thisunit->name, unitname)) {
-                thisunit->enabled = enabling;
-                break;
-              }
-            }                   /* search relevant unit */
-            xbt_assert(it2_unit != xbt_dynar_length(thissuite->units),
-                "Suite '%s' has no unit of name '%s'. Cannot apply the selection\n", suitename, unitname);
+            /* search relevant unit */
+            auto unit = std::find_if(begin(thissuite->units_), end(thissuite->units_),
+                                     [&unitname](s_xbt_test_unit const& unit) { return unit.name_ == unitname; });
+            if (unit == end(thissuite->units_))
+              xbt_die("Suite '%s' has no unit of name '%s'. Cannot apply the selection\n", suitename.c_str(),
+                      unitname.c_str());
+            unit->enabled_ = enabling;
           }                     /* act on childs (either all or one) */
-
+          suitefound = true;
           break;                /* found the relevant serie. We are happy */
         }
       }                         /* search relevant series */
-      xbt_assert(it != xbt_dynar_length(_xbt_test_suites),
-                 "No suite of name '%s' found. Cannot apply the selection\n", suitename);
+      xbt_assert(suitefound, "No suite of name '%s' found. Cannot apply the selection\n", suitename.c_str());
     }
   }
 }
@@ -555,14 +458,11 @@ void xbt_test_dump(char *selection)
 {
   apply_selection(selection);
 
-  if (_xbt_test_suites) {
-    unsigned int it_suite;
-    xbt_test_suite_t suite;
-
-    xbt_dynar_foreach(_xbt_test_suites, it_suite, suite)
-        xbt_test_suite_dump(suite);
+  if (not _xbt_test_suites.empty()) {
+    for (xbt_test_suite_t suite : _xbt_test_suites)
+      suite->dump();
   } else {
-    printf(" No suite defined.");
+    _xbt_test_out << " No suite defined.";
   }
 }
 
@@ -570,67 +470,73 @@ int xbt_test_run(char *selection, int verbosity)
 {
   apply_selection(selection);
 
-  if (_xbt_test_suites) {
-    unsigned int it_suite;
-    xbt_test_suite_t suite;
-    int first = 1;
+  if (not _xbt_test_suites.empty()) {
+    bool first = true;
 
     /* Run all the suites */
-    xbt_dynar_foreach(_xbt_test_suites, it_suite, suite)
-      xbt_test_suite_run(suite, verbosity);
+    for (xbt_test_suite_t& suite : _xbt_test_suites)
+      if (suite)
+        suite->run(verbosity);
 
     /* Display some more statistics */
-    fprintf(stderr, "\n\n TOTAL: Suites: %.0f%% ok (%d suites: ",_xbt_test_nb_suites
-            ? ((1 - (double) _xbt_test_suite_failed / (double) _xbt_test_nb_suites) * 100.0)
-            : 100.0, _xbt_test_nb_suites);
+    _xbt_test_out.setf(std::ios::fixed);
+    _xbt_test_out.precision(0);
+    _xbt_test_out << "\n\n TOTAL: Suites: "
+                  << (_xbt_test_nb_suites ? ((1 - (double)_xbt_test_suite_failed / (double)_xbt_test_nb_suites) * 100.0)
+                                          : 100.0)
+                  << "% ok (" << _xbt_test_nb_suites << " suites: ";
     if (_xbt_test_nb_suites != _xbt_test_suite_failed) {
-      fprintf(stderr, "%d ok", _xbt_test_nb_suites - _xbt_test_suite_failed);
-      first = 0;
+      _xbt_test_out << (_xbt_test_nb_suites - _xbt_test_suite_failed) << " ok";
+      first = false;
     }
     if (_xbt_test_suite_failed) {
-      fprintf(stderr, "%s%d failed", (first ? "" : ", "), _xbt_test_suite_failed);
-      first = 0;
+      _xbt_test_out << (first ? "" : ", ") << _xbt_test_suite_failed << " failed";
+      first = false;
     }
 
     if (_xbt_test_suite_ignore) {
-      fprintf(stderr, "%s%d ignored", (first ? "" : ", "), _xbt_test_suite_ignore);
+      _xbt_test_out << (first ? "" : ", ") << _xbt_test_suite_ignore << " ignored";
     }
-    fprintf(stderr, ")\n        Units:  %.0f%% ok (%d units: ", _xbt_test_nb_units
-            ? ((1 - (double) _xbt_test_unit_failed / (double) _xbt_test_nb_units) * 100.0) : 100.0, _xbt_test_nb_units);
-    first = 1;
+    _xbt_test_out << ")\n        Units:  "
+                  << (_xbt_test_nb_units ? ((1 - (double)_xbt_test_unit_failed / (double)_xbt_test_nb_units) * 100.0)
+                                         : 100.0)
+                  << "% ok (" << _xbt_test_nb_units << " units: ";
+    first = true;
     if (_xbt_test_nb_units != _xbt_test_unit_failed) {
-      fprintf(stderr, "%d ok", _xbt_test_nb_units - _xbt_test_unit_failed);
-      first = 0;
+      _xbt_test_out << (_xbt_test_nb_units - _xbt_test_unit_failed) << " ok";
+      first = false;
     }
     if (_xbt_test_unit_failed) {
-      fprintf(stderr, "%s%d failed", (first ? "" : ", "), _xbt_test_unit_failed);
-      first = 0;
+      _xbt_test_out << (first ? "" : ", ") << _xbt_test_unit_failed << " failed";
+      first = false;
     }
     if (_xbt_test_unit_ignore) {
-      fprintf(stderr, "%s%d ignored", (first ? "" : ", "), _xbt_test_unit_ignore);
+      _xbt_test_out << (first ? "" : ", ") << _xbt_test_unit_ignore << " ignored";
     }
-    fprintf(stderr, ")\n        Tests:  %.0f%% ok (%d tests: ", _xbt_test_nb_tests
-            ? ((1 - (double) _xbt_test_test_failed / (double) _xbt_test_nb_tests) * 100.0) : 100.0, _xbt_test_nb_tests);
-    first = 1;
+    _xbt_test_out << ")\n        Tests:  "
+                  << (_xbt_test_nb_tests ? ((1 - (double)_xbt_test_test_failed / (double)_xbt_test_nb_tests) * 100.0)
+                                         : 100.0)
+                  << "% ok (" << _xbt_test_nb_tests << " tests: ";
+    first = true;
     if (_xbt_test_nb_tests != _xbt_test_test_failed) {
-      fprintf(stderr, "%d ok", _xbt_test_nb_tests - _xbt_test_test_failed);
-      first = 0;
+      _xbt_test_out << (_xbt_test_nb_tests - _xbt_test_test_failed) << " ok";
+      first = false;
     }
     if (_xbt_test_test_failed) {
-      fprintf(stderr, "%s%d failed", (first ? "" : ", "), _xbt_test_test_failed);
-      first = 0;
+      _xbt_test_out << (first ? "" : ", ") << _xbt_test_test_failed << " failed";
+      first = false;
     }
     if (_xbt_test_test_ignore) {
-      fprintf(stderr, "%s%d ignored", (first ? "" : ", "), _xbt_test_test_ignore);
-      first = 0;
+      _xbt_test_out << (first ? "" : ", ") << _xbt_test_test_ignore << " ignored";
+      first = false;
     }
     if (_xbt_test_test_expect) {
-      fprintf(stderr, "%s%d expected to fail", (first ? "" : ", "), _xbt_test_test_expect);
+      _xbt_test_out << (first ? "" : ", ") << _xbt_test_test_expect << " expected to fail";
     }
 
-    fprintf(stderr, ")\n");
+    _xbt_test_out << ")\n";
   } else {
-    fprintf(stderr, "No unit to run!\n");
+    _xbt_test_out << "No unit to run!\n";
     _xbt_test_unit_failed++;
   }
   return _xbt_test_unit_failed;
@@ -638,7 +544,9 @@ int xbt_test_run(char *selection, int verbosity)
 
 void xbt_test_exit()
 {
-  xbt_dynar_free(&_xbt_test_suites);
+  for (xbt_test_suite_t suite : _xbt_test_suites)
+    delete suite;
+  _xbt_test_suites.clear();
 }
 
 /* annotate test case with test */
@@ -648,17 +556,9 @@ 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);
   va_start(ap, fmt);
-  test->title = bvprintf(fmt, ap);
+  unit->tests_.emplace_back(simgrid::xbt::string_vprintf(fmt, ap), file, line);
   va_end(ap);
-  test->failed = 0;
-  test->expected_failure = 0;
-  test->ignored = 0;
-  test->file = file;
-  test->line = line;
-  test->logs = xbt_dynar_new(sizeof(xbt_test_log_t), xbt_test_log_free);
-  xbt_dynar_push(unit->tests, &test);
 }
 
 /* annotate test case with log message and failure */
@@ -666,21 +566,16 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...)
 {
   xbt_test_unit_t unit = _xbt_test_current_unit;
   xbt_assert(unit);
-  xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
-      "Test failed even before being declared (broken unit: %s)", unit->title);
+  xbt_assert(not _xbt_test_current_unit->tests_.empty(), "Test failed even before being declared (broken unit: %s)",
+             unit->title_.c_str());
 
+  s_xbt_test_test& test = unit->tests_.back();
   va_list ap;
-  xbt_test_log_t log = xbt_new(struct s_xbt_test_log, 1);
   va_start(ap, fmt);
-  log->text = bvprintf(fmt, ap);
+  test.logs_.emplace_back(simgrid::xbt::string_vprintf(fmt, ap), file, line);
   va_end(ap);
-  log->file = file;
-  log->line = line;
-
-  xbt_test_test_t test = xbt_dynar_getlast_as(unit->tests, xbt_test_test_t);
-  xbt_dynar_push(test->logs, &log);
 
-  test->failed = 1;
+  test.failed_ = true;
 }
 
 void xbt_test_exception(xbt_ex_t e)
@@ -690,18 +585,17 @@ void xbt_test_exception(xbt_ex_t e)
 
 void xbt_test_expect_failure()
 {
-  xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
-      "Cannot expect the failure of a test before declaring it (broken unit: %s)", _xbt_test_current_unit->title);
-  xbt_test_test_t test = xbt_dynar_getlast_as(_xbt_test_current_unit->tests, xbt_test_test_t);
-  test->expected_failure = 1;
+  xbt_assert(not _xbt_test_current_unit->tests_.empty(),
+             "Cannot expect the failure of a test before declaring it (broken unit: %s)",
+             _xbt_test_current_unit->title_.c_str());
+  _xbt_test_current_unit->tests_.back().expected_failure_ = true;
 }
 
 void xbt_test_skip()
 {
-  xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
-      "Test skipped even before being declared (broken unit: %s)", _xbt_test_current_unit->title);
-  xbt_test_test_t test = xbt_dynar_getlast_as(_xbt_test_current_unit->tests, xbt_test_test_t);
-  test->ignored = 1;
+  xbt_assert(not _xbt_test_current_unit->tests_.empty(), "Test skipped even before being declared (broken unit: %s)",
+             _xbt_test_current_unit->title_.c_str());
+  _xbt_test_current_unit->tests_.back().ignored_ = true;
 }
 
 /* annotate test case with log message only */
@@ -709,19 +603,13 @@ void _xbt_test_log(const char *file, int line, const char *fmt, ...)
 {
   xbt_test_unit_t unit = _xbt_test_current_unit;
   xbt_assert(unit);
-  xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
-      "Test logged into even before being declared (broken test unit: %s)", unit->title);
+  xbt_assert(not _xbt_test_current_unit->tests_.empty(),
+             "Test logged into even before being declared (broken test unit: %s)", unit->title_.c_str());
 
   va_list ap;
-  xbt_test_log_t log = xbt_new(struct s_xbt_test_log, 1);
   va_start(ap, fmt);
-  log->text = bvprintf(fmt, ap);
+  unit->tests_.back().logs_.emplace_back(simgrid::xbt::string_vprintf(fmt, ap), file, line);
   va_end(ap);
-  log->file = file;
-  log->line = line;
-
-  xbt_test_test_t test = xbt_dynar_getlast_as(unit->tests, xbt_test_test_t);
-  xbt_dynar_push(test->logs, &log);
 }
 
 #ifdef SIMGRID_TEST
index 5f53f43..2d2520d 100644 (file)
@@ -6,8 +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 <string.h>
-#include <stdio.h>
+#include <cstdio>
+#include <cstring>
 
 #include "xbt/dict.h"
 #include "xbt/ex.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt, "Dictionaries provide the same functionalities as hash tables");
 
-/**
- * \brief Constructor
- * \return pointer to the destination
- * \see xbt_dict_new_homogenous(), xbt_dict_free()
- *
- * Creates and initialize a new dictionary with a default hashtable size.
- * The dictionary is heterogeneous: each element can have a different free function.
- */
 xbt_dict_t xbt_dict_new()
 {
   XBT_WARN("Function xbt_dict_new() will soon be dropped. Please switch to xbt_dict_new_homogeneous()");
@@ -111,7 +103,7 @@ static void xbt_dict_rehash(xbt_dict_t dict)
   newsize--;
   dict->table_size = newsize;
   dict->table = currcell;
-  XBT_DEBUG("REHASH (%d->%d)", oldsize, newsize);
+  XBT_DEBUG("REHASH (%u->%u)", oldsize, newsize);
 
   for (unsigned i = 0; i < oldsize; i++, currcell++) {
     if (*currcell == nullptr) /* empty cell */
@@ -562,11 +554,11 @@ void xbt_dict_postexit()
 }
 
 #ifdef SIMGRID_TEST
-#include <time.h>
+#include "src/internal_config.h"
 #include "xbt.h"
 #include "xbt/ex.h"
+#include <ctime>
 #include <xbt/ex.hpp>
-#include "src/internal_config.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict);
 
@@ -630,7 +622,6 @@ static void debugged_remove(xbt_dict_t head, const char* key)
 {
   xbt_test_add("Remove '%s'", key);
   xbt_dict_remove(head, key);
-  /*  xbt_dict_dump(head,(void (*)(void*))&printf); */
 }
 
 static void traverse(xbt_dict_t head)
@@ -646,7 +637,7 @@ static void traverse(xbt_dict_t head)
     } else {
       xbt_test_log("Seen #%d:  %s", ++i, key);
     }
-    xbt_test_assert(not data || not strcmp(key, data), "Key(%s) != value(%s). Aborting", key, data);
+    xbt_test_assert(key && data && strcmp(key, data) == 0, "Key(%s) != value(%s). Aborting", key, data);
   }
 }
 
@@ -758,8 +749,7 @@ XBT_TEST_UNIT("basic", test_dict_basic, "Basic usage: change, retrieve and trave
   /* RETRIEVE */
   xbt_test_add("Search 123");
   char* data = (char*)xbt_dict_get(head, "123");
-  xbt_test_assert(data);
-  xbt_test_assert(not strcmp("123", data));
+  xbt_test_assert(data && strcmp("123", data) == 0);
 
   search_not_found(head, "Can't be found");
   search_not_found(head, "123 Can't be found");
@@ -775,8 +765,6 @@ XBT_TEST_UNIT("basic", test_dict_basic, "Basic usage: change, retrieve and trave
   xbt_test_add("Traverse the resulting dictionary");
   traverse(head);
 
-  /*  xbt_dict_dump(head,(void (*)(void*))&printf); */
-
   xbt_test_add("Free the dictionary twice");
   xbt_dict_free(&head);
   xbt_dict_free(&head);
@@ -872,7 +860,7 @@ XBT_TEST_UNIT("nulldata", test_dict_nulldata, "nullptr data management")
         xbt_test_log("Seen:  %s", key);
       }
 
-      if (not strcmp(key, "null"))
+      if (key && strcmp(key, "null") == 0)
         found = 1;
     }
     xbt_test_assert(found, "the key 'null', associated to nullptr is not found");
@@ -904,7 +892,6 @@ XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
     xbt_test_log("Fill the struct, count its elems and frees the structure");
     xbt_test_log("using 1000 elements with %d chars long randomized keys.", SIZEOFKEY);
     xbt_dict_t head = xbt_dict_new_homogeneous(free);
-    /* if (i%10) printf("."); else printf("%d",i/10); fflush(stdout); */
     for (int j = 0; j < 1000; j++) {
       char* data = nullptr;
       char* key  = (char*)xbt_malloc(SIZEOFKEY);
@@ -913,7 +900,6 @@ XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
         for (int k         = 0; k < SIZEOFKEY - 1; k++)
           key[k] = rand() % ('z' - 'a') + 'a';
         key[SIZEOFKEY - 1] = '\0';
-        /*      printf("[%d %s]\n",j,key); */
         data = (char*) xbt_dict_get_or_null(head, key);
       } while (data != nullptr);
 
@@ -923,7 +909,6 @@ XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
 
       count(head, j + 1);
     }
-    /*    xbt_dict_dump(head,(void (*)(void*))&printf); */
     traverse(head);
     xbt_dict_free(&head);
     xbt_dict_free(&head);
@@ -937,7 +922,6 @@ XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
     snprintf(key,10, "%d", j);
     xbt_dict_set(head, key, key, nullptr);
   }
-  /*xbt_dict_dump(head,(void (*)(void*))&printf); */
 
   xbt_test_add("Count the elements (retrieving the key and data for each)");
   xbt_test_log("There is %d elements", countelems(head));
@@ -945,7 +929,6 @@ XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
   xbt_test_add("Search my %d elements 20 times", NB_ELM);
   char* key = (char*)xbt_malloc(10);
   for (int i = 0; i < 20; i++) {
-    /* if (i%10) printf("."); else printf("%d",i/10); fflush(stdout); */
     for (int j = 0; j < NB_ELM; j++) {
       snprintf(key,10, "%d", j);
       void* data = xbt_dict_get(head, key);
index 38c7930..574a4e6 100644 (file)
@@ -1,6 +1,6 @@
 /* dict_cursor - iterators over dictionaries                               */
 
-/* Copyright (c) 2004-2014. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -19,9 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict_cursor, xbt_dict, "To traverse dictiona
 /* Don't add or remove entries to the dict while traversing !!!             */
 /*###########################################################################*/
 
-#undef xbt_dict_CURSOR_DEBUG
-/*#define xbt_dict_CURSOR_DEBUG 1*/
-
 /** @brief Creator
  *  @param dict the dict
  */
index cef1231..c6a637c 100644 (file)
@@ -1,6 +1,6 @@
 /* a generic DYNamic ARray implementation.                                  */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -119,7 +119,7 @@ extern "C" void xbt_dynar_free_data(xbt_dynar_t dynar)
 {
   xbt_dynar_reset(dynar);
   if (dynar)
-    free(dynar->data);
+    xbt_free(dynar->data);
 }
 
 /** @brief Destructor of the structure not touching to the content
@@ -133,8 +133,8 @@ extern "C" void xbt_dynar_free_container(xbt_dynar_t* dynar)
 {
   if (dynar && *dynar) {
     xbt_dynar_t d = *dynar;
-    free(d->data);
-    free(d);
+    xbt_free(d->data);
+    xbt_free(d);
     *dynar = nullptr;
   }
 }
@@ -614,53 +614,6 @@ extern "C" xbt_dynar_t xbt_dynar_sort_strings(xbt_dynar_t dynar)
   return dynar; // to enable functional uses
 }
 
-/** @brief Sorts a dynar according to their color assuming elements can have only three colors.
- * Since there are only three colors, it is linear and much faster than a classical sort.
- * See for example http://en.wikipedia.org/wiki/Dutch_national_flag_problem
- *
- * \param dynar the dynar to sort
- * \param color the color function of type (int (compar_fn*) (void*) (void*)). The return value of color is assumed to
- *        be 0, 1, or 2.
- *
- * At the end of the call, elements with color 0 are at the beginning of the dynar, elements with color 2 are at the
- * end and elements with color 1 are in the middle.
- *
- * Remark: if the elements stored in the dynar are structures, the color function has to retrieve the field to sort
- * first.
- */
-extern "C" void xbt_dynar_three_way_partition(xbt_dynar_t const dynar, int_f_pvoid_t color)
-{
-  unsigned long int i;
-  unsigned long int p = -1;
-  unsigned long int q = dynar->used;
-  const unsigned long elmsize = dynar->elmsize;
-  char* tmp[elmsize];
-  void *elm;
-
-  for (i = 0; i < q;) {
-    void *elmi = _xbt_dynar_elm(dynar, i);
-    int colori = color(elmi);
-
-    if (colori == 1) {
-      ++i;
-    } else {
-      if (colori == 0) {
-        ++p;
-        elm = _xbt_dynar_elm(dynar, p);
-        ++i;
-      } else {                  /* colori == 2 */
-        --q;
-        elm = _xbt_dynar_elm(dynar, q);
-      }
-      if (elm != elmi) {
-        memcpy(tmp,  elm,  elmsize);
-        memcpy(elm,  elmi, elmsize);
-        memcpy(elmi, tmp,  elmsize);
-      }
-    }
-  }
-}
-
 /** @brief Transform a dynar into a nullptr terminated array.
  *
  *  \param dynar the dynar to transform
@@ -674,7 +627,7 @@ extern "C" void* xbt_dynar_to_array(xbt_dynar_t dynar)
   xbt_dynar_shrink(dynar, 1);
   memset(xbt_dynar_push_ptr(dynar), 0, dynar->elmsize);
   res = dynar->data;
-  free(dynar);
+  xbt_free(dynar);
   return res;
 }
 
@@ -776,7 +729,6 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
 
   for (int cpt = 0; cpt < NB_ELEM; cpt++)
     *(int *) xbt_dynar_get_ptr(d, cpt) = cpt;
-  /*     xbt_dynar_set(d,cpt,&cpt); */
 
   for (int cpt = 0; cpt < NB_ELEM; cpt++)
     *(int *) xbt_dynar_get_ptr(d, cpt) = cpt;
@@ -1073,7 +1025,7 @@ XBT_TEST_UNIT("string", test_dynar_string, "Dynars of strings")
     snprintf(buf,1023, "%d", cpt);
     xbt_dynar_shift(d, &s2);
     xbt_test_assert(not strcmp(buf, s2), "The retrieved value is not the same than the injected one (%s!=%s)", buf, s2);
-    free(s2);
+    xbt_free(s2);
   }
   xbt_dynar_free(&d);           /* This code is used both as example and as regression test, so we try to */
   xbt_dynar_free(&d);           /* free the struct twice here to check that it's ok, but freeing  it only once */
@@ -1096,7 +1048,7 @@ XBT_TEST_UNIT("string", test_dynar_string, "Dynars of strings")
     snprintf(buf,1023, "%d", cpt);
     xbt_dynar_pop(d, &s2);
     xbt_test_assert(not strcmp(buf, s2), "The retrieved value is not the same than the injected one (%s!=%s)", buf, s2);
-    free(s2);
+    xbt_free(s2);
   }
   /* 4. Free the resources */
   xbt_dynar_free(&d);           /* This code is used both as example and as regression test, so we try to */
@@ -1121,21 +1073,21 @@ XBT_TEST_UNIT("string", test_dynar_string, "Dynars of strings")
     xbt_dynar_shift(d, &s2);
     xbt_test_assert(not strcmp(buf, s2),
                     "The retrieved value is not the same than the injected one at the begining (%s!=%s)", buf, s2);
-    free(s2);
+    xbt_free(s2);
   }
   for (int cpt = (NB_ELEM / 5) - 1; cpt >= 0; cpt--) {
     snprintf(buf,1023, "%d", cpt);
     xbt_dynar_shift(d, &s2);
     xbt_test_assert(not strcmp(buf, s2),
                     "The retrieved value is not the same than the injected one in the middle (%s!=%s)", buf, s2);
-    free(s2);
+    xbt_free(s2);
   }
   for (int cpt = NB_ELEM / 2; cpt < NB_ELEM; cpt++) {
     snprintf(buf,1023, "%d", cpt);
     xbt_dynar_shift(d, &s2);
     xbt_test_assert(not strcmp(buf, s2),
                     "The retrieved value is not the same than the injected one at the end (%s!=%s)", buf, s2);
-    free(s2);
+    xbt_free(s2);
   }
   xbt_dynar_free(&d);           /* This code is used both as example and as regression test, so we try to */
   xbt_dynar_free(&d);           /* free the struct twice here to check that it's ok, but freeing  it only once */
@@ -1152,7 +1104,7 @@ XBT_TEST_UNIT("string", test_dynar_string, "Dynars of strings")
     snprintf(buf,1023, "%d", cpt);
     xbt_dynar_remove_at(d, 2 * (NB_ELEM / 5), &s2);
     xbt_test_assert(not strcmp(buf, s2), "Remove a bad value. Got %s, expected %s", s2, buf);
-    free(s2);
+    xbt_free(s2);
   }
   xbt_dynar_free(&d);           /* end_of_doxygen */
 }
index 9115b40..c439569 100644 (file)
@@ -41,8 +41,8 @@
 /* The extensions made for the SimGrid project can either be distributed    */
 /* under the same license, or under the LGPL v2.1                           */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
 
 #include <xbt/backtrace.hpp>
 #include "src/internal_config.h"           /* execinfo when available */
 #include "xbt/log.hpp"
 #include "xbt/backtrace.h"
 #include "xbt/backtrace.hpp"
-#include "xbt/str.h"
 #include "src/xbt_modinter.h"       /* backtrace initialization headers */
 
 #include "simgrid/sg_config.h"  /* Configuration mechanism of SimGrid */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ex, xbt, "Exception mechanism");
 
+// Don't define ~xbt_ex() in ex.hpp.  It is defined here to ensure that there is an unique definition of xt_ex in
+// libsimgrid, but not in libsimgrid-java.  Otherwise, sone tests are broken (seen with clang/libc++ on freebsd).
+xbt_ex::~xbt_ex() = default;
+
 void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func)
 {
   xbt_ex e(simgrid::xbt::ThrowPoint(file, line, func), message);
-  free(message);
+  xbt_free(message);
   e.category = errcat;
   e.value = value;
   throw e;
@@ -113,8 +116,8 @@ const char *xbt_ex_catname(xbt_errcat_t cat)
 }
 
 #ifdef SIMGRID_TEST
-#include <stdio.h>
 #include "xbt/ex.h"
+#include <cstdio>
 #include <xbt/ex.hpp>
 
 XBT_TEST_SUITE("xbt_ex", "Exception Handling");
@@ -186,7 +189,7 @@ XBT_TEST_UNIT("variables", test_variables, "variable value preservation")
 {
   xbt_ex_t ex;
   int r1;
-  int XBT_ATTRIB_UNUSED r2;
+  XBT_ATTRIB_UNUSED int r2;
   int v1;
   int v2;
 
index 5483ae5..a1c6d0b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005-2016. The SimGrid Team.
+/* Copyright (c) 2005-2017. The SimGrid Team.
  * All rights reserved. */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,6 +15,8 @@
 #include <mutex>
 
 #include <xbt/backtrace.hpp>
+#include <xbt/config.hpp>
+#include <xbt/ex.hpp>
 #include <xbt/exception.hpp>
 #include <xbt/log.h>
 #include <xbt/log.hpp>
@@ -47,7 +49,7 @@ void logException(
       XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what());
 
     // Do we have a backtrace?
-    if (with_context != nullptr) {
+    if (with_context != nullptr && not xbt_cfg_get_boolean("exception/cutpath")) {
       auto backtrace = simgrid::xbt::resolveBacktrace(
         with_context->backtrace().data(), with_context->backtrace().size());
       for (std::string const& s : backtrace)
@@ -76,6 +78,10 @@ void logException(
 
 static void showBacktrace(std::vector<xbt_backtrace_location_t>& bt)
 {
+  if (xbt_cfg_get_boolean("exception/cutpath")) {
+    XBT_LOG(xbt_log_priority_critical, "Display of current backtrace disabled by --cfg=exception/cutpath.");
+    return;
+  }
   std::vector<std::string> res = resolveBacktrace(&bt[0], bt.size());
   XBT_LOG(xbt_log_priority_critical, "Current backtrace:");
   for (std::string const& s : res)
index 42c211f..121a842 100644 (file)
@@ -1,6 +1,6 @@
 /* a generic graph library.                                                 */
 
-/* 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
 #include "xbt/graph.h"
 #include "graph_private.h"
 #include "xbt/dict.h"
-#include "xbt/heap.h"
-#include "xbt/str.h"
-#include "xbt/file.h"
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_graph, xbt, "Graph");
@@ -227,11 +225,10 @@ void xbt_floyd_algorithm(xbt_graph_t g, double *adj, double *d, xbt_node_t * p)
   for (k = 0; k < n; k++) {
     for (i = 0; i < n; i++) {
       for (j = 0; j < n; j++) {
-        if ((d[i*n+k] > -1) && (d[k*n+j] > -1)) {
-          if ((d[i*n+j] < 0) || (d[i*n+j] > d[i*n+k] + d[k*n+j])) {
-            d[i*n+j] = d[i*n+k] + d[k*n+j];
-            p[i*n+j] = p[k*n+j];
-          }
+        if (d[i * n + k] > -1 && d[k * n + j] > -1 &&
+            (d[i * n + j] < 0 || d[i * n + j] > d[i * n + k] + d[k * n + j])) {
+          d[i * n + j] = d[i * n + k] + d[k * n + j];
+          p[i * n + j] = p[k * n + j];
         }
       }
     }
diff --git a/src/xbt/heap.c b/src/xbt/heap.c
deleted file mode 100644 (file)
index 5bd06f3..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/* a generic and efficient heap                                             */
-
-/* Copyright (c) 2004-2005, 2007-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. */
-
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "heap_private.h"
-
-#include <stdio.h>
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_heap, xbt, "Heap");
-
-static void xbt_heap_max_heapify(xbt_heap_t H, int i);
-static void xbt_heap_increase_key(xbt_heap_t H, int i);
-
-/** @addtogroup XBT_heap
- *  \brief This section describes the API to generic heap with O(log(n)) access.
- */
-
-/**
- * @brief Creates a new heap.
- * \param init_size initial size of the heap
- * \param free_func function to call on each element when you want to free the whole heap (or NULL if nothing to do).
- *
- * Creates a new heap.
- */
-inline xbt_heap_t xbt_heap_new(int init_size, void_f_pvoid_t const free_func)
-{
-  xbt_heap_t H = xbt_new0(struct xbt_heap, 1);
-  H->size = init_size;
-  H->count = 0;
-  H->items = (xbt_heap_item_t) xbt_new0(struct xbt_heap_item, init_size);
-  H->free = free_func;
-  return H;
-}
-
-/**
- * @brief Set the update callback function.
- * @param H the heap we're working on
- * \param update_callback function to call on each element to update its index when needed.
- */
-inline void xbt_heap_set_update_callback(xbt_heap_t H, void (*update_callback) (void*, int))
-{
-  H->update_callback = update_callback;
-}
-
-/**
- * @brief kilkil a heap and its content
- * @param H poor victim
- */
-void xbt_heap_free(xbt_heap_t H)
-{
-  if (!H)
-    return;
-
-  if (H->free)
-    for (int i = 0; i < H->count; i++)
-      H->free(H->items[i].content);
-  free(H->items);
-  free(H);
-}
-
-/**
- * @brief returns the number of elements in the heap
- * @param H the heap we're working on
- * @return the number of elements in the heap
- */
-inline int xbt_heap_size(xbt_heap_t H)
-{
-  return (H->count);
-}
-
-/**
- * @brief Add an element into the heap.
- * \param H the heap we're working on
- * \param content the object you want to add to the heap
- * \param key the key associated to this object
- *
- * The element with the smallest key is automatically moved at the top of the heap.
- */
-void xbt_heap_push(xbt_heap_t H, void *content, double key)
-{
-  H->count += 1;
-  int count = H->count;
-
-  int size = H->size;
-  xbt_heap_item_t item;
-
-  if (count > size) {
-    H->size = (size << 1) + 1;
-    H->items = (void *) xbt_realloc(H->items, (H->size) * sizeof(struct xbt_heap_item));
-  }
-
-  item = &(H->items[count - 1]);
-  item->key = key;
-  item->content = content;
-  xbt_heap_increase_key(H, count - 1);
-  XBT_DEBUG("Heap has now %d elements and max elem is %g",xbt_heap_size(H),xbt_heap_maxkey(H));
-}
-
-/**
- * @brief Extracts from the heap and returns the element with the smallest key.
- * \param H the heap we're working on
- * \return the element with the smallest key
- *
- * Extracts from the heap and returns the element with the smallest key. The element with the next smallest key is
- * automatically moved at the top of the heap.
- */
-void *xbt_heap_pop(xbt_heap_t H)
-{
-  xbt_heap_item_t items = H->items;
-  int size = H->size;
-  void *max;
-
-  if (H->count == 0)
-    return NULL;
-
-  XBT_DEBUG("Heap has %d elements before extraction and max elem was %g",xbt_heap_size(H),xbt_heap_maxkey(H));
-
-  max = CONTENT(H, 0);
-
-  items[0] = items[(H->count) - 1];
-  (H->count)--;
-  xbt_heap_max_heapify(H,0);
-  if (H->count < size >> 2 && size > 16) {
-    size = (size >> 1) + 1;
-    H->items = (void *) xbt_realloc(items, size * sizeof(struct xbt_heap_item));
-    H->size = size;
-  }
-
-  if (H->update_callback)
-    H->update_callback(max, -1);
-  return max;
-}
-
-/**
- * @brief Extracts from the heap and returns the element at position i.
- * \param H the heap we're working on
- * \param i  element position
- * \return the element at position i if ok, NULL otherwise
- *
- * Extracts from the heap and returns the element at position i. The heap is automatically reordered.
- */
-void *xbt_heap_remove(xbt_heap_t H, int i)
-{
-  XBT_DEBUG("Heap has %d elements: extracting element %d",xbt_heap_size(H),i);
-
-  if ((i < 0) || (i > H->count - 1))
-    return NULL;
-  /* put element i at head */
-  if (i > 0) {
-    KEY(H, i) = MIN_KEY_VALUE;
-    xbt_heap_increase_key(H, i);
-  }
-
-  return xbt_heap_pop(H);
-}
-/** @brief Remove an arbitrary element from the heap
- *  @param H the heap we're working on
- *  @param content the object you want to add to the heap
- *  @param key the key associated to this object
- */
-void xbt_heap_rm_elm(xbt_heap_t H, void *content, double key) {
-  int i=0;
-  while (i < H->count && (KEY(H, i) != key || CONTENT(H, i) != content))
-    i++;
-  if (i == H->count)
-    return;
-  xbt_heap_remove(H,i);
-}
-
-/**
- * @brief Updates an element of the heap with a new value.
- * \param H the heap we're working on
- * \param i  element position
- * \param key new value for the element
- *
- * Updates an element of the heap with a new value.
- */
-void xbt_heap_update(xbt_heap_t H, int i, double key)
-{
-  XBT_DEBUG("Heap has %d elements: updating element %d : was %1.12f to %1.12f ",xbt_heap_size(H),i,KEY(H, i), key);
-
-  if ((i < 0) || (i > H->count - 1) || key == KEY(H, i))
-    return ;
-
-  if(key< KEY(H, i)){
-    KEY(H, i)=key;
-    xbt_heap_increase_key(H, i);
-  }else{
-    KEY(H, i)=key;
-    xbt_heap_max_heapify(H,i);
-  }
-}
-
-/**
- * @brief returns the smallest key in the heap (heap unchanged)
- * \param H the heap we're working on
- *
- * \return the smallest key in the heap without modifying the heap.
- */
-inline double xbt_heap_maxkey(xbt_heap_t H)
-{
-  xbt_assert(H->count != 0, "Empty heap");
-  return KEY(H, 0);
-}
-
-/**
- * @brief returns the value associated to the smallest key in the heap (heap unchanged)
- * \param H the heap we're working on
- *
- * \return the value associated to the smallest key in the heap
- * without modifying the heap.
- */
-void *xbt_heap_maxcontent(xbt_heap_t H)
-{
-  xbt_assert(H->count != 0, "Empty heap");
-  return CONTENT(H, 0);
-}
-
-/* <<<< private >>>>
- * \param H the heap we're working on
- *
- * Restores the heap property once an element has been deleted.
- */
-static void xbt_heap_max_heapify(xbt_heap_t H, int index)
-{
-  int i = index;
-  int count = H->count;
-  xbt_heap_item_t items = H->items;
-
-  while (1) {
-    int greatest = i;
-    int l = LEFT(i);
-    int r = l + 1;
-    if (l < count && items[l].key < items[i].key)
-      greatest = l;
-    if (r < count && items[r].key < items[greatest].key)
-      greatest = r;
-    if (greatest != i) {
-      struct xbt_heap_item tmp = items[i];
-      items[i] = items[greatest];
-      items[greatest] = tmp;
-      if (H->update_callback)
-        H->update_callback(items[i].content, i);
-      i = greatest;
-    } else {
-      if (H->update_callback)
-        H->update_callback(items[i].content, i);
-      return;
-    }
-  }
-}
-
-/* <<<< private >>>>
- * \param H the heap we're working on
- * \param i an item position in the heap
- *
- * Moves up an item at position i to its correct position. Works only when called from xbt_heap_push.
- * Do not use otherwise.
- */
-static void xbt_heap_increase_key(xbt_heap_t H, int i)
-{
-  xbt_heap_item_t items = H->items;
-  int p = PARENT(i);
-  while (i > 0 && items[p].key > items[i].key) {
-    struct xbt_heap_item tmp = items[i];
-    items[i] = items[p];
-    items[p] = tmp;
-    if (H->update_callback)
-      H->update_callback(items[i].content, i);
-    i = p;
-    p = PARENT(i);
-  }
-  if (H->update_callback)
-    H->update_callback(items[i].content, i);
-}
diff --git a/src/xbt/heap_private.h b/src/xbt/heap_private.h
deleted file mode 100644 (file)
index aeed373..0000000
+++ /dev/null
@@ -1,36 +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 XBT_HEAP_PRIVATE_H
-#define XBT_HEAP_PRIVATE_H
-
-#include <float.h>
-#include <xbt/dynar.h>
-#include <xbt/heap.h>
-
-typedef struct xbt_heap_item {
-  void *content;
-  double key;
-} s_xbt_heap_item_t;
-typedef s_xbt_heap_item_t* xbt_heap_item_t;
-
-typedef struct xbt_heap {
-  int size;
-  int count;
-  s_xbt_heap_item_t* items; /* array of structs */
-  void_f_pvoid_t free;
-  void (*update_callback) (void *, int);
-} s_xbt_heap_t;
-
-#define PARENT(i)  (i >> 1)
-#define LEFT(i)    (i << 1)
-#define RIGHT(i)   ((i << 1) + 1)
-
-#define KEY(H,i)     ((H->items)[i]).key
-#define CONTENT(H,i) ((H->items)[i]).content
-
-#define MIN_KEY_VALUE -DBL_MAX
-
-#endif
index df31ba7..767f883 100644 (file)
@@ -1,6 +1,6 @@
 /* log - a generic logging facility in the spirit of log4j                  */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -108,10 +108,10 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(xbt_dict_elm);
   XBT_LOG_CONNECT(xbt_dyn);
   XBT_LOG_CONNECT(xbt_ex);
+  XBT_LOG_CONNECT(xbt_automaton);
   XBT_LOG_CONNECT(xbt_backtrace);
   XBT_LOG_CONNECT(xbt_exception);
   XBT_LOG_CONNECT(xbt_graph);
-  XBT_LOG_CONNECT(xbt_heap);
   XBT_LOG_CONNECT(xbt_mallocator);
   XBT_LOG_CONNECT(xbt_memory_map);
   XBT_LOG_CONNECT(xbt_parmap);
@@ -199,6 +199,8 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(s4u_channel);
   XBT_LOG_CONNECT(s4u_comm);
   XBT_LOG_CONNECT(s4u_file);
+  XBT_LOG_CONNECT(s4u_link);
+  XBT_LOG_CONNECT(s4u_vm);
 
   /* sg */
   XBT_LOG_CONNECT(sg_host);
@@ -220,6 +222,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(simix_host);
   XBT_LOG_CONNECT(simix_io);
   XBT_LOG_CONNECT(simix_kernel);
+  XBT_LOG_CONNECT(simix_mailbox);
   XBT_LOG_CONNECT(simix_network);
   XBT_LOG_CONNECT(simix_process);
   XBT_LOG_CONNECT(simix_popping);
@@ -244,6 +247,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(ns3);
 #endif
   XBT_LOG_CONNECT(surf_parse);
+  XBT_LOG_CONNECT(surf_plugin_load);
   XBT_LOG_CONNECT(surf_route);
   XBT_LOG_CONNECT(surf_routing_generic);
   XBT_LOG_CONNECT(surf_route_cluster);
@@ -273,19 +277,12 @@ static void xbt_log_help_categories(void);
 void xbt_log_init(int *argc, char **argv)
 {
   unsigned help_requested = 0;  /* 1: logs; 2: categories */
-  int i;
-  int j;
-  char *opt;
-
-  /* uncomment to set the LOG category to debug directly */
-  //    _XBT_LOGV(log).threshold = xbt_log_priority_debug;
-
-  xbt_log_connect_categories();
+  int j                   = 1;
 
   /* Set logs and init log submodule */
-  for (j = i = 1; i < *argc; i++) {
+  for (int i = 1; i < *argc; i++) {
     if (!strncmp(argv[i], "--log=", strlen("--log="))) {
-      opt = strchr(argv[i], '=');
+      char* opt = strchr(argv[i], '=');
       opt++;
       xbt_log_control_set(opt);
       XBT_DEBUG("Did apply '%s' as log setting", opt);
@@ -338,7 +335,7 @@ void xbt_log_postexit(void)
   log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
 }
 
- /* Size of the static string in which we  build the log string */
+/* Size of the static string in which we build the log string */
 #define XBT_LOG_STATIC_BUFFER_SIZE 2048
 /* Minimum size of the dynamic string in which we build the log string
    (should be greater than XBT_LOG_STATIC_BUFFER_SIZE) */
@@ -352,63 +349,67 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
   xbt_assert(ev->priority < sizeof(xbt_log_priority_names), "Priority %d is greater than the biggest allowed value",
              ev->priority);
 
-  do {
+  while (1) {
     xbt_log_appender_t appender = cat->appender;
 
-    if (!appender)
-      continue;                 /* No appender, try next */
+    if (appender != NULL) {
+      xbt_assert(cat->layout, "No valid layout for the appender of category %s", cat->name);
 
-    xbt_assert(cat->layout, "No valid layout for the appender of category %s", cat->name);
-
-    /* First, try with a static buffer */
-    if (XBT_LOG_STATIC_BUFFER_SIZE) {
+      /* First, try with a static buffer */
+      int done = 0;
       char buff[XBT_LOG_STATIC_BUFFER_SIZE];
-      ev->buffer = buff;
+      ev->buffer      = buff;
       ev->buffer_size = sizeof buff;
       va_start(ev->ap, fmt);
-      int done = cat->layout->do_layout(cat->layout, ev, fmt);
+      done = cat->layout->do_layout(cat->layout, ev, fmt);
       va_end(ev->ap);
       if (done) {
         appender->do_append(appender, buff);
-        continue;               /* Ok, that worked: go next */
+      } else {
+
+        /* The static buffer was too small, use a dynamically expanded one */
+        ev->buffer_size = XBT_LOG_DYNAMIC_BUFFER_SIZE;
+        ev->buffer      = xbt_malloc(ev->buffer_size);
+        while (1) {
+          va_start(ev->ap, fmt);
+          done = cat->layout->do_layout(cat->layout, ev, fmt);
+          va_end(ev->ap);
+          if (done)
+            break; /* Got it */
+          ev->buffer_size *= 2;
+          ev->buffer = xbt_realloc(ev->buffer, ev->buffer_size);
+        }
+        appender->do_append(appender, ev->buffer);
+        xbt_free(ev->buffer);
       }
     }
 
-    /* The static buffer was too small, use a dynamically expanded one */
-    ev->buffer_size = XBT_LOG_DYNAMIC_BUFFER_SIZE;
-    ev->buffer = xbt_malloc(ev->buffer_size);
-    while (1) {
-      va_start(ev->ap, fmt);
-      int done = cat->layout->do_layout(cat->layout, ev, fmt);
-      va_end(ev->ap);
-      if (done)
-        break;                  /* Got it */
-      ev->buffer_size *= 2;
-      ev->buffer = xbt_realloc(ev->buffer, ev->buffer_size);
-    }
-    appender->do_append(appender, ev->buffer);
-    xbt_free(ev->buffer);
-
-  } while (cat->additivity && (cat = cat->parent, 1));
+    if (!cat->additivity)
+      break;
+    cat = cat->parent;
+  }
 }
 
-#undef XBT_LOG_DYNAMIC_BUFFER_SIZE
-#undef XBT_LOG_STATIC_BUFFER_SIZE
-
 /* NOTE:
  *
  * The standard logging macros use _XBT_LOG_ISENABLED, which calls _xbt_log_cat_init().  Thus, if we want to avoid an
  * infinite recursion, we can not use the standard logging macros in _xbt_log_cat_init(), and in all functions called
  * from it.
  *
- * To circumvent the problem, we define the macro_xbt_log_init() as (0) for the length of the affected functions, and
- * we do not forget to undefine it at the end!
+ * To circumvent the problem, we define the macro DISABLE_XBT_LOG_CAT_INIT() to hide the real _xbt_log_cat_init(). The
+ * macro has to be called at the beginning of the affected functions.
  */
+static int fake_xbt_log_cat_init(xbt_log_category_t XBT_ATTRIB_UNUSED category,
+                                 e_xbt_log_priority_t XBT_ATTRIB_UNUSED priority)
+{
+  return 0;
+}
+#define DISABLE_XBT_LOG_CAT_INIT()                                                                                     \
+  int (*_xbt_log_cat_init)(xbt_log_category_t, e_xbt_log_priority_t) XBT_ATTRIB_UNUSED = fake_xbt_log_cat_init;
 
 static void _xbt_log_cat_apply_set(xbt_log_category_t category, xbt_log_setting_t setting)
 {
-#define _xbt_log_cat_init(a, b) (0)
-
+  DISABLE_XBT_LOG_CAT_INIT();
   if (setting->thresh != xbt_log_priority_uninitialized) {
     xbt_log_threshold_set(category, setting->thresh);
 
@@ -435,7 +436,6 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category, xbt_log_setting_
     category->additivity = 0;
     XBT_DEBUG("Set %p as appender of category '%s'", setting->appender, category->name);
   }
-#undef _xbt_log_cat_init
 }
 
 /*
@@ -444,8 +444,7 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category, xbt_log_setting_
  */
 int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority)
 {
-#define _xbt_log_cat_init(a, b) (0)
-
+  DISABLE_XBT_LOG_CAT_INIT();
   if (log_cat_init_mutex != NULL)
     xbt_os_mutex_acquire(log_cat_init_mutex);
 
@@ -523,8 +522,6 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
   if (log_cat_init_mutex != NULL)
     xbt_os_mutex_release(log_cat_init_mutex);
   return priority >= category->threshold;
-
-#undef _xbt_log_cat_init
 }
 
 void xbt_log_parent_set(xbt_log_category_t cat, xbt_log_category_t parent)
@@ -783,7 +780,7 @@ void xbt_log_appender_set(xbt_log_category_t cat, xbt_log_appender_t app)
 
 void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
 {
-#define _xbt_log_cat_init(a, b) (0)
+  DISABLE_XBT_LOG_CAT_INIT();
   if (!cat->appender) {
     XBT_VERB ("No appender to category %s. Setting the file appender as default", cat->name);
     xbt_log_appender_set(cat, xbt_log_appender_file_new(NULL));
@@ -796,7 +793,6 @@ void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
   }
   cat->layout = lay;
   xbt_log_additivity_set(cat, 0);
-#undef _xbt_log_cat_init
 }
 
 void xbt_log_additivity_set(xbt_log_category_t cat, int additivity)
@@ -818,9 +814,10 @@ static void xbt_log_help(void)
          "         -> warning: minor issue encountered\n"
          "         -> error: issue encountered\n"
          "         -> critical: major issue encountered\n"
+         "      The default priority level is 'info'.\n"
          "\n"
-         "   Format configuration: --log=CATEGORY_NAME.fmt:OPTIONS\n"
-         "      OPTIONS may be:\n"
+         "   Format configuration: --log=CATEGORY_NAME.fmt:FORMAT\n"
+         "      FORMAT string may contain:\n"
          "         -> %%%%: the %% char\n"
          "         -> %%n: platform-dependent line separator (LOG4J compatible)\n"
          "         -> %%e: plain old space (SimGrid extension)\n"
index fa9f582..ec32f17 100644 (file)
@@ -1,6 +1,6 @@
 /* mallocator - recycle objects to avoid malloc() / free()                  */
 
-/* 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
@@ -46,8 +46,7 @@ static inline void lock_reset(xbt_mallocator_t m)
 static inline void lock_acquire(xbt_mallocator_t m)
 {
   if (initialization_done > 1) {
-    int *lock = &m->lock;
-    while (__sync_lock_test_and_set(lock, 1))
+    while (__atomic_test_and_set(&m->lock, __ATOMIC_ACQUIRE))
       /* nop */;
   }
 }
@@ -55,7 +54,7 @@ static inline void lock_acquire(xbt_mallocator_t m)
 static inline void lock_release(xbt_mallocator_t m)
 {
   if (initialization_done > 1)
-    __sync_lock_release(&m->lock);
+    __atomic_clear(&m->lock, __ATOMIC_RELEASE);
 }
 
 /**
@@ -154,8 +153,6 @@ void *xbt_mallocator_get(xbt_mallocator_t m)
     if (m->current_size <= 0) {
       /* No object is ready yet. Create a bunch of them to try to group the
        * mallocs on the same memory pages (to help the cache lines) */
-
-      /* XBT_DEBUG("Create a new object for mallocator %p (size:%d/%d)", m, m->current_size, m->max_size); */
       int i;
       int amount = MIN(m->max_size / 2, 1000);
       for (i = 0; i < amount; i++)
@@ -164,7 +161,6 @@ void *xbt_mallocator_get(xbt_mallocator_t m)
     }
 
     /* there is at least an available object, now */
-    /* XBT_DEBUG("Reuse an old object for mallocator %p (size:%d/%d)", m, m->current_size, m->max_size); */
     object = m->objects[--m->current_size];
     lock_release(m);
   } else {
@@ -202,14 +198,11 @@ void xbt_mallocator_release(xbt_mallocator_t m, void *object)
     lock_acquire(m);
     if (m->current_size < m->max_size) {
       /* there is enough place to push the object */
-      /* XBT_DEBUG("Store deleted object in mallocator %p for further use (size:%d/%d)",
-         m, m->current_size, m->max_size); */
       m->objects[m->current_size++] = object;
       lock_release(m);
     } else {
       lock_release(m);
       /* otherwise we don't have a choice, we must free the object */
-      /* XBT_DEBUG("Free deleted object: mallocator %p is full (size:%d/%d)", m, m->current_size, m->max_size); */
       m->free_f(object);
     }
   } else {
index a69e26d..ccd5b52 100644 (file)
@@ -17,7 +17,7 @@ typedef struct s_xbt_mallocator {
   pvoid_f_void_t new_f;         /* function to call when we are running out of objects */
   void_f_pvoid_t free_f;        /* function to call when we have got too many objects */
   void_f_pvoid_t reset_f;       /* function to call when an object is released by the user */
-  int lock;                     /* lock to ensure the mallocator is thread-safe */
+  char lock;                    /* lock to ensure the mallocator is thread-safe */
 } s_xbt_mallocator_t;
 
 #endif
index b2185d7..b575f5e 100644 (file)
@@ -3,9 +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. */
 
-#include <cstdlib>
 #include <cstdio>
+#include <cstdlib>
 #include <cstring>
+#include <fstream>
+#include <iostream>
+#include <string>
 
 #include <sys/types.h>
 
@@ -45,7 +48,6 @@
 
 #include <xbt/sysdep.h>
 #include <xbt/base.h>
-#include <xbt/file.h>
 #include <xbt/log.h>
 
 #include "memory_map.hpp"
@@ -168,37 +170,32 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
 #elif defined __linux__
   /* Open the actual process's proc maps file and create the memory_map_t */
   /* to be returned. */
-  char* path = bprintf("/proc/%i/maps", (int) pid);
-  FILE *fp = std::fopen(path, "r");
-  if (fp == nullptr) {
-    std::perror("fopen failed");
-    xbt_die("Cannot open %s to investigate the memory map of the process.", path);
+  std::string path = std::string("/proc/") + std::to_string(pid) + "/maps";
+  std::ifstream fp;
+  fp.rdbuf()->pubsetbuf(0, 0);
+  fp.open(path);
+  if (not fp) {
+    std::perror("open failed");
+    xbt_die("Cannot open %s to investigate the memory map of the process.", path.c_str());
   }
-  free(path);
-  setbuf(fp, nullptr);
 
   /* Read one line at the time, parse it and add it to the memory map to be returned */
-  ssize_t read; /* Number of bytes readed */
-  char* line = nullptr;
-  std::size_t n = 0; /* Amount of bytes to read by xbt_getline */
-  while ((read = xbt_getline(&line, &n, fp)) != -1) {
+  std::string sline;
+  while (std::getline(fp, sline)) {
     /**
      * The lines that we read have this format: (This is just an example)
      * 00602000-00603000 rw-p 00002000 00:28 1837264                            <complete-path-to-file>
      */
-
-    //fprintf(stderr,"%s", line);
-
-    /* Wipeout the new line character */
-    line[read - 1] = '\0';
+    char* line = &sline[0];
 
     /* Tokenize the line using spaces as delimiters and store each token in lfields array. We expect 5 tokens for 6 fields */
+    char* saveptr = nullptr; // for strtok_r()
     char* lfields[6];
-    lfields[0] = strtok(line, " ");
+    lfields[0] = strtok_r(line, " ", &saveptr);
 
     int i;
     for (i = 1; i < 6 && lfields[i - 1] != nullptr; i++) {
-      lfields[i] = std::strtok(nullptr, " ");
+      lfields[i] = strtok_r(nullptr, " ", &saveptr);
     }
 
     /* Check to see if we got the expected amount of columns */
@@ -207,7 +204,7 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
 
     /* Ok we are good enough to try to get the info we need */
     /* First get the start and the end address of the map   */
-    char *tok = std::strtok(lfields[0], "-");
+    char* tok = strtok_r(lfields[0], "-", &saveptr);
     if (tok == nullptr)
       xbt_die("Start and end address of the map are not concatenated by a hyphen (-). Recovery impossible.");
 
@@ -218,7 +215,7 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     if (*endptr != '\0')
       xbt_abort();
 
-    tok = std::strtok(nullptr, "-");
+    tok = strtok_r(nullptr, "-", &saveptr);
     if (tok == nullptr)
       xbt_abort();
 
@@ -268,7 +265,7 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
       xbt_abort();
 
     /* Get the device major:minor bytes */
-    tok = std::strtok(lfields[3], ":");
+    tok = strtok_r(lfields[3], ":", &saveptr);
     if (tok == nullptr)
       xbt_abort();
 
@@ -277,7 +274,7 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     if (*endptr != '\0')
       xbt_abort();
 
-    tok = std::strtok(nullptr, ":");
+    tok = strtok_r(nullptr, ":", &saveptr);
     if (tok == nullptr)
       xbt_abort();
 
@@ -302,8 +299,7 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     ret.push_back(std::move(memreg));
   }
 
-  std::free(line);
-  std::fclose(fp);
+  fp.close();
 #elif defined __FreeBSD__
   struct procstat *prstat;
   struct kinfo_proc *proc;
index 7ee5e76..47efab7 100644 (file)
@@ -24,7 +24,6 @@ void mfree(struct mdesc *mdp, void *ptr)
   size_t i;
   int it;
 
-  mmalloc_paranoia(mdp);
 //  fprintf(stderr,"free(%p)\n",ptr);
 
   if (ptr == NULL)
index a8962f7..5afb74a 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
@@ -92,13 +92,14 @@ static void* mm_fake_calloc(size_t nmemb, size_t size)
   return mm_fake_malloc(n);
 }
 
-static void* mm_fake_realloc(void *p, size_t s)
+static void* mm_fake_realloc(XBT_ATTRIB_UNUSED void* p, size_t s)
 {
   return mm_fake_malloc(s);
 }
 
-static void mm_fake_free(void *p)
+static void mm_fake_free(XBT_ATTRIB_UNUSED void* p)
 {
+  // Nothing to do
 }
 
 /* Function signatures for the main malloc functions: */
@@ -118,7 +119,7 @@ static int mm_initialized;
 
 /** Constructor functions used to initialize the malloc implementation
  */
-static void __attribute__((constructor(101))) mm_legacy_constructor()
+_XBT_GNUC_CONSTRUCTOR(101) static void mm_legacy_constructor()
 {
   if (mm_initialized)
     return;
index 6c04fdf..ec21f2d 100644 (file)
@@ -381,32 +381,3 @@ ssize_t mmalloc_get_busy_size(xbt_mheap_t heap, void *ptr){
   }
 
 }
-
-void mmcheck(xbt_mheap_t heap) {return;
-  if (!heap->heapinfo)
-    return;
-  malloc_info* heapinfo = NULL;
-  for (size_t i=1; i < heap->heaplimit; i += mmalloc_get_increment(heapinfo)) {
-    heapinfo = heap->heapinfo + i;
-    switch (heapinfo->type) {
-    case MMALLOC_TYPE_HEAPINFO:
-    case MMALLOC_TYPE_FREE:
-      if (heapinfo->free_block.size==0) {
-        xbt_die("Block size == 0");
-      }
-      break;
-    case MMALLOC_TYPE_UNFRAGMENTED:
-      if (heapinfo->busy_block.size==0) {
-        xbt_die("Block size == 0");
-      }
-      if (heapinfo->busy_block.busy_size==0 && heapinfo->busy_block.size!=0) {
-        xbt_die("Empty busy block");
-      }
-      break;
-    default:
-      if (heapinfo->type<0) {
-        xbt_die("Unkown mmalloc block type.");
-      }
-    }
-  }
-}
index ee9dee9..2636c29 100644 (file)
@@ -95,7 +95,11 @@ static void initialize(xbt_mheap_t mdp)
   }
 }
 
-#define update_hook(a,offset) do { if (a) { a = ((char*)a +(offset));} }while(0)
+static inline void update_hook(void **a, size_t offset)
+{
+  if (*a)
+    *a = (char*)*a + offset;
+}
 
 /* Get neatly aligned memory from the low level layers, and register it
  * into the heap info table as necessary. */
@@ -124,13 +128,13 @@ static void *register_morecore(struct mdesc *mdp, size_t size)
     size_t offset=((char*)newinfo)-((char*)oldinfo);
 
     for (int i = 1 /*first element of heapinfo describes the mdesc area*/; i < mdp->heaplimit; i++) {
-      update_hook(newinfo[i].freehook.next,offset);
-      update_hook(newinfo[i].freehook.prev,offset);
+      update_hook(&newinfo[i].freehook.next, offset);
+      update_hook(&newinfo[i].freehook.prev, offset);
     }
     // also update the starting points of the swag
     for (int i = 0; i < BLOCKLOG; i++) {
-      update_hook(mdp->fraghead[i].head,offset);
-      update_hook(mdp->fraghead[i].tail,offset);
+      update_hook(&mdp->fraghead[i].head, offset);
+      update_hook(&mdp->fraghead[i].tail, offset);
     }
     mdp->heapinfo = newinfo;
 
@@ -152,7 +156,6 @@ static void *register_morecore(struct mdesc *mdp, size_t size)
   mdp->heaplimit = BLOCK((char *) result + size);
   return (result);
 }
-#undef update_hook
 
 /* Allocate memory from the heap.  */
 void *mmalloc(xbt_mheap_t mdp, size_t size) {
@@ -162,6 +165,25 @@ void *mmalloc(xbt_mheap_t mdp, size_t size) {
   }
   return res;
 }
+
+static void mmalloc_mark_used(xbt_mheap_t mdp, size_t block, size_t nblocks, size_t requested_size)
+{
+  for (int it = 0; it < nblocks; it++) {
+    mdp->heapinfo[block + it].type                 = MMALLOC_TYPE_UNFRAGMENTED;
+    mdp->heapinfo[block + it].busy_block.busy_size = 0;
+    mdp->heapinfo[block + it].busy_block.ignore    = 0;
+    mdp->heapinfo[block + it].busy_block.size      = 0;
+  }
+  mdp->heapinfo[block].busy_block.size      = nblocks;
+  mdp->heapinfo[block].busy_block.busy_size = requested_size;
+  // mdp->heapinfo[block].busy_block.bt_size =
+  //     xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt, XBT_BACKTRACE_SIZE);
+  // mdp->heapinfo[block].busy_block.bt_size =
+  //     xbt_libunwind_backtrace(mdp->heapinfo[block].busy_block.bt, XBT_BACKTRACE_SIZE);
+  mdp->heapstats.chunks_used++;
+  mdp->heapstats.bytes_used += nblocks * BLOCKSIZE;
+}
+
 /* Spliting mmalloc this way is mandated by a trick in mrealloc, that gives
    back the memory of big blocks to the system before reallocating them: we don't
    want to loose the beginning of the area when this happens */
@@ -184,8 +206,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
   if (!(mdp->flags & MMALLOC_INITIALIZED))
     initialize(mdp);
 
-  mmalloc_paranoia(mdp);
-
   /* Determine the allocation policy based on the request size.  */
   if (size <= BLOCKSIZE / 2) {
     /* Small allocation to receive a fragment of a block.
@@ -298,18 +318,7 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
         result = register_morecore(mdp, blocks * BLOCKSIZE);
 
         block = BLOCK(result);
-        for (int it = 0; it < blocks; it++) {
-          mdp->heapinfo[block + it].type                 = MMALLOC_TYPE_UNFRAGMENTED;
-          mdp->heapinfo[block + it].busy_block.busy_size = 0;
-          mdp->heapinfo[block + it].busy_block.ignore    = 0;
-          mdp->heapinfo[block + it].busy_block.size      = 0;
-        }
-        mdp->heapinfo[block].busy_block.size = blocks;
-        mdp->heapinfo[block].busy_block.busy_size = requested_size;
-        //mdp->heapinfo[block].busy_block.bt_size=xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE);
-        //mdp->heapinfo[block].busy_block.bt_size = xbt_libunwind_backtrace(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE);
-        mdp -> heapstats.chunks_used++;
-        mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
+        mmalloc_mark_used(mdp, block, blocks, requested_size);
 
         return result;
       }
@@ -340,19 +349,7 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
         = mdp->heapindex = mdp->heapinfo[block].free_block.next;
     }
 
-    for (int it = 0; it < blocks; it++) {
-      mdp->heapinfo[block+it].type = MMALLOC_TYPE_UNFRAGMENTED;
-      mdp->heapinfo[block+it].busy_block.busy_size = 0;
-      mdp->heapinfo[block+it].busy_block.ignore = 0;
-      mdp->heapinfo[block+it].busy_block.size = 0;
-    }
-    mdp->heapinfo[block].busy_block.size = blocks;
-    mdp->heapinfo[block].busy_block.busy_size = requested_size;
-    //mdp->heapinfo[block].busy_block.bt_size = xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE);
-    //mdp->heapinfo[block].busy_block.bt_size = xbt_libunwind_backtrace(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE);
-
-    mdp -> heapstats.chunks_used++;
-    mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
+    mmalloc_mark_used(mdp, block, blocks, requested_size);
     mdp -> heapstats.bytes_free -= blocks * BLOCKSIZE;
 
   }
index 93f925a..2fdc94c 100644 (file)
@@ -294,12 +294,6 @@ XBT_PUBLIC( void *)mmorecore(struct mdesc *mdp, ssize_t size);
 #define LOCK(mdp) pthread_mutex_lock(&mdp->mutex)
 #define UNLOCK(mdp) pthread_mutex_unlock(&mdp->mutex)
 
-static inline void  mmalloc_paranoia(struct mdesc *mdp){
-
-  /* nothing to fear for no */
-
-}
-
 static inline int mmalloc_get_increment(malloc_info* heapinfo) {
   if (heapinfo->type < 0) {
     return heapinfo->free_block.size;
@@ -310,8 +304,6 @@ static inline int mmalloc_get_increment(malloc_info* heapinfo) {
   }
 }
 
-XBT_PRIVATE void mmcheck(xbt_mheap_t heap);
-
 XBT_PRIVATE int malloc_use_mmalloc(void);
 
 XBT_PRIVATE int mmalloc_exec_using_mm(int argc, const char** argv);
index dfd03b8..aabf868 100644 (file)
@@ -36,9 +36,7 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
   if ((char *) ptr < (char *) mdp->heapbase || BLOCK(ptr) > mdp->heapsize) {
     printf("FIXME. Ouch, this pointer is not mine, refusing to proceed (another solution would be to malloc "
            "it instead of reallocing it, see source code)\n");
-    result = mmalloc(mdp, size);
     abort();
-    return result;
   }
 
   size_t requested_size = size; // The amount of memory requested by user, for real
index df47a7a..c5754e4 100644 (file)
@@ -3,506 +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 <atomic>
-#include <climits>
-
-#include "src/internal_config.h"
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifndef _WIN32
-#include <sys/syscall.h>
-#endif
-
-#if HAVE_FUTEX_H
-#include <linux/futex.h>
-#include <limits.h>
-#endif
-
-#include "xbt/parmap.h"
 #include "xbt/log.h"
-#include "xbt/function_types.h"
-#include "xbt/dynar.h"
-#include "xbt/xbt_os_thread.h"
-#include "xbt/sysdep.h"
-#include "src/simix/smx_private.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_parmap, xbt, "parmap: parallel map");
-
-typedef enum {
-  XBT_PARMAP_WORK,
-  XBT_PARMAP_DESTROY
-} e_xbt_parmap_flag_t;
-
-static void xbt_parmap_set_mode(xbt_parmap_t parmap, e_xbt_parmap_mode_t mode);
-static void *xbt_parmap_worker_main(void *parmap);
-static void xbt_parmap_work(xbt_parmap_t parmap);
-
-static void xbt_parmap_posix_master_wait(xbt_parmap_t parmap);
-static void xbt_parmap_posix_worker_signal(xbt_parmap_t parmap);
-static void xbt_parmap_posix_master_signal(xbt_parmap_t parmap);
-static void xbt_parmap_posix_worker_wait(xbt_parmap_t parmap, unsigned round);
-
-#if HAVE_FUTEX_H
-static void xbt_parmap_futex_master_wait(xbt_parmap_t parmap);
-static void xbt_parmap_futex_worker_signal(xbt_parmap_t parmap);
-static void xbt_parmap_futex_master_signal(xbt_parmap_t parmap);
-static void xbt_parmap_futex_worker_wait(xbt_parmap_t parmap, unsigned round);
-static void futex_wait(unsigned *uaddr, unsigned val);
-static void futex_wake(unsigned *uaddr, unsigned val);
-#endif
-
-static void xbt_parmap_busy_master_wait(xbt_parmap_t parmap);
-static void xbt_parmap_busy_worker_signal(xbt_parmap_t parmap);
-static void xbt_parmap_busy_master_signal(xbt_parmap_t parmap);
-static void xbt_parmap_busy_worker_wait(xbt_parmap_t parmap, unsigned round);
-
-/**
- * \brief Parallel map structure
- */
-typedef struct s_xbt_parmap {
-  e_xbt_parmap_flag_t status;      /**< is the parmap active or being destroyed? */
-  unsigned work;                   /**< index of the current round */
-  unsigned thread_counter;         /**< number of workers that have done the work */
-
-  unsigned int num_workers;        /**< total number of worker threads including the controller */
-  xbt_os_thread_t *workers;        /**< worker thread handlers */
-  void_f_pvoid_t fun;              /**< function to run in parallel on each element of data */
-  xbt_dynar_t data;                /**< parameters to pass to fun in parallel */
-  std::atomic<unsigned int> index; /**< index of the next element of data to pick */
-
-  /* posix only */
-  xbt_os_cond_t ready_cond;
-  xbt_os_mutex_t ready_mutex;
-  xbt_os_cond_t done_cond;
-  xbt_os_mutex_t done_mutex;
-
-  /* fields that depend on the synchronization mode */
-  e_xbt_parmap_mode_t mode;        /**< synchronization mode */
-  void (*master_wait_f)(xbt_parmap_t);    /**< wait for the workers to have done the work */
-  void (*worker_signal_f)(xbt_parmap_t);  /**< signal the master that a worker has done the work */
-  void (*master_signal_f)(xbt_parmap_t);  /**< wakes the workers threads to process tasks */
-  void (*worker_wait_f)(xbt_parmap_t, unsigned); /**< waits for more work */
-} s_xbt_parmap_t;
-
-/**
- * \brief Thread data transmission structure
- */
-typedef struct s_xbt_parmap_thread_data{
-  xbt_parmap_t parmap;
-  int worker_id;
-} s_xbt_parmap_thread_data_t;
-
-typedef s_xbt_parmap_thread_data_t *xbt_parmap_thread_data_t;
-
-/**
- * \brief Creates a parallel map object
- * \param num_workers number of worker threads to create
- * \param mode how to synchronize the worker threads
- * \return the parmap created
- */
-xbt_parmap_t xbt_parmap_new(unsigned int num_workers, e_xbt_parmap_mode_t mode)
-{
-  XBT_DEBUG("Create new parmap (%u workers)", num_workers);
-
-  /* Initialize the thread pool data structure */
-  xbt_parmap_t parmap = new s_xbt_parmap_t();
-  parmap->workers = xbt_new(xbt_os_thread_t, num_workers);
-
-  parmap->num_workers = num_workers;
-  parmap->status = XBT_PARMAP_WORK;
-  xbt_parmap_set_mode(parmap, mode);
-
-  /* Create the pool of worker threads */
-  parmap->workers[0] = nullptr;
-#if HAVE_PTHREAD_SETAFFINITY
-  int core_bind = 0;
-#endif
-  for (unsigned int i = 1; i < num_workers; i++) {
-    xbt_parmap_thread_data_t data = xbt_new0(s_xbt_parmap_thread_data_t, 1);
-    data->parmap = parmap;
-    data->worker_id = i;
-    parmap->workers[i] = xbt_os_thread_create(nullptr, xbt_parmap_worker_main, data, nullptr);
-#if HAVE_PTHREAD_SETAFFINITY
-    xbt_os_thread_bind(parmap->workers[i], core_bind);
-    if (core_bind != xbt_os_get_numcores() - 1)
-      core_bind++;
-    else
-      core_bind = 0;
-#endif
-  }
-  return parmap;
-}
-
-/**
- * \brief Destroys a parmap
- * \param parmap the parmap to destroy
- */
-void xbt_parmap_destroy(xbt_parmap_t parmap)
-{
-  if (not parmap) {
-    return;
-  }
-
-  parmap->status = XBT_PARMAP_DESTROY;
-  parmap->master_signal_f(parmap);
-
-  unsigned int i;
-  for (i = 1; i < parmap->num_workers; i++)
-    xbt_os_thread_join(parmap->workers[i], nullptr);
-
-  xbt_os_cond_destroy(parmap->ready_cond);
-  xbt_os_mutex_destroy(parmap->ready_mutex);
-  xbt_os_cond_destroy(parmap->done_cond);
-  xbt_os_mutex_destroy(parmap->done_mutex);
-
-  xbt_free(parmap->workers);
-  delete parmap;
-}
-
-/**
- * \brief Sets the synchronization mode of a parmap.
- * \param parmap a parallel map object
- * \param mode the synchronization mode
- */
-static void xbt_parmap_set_mode(xbt_parmap_t parmap, e_xbt_parmap_mode_t mode)
-{
-  if (mode == XBT_PARMAP_DEFAULT) {
-#if HAVE_FUTEX_H
-    mode = XBT_PARMAP_FUTEX;
-#else
-    mode = XBT_PARMAP_POSIX;
-#endif
-  }
-  parmap->mode = mode;
-
-  switch (mode) {
-    case XBT_PARMAP_POSIX:
-      parmap->master_wait_f   = &xbt_parmap_posix_master_wait;
-      parmap->worker_signal_f = &xbt_parmap_posix_worker_signal;
-      parmap->master_signal_f = &xbt_parmap_posix_master_signal;
-      parmap->worker_wait_f   = &xbt_parmap_posix_worker_wait;
-
-      parmap->ready_cond = xbt_os_cond_init();
-      parmap->ready_mutex = xbt_os_mutex_init();
-      parmap->done_cond = xbt_os_cond_init();
-      parmap->done_mutex = xbt_os_mutex_init();
-      break;
-    case XBT_PARMAP_FUTEX:
-#if HAVE_FUTEX_H
-      parmap->master_wait_f   = &xbt_parmap_futex_master_wait;
-      parmap->worker_signal_f = &xbt_parmap_futex_worker_signal;
-      parmap->master_signal_f = &xbt_parmap_futex_master_signal;
-      parmap->worker_wait_f   = &xbt_parmap_futex_worker_wait;
-
-      xbt_os_cond_destroy(parmap->ready_cond);
-      xbt_os_mutex_destroy(parmap->ready_mutex);
-      xbt_os_cond_destroy(parmap->done_cond);
-      xbt_os_mutex_destroy(parmap->done_mutex);
-      break;
-#else
-      xbt_die("Futex is not available on this OS.");
-#endif
-    case XBT_PARMAP_BUSY_WAIT:
-      parmap->master_wait_f   = &xbt_parmap_busy_master_wait;
-      parmap->worker_signal_f = &xbt_parmap_busy_worker_signal;
-      parmap->master_signal_f = &xbt_parmap_busy_master_signal;
-      parmap->worker_wait_f   = &xbt_parmap_busy_worker_wait;
-
-      xbt_os_cond_destroy(parmap->ready_cond);
-      xbt_os_mutex_destroy(parmap->ready_mutex);
-      xbt_os_cond_destroy(parmap->done_cond);
-      xbt_os_mutex_destroy(parmap->done_mutex);
-      break;
-    case XBT_PARMAP_DEFAULT:
-      THROW_IMPOSSIBLE;
-      break;
-    default:
-      THROW_IMPOSSIBLE;
-  }
-}
-
-/**
- * \brief Applies a list of tasks in parallel.
- * \param parmap a parallel map object
- * \param fun the function to call in parallel
- * \param data each element of this dynar will be passed as an argument to fun
- */
-void xbt_parmap_apply(xbt_parmap_t parmap, void_f_pvoid_t fun, xbt_dynar_t data)
-{
-  /* Assign resources to worker threads (we are maestro here)*/
-  parmap->fun = fun;
-  parmap->data = data;
-  parmap->index = 0;
-  parmap->master_signal_f(parmap); // maestro runs futex_wait to wake all the minions (the working threads)
-  xbt_parmap_work(parmap);         // maestro works with its minions
-  parmap->master_wait_f(parmap);   // When there is no more work to do, then maestro waits for the last minion to stop
-  XBT_DEBUG("Job done");           //   ... and proceeds
-}
-
-/**
- * \brief Returns a next task to process.
- *
- * Worker threads call this function to get more work.
- *
- * \return the next task to process, or nullptr if there is no more work
- */
-void* xbt_parmap_next(xbt_parmap_t parmap)
-{
-  unsigned int index = parmap->index++;
-  if (index < xbt_dynar_length(parmap->data)) {
-    return xbt_dynar_get_as(parmap->data, index, void*);
-  }
-  return nullptr;
-}
-
-static void xbt_parmap_work(xbt_parmap_t parmap)
-{
-  unsigned int index = parmap->index++;
-  while (index < xbt_dynar_length(parmap->data)){
-    parmap->fun(xbt_dynar_get_as(parmap->data, index, void*));
-    index = parmap->index++;
-  }
-}
-
-/**
- * \brief Main function of a worker thread.
- * \param arg the parmap
- */
-static void *xbt_parmap_worker_main(void *arg)
-{
-  xbt_parmap_thread_data_t data = static_cast<xbt_parmap_thread_data_t>(arg);
-  xbt_parmap_t parmap = data->parmap;
-  unsigned round = 0;
-  smx_context_t context = SIMIX_context_new(std::function<void()>(), nullptr, nullptr);
-  SIMIX_context_set_current(context);
-
-  XBT_DEBUG("New worker thread created");
-
-  /* Worker's main loop */
-  while (1) {
-    round++;
-    parmap->worker_wait_f(parmap, round);
-    if (parmap->status == XBT_PARMAP_WORK) {
-      XBT_DEBUG("Worker %d got a job", data->worker_id);
-
-      xbt_parmap_work(parmap);
-      parmap->worker_signal_f(parmap);
-
-      XBT_DEBUG("Worker %d has finished", data->worker_id);
-    /* We are destroying the parmap */
-    } else {
-      delete context;
-      xbt_free(data);
-      return nullptr;
-    }
-  }
-}
-
-#if HAVE_FUTEX_H
-static void futex_wait(unsigned *uaddr, unsigned val)
-{
-  XBT_VERB("Waiting on futex %p", uaddr);
-  syscall(SYS_futex, uaddr, FUTEX_WAIT_PRIVATE, val, nullptr, nullptr, 0);
-}
-
-static void futex_wake(unsigned *uaddr, unsigned val)
-{
-  XBT_VERB("Waking futex %p", uaddr);
-  syscall(SYS_futex, uaddr, FUTEX_WAKE_PRIVATE, val, nullptr, nullptr, 0);
-}
-#endif
-
-/**
- * \brief Starts the parmap: waits for all workers to be ready and returns.
- *
- * This function is called by the controller thread.
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_posix_master_wait(xbt_parmap_t parmap)
-{
-  xbt_os_mutex_acquire(parmap->done_mutex);
-  if (parmap->thread_counter < parmap->num_workers) {
-    /* wait for all workers to be ready */
-    xbt_os_cond_wait(parmap->done_cond, parmap->done_mutex);
-  }
-  xbt_os_mutex_release(parmap->done_mutex);
-}
-
-/**
- * \brief Ends the parmap: wakes the controller thread when all workers terminate.
- *
- * This function is called by all worker threads when they end (not including the controller).
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_posix_worker_signal(xbt_parmap_t parmap)
-{
-  xbt_os_mutex_acquire(parmap->done_mutex);
-  parmap->thread_counter++;
-  if (parmap->thread_counter == parmap->num_workers) {
-    /* all workers have finished, wake the controller */
-    xbt_os_cond_signal(parmap->done_cond);
-  }
-  xbt_os_mutex_release(parmap->done_mutex);
-}
-
-/**
- * \brief Wakes all workers and waits for them to finish the tasks.
- *
- * This function is called by the controller thread.
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_posix_master_signal(xbt_parmap_t parmap)
-{
-  xbt_os_mutex_acquire(parmap->ready_mutex);
-  parmap->thread_counter = 1;
-  parmap->work++;
-  /* wake all workers */
-  xbt_os_cond_broadcast(parmap->ready_cond);
-  xbt_os_mutex_release(parmap->ready_mutex);
-}
-
-/**
- * \brief Waits for some work to process.
- *
- * This function is called by each worker thread (not including the controller) when it has no more work to do.
- *
- * \param parmap a parmap
- * \param round  the expected round number
- */
-static void xbt_parmap_posix_worker_wait(xbt_parmap_t parmap, unsigned round)
-{
-  xbt_os_mutex_acquire(parmap->ready_mutex);
-  /* wait for more work */
-  if (parmap->work != round) {
-    xbt_os_cond_wait(parmap->ready_cond, parmap->ready_mutex);
-  }
-  xbt_os_mutex_release(parmap->ready_mutex);
-}
-
-#if HAVE_FUTEX_H
-/**
- * \brief Starts the parmap: waits for all workers to be ready and returns.
- *
- * This function is called by the controller thread.
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_futex_master_wait(xbt_parmap_t parmap)
-{
-  unsigned count = parmap->thread_counter;
-  while (count < parmap->num_workers) {
-    /* wait for all workers to be ready */
-    futex_wait(&parmap->thread_counter, count);
-    count = parmap->thread_counter;
-  }
-}
-
-/**
- * \brief Ends the parmap: wakes the controller thread when all workers terminate.
- *
- * This function is called by all worker threads when they end (not including the controller).
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_futex_worker_signal(xbt_parmap_t parmap)
-{
-  unsigned count = __sync_add_and_fetch(&parmap->thread_counter, 1);
-  if (count == parmap->num_workers) {
-    /* all workers have finished, wake the controller */
-    futex_wake(&parmap->thread_counter, INT_MAX);
-  }
-}
-
-/**
- * \brief Wakes all workers and waits for them to finish the tasks.
- *
- * This function is called by the controller thread.
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_futex_master_signal(xbt_parmap_t parmap)
-{
-  parmap->thread_counter = 1;
-  __sync_add_and_fetch(&parmap->work, 1);
-  /* wake all workers */
-  futex_wake(&parmap->work, INT_MAX);
-}
-
-/**
- * \brief Waits for some work to process.
- *
- * This function is called by each worker thread (not including the controller) when it has no more work to do.
- *
- * \param parmap a parmap
- * \param round  the expected round number
- */
-static void xbt_parmap_futex_worker_wait(xbt_parmap_t parmap, unsigned round)
-{
-  unsigned work = parmap->work;
-  /* wait for more work */
-  while (work != round) {
-    futex_wait(&parmap->work, work);
-    work = parmap->work;
-  }
-}
-#endif
-
-/**
- * \brief Starts the parmap: waits for all workers to be ready and returns.
- *
- * This function is called by the controller thread.
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_busy_master_wait(xbt_parmap_t parmap)
-{
-  while (parmap->thread_counter < parmap->num_workers) {
-    xbt_os_thread_yield();
-  }
-}
-
-/**
- * \brief Ends the parmap: wakes the controller thread when all workers terminate.
- *
- * This function is called by all worker threads when they end.
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_busy_worker_signal(xbt_parmap_t parmap)
-{
-  __sync_add_and_fetch(&parmap->thread_counter, 1);
-}
-
-/**
- * \brief Wakes all workers and waits for them to finish the tasks.
- *
- * This function is called by the controller thread.
- *
- * \param parmap a parmap
- */
-static void xbt_parmap_busy_master_signal(xbt_parmap_t parmap)
-{
-  parmap->thread_counter = 1;
-  __sync_add_and_fetch(&parmap->work, 1);
-}
-
-/**
- * \brief Waits for some work to process.
- *
- * This function is called by each worker thread (not including the controller) when it has no more work to do.
- *
- * \param parmap a parmap
- * \param round  the expected round number
- */
-static void xbt_parmap_busy_worker_wait(xbt_parmap_t parmap, unsigned round)
-{
-  /* wait for more work */
-  while (parmap->work != round) {
-    xbt_os_thread_yield();
-  }
-}
index afc6445..7872cdc 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
@@ -17,7 +17,7 @@ namespace xbt {
 
 #if SIMGRID_HAVE_MC
 
-const char string::NUL = '\0';
+char string::NUL = '\0';
 
 #endif
 
index e10514e..6bf90c0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2014. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -172,7 +172,7 @@ void *xbt_swag_extract(xbt_swag_t swag)
  * \param swag a swag
  * \return the number of objects in \a swag
  */
-inline int xbt_swag_size(xbt_swag_t swag)
+inline int xbt_swag_size(const_xbt_swag_t swag)
 {
   return (swag->count);
 }
@@ -212,7 +212,6 @@ XBT_TEST_UNIT("basic", test_swag_basic, "Basic usage")
 
   xbt_test_assert(xbt_swag_remove(NULL, setB) == NULL);
   xbt_test_assert(xbt_swag_remove(obj1, setB) == obj1);
-  /*  xbt_test_assert(xbt_swag_remove(obj2, setB) == obj2); */
 
   xbt_test_add("Traverse set A");
   xbt_swag_foreach(obj, setA) {
index 74232a6..e511603 100644 (file)
@@ -1,43 +1,39 @@
 /* file_appender - a dumb log appender which simply prints to a file        */
 
-/* Copyright (c) 2007-2014. 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 "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);
 }
 
-static void smpi_append_file(xbt_log_appender_t this_, char *str) {
-  fputs(str, (FILE *) this_->data);
-}
-
 static void free_(xbt_log_appender_t this_) {
   if (this_->data != stderr)
     fclose(this_->data);
 }
 
-XBT_LOG_EXTERNAL_CATEGORY(smpi); // To detect if SMPI is inited
-
 xbt_log_appender_t xbt_log_appender_file_new(char *arg) {
 
   xbt_log_appender_t res = xbt_new0(s_xbt_log_appender_t, 1);
-  if (_XBT_LOGV(smpi).initialized) // HACK to detect if we run in SMPI mode. Relies on MAIN__ source disposition
-    res->do_append = &smpi_append_file;
-  else
-    res->do_append = &append_file;
-  res->free_       = &free_;
-  if (arg)
+  res->do_append         = &append_file;
+  res->free_             = &free_;
+  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;
 }
 
@@ -55,14 +51,15 @@ 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);
     }
   } else{
-    //printf("Splitting\n");
     //Split
     if(data->file)
       fclose(data->file);
@@ -76,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);
   }
 }
 
@@ -93,14 +92,13 @@ static void append2_file(xbt_log_appender_t this_, char *str) {
    }
 }
 
-static void smpi_append2_file(xbt_log_appender_t this_, char *str) {
-  append2_file(this_,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);
 }
 
 
@@ -109,11 +107,8 @@ static void free_append2_(xbt_log_appender_t this_) {
 //For split, replace %  in the file by the current count
 xbt_log_appender_t xbt_log_appender2_file_new(char *arg,int roll) {
 
-  xbt_log_appender_t res = xbt_new0(s_xbt_log_appender_t, 1);
-  if (_XBT_LOGV(smpi).initialized) // HACK to detect if we run in SMPI mode. Relies on MAIN__ source disposition
-    res->do_append = &smpi_append2_file;
-  else
-    res->do_append            = &append2_file;
+  xbt_log_appender_t res      = xbt_new0(s_xbt_log_appender_t, 1);
+  res->do_append              = &append2_file;
   res->free_                  = &free_append2_;
   xbt_log_append2_file_t data = xbt_new0(struct xbt_log_append2_file_s, 1);
   xbt_assert(arg);
index 18c55ac..d0d2bf9 100644 (file)
@@ -6,15 +6,13 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/host.h"
+#include "simgrid/msg.h" /* MSG_get_clock */
 #include "src/xbt/log_private.h"
-#include "surf/surf.h"
 #include "xbt/sysdep.h"
 #include <stdio.h>
 
 extern const char *xbt_log_priority_names[8];
 
-static double format_begin_of_time = -1;
-
 #define ERRMSG                                                          \
   "Unknown %%%c sequence in layout format (%s).\n"                      \
   "Known sequences:\n"                                                  \
@@ -78,89 +76,94 @@ static int xbt_log_layout_format_doit(xbt_log_layout_t l, xbt_log_event_t ev, co
   for (char* q = l->data ; *q != '\0' ; q++) {
     if (*q == '%') {
       q++;
-    handle_modifier:
-      switch (*q) {
-      case '\0':
-        fprintf(stderr, "Layout format (%s) ending with %%\n", (char *)l->data);
-        xbt_abort();
-        break;
-      case '%':
-        *p = '%';
-        check_overflow(1);
-        break;
-      case 'n':         /* platform-dependant line separator; LOG4J compliant */
-        *p = '\n';
-        check_overflow(1);
-        break;
-      case 'e':                 /* plain space; SimGrid extension */
-        *p = ' ';
-        check_overflow(1);
-        break;
-      case '.':                 /* precision specifier */
-        precision = strtol(q + 1, &q, 10);
-        goto handle_modifier;
-      case '0':
-      case '1':
-      case '2':
-      case '3':
-      case '4':
-      case '5':
-      case '6':
-      case '7':
-      case '8':
-      case '9':                 /* length modifier */
-        length = strtol(q, &q, 10);
-        goto handle_modifier;
-      case 'c':                 /* category name; LOG4J compliant
-                                   should accept a precision postfix to show the hierarchy */
-        show_string(ev->cat->name);
-        break;
-      case 'p':                 /* priority name; LOG4J compliant */
-        show_string(xbt_log_priority_names[ev->priority]);
-        break;
-      case 'h':                 /* host name; SimGrid extension */
-        show_string(sg_host_self_get_name());
-        break;
-      case 't':                 /* thread/process name; LOG4J compliant */
-      case 'P':                 /* process name; SimGrid extension */
-        show_string(xbt_procname());
-        break;
-      case 'i':                 /* process PID name; SimGrid extension */
-        show_int(xbt_getpid());
-        break;
-      case 'F':                 /* file name; LOG4J compliant */
-        show_string(ev->fileName);
-        break;
-      case 'l': {               /* location; LOG4J compliant */
-        int sz;
-        set_sz_from_precision();
-        int len = snprintf(p, sz, "%s:%d", ev->fileName, ev->lineNum);
-        check_overflow(MIN(sz, len));
-        break;
-      }
-      case 'L':                 /* line number; LOG4J compliant */
-        show_int(ev->lineNum);
-        break;
-      case 'M':                /* method (ie, function) name; LOG4J compliant */
-        show_string(ev->functionName);
-        break;
-      case 'd':                 /* date; LOG4J compliant */
-        show_double(surf_get_clock());
-        break;
-      case 'r':                 /* application age; LOG4J compliant */
-        show_double(surf_get_clock() - format_begin_of_time);
-        break;
-      case 'm': {               /* user-provided message; LOG4J compliant */
-        int sz;
-        set_sz_from_precision();
-        int len = vsnprintf(p, sz, msg_fmt, ev->ap);
-        check_overflow(MIN(sz, len));
-        break;
-      }
-      default:
-        fprintf(stderr, ERRMSG, *q, (char *)l->data);
-        xbt_abort();
-      }
+      do {
+        switch (*q) {
+          case '\0':
+            fprintf(stderr, "Layout format (%s) ending with %%\n", (char*)l->data);
+            xbt_abort();
+            break;
+          case '%':
+            *p = '%';
+            check_overflow(1);
+            break;
+          case 'n': /* platform-dependant line separator; LOG4J compliant */
+            *p = '\n';
+            check_overflow(1);
+            break;
+          case 'e': /* plain space; SimGrid extension */
+            *p = ' ';
+            check_overflow(1);
+            break;
+          case '.': /* precision specifier */
+            precision = strtol(q + 1, &q, 10);
+            continue; /* conversion specifier still not found, continue reading */
+          case '0':
+          case '1':
+          case '2':
+          case '3':
+          case '4':
+          case '5':
+          case '6':
+          case '7':
+          case '8':
+          case '9': /* length modifier */
+            length = strtol(q, &q, 10);
+            continue; /* conversion specifier still not found, continue reading */
+          case 'c':   /* category name; LOG4J compliant
+                         should accept a precision postfix to show the hierarchy */
+            show_string(ev->cat->name);
+            break;
+          case 'p': /* priority name; LOG4J compliant */
+            show_string(xbt_log_priority_names[ev->priority]);
+            break;
+          case 'h': /* host name; SimGrid extension */
+            show_string(sg_host_self_get_name());
+            break;
+          case 't': /* thread/process name; LOG4J compliant */
+          case 'P': /* process name; SimGrid extension */
+            show_string(xbt_procname());
+            break;
+          case 'i': /* process PID name; SimGrid extension */
+            show_int(xbt_getpid());
+            break;
+          case 'F': /* file name; LOG4J compliant */
+            show_string(ev->fileName);
+            break;
+          case 'l': { /* location; LOG4J compliant */
+            int sz;
+            set_sz_from_precision();
+            int len = snprintf(p, sz, "%s:%d", ev->fileName, ev->lineNum);
+            check_overflow(MIN(sz, len));
+            break;
+          }
+          case 'L': /* line number; LOG4J compliant */
+            show_int(ev->lineNum);
+            break;
+          case 'M': /* method (ie, function) name; LOG4J compliant */
+            show_string(ev->functionName);
+            break;
+          case 'd': /* date; LOG4J compliant */
+            show_double(MSG_get_clock());
+            break;
+          case 'r': /* application age; LOG4J compliant */
+            show_double(MSG_get_clock());
+            break;
+          case 'm': { /* user-provided message; LOG4J compliant */
+            int sz;
+            set_sz_from_precision();
+            va_list ap;
+            va_copy(ap, ev->ap);
+            int len = vsnprintf(p, sz, msg_fmt, ap);
+            va_end(ap);
+            check_overflow(MIN(sz, len));
+            break;
+          }
+          default:
+            fprintf(stderr, ERRMSG, *q, (char*)l->data);
+            xbt_abort();
+        }
+        break; /* done, continue normally */
+      } while (1);
     } else {
       *p = *q;
       check_overflow(1);
@@ -183,8 +186,5 @@ xbt_log_layout_t xbt_log_layout_format_new(char *arg)
   res->free_           = &xbt_log_layout_format_free;
   res->data = xbt_strdup((char *) arg);
 
-  if (format_begin_of_time < 0)
-    format_begin_of_time = surf_get_clock();
-
   return res;
 }
index b890b15..74374bf 100644 (file)
@@ -9,21 +9,19 @@
 #include "src/xbt/log_private.h"
 
 #include "simgrid/host.h" /* sg_host_self_get_name */
-#include "surf/surf.h"
+#include "simgrid/msg.h"  /* MSG_get_clock */
 #include <stdio.h>
 
 extern const char *xbt_log_priority_names[8];
 extern int xbt_log_no_loc;
 
-static double simple_begin_of_time = -1;
-
 #define check_overflow(len)                                             \
   if ((rem_size -= (len)) > 0) {                                        \
     p += (len);                                                         \
   } else                                                                \
     return 0
 
-static int xbt_log_layout_simple_doit(xbt_log_layout_t l, xbt_log_event_t ev, const char *fmt)
+static int xbt_log_layout_simple_doit(XBT_ATTRIB_UNUSED xbt_log_layout_t l, xbt_log_event_t ev, const char* fmt)
 {
   char *p = ev->buffer;
   int rem_size = ev->buffer_size;
@@ -45,7 +43,7 @@ static int xbt_log_layout_simple_doit(xbt_log_layout_t l, xbt_log_event_t ev, co
   }
 
   /* Display the date */
-  len = snprintf(p, rem_size, "%f] ", surf_get_clock() - simple_begin_of_time);
+  len = snprintf(p, rem_size, "%f] ", MSG_get_clock());
   check_overflow(len);
 
   /* Display file position if not INFO */
@@ -70,13 +68,10 @@ static int xbt_log_layout_simple_doit(xbt_log_layout_t l, xbt_log_event_t ev, co
   return 1;
 }
 
-xbt_log_layout_t xbt_log_layout_simple_new(char *arg)
+xbt_log_layout_t xbt_log_layout_simple_new(XBT_ATTRIB_UNUSED char* arg)
 {
   xbt_log_layout_t res = xbt_new0(s_xbt_log_layout_t, 1);
   res->do_layout       = &xbt_log_layout_simple_doit;
 
-  if (simple_begin_of_time < 0)
-    simple_begin_of_time = surf_get_clock();
-
   return res;
 }
index f4ba9ab..810cd26 100644 (file)
@@ -7,14 +7,14 @@
 
 #define XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL /* MSVC don't want it to be declared extern in headers and local here */
 
-#include <math.h>
-#include "xbt/misc.h"
 #include "simgrid_config.h"
-#include "xbt/sysdep.h"
+#include "xbt/config.h"
+#include "xbt/dynar.h"
 #include "xbt/log.h"
 #include "xbt/log.hpp"
-#include "xbt/dynar.h"
-#include "xbt/config.h"
+#include "xbt/misc.h"
+#include "xbt/sysdep.h"
+#include <cmath>
 
 #include "xbt/module.h"         /* this module */
 
 #include "simgrid/sg_config.h"
 
 #include "src/internal_config.h"
-#include <stdio.h>
+#include <cstdio>
 #ifdef _WIN32
-#include <signal.h> /* To silence MSVC on abort() */
+# include <csignal> /* To silence MSVC on abort() */
 #endif
 #if HAVE_UNISTD_H
-#  include <unistd.h>
+# include <unistd.h>
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
@@ -85,7 +85,7 @@ static void xbt_preinit()
 #elif HAVE_SYSCONF
   xbt_pagesize = sysconf(_SC_PAGESIZE);
 #else
-  #error Cannot get page size.
+error Cannot get page size.
 #endif
 
   xbt_pagebits = log2(xbt_pagesize);
@@ -114,7 +114,6 @@ static void xbt_postexit()
   xbt_os_thread_mod_postexit();
   xbt_dynar_free(&xbt_cmdline);
   xbt_log_postexit();
-  free(xbt_binary_name);
 #if SIMGRID_HAVE_MC
   mmalloc_postexit();
 #endif
@@ -125,13 +124,13 @@ void xbt_init(int *argc, char **argv)
 {
   simgrid::xbt::installExceptionHandler();
 
-  if (xbt_initialized) {
-    xbt_initialized++;
+  xbt_initialized++;
+  if (xbt_initialized > 1) {
     XBT_DEBUG("XBT has been initialized %d times.", xbt_initialized);
     return;
   }
 
-  xbt_binary_name = xbt_strdup(argv[0]);
+  xbt_binary_name = argv[0];
   xbt_cmdline     = xbt_dynar_new(sizeof(char*), NULL);
   for (int i = 0; i < *argc; i++)
     xbt_dynar_push(xbt_cmdline,&(argv[i]));
@@ -140,16 +139,16 @@ void xbt_init(int *argc, char **argv)
 }
 
 /* these two functions belong to xbt/sysdep.h, which have no corresponding .c file */
-/** @brief like free, but you can be sure that it is a function  */
+/** @brief like xbt_free, but you can be sure that it is a function  */
 void xbt_free_f(void *p)
 {
-  free(p);
+  xbt_free(p);
 }
 
 /** @brief should be given a pointer to pointer, and frees the second one */
 void xbt_free_ref(void *d)
 {
-  free(*(void **) d);
+  xbt_free(*(void**)d);
 }
 
 /** @brief Kill the program in silence */
diff --git a/src/xbt/xbt_os_file.c b/src/xbt/xbt_os_file.c
deleted file mode 100644 (file)
index 789c141..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* xbt_os_file.c -- portable interface to file-related functions            */
-
-/* Copyright (c) 2007-2010, 2012-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. */
-
-#include "xbt/sysdep.h"
-#include "xbt/file.h"    /* this module */
-#include "xbt/log.h"
-#include "src/internal_config.h"
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-#include "libgen.h" /* POSIX dirname */
-
-/** @brief Get a single line from the stream (reimplementation of the GNU getline)
- *
- * This is a reimplementation of the GNU getline function, so that our code don't depends on the GNU libc.
- *
- * xbt_getline() reads an entire line from stream, storing the address of the buffer containing the text into *buf.
- * The buffer is null-terminated and includes the newline character, if one was found.
- *
- * If *buf is NULL, then xbt_getline() will allocate a buffer for storing the  line, which should be freed by the user
- * program.
- *
- * Alternatively, before calling xbt_getline(), *buf can contain a pointer to a malloc()-allocated buffer *n bytes in
- * size. If the buffer is not large enough to hold the line, xbt_getline() resizes it with realloc(), updating
- * *buf and *n as necessary.
- *
- * In either case, on a successful call, *buf and *n will be updated to reflect the buffer address and allocated size
- * respectively.
- */
-ssize_t xbt_getline(char **buf, size_t *n, FILE *stream)
-{
-  int ch = getc(stream);
-  if (ferror(stream) || feof(stream))
-    return -1;
-
-  if (!*buf) {
-    *n = 512;
-    *buf = xbt_malloc(*n);
-  }
-
-  ssize_t i = 0;
-  do {
-    if (i == *n) {
-      *n += 512;
-      *buf = xbt_realloc(*buf, *n);
-    }
-    (*buf)[i] = ch;
-    i++;
-  } while (ch != '\n' && (ch = getc(stream)) != EOF);
-
-  if (i == *n) {
-    *n += 1;
-    *buf = xbt_realloc(*buf, *n);
-  }
-  (*buf)[i] = '\0';
-
-  return i;
-}
-
-/** @brief Returns the directory component of a path (reimplementation of POSIX dirname)
- *
- * The argument is never modified, and the returned value must be freed after use.
- */
-char *xbt_dirname(const char *path) {
-  char *tmp = xbt_strdup(path);
-  char *res = xbt_strdup(dirname(tmp));
-  free(tmp);
-  return res;
-}
-
-/** @brief Returns the file component of a path (reimplementation of POSIX basename)
- *
- * The argument is never modified, and the returned value must be freed after use.
- */
-char *xbt_basename(const char *path) {
-  char *tmp = xbt_strdup(path);
-  char *res = xbt_strdup(basename(tmp));
-  free(tmp);
-  return res;
-}
diff --git a/src/xbt/xbt_os_file.cpp b/src/xbt/xbt_os_file.cpp
new file mode 100644 (file)
index 0000000..1248350
--- /dev/null
@@ -0,0 +1,30 @@
+/* xbt_os_file.cpp -- portable interface to file-related functions            */
+
+/* Copyright (c) 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/file.hpp" /* this module */
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#include <cstring>
+#include <libgen.h> /* POSIX dirname */
+
+std::string simgrid::xbt::Path::getDirname()
+{
+  std::string p(path_);
+  char *res = dirname(&p[0]);
+  return std::string(res, strlen(res));
+}
+
+std::string simgrid::xbt::Path::getBasename()
+{
+  std::string p(path_);
+  char *res = basename(&p[0]);
+  return std::string(res, strlen(res));
+}
index af1dc12..503ad7c 100644 (file)
@@ -2,7 +2,7 @@
 /* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD     */
 /* in SG, when using HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead   */
 
-/* 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
@@ -52,7 +52,6 @@ static xbt_os_mutex_t next_sem_ID_lock;
 
 typedef struct xbt_os_thread_ {
   pthread_t t;
-  int detached;
   char *name;
   void *param;
   pvoid_f_pvoid_t start_routine;
@@ -77,14 +76,6 @@ static void xbt_os_thread_free_thread_data(xbt_os_thread_t thread)
   free(thread);
 }
 
-/* callback: termination */
-static void _os_thread_ex_terminate(xbt_ex_t * e)
-{
-  xbt_ex_display(e);
-  xbt_abort();
-  /* FIXME: there should be a configuration variable to choose to kill everyone or only this one */
-}
-
 void xbt_os_thread_mod_preinit(void)
 {
   if (thread_mod_inited)
@@ -95,7 +86,6 @@ void xbt_os_thread_mod_preinit(void)
 
   main_thread = xbt_new(s_xbt_os_thread_t, 1);
   main_thread->name = NULL;
-  main_thread->detached = 0;
   main_thread->name = xbt_strdup("main");
   main_thread->param = NULL;
   main_thread->start_routine = NULL;
@@ -151,16 +141,12 @@ static void *wrapper_start_routine(void *s)
   int errcode = pthread_setspecific(xbt_self_thread_key, t);
   xbt_assert(errcode == 0, "pthread_setspecific failed for xbt_self_thread_key");
 
-  void *res = t->start_routine(t->param);
-  if (t->detached)
-    xbt_os_thread_free_thread_data(t);
-  return res;
+  return t->start_routine(t->param);
 }
 
 xbt_os_thread_t xbt_os_thread_create(const char *name,  pvoid_f_pvoid_t start_routine, void *param, void *extra_data)
 {
   xbt_os_thread_t res_thread = xbt_new(s_xbt_os_thread_t, 1);
-  res_thread->detached = 0;
   res_thread->name = xbt_strdup(name);
   res_thread->start_routine = start_routine;
   res_thread->param = param;
@@ -176,7 +162,8 @@ xbt_os_thread_t xbt_os_thread_create(const char *name,  pvoid_f_pvoid_t start_ro
  *
  * If pthread_setaffinity_np is not usable on that (non-gnu) platform, this function does nothing.
  */
-int xbt_os_thread_bind(xbt_os_thread_t thread, int cpu){
+int xbt_os_thread_bind(XBT_ATTRIB_UNUSED xbt_os_thread_t thread, XBT_ATTRIB_UNUSED int cpu)
+{
   int errcode = 0;
 #if HAVE_PTHREAD_SETAFFINITY
   pthread_t pthread = thread->t;
@@ -208,16 +195,16 @@ void xbt_os_thread_setstacksize(int stack_size)
     size_t rem = sz % alignment[i];
     if (rem != 0 || sz == 0) {
       size_t sz2 = sz - rem + alignment[i];
-      XBT_DEBUG("pthread_attr_setstacksize failed for %zd, try again with %zd", sz, sz2);
+      XBT_DEBUG("pthread_attr_setstacksize failed for %zu, try again with %zu", sz, sz2);
       sz = sz2;
       res = pthread_attr_setstacksize(&thread_attr, sz);
     }
   }
 
   if (res == EINVAL)
-    XBT_WARN("invalid stack size (maybe too big): %zd", sz);
+    XBT_WARN("invalid stack size (maybe too big): %zu", sz);
   else if (res != 0)
-    XBT_WARN("unknown error %d in pthread stacksize setting: %zd", res, sz);
+    XBT_WARN("unknown error %d in pthread stacksize setting: %zu", res, sz);
 }
 
 void xbt_os_thread_setguardsize(int guard_size)
@@ -228,7 +215,7 @@ void xbt_os_thread_setguardsize(int guard_size)
   size_t sz = guard_size;
   int res = pthread_attr_setguardsize(&thread_attr, sz);
   if (res)
-    XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zd", res, sz);
+    XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zu", res, sz);
 #endif
 }
 
@@ -265,6 +252,12 @@ void xbt_os_thread_key_create(xbt_os_thread_key_t* key)
   xbt_assert(errcode==0 , "pthread_key_create failed");
 }
 
+void xbt_os_thread_key_destroy(xbt_os_thread_key_t key)
+{
+  int errcode = pthread_key_delete(key);
+  xbt_assert(errcode == 0, "pthread_key_delete failed");
+}
+
 void xbt_os_thread_set_specific(xbt_os_thread_key_t key, void* value)
 {
   int errcode = pthread_setspecific(key, value);
@@ -276,23 +269,12 @@ void* xbt_os_thread_get_specific(xbt_os_thread_key_t key)
   return pthread_getspecific(key);
 }
 
-void xbt_os_thread_detach(xbt_os_thread_t thread)
-{
-  thread->detached = 1;
-  pthread_detach(thread->t);
-}
-
 #include <sched.h>
 void xbt_os_thread_yield(void)
 {
   sched_yield();
 }
 
-void xbt_os_thread_cancel(xbt_os_thread_t t)
-{
-  pthread_cancel(t->t);
-}
-
 /****** mutex related functions ******/
 typedef struct xbt_os_mutex_ {
   pthread_mutex_t m;
index 0e8951f..91c81a9 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_os_time.c -- portable interface to time-related functions            */
 
-/* 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 <mach/task.h>
 #endif
 
+#ifdef _WIN32
+static void w32_time_to_timeval(struct timeval* tv, const FILETIME* ft)
+{
+  unsigned __int64 tm;
+  tm = (unsigned __int64)ft->dwHighDateTime << 32;
+  tm |= ft->dwLowDateTime;
+  tm /= 10;
+  tm -= 11644473600000000ULL;
+  tv->tv_sec  = (long)(tm / 1000000L);
+  tv->tv_usec = (long)(tm % 1000000L);
+}
+
+static void w32_times_to_timeval(struct timeval* tv, const FILETIME* kernel_time, const FILETIME* user_time)
+{
+  unsigned __int64 ktm, utm;
+  ktm = (unsigned __int64)kernel_time->dwHighDateTime << 32;
+  ktm |= kernel_time->dwLowDateTime;
+  ktm /= 10;
+  utm = (unsigned __int64)user_time->dwHighDateTime << 32;
+  utm |= user_time->dwLowDateTime;
+  utm /= 10;
+  tv->tv_sec  = (long)(ktm / 1000000L) + (long)(utm / 1000000L);
+  tv->tv_usec = (long)(ktm % 1000000L) + (long)(utm % 1000000L);
+}
+#endif
+
 double xbt_os_time(void)
 {
 #if HAVE_GETTIMEOFDAY
@@ -46,17 +72,8 @@ double xbt_os_time(void)
 #elif defined(_WIN32)
   struct timeval tv;
   FILETIME ft;
-  unsigned __int64 tm;
-
   GetSystemTimeAsFileTime(&ft);
-  tm = (unsigned __int64) ft.dwHighDateTime << 32;
-  tm |= ft.dwLowDateTime;
-  tm /= 10;
-  tm -= 11644473600000000ULL;
-
-  tv.tv_sec = (long) (tm / 1000000L);
-  tv.tv_usec = (long) (tm % 1000000L);
-
+  w32_time_to_timeval(&tv, &ft);
 #else                           /* not windows, no gettimeofday => poor resolution */
   return (double) (time(NULL));
 #endif                          /* HAVE_GETTIMEOFDAY? */
@@ -149,16 +166,8 @@ void xbt_os_walltimer_start(xbt_os_timer_t timer)
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_usec = 0;
   FILETIME ft;
-  unsigned __int64 tm;
-
   GetSystemTimeAsFileTime(&ft);
-  tm = (unsigned __int64) ft.dwHighDateTime << 32;
-  tm |= ft.dwLowDateTime;
-  tm /= 10;
-  tm -= 11644473600000000ULL;
-
-  timer->start.tv_sec = (long) (tm / 1000000L);
-  timer->start.tv_usec = (long) (tm % 1000000L);
+  w32_time_to_timeval(&timer->start, &ft);
 #else
   timer->elapse = 0;
   timer->start = (unsigned long int) (time(NULL));
@@ -180,16 +189,8 @@ void xbt_os_walltimer_resume(xbt_os_timer_t timer)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
   timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
   FILETIME ft;
-  unsigned __int64 tm;
-
   GetSystemTimeAsFileTime(&ft);
-  tm = (unsigned __int64) ft.dwHighDateTime << 32;
-  tm |= ft.dwLowDateTime;
-  tm /= 10;
-  tm -= 11644473600000000ULL;
-
-  timer->start.tv_sec = (long) (tm / 1000000L);
-  timer->start.tv_usec = (long) (tm % 1000000L);
+  w32_time_to_timeval(&timer->start, &ft);
 #else
   timer->elapse = timer->stop - timer->start;
   timer->start = (unsigned long int) (time(NULL));
@@ -204,16 +205,8 @@ void xbt_os_walltimer_stop(xbt_os_timer_t timer)
   gettimeofday(&(timer->stop), NULL);
 #elif defined(_WIN32)
   FILETIME ft;
-  unsigned __int64 tm;
-
   GetSystemTimeAsFileTime(&ft);
-  tm = (unsigned __int64) ft.dwHighDateTime << 32;
-  tm |= ft.dwLowDateTime;
-  tm /= 10;
-  tm -= 11644473600000000ULL;
-
-  timer->stop.tv_sec = (long) (tm / 1000000L);
-  timer->stop.tv_usec = (long) (tm % 1000000L);
+  w32_time_to_timeval(&timer->stop, &ft);
 #else
   timer->stop = (unsigned long int) (time(NULL));
 #endif
@@ -235,15 +228,7 @@ void xbt_os_cputimer_start(xbt_os_timer_t timer)
   HANDLE h = GetCurrentProcess();
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
-  unsigned __int64 ktm, utm;
-  ktm = (unsigned __int64) kernelTime.dwHighDateTime << 32;
-  ktm |= kernelTime.dwLowDateTime;
-  ktm /= 10;
-  utm = (unsigned __int64) userTime.dwHighDateTime << 32;
-  utm |= userTime.dwLowDateTime;
-  utm /= 10;
-  timer->start.tv_sec = (long) (ktm / 1000000L) + (long) (utm / 1000000L);
-  timer->start.tv_usec = (long) (ktm % 1000000L) + (long) (utm % 1000000L);
+  w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
 #endif
 }
 
@@ -263,15 +248,7 @@ void xbt_os_cputimer_resume(xbt_os_timer_t timer)
   HANDLE h = GetCurrentProcess();
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
-  unsigned __int64 ktm, utm;
-  ktm = (unsigned __int64) kernelTime.dwHighDateTime << 32;
-  ktm |= kernelTime.dwLowDateTime;
-  ktm /= 10;
-  utm = (unsigned __int64) userTime.dwHighDateTime << 32;
-  utm |= userTime.dwLowDateTime;
-  utm /= 10;
-  timer->start.tv_sec = (long) (ktm / 1000000L) + (long) (utm / 1000000L);
-  timer->start.tv_usec = (long) (ktm % 1000000L) + (long) (utm % 1000000L);
+  w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
 #endif
 }
 
@@ -285,15 +262,7 @@ void xbt_os_cputimer_stop(xbt_os_timer_t timer)
   HANDLE h = GetCurrentProcess();
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
-  unsigned __int64 ktm, utm;
-  ktm = (unsigned __int64) kernelTime.dwHighDateTime << 32;
-  ktm |= kernelTime.dwLowDateTime;
-  ktm /= 10;
-  utm = (unsigned __int64) userTime.dwHighDateTime << 32;
-  utm |= userTime.dwLowDateTime;
-  utm /= 10;
-  timer->stop.tv_sec = (long) (ktm / 1000000L) + (long) (utm / 1000000L);
-  timer->stop.tv_usec = (long) (ktm % 1000000L) + (long) (utm % 1000000L);
+  w32_times_to_timeval(&timer->stop, &kernelTime, &userTime);
 #endif
 }
 
@@ -320,15 +289,7 @@ void xbt_os_threadtimer_start(xbt_os_timer_t timer)
   HANDLE h = GetCurrentThread();
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
-  unsigned __int64 ktm, utm;
-  ktm = (unsigned __int64) kernelTime.dwHighDateTime << 32;
-  ktm |= kernelTime.dwLowDateTime;
-  ktm /= 10;
-  utm = (unsigned __int64) userTime.dwHighDateTime << 32;
-  utm |= userTime.dwLowDateTime;
-  utm /= 10;
-  timer->start.tv_sec = (long) (ktm / 1000000L) + (long) (utm / 1000000L);
-  timer->start.tv_usec = (long) (ktm % 1000000L) + (long) (utm % 1000000L);
+  w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
 #endif
 }
 
@@ -357,15 +318,7 @@ void xbt_os_threadtimer_resume(xbt_os_timer_t timer)
   HANDLE h = GetCurrentThread();
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
-  unsigned __int64 ktm, utm;
-  ktm = (unsigned __int64) kernelTime.dwHighDateTime << 32;
-  ktm |= kernelTime.dwLowDateTime;
-  ktm /= 10;
-  utm = (unsigned __int64) userTime.dwHighDateTime << 32;
-  utm |= userTime.dwLowDateTime;
-  utm /= 10;
-  timer->start.tv_sec = (long) (ktm / 1000000L) + (long) (utm / 1000000L);
-  timer->start.tv_usec = (long) (ktm % 1000000L) + (long) (utm % 1000000L);
+  w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
 #endif
 }
 
@@ -386,14 +339,6 @@ void xbt_os_threadtimer_stop(xbt_os_timer_t timer)
   HANDLE h = GetCurrentThread();
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
-  unsigned __int64 ktm, utm;
-  ktm = (unsigned __int64) kernelTime.dwHighDateTime << 32;
-  ktm |= kernelTime.dwLowDateTime;
-  ktm /= 10;
-  utm = (unsigned __int64) userTime.dwHighDateTime << 32;
-  utm |= userTime.dwLowDateTime;
-  utm /= 10;
-  timer->stop.tv_sec = (long) (ktm / 1000000L) + (long) (utm / 1000000L);
-  timer->stop.tv_usec = (long) (ktm % 1000000L) + (long) (utm % 1000000L);
+  w32_times_to_timeval(&timer->stop, &kernelTime, &userTime);
 #endif
 }
index b9b6612..beee5cd 100644 (file)
@@ -38,6 +38,7 @@ public:
     fs = new std::ifstream(filename, std::ifstream::in);
     xbt_assert(fs->is_open(), "Cannot read replay file '%s'", filename);
   }
+  ReplayReader(const ReplayReader&) = delete;
   ~ReplayReader()
   {
     delete fs;
@@ -78,9 +79,10 @@ static ReplayAction* get_action(char* name)
       } else {
         // Else, I have to store it for the relevant colleague
         std::queue<ReplayAction*>* otherqueue = nullptr;
-        if (action_queues.find(evtname) != action_queues.end())
-          otherqueue = action_queues.at(evtname);
-        else { // Damn. Create the queue of that guy
+        auto act                              = action_queues.find(evtname);
+        if (act != action_queues.end()) {
+          otherqueue = act->second;
+        } else { // Damn. Create the queue of that guy
           otherqueue = new std::queue<ReplayAction*>();
           action_queues.insert({evtname, otherqueue});
         }
@@ -103,7 +105,7 @@ static void handle_action(ReplayAction* action)
   char** c_action     = new char*[action->size() + 1];
   action_fun function = action_funs.at(action->at(1));
   int i               = 0;
-  for (auto arg : *action) {
+  for (auto const& arg : *action) {
     c_action[i] = xbt_strdup(arg.c_str());
     i++;
   }
@@ -177,7 +179,7 @@ int replay_runner(int argc, char* argv[])
  */
 void xbt_replay_action_register(const char* action_name, action_fun function)
 {
-  simgrid::xbt::action_funs.insert({std::string(action_name), function});
+  simgrid::xbt::action_funs[std::string(action_name)] = function;
 }
 
 /**
index ac5bc37..06f1860 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_str.cpp - various helping functions to deal with strings               */
 
-/* Copyright (c) 2007-2014. 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 "xbt/sysdep.h"
 #include "xbt/str.h"            /* headers of these functions */
 
-/**  @brief Strip whitespace (or other characters) from the end of a string.
- *
- * Strips the whitespaces from the end of s.
- * By default (when char_list=nullptr), these characters get stripped:
- *
- *  - " "    (ASCII 32  (0x20))  space.
- *  - "\t"    (ASCII 9  (0x09))  tab.
- *  - "\n"    (ASCII 10  (0x0A))  line feed.
- *  - "\r"    (ASCII 13  (0x0D))  carriage return.
- *  - "\0"    (ASCII 0  (0x00))  nullptr.
- *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
- *
- * @param s The string to strip. Modified in place.
- * @param char_list A string which contains the characters you want to strip.
- */
-void xbt_str_rtrim(char *s, const char *char_list)
-{
-  char *cur = s;
-  const char *__char_list = " \t\n\r\x0B";
-  char white_char[256] = { 1, 0 };
-
-  if (not s)
-    return;
-
-  if (not char_list) {
-    while (*__char_list) {
-      white_char[(unsigned char) *__char_list++] = 1;
-    }
-  } else {
-    while (*char_list) {
-      white_char[(unsigned char) *char_list++] = 1;
-    }
-  }
-
-  while (*cur)
-    ++cur;
-
-  while ((cur >= s) && white_char[(unsigned char) *cur])
-    --cur;
-
-  *++cur = '\0';
-}
-
-/**  @brief Strip whitespace (or other characters) from the beginning of a string.
- *
- * Strips the whitespaces from the begining of s.
- * By default (when char_list=nullptr), these characters get stripped:
- *
- *  - " "    (ASCII 32  (0x20))  space.
- *  - "\t"    (ASCII 9  (0x09))  tab.
- *  - "\n"    (ASCII 10  (0x0A))  line feed.
- *  - "\r"    (ASCII 13  (0x0D))  carriage return.
- *  - "\0"    (ASCII 0  (0x00))  nullptr.
- *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
- *
- * @param s The string to strip. Modified in place.
- * @param char_list A string which contains the characters you want to strip.
- */
-void xbt_str_ltrim(char *s, const char *char_list)
-{
-  char *cur = s;
-  const char *__char_list = " \t\n\r\x0B";
-  char white_char[256] = { 1, 0 };
-
-  if (not s)
-    return;
-
-  if (not char_list) {
-    while (*__char_list) {
-      white_char[(unsigned char) *__char_list++] = 1;
-    }
-  } else {
-    while (*char_list) {
-      white_char[(unsigned char) *char_list++] = 1;
-    }
-  }
-
-  while (*cur && white_char[(unsigned char) *cur])
-    ++cur;
-
-  memmove(s, cur, strlen(cur) + 1);
-}
-
-/**  @brief Strip whitespace (or other characters) from the end and the begining of a string.
- *
- * Strips the whitespaces from both the beginning and the end of s.
- * By default (when char_list=nullptr), these characters get stripped:
- *
- *  - " "    (ASCII 32  (0x20))  space.
- *  - "\t"    (ASCII 9  (0x09))  tab.
- *  - "\n"    (ASCII 10  (0x0A))  line feed.
- *  - "\r"    (ASCII 13  (0x0D))  carriage return.
- *  - "\0"    (ASCII 0  (0x00))  nullptr.
- *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
- *
- * @param s The string to strip.
- * @param char_list A string which contains the characters you want to strip.
- */
-void xbt_str_trim(char *s, const char *char_list)
-{
-  if (not s)
-    return;
-
-  xbt_str_rtrim(s, char_list);
-  xbt_str_ltrim(s, char_list);
-}
-
-/** @brief Substitutes a char for another in a string
- *
- * @param str the string to modify
- * @param from char to search
- * @param to char to put instead
- * @param occurence number of changes to do (=0 means all)
- */
-void xbt_str_subst(char *str, char from, char to, int occurence)
-{
-  char *p = str;
-  while (*p != '\0') {
-    if (*p == from) {
-      *p = to;
-      if (occurence == 1)
-        return;
-      occurence--;
-    }
-    p++;
-  }
-}
-
 /** @brief Splits a string into a dynar of strings
  *
  * @param s: the string to split
@@ -196,52 +68,6 @@ xbt_dynar_t xbt_str_split(const char *s, const char *sep)
   return res;
 }
 
-/**
- * \brief This functions splits a string after using another string as separator
- * For example Anot not B!not C split after !! will return the dynar {A,B,C}
- * \return An array of dynars containing the string tokens
- */
-xbt_dynar_t xbt_str_split_str(const char *s, const char *sep)
-{
-  xbt_dynar_t res = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
-
-  const char* p = s;
-  const char* q = s;
-  int done      = 0;
-
-  if (s[0] == '\0')
-    return res;
-  if (sep[0] == '\0') {
-    s = xbt_strdup(s);
-    xbt_dynar_push(res, &s);
-    return res;
-  }
-
-  while (not done) {
-    char *to_push;
-    // get the start of the first occurrence of the substring
-    q = strstr(p, sep);
-    //if substring was not found add the entire string
-    if (nullptr == q) {
-      int v   = strlen(p);
-      to_push = (char*) xbt_malloc(v + 1);
-      memcpy(to_push, p, v);
-      to_push[v] = '\0';
-      xbt_dynar_push(res, &to_push);
-      done = 1;
-    } else {
-      //get the appearance
-      to_push = (char*) xbt_malloc(q - p + 1);
-      memcpy(to_push, p, q - p);
-      //add string terminator
-      to_push[q - p] = '\0';
-      xbt_dynar_push(res, &to_push);
-      p = q + strlen(sep);
-    }
-  }
-  return res;
-}
-
 /** @brief Just like @ref xbt_str_split_quoted (Splits a string into a dynar of strings), but without memory allocation
  *
  * The string passed as argument must be writable (not const)
@@ -362,40 +188,12 @@ xbt_dynar_t xbt_str_split_quoted(const char *s)
     char *q=xbt_strdup(p);
     xbt_dynar_push(res,&q);
   }
-  free(str_to_free);
+  xbt_free(str_to_free);
   xbt_dynar_shrink(res, 0);
   xbt_dynar_free(&parsed);
   return res;
 }
 
-/** @brief Join a set of strings as a single string */
-char *xbt_str_join(xbt_dynar_t dyn, const char *sep)
-{
-  int len     = 1;
-  int dyn_len = xbt_dynar_length(dyn);
-  unsigned int cpt;
-  char* cursor;
-
-  if (not dyn_len)
-    return xbt_strdup("");
-
-  /* compute the length */
-  xbt_dynar_foreach(dyn, cpt, cursor) {
-    len += strlen(cursor);
-  }
-  len += strlen(sep) * dyn_len;
-  /* Do the job */
-  char* res = (char*)xbt_malloc(len);
-  char* p   = res;
-  xbt_dynar_foreach(dyn, cpt, cursor) {
-    if ((int) cpt < dyn_len - 1)
-      p += snprintf(p,len, "%s%s", cursor, sep);
-    else
-      p += snprintf(p,len, "%s", cursor);
-  }
-  return res;
-}
-
 /** @brief Join a set of strings as a single string
  *
  * The parameter must be a nullptr-terminated array of chars,
@@ -473,14 +271,16 @@ XBT_TEST_SUITE("xbt_str", "String Handling");
 
 #define mytest(name, input, expected)                                                                                  \
   xbt_test_add(name);                                                                                                  \
-  d = xbt_str_split_quoted(input);                                                                                     \
-  s = xbt_str_join(d, "XXX");                                                                                          \
+  a = static_cast<char**>(xbt_dynar_to_array(xbt_str_split_quoted(input)));                                            \
+  s = xbt_str_join_array(a, "XXX");                                                                                    \
   xbt_test_assert(not strcmp(s, expected), "Input (%s) leads to (%s) instead of (%s)", input, s, expected);            \
-  free(s);                                                                                                             \
-  xbt_dynar_free(&d);
-XBT_TEST_UNIT("xbt_str_split_quoted", test_split_quoted, "test the function xbt_str_split_quoted")
+  xbt_free(s);                                                                                                         \
+  for (int i = 0; a[i] != nullptr; i++)                                                                                \
+    xbt_free(a[i]);                                                                                                    \
+  xbt_free(a);
+XBT_TEST_UNIT("xbt_str_split_quoted", test_split_quoted, "Test the function xbt_str_split_quoted")
 {
-  xbt_dynar_t d;
+  char** a;
   char *s;
 
   mytest("Empty", "", "");
@@ -497,26 +297,6 @@ XBT_TEST_UNIT("xbt_str_split_quoted", test_split_quoted, "test the function xbt_
   mytest("Backslashed quotes + quotes", "'toto \\'tutu' tata", "toto 'tutuXXXtata");
 }
 
-#define mytest_str(name, input, separator, expected)                                                                   \
-  xbt_test_add(name);                                                                                                  \
-  d = xbt_str_split_str(input, separator);                                                                             \
-  s = xbt_str_join(d, "XXX");                                                                                          \
-  xbt_test_assert(not strcmp(s, expected), "Input (%s) leads to (%s) instead of (%s)", input, s, expected);            \
-  free(s);                                                                                                             \
-  xbt_dynar_free(&d);
-
-XBT_TEST_UNIT("xbt_str_split_str", test_split_str, "test the function xbt_str_split_str")
-{
-  xbt_dynar_t d;
-  char *s;
-
-  mytest_str("Empty string and separator", "", "", "");
-  mytest_str("Empty string", "", "##", "");
-  mytest_str("Empty separator", "toto", "", "toto");
-  mytest_str("String with no separator in it", "toto", "##", "toto");
-  mytest_str("Basic test", "toto##tutu", "##", "totoXXXtutu");
-}
-
 #define test_parse_error(function, name, variable, str)                 \
   do {                                                                  \
     xbt_test_add(name);                                                 \
index 2d9d5df..de2af46 100644 (file)
@@ -1,7 +1,7 @@
-set(semaphoreGC_files  SemaphoreGC)
-set(sleepHostOff_files SleepHostOff)
+set(semaphoregc_files  SemaphoreGC)
+set(sleephostoff_files SleepHostOff)
 
-foreach(example semaphoreGC sleepHostOff)
+foreach(example semaphoregc sleephostoff)
   foreach (filename ${${example}_files} )
     set(sources "${${example}_sources}" "${CMAKE_CURRENT_SOURCE_DIR}/${example}/${filename}.java")
   endforeach()
@@ -11,14 +11,14 @@ foreach(example semaphoreGC sleepHostOff)
   if(enable_java)
     add_custom_command(
       COMMENT "Building ${example}..."
-      OUTPUT  ${example}_compiled
+      OUTPUT  java-${example}_compiled
       DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
       COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${sources}
-      COMMAND ${CMAKE_COMMAND} -E remove ${example}/${example}_compiled
-      COMMAND ${CMAKE_COMMAND} -E touch ${example}/${example}_compiled
+      COMMAND ${CMAKE_COMMAND} -E remove ${example}/java-${example}_compiled
+      COMMAND ${CMAKE_COMMAND} -E touch ${example}/java-${example}_compiled
     )
-    add_custom_target(${example} ALL DEPENDS ${example}_compiled)
-    set_target_properties(${example}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
+    add_custom_target(java-${example} ALL DEPENDS java-${example}_compiled)
+    set_target_properties(java-${example}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
   endif()
   set(examples_src ${examples_src} ${sources})
 endforeach()
@@ -27,6 +27,6 @@ set(examples_src ${examples_src} ${sources}
 set(tesh_files   ${tesh_files}                                                                 PARENT_SCOPE)
 
 if(enable_java)
-  ADD_TESH(tesh-java-semaphoreGC  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/semaphoreGC  ${CMAKE_HOME_DIRECTORY}/teshsuite/java/semaphoreGC/semaphoreGC.tesh)
-  ADD_TESH(tesh-java-sleepHostOff --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/sleepHostOff ${CMAKE_HOME_DIRECTORY}/teshsuite/java/sleepHostOff/sleepHostOff.tesh)
+  ADD_TESH(tesh-java-semaphoregc  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/semaphoregc  ${CMAKE_HOME_DIRECTORY}/teshsuite/java/semaphoregc/semaphoregc.tesh)
+  ADD_TESH(tesh-java-sleephostoff --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/sleephostoff ${CMAKE_HOME_DIRECTORY}/teshsuite/java/sleephostoff/sleephostoff.tesh)
 endif()
similarity index 93%
rename from teshsuite/java/semaphoreGC/SemaphoreGC.java
rename to teshsuite/java/semaphoregc/SemaphoreGC.java
index cf18ab2..21cad25 100644 (file)
@@ -7,7 +7,7 @@
  * This was reported as bug #19893 on gforge.
  */
 
-package semaphoreGC;
+package semaphoregc;
 
 import org.simgrid.msg.*;
 import org.simgrid.msg.Process;
@@ -37,7 +37,7 @@ public class SemaphoreGC {
   public static void main(String[] args) throws Exception {
     Msg.init(args);
     if (args.length < 1) {
-      Msg.info("Usage: java -cp simgrid.jar:. semaphoreGC.SemaphoreGC <deployment.xml>");
+      Msg.info("Usage: java -cp simgrid.jar:. semaphoregc.SemaphoreGC <deployment.xml>");
       System.exit(1);
     }
     Msg.createEnvironment(args[0]);
similarity index 86%
rename from teshsuite/java/semaphoreGC/semaphoreGC.tesh
rename to teshsuite/java/semaphoregc/semaphoregc.tesh
index d3d9f3e..a321b13 100644 (file)
@@ -1,6 +1,6 @@
 ! timeout 15
 
-$ java -classpath ${classpath:=.} semaphoreGC.SemaphoreGC ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.4r]%e(%i:%P@%h)%e%m%n"
+$ java -classpath ${classpath:=.} semaphoregc.SemaphoreGC ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.4r]%e(%i:%P@%h)%e%m%n"
 > [    0.0000] (0:maestro@) Using regular java threads.
 > [    0.0000] (1:SemCreator@Fafard) Creating 50 new Semaphores, yielding and triggering a GC after each
 > [  500.0000] (1:SemCreator@Fafard) It worked, we survived. The test is passed.
@@ -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. */
 
-package sleepHostOff;
+package sleephostoff;
 
 import org.simgrid.msg.*;
 import org.simgrid.msg.Process;
@@ -55,7 +55,7 @@ public class SleepHostOff {
     Msg.init(args);
 
     if (args.length < 1) {
-      Msg.info("Usage: java -cp simgrid.jar:. sleepHostOff.SleepHostOff <platform.xml>");
+      Msg.info("Usage: java -cp simgrid.jar:. sleephostoff.SleepHostOff <platform.xml>");
       System.exit(1);
     }
 
@@ -1,4 +1,4 @@
-$ java -classpath ${classpath:=.} sleepHostOff.SleepHostOff ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ java -classpath ${classpath:=.} sleephostoff.SleepHostOff ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Using regular java threads.
 > [  0.000000] (1:TestRunner@Fafard) **** **** **** ***** ***** Test Sleep ***** ***** **** **** ****
 > [  0.000000] (1:TestRunner@Fafard) Test sleep: Create a process on Tremblay that simply make periodic sleep, turn off Tremblay
index 17e7aec..1ca7992 100644 (file)
@@ -1,4 +1,4 @@
-$ ${bindir:=.}/../../examples/msg/app-masterworker/app-masterworker ${srcdir:=.}/../../examples/platforms/small_platform.lua ${srcdir:=.}/../../examples/msg/app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/msg/app-masterworker/app-masterworker ${srcdir:=.}/../../examples/platforms/small_platform.lua ${srcdir:=.}/../../examples/msg/app-masterworker/app-masterworker_d.xml
 > [Tremblay:master:(1) 0.000000] [msg_app_masterworker/INFO] Got 5 workers and 20 tasks to process
 > [Tremblay:master:(1) 0.000000] [msg_app_masterworker/INFO] Sending "Task_0" (of 20) to mailbox "worker-0"
 > [Tremblay:master:(1) 0.002265] [msg_app_masterworker/INFO] Sending "Task_1" (of 20) to mailbox "worker-1"
@@ -28,7 +28,7 @@ $ ${bindir:=.}/../../examples/msg/app-masterworker/app-masterworker ${srcdir:=.}
 > [Bourassa:worker:(6) 5.133855] [msg_app_masterworker/INFO] I'm done. See you!
 > [5.133855] [msg_app_masterworker/INFO] Simulation time 5.13386
 
-$ $SG_TEST_EXENV ${bindir:=.}/../../examples/msg/app-token-ring/app-token-ring ${srcdir:=.}/../../examples/platforms/routing_cluster.lua "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/msg/app-token-ring/app-token-ring ${srcdir:=.}/../../examples/platforms/routing_cluster.lua "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Number of hosts '6'
 > [  0.000000] (1:0@host1) Host "0" send 'Token' to Host "1"
 > [  0.017354] (2:1@host2) Host "1" received "Token"
index afc7d12..0ebb431 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
@@ -8,11 +8,11 @@
 #undef NDEBUG
 #endif
 
-#include <string.h>
-#include <assert.h>
-#include <stdlib.h>
+#include <cassert>
+#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"
@@ -56,12 +56,15 @@ void basic_test(simgrid::dwarf::ExpressionContext const& state) {
 
   simgrid::dwarf::ExpressionStack stack;
 
+  bool caught_ex = false;
   try {
     ops[0].atom = DW_OP_drop;
     simgrid::dwarf::execute(ops, 1, state, stack);
-    fprintf(stderr,"Exception expected");
+  } catch (simgrid::dwarf::evaluation_error& e) {
+    caught_ex = true;
   }
-  catch(simgrid::dwarf::evaluation_error& e) {}
+  if (not caught_ex)
+    fprintf(stderr, "Exception expected");
 
   ops[0].atom = DW_OP_lit21;
   simgrid::dwarf::execute(ops, 1, state, stack);
index 20e0645..c1eb4fa 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
@@ -8,13 +8,13 @@
 #undef NDEBUG
 #endif
 
-#include <string.h>
-#include <assert.h>
+#include <cassert>
+#include <cstring>
 
 #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"
@@ -25,7 +25,8 @@ int test_some_array[4][5][6];
 struct some_struct {
   int first;
   int second[4][5];
-} test_some_struct;
+};
+some_struct test_some_struct;
 
 static simgrid::mc::Type* find_type_by_name(simgrid::mc::ObjectInformation* info, const char* name)
 {
@@ -105,11 +106,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)
+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)
@@ -153,7 +156,7 @@ int main(int argc, char** argv)
   int lexical_block_variable = 50;
   test_local_variable(process.binary_info.get(), "main", "lexical_block_variable", &lexical_block_variable, &cursor);
 
-  s_foo my_foo;
+  s_foo my_foo = {0};
   test_type_by_name(process, my_foo);
 
   _exit(0);
index 8203287..0556ec3 100644 (file)
@@ -10,7 +10,7 @@ foreach(x actions-comm actions-storage cloud-sharing get_sender host_on_off host
 endforeach()
 
 # CPP examples
-foreach(x task_destroy_cancel task_listen_from)
+foreach(x task_destroy_cancel task_listen_from task_progress)
   add_executable       (${x}  ${x}/${x}.cpp)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -19,8 +19,17 @@ foreach(x task_destroy_cancel task_listen_from)
   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
 endforeach()
 
+add_executable       (bittorrent app-bittorrent/bittorrent.c app-bittorrent/messages.c app-bittorrent/peer.c app-bittorrent/tracker.c app-bittorrent/connection.c)
+target_link_libraries(bittorrent simgrid)
+set_target_properties(bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
+foreach (file bittorrent connection messages peer tracker)
+  set(teshsuite_src  ${teshsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.c  ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.h)
+endforeach()
+
+
 set(teshsuite_src ${teshsuite_src}  PARENT_SCOPE)
-set(tesh_files    ${tesh_files}     PARENT_SCOPE)
+set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent.tesh          PARENT_SCOPE)
+set(bin_files    ${bin_files}      ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/generate.py                  PARENT_SCOPE)
 set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm.txt
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm_split_p0.txt
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm_split_p1.txt
@@ -28,7 +37,8 @@ set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/acti
 set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm_split_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/actions-storage_d.xml
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.5-hbp1.5.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1-c0s0-c0s1.xml
@@ -41,11 +51,12 @@ set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/acti
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1-c1s1-c3s2.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp2.5-hbp1.5.xml    PARENT_SCOPE)
 
-foreach(x get_sender host_on_off host_on_off_processes host_on_off_recv task_destroy_cancel task_listen_from trace_integration)
-  ADD_TESH_FACTORIES(tesh-msg-${x} "thread;boost;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
+foreach(x get_sender host_on_off host_on_off_processes host_on_off_recv
+    task_destroy_cancel task_listen_from task_progress trace_integration)
+  ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
 endforeach()
 
-foreach(x actions-comm actions-storage)
+foreach(x actions-comm actions-storage app-bittorrent)
   ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} ${x}.tesh)
 endforeach()
 # One context factory is enough for these ones
@@ -53,3 +64,5 @@ endforeach()
 foreach(x cloud-sharing)
   ADD_TESH(tesh-msg-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
 endforeach()
+
+ADD_TESH_FACTORIES(tesh-app-bittorrent-parallel         "thread;ucontext;raw;boost" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/app-bittorrent --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/app-bittorrent app-bittorrent.tesh)
index d0fc423..e4cfac8 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/msg.h"
+#include "simgrid/plugins/file_system.h"
 #include <xbt/replay.hpp>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(storage_actions, "Messages specific for this example");
@@ -98,6 +99,7 @@ static void action_close(const char* const* action)
 int main(int argc, char* argv[])
 {
   MSG_init(&argc, argv);
+  MSG_storage_file_system_init();
   /* Explicit initialization of the action module is required */
   MSG_action_init();
 
@@ -4,7 +4,7 @@ p Testing the Bittorrent implementation with MSG
 
 ! timeout 10
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/bittorrent ${srcdir:=.}/cluster.xml ${srcdir:=.}/../msg/app-bittorrent/app-bittorrent_d.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/bittorrent ${srcdir:=.}/cluster.xml app-bittorrent_d.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
 > [    0.000000] (1:tracker@node-0.acme.org) Tracker launched.
 > [    0.000000] (2:peer@node-1.acme.org) Hi, I'm joining the network with id 2
 > [    0.000000] (3:peer@node-2.acme.org) Hi, I'm joining the network with id 3
diff --git a/teshsuite/msg/app-bittorrent/app-bittorrent_d.xml b/teshsuite/msg/app-bittorrent/app-bittorrent_d.xml
new file mode 100644 (file)
index 0000000..5460ab1
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+
+  <actor host="node-0.acme.org" function="tracker">
+    <argument value="3000" />
+  </actor>
+
+  <actor host="node-1.acme.org" function="peer">
+    <argument value="00000002"/>    <!-- my id -->
+    <argument value="5000" />    <!-- end time --> 
+    <argument value="1" />       <!-- indicates if the peer is a seed at the beginning of the simulation --> 
+  </actor>
+  <actor host="node-2.acme.org" function="peer">
+    <argument value="00000003"/>    <!-- my id -->
+    <argument value="5000" />    <!-- end time --> 
+  </actor>
+  <actor host="node-3.acme.org" function="peer">
+    <argument value="00000004"/>    <!-- my id -->
+    <argument value="5000" />    <!-- end time --> 
+  </actor>
+  <actor host="node-4.acme.org" function="peer">
+    <argument value="00000005"/>    <!-- my id -->
+    <argument value="5000" />    <!-- end time --> 
+    <argument value="1" />       <!-- indicates if the peer is a seed at the beginning of the simulation --> 
+  </actor>
+  <actor host="node-5.acme.org" function="peer">
+    <argument value="00000006"/>    <!-- my id -->
+    <argument value="5000" />    <!-- end time --> 
+  </actor>
+  <actor host="node-6.acme.org" function="peer">
+    <argument value="00000007"/>    <!-- my id -->
+    <argument value="5000" />    <!-- end time --> 
+  </actor>
+  <actor host="node-7.acme.org" function="peer">
+    <argument value="00000008"/>    <!-- my id -->
+    <argument value="5000" />    <!-- end time --> 
+  </actor>
+</platform>
similarity index 85%
rename from examples/msg/app-bittorrent/bittorrent.c
rename to teshsuite/msg/app-bittorrent/bittorrent.c
index c38162a..93b8e0e 100644 (file)
@@ -11,7 +11,7 @@
 #include <xbt/RngStream.h>
 
 /** Bittorrent example launcher */
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   msg_host_t host;
   unsigned i;
@@ -19,12 +19,12 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
 
   /* Check the arguments */
-  xbt_assert (argc > 2, "Usage: %s platform_file deployment_file", argv[0]);
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file", argv[0]);
 
   MSG_create_environment(argv[1]);
 
   xbt_dynar_t host_list = MSG_hosts_as_dynar();
-  xbt_dynar_foreach(host_list, i, host) {
+  xbt_dynar_foreach (host_list, i, host) {
     char descr[512];
     snprintf(descr, sizeof descr, "RngSream<%s>", MSG_host_get_name(host));
     RngStream stream = RngStream_CreateStream(descr);
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
 
   MSG_main();
 
-  xbt_dynar_foreach(host_list, i, host) {
+  xbt_dynar_foreach (host_list, i, host) {
     RngStream stream = (RngStream)MSG_host_get_data(host);
     RngStream_DeleteStream(&stream);
     MSG_host_set_data(host, NULL);
similarity index 84%
rename from examples/msg/app-bittorrent/bittorrent.h
rename to teshsuite/msg/app-bittorrent/bittorrent.h
index b45d688..d887938 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
 #define MAILBOX_SIZE 40
 #define TRACKER_MAILBOX "tracker_mailbox"
 /** Max number of pairs sent by the tracker to clients */
-#define MAXIMUM_PAIRS 50
+#define MAXIMUM_PEERS 50
 /** Interval of time where the peer should send a request to the tracker */
 #define TRACKER_QUERY_INTERVAL 1000
 /** Communication size for a task to the tracker */
-#define TRACKER_COMM_SIZE 0.01
+#define TRACKER_COMM_SIZE 1
 #define GET_PEERS_TIMEOUT 10000
 #define TIMEOUT_MESSAGE 10
 #define TRACKER_RECEIVE_TIMEOUT 10
@@ -25,4 +25,4 @@
 /** Number of pieces the peer asks for simultaneously */
 #define MAX_PIECES 1
 
-#endif                          /* BITTORRENT_BITTORRENT_H_ */
+#endif /* BITTORRENT_BITTORRENT_H_ */
similarity index 63%
rename from examples/msg/app-bittorrent/connection.c
rename to teshsuite/msg/app-bittorrent/connection.c
index 43140e6..3a53ed9 100644 (file)
@@ -13,16 +13,16 @@ connection_t connection_new(int id)
 {
   connection_t connection = xbt_new(s_connection_t, 1);
 
-  connection->id = id;
-  connection->mailbox = bprintf("%d", id);
-  connection->bitfield = 0;
-  connection->current_piece = -1;
-  connection->interested = 0;
-  connection->am_interested = 0;
-  connection->choked_upload = 1;
+  connection->id              = id;
+  connection->mailbox         = bprintf("%d", id);
+  connection->bitfield        = 0;
+  connection->current_piece   = -1;
+  connection->interested      = 0;
+  connection->am_interested   = 0;
+  connection->choked_upload   = 1;
   connection->choked_download = 1;
-  connection->peer_speed = 0;
-  connection->last_unchoke = 0;
+  connection->peer_speed      = 0;
+  connection->last_unchoke    = 0;
 
   return connection;
 }
@@ -32,13 +32,14 @@ void connection_add_speed_value(connection_t connection, double speed)
   connection->peer_speed = connection->peer_speed * 0.6 + speed * 0.4;
 }
 
-void connection_free(void *data)
+void connection_free(voiddata)
 {
-  connection_t co = (connection_t) data;
+  connection_t co = (connection_t)data;
   xbt_free(co->mailbox);
   xbt_free(co);
 }
 
-int connection_has_piece(connection_t connection, unsigned int piece){
-  return (connection->bitfield & 1U<<piece);
+int connection_has_piece(connection_t connection, unsigned int piece)
+{
+  return (connection->bitfield & 1U << piece);
 }
similarity index 62%
rename from examples/msg/app-bittorrent/connection.h
rename to teshsuite/msg/app-bittorrent/connection.h
index cd33620..2b64528 100644 (file)
@@ -9,20 +9,20 @@
 
 /**  Contains the connection data of a peer. */
 typedef struct s_connection {
-  int id;                       //Peer id
-  unsigned int bitfield;        //Fields
-  char *mailbox;
+  int id;                // Peer id
+  unsigned int bitfield; // Fields
+  charmailbox;
   int messages_count;
   double peer_speed;
   double last_unchoke;
   int current_piece;
-  unsigned int am_interested:1;   //Indicates if we are interested in something the peer has
-  unsigned int interested:1;      //Indicates if the peer is interested in one of our pieces
-  unsigned int choked_upload:1;   //Indicates if the peer is choked for the current peer
-  unsigned int choked_download:1; //Indicates if the peer has choked the current peer
+  unsigned int am_interested : 1;   // Indicates if we are interested in something the peer has
+  unsigned int interested : 1;      // Indicates if the peer is interested in one of our pieces
+  unsigned int choked_upload : 1;   // Indicates if the peer is choked for the current peer
+  unsigned int choked_download : 1; // Indicates if the peer has choked the current peer
 } s_connection_t;
 
-typedef s_connection_t *connection_t;
+typedef s_connection_tconnection_t;
 
 /** @brief Build a new connection object from the peer id.
  *  @param id id of the peer
@@ -34,6 +34,6 @@ connection_t connection_new(int id);
  */
 void connection_add_speed_value(connection_t connection, double speed);
 /** Frees a connection object */
-void connection_free(void *data);
+void connection_free(voiddata);
 int connection_has_piece(connection_t connection, unsigned int piece);
-#endif                          /* BITTORRENT_CONNECTION_H_ */
+#endif /* BITTORRENT_CONNECTION_H_ */
diff --git a/teshsuite/msg/app-bittorrent/messages.c b/teshsuite/msg/app-bittorrent/messages.c
new file mode 100644 (file)
index 0000000..671c289
--- /dev/null
@@ -0,0 +1,118 @@
+/* Copyright (c) 2012-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "messages.h"
+#include "bittorrent.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_messages, "Messages specific for the message factory");
+
+#define BITS_TO_BYTES(x) (((x) / 8 + (x) % 8) ? 1 : 0)
+
+/** @brief Build a new empty message
+ * @param type type of the message
+ * @param issuer_host_name hostname of the issuer, for debugging purposes
+ * @param mailbox mailbox where the peer should answer
+ * @param peer_id id of the issuer
+ * @param size message size in bytes
+ */
+msg_task_t task_message_new(e_message_type type, const char* issuer_host_name, const char* mailbox, int peer_id,
+                            int size)
+{
+  message_t message         = xbt_new(s_message_t, 1);
+  message->issuer_host_name = issuer_host_name;
+  message->peer_id          = peer_id;
+  message->mailbox          = mailbox;
+  message->type             = type;
+  msg_task_t task           = MSG_task_create(NULL, 0, size, message);
+  XBT_DEBUG("type: %d size: %d", (int)type, size);
+  return task;
+}
+
+/** Builds a message containing an index. */
+msg_task_t task_message_index_new(e_message_type type, const char* issuer_host_name, const char* mailbox, int peer_id,
+                                  int index, int varsize)
+{
+  msg_task_t task   = task_message_new(type, issuer_host_name, mailbox, peer_id, task_message_size(type) + varsize);
+  message_t message = MSG_task_get_data(task);
+  message->index    = index;
+  return task;
+}
+
+msg_task_t task_message_bitfield_new(const char* issuer_host_name, const char* mailbox, int peer_id,
+                                     unsigned int bitfield, int bitfield_size)
+{
+  msg_task_t task = task_message_new(MESSAGE_BITFIELD, issuer_host_name, mailbox, peer_id,
+                                     task_message_size(MESSAGE_BITFIELD) + BITS_TO_BYTES(bitfield_size));
+  message_t message = MSG_task_get_data(task);
+  message->bitfield = bitfield;
+  return task;
+}
+
+msg_task_t task_message_request_new(const char* issuer_host_name, const char* mailbox, int peer_id, int index,
+                                    int block_index, int block_length)
+{
+  msg_task_t task       = task_message_index_new(MESSAGE_REQUEST, issuer_host_name, mailbox, peer_id, index, 0);
+  message_t message     = MSG_task_get_data(task);
+  message->block_index  = block_index;
+  message->block_length = block_length;
+  return task;
+}
+
+msg_task_t task_message_piece_new(const char* issuer_host_name, const char* mailbox, int peer_id, int index,
+                                  int block_index, int block_length, int block_size)
+{
+  msg_task_t task =
+      task_message_index_new(MESSAGE_PIECE, issuer_host_name, mailbox, peer_id, index, block_length * block_size);
+  message_t message     = MSG_task_get_data(task);
+  message->block_index  = block_index;
+  message->block_length = block_length;
+  return task;
+}
+
+void task_message_free(void* task)
+{
+  message_t message = MSG_task_get_data(task);
+  xbt_free(message);
+  MSG_task_destroy(task);
+}
+
+int task_message_size(e_message_type type)
+{
+  int size = 0;
+  switch (type) {
+    case MESSAGE_HANDSHAKE:
+      size = MESSAGE_HANDSHAKE_SIZE;
+      break;
+    case MESSAGE_CHOKE:
+      size = MESSAGE_CHOKE_SIZE;
+      break;
+    case MESSAGE_UNCHOKE:
+      size = MESSAGE_UNCHOKE_SIZE;
+      break;
+    case MESSAGE_INTERESTED:
+    case MESSAGE_NOTINTERESTED:
+      size = MESSAGE_INTERESTED_SIZE;
+      break;
+    case MESSAGE_HAVE:
+      size = MESSAGE_HAVE_SIZE;
+      break;
+    case MESSAGE_BITFIELD:
+      size = MESSAGE_BITFIELD_SIZE;
+      break;
+    case MESSAGE_REQUEST:
+      size = MESSAGE_REQUEST_SIZE;
+      break;
+    case MESSAGE_PIECE:
+      size = MESSAGE_PIECE_SIZE;
+      break;
+    case MESSAGE_CANCEL:
+      size = MESSAGE_CANCEL_SIZE;
+      break;
+    default:
+      THROW_IMPOSSIBLE;
+  }
+  return size;
+}
similarity index 74%
rename from examples/msg/app-bittorrent/messages.h
rename to teshsuite/msg/app-bittorrent/messages.h
index 66129d9..a86649b 100644 (file)
@@ -40,33 +40,33 @@ typedef enum {
 /** Message data */
 typedef struct s_message {
   e_message_type type;
-  const char *mailbox;
-  const char *issuer_host_name;
+  const charmailbox;
+  const charissuer_host_name;
   int peer_id;
   unsigned int bitfield;
   int index;
   int block_index;
   int block_length;
 } s_message_t;
-typedef s_message_t *message_t;
+typedef s_message_tmessage_t;
 
 /** Builds a new value-less message */
-msg_task_t task_message_new(e_message_type type, const char *issuer_host_name, const char *mailbox, int peer_id,
+msg_task_t task_message_new(e_message_type type, const char* issuer_host_name, const char* mailbox, int peer_id,
                             int size);
 /** Builds a new "have/piece" message */
-msg_task_t task_message_index_new(e_message_type type, const char *issuer_host_name, const char *mailbox, int peer_id,
+msg_task_t task_message_index_new(e_message_type type, const char* issuer_host_name, const char* mailbox, int peer_id,
                                   int index, int varsize);
 /** Builds a new bitfield message */
-msg_task_t task_message_bitfield_new(const char *issuer_host_name, const char *mailbox, int peer_id,
+msg_task_t task_message_bitfield_new(const char* issuer_host_name, const char* mailbox, int peer_id,
                                      unsigned int bitfield, int bitfield_size);
 /** Builds a new "request" message */
-msg_task_t task_message_request_new(const char *issuer_host_name, const char *mailbox, int peer_id, int index,
+msg_task_t task_message_request_new(const char* issuer_host_name, const char* mailbox, int peer_id, int index,
                                     int block_index, int block_length);
 /** Build a new "piece" message */
-msg_task_t task_message_piece_new(const char *issuer_host_name, const char *mailbox, int peer_id, int index,
+msg_task_t task_message_piece_new(const char* issuer_host_name, const char* mailbox, int peer_id, int index,
                                   int block_index, int block_length, int block_size);
 /** Free a message task */
-void task_message_free(void *);
+void task_message_free(void*);
 int task_message_size(e_message_type type);
 
-#endif                          /* BITTORRENT_MESSAGES_H_ */
+#endif /* BITTORRENT_MESSAGES_H_ */
similarity index 63%
rename from examples/msg/app-bittorrent/peer.c
rename to teshsuite/msg/app-bittorrent/peer.c
index 959e523..69d75df 100644 (file)
@@ -4,12 +4,12 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "peer.h"
-#include "tracker.h"
 #include "connection.h"
 #include "messages.h"
+#include "tracker.h"
+#include <limits.h>
 #include <simgrid/msg.h>
 #include <xbt/RngStream.h>
-#include <limits.h>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_peers, "Messages specific for the peers");
 
@@ -17,9 +17,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_peers, "Messages specific for the peers");
  * User parameters for transferred file data. For the test, the default values are :
  * File size: 10 pieces * 5 blocks/piece * 16384 bytes/block = 819200 bytes
  */
-#define FILE_PIECES  10U
-#define PIECES_BLOCKS 5U
-#define BLOCK_SIZE  16384
+#define FILE_PIECES 10UL
+#define PIECES_BLOCKS 5UL
+#define BLOCK_SIZE 16384
 static const unsigned long int FILE_SIZE = FILE_PIECES * PIECES_BLOCKS * BLOCK_SIZE;
 
 /** Number of blocks asked by each request */
@@ -28,48 +28,52 @@ static const unsigned long int FILE_SIZE = FILE_PIECES * PIECES_BLOCKS * BLOCK_S
 #define ENABLE_END_GAME_MODE 1
 #define SLEEP_DURATION 1
 
-int count_pieces(unsigned int bitfield){
-  int count=0;
+int count_pieces(unsigned int bitfield)
+{
+  int count      = 0;
   unsigned int n = bitfield;
-  while (n){
+  while (n) {
     count += n & 1U;
-    n >>= 1U ;
+    n >>= 1U;
   }
   return count;
 }
 
-int peer_has_not_piece(peer_t peer, unsigned int piece){
-  return !(peer->bitfield & 1U<<piece);
+int peer_has_not_piece(peer_t peer, unsigned int piece)
+{
+  return !(peer->bitfield & 1U << piece);
 }
 
 /** Check that a piece is not currently being download by the peer. */
-int peer_is_not_downloading_piece(peer_t peer, unsigned int piece){
-  return !(peer->current_pieces & 1U<<piece);
+int peer_is_not_downloading_piece(peer_t peer, unsigned int piece)
+{
+  return !(peer->current_pieces & 1U << piece);
 }
 
-void get_status(char **status, unsigned int bitfield){
-  for(int i=FILE_PIECES-1; i>=0; i--)
+void get_status(char** status, unsigned int bitfield)
+{
+  for (int i             = FILE_PIECES - 1; i >= 0; i--)
     (*status)[i]         = (bitfield & (1U << i)) ? '1' : '0';
   (*status)[FILE_PIECES] = '\0';
 }
 
 /** Peer main function */
-int peer(int argc, char *argv[])
+int peer(int argc, charargv[])
 {
-  //Check arguments
+  // Check arguments
   xbt_assert(argc == 3 || argc == 4, "Wrong number of arguments");
 
-  //Build peer object
-  peer_t peer = peer_init(xbt_str_parse_int(argv[1],"Invalid ID: %s"), argc==4 ? 1:0);
+  // Build peer object
+  peer_t peer = peer_init(xbt_str_parse_int(argv[1], "Invalid ID: %s"), argc == 4 ? 1 : 0);
 
-  //Retrieve deadline
-  double deadline = xbt_str_parse_double(argv[2],"Invalid deadline: %s");
+  // Retrieve deadline
+  double deadline = xbt_str_parse_double(argv[2], "Invalid deadline: %s");
   xbt_assert(deadline > 0, "Wrong deadline supplied");
 
-  char *status = xbt_malloc0(FILE_PIECES+1);
+  char* status = xbt_malloc0(FILE_PIECES + 1);
   get_status(&status, peer->bitfield);
   XBT_INFO("Hi, I'm joining the network with id %d", peer->id);
-  //Getting peer data from the tracker.
+  // Getting peer data from the tracker.
   if (get_peers_data(peer)) {
     XBT_DEBUG("Got %d peers from the tracker. Current status is: %s", xbt_dict_length(peer->peers), status);
     peer->begin_receive_time = MSG_get_clock();
@@ -121,7 +125,7 @@ void leech_loop(peer_t peer, double deadline)
         handle_message(peer, peer->task_received);
       }
     } else {
-      //We don't execute the choke algorithm if we don't already have a piece
+      // We don't execute the choke algorithm if we don't already have a piece
       if (MSG_get_clock() >= next_choked_update && count_pieces(peer->bitfield) > 0) {
         update_choked_peers(peer);
         next_choked_update += UPDATE_CHOKED_INTERVAL;
@@ -142,7 +146,7 @@ void seed_loop(peer_t peer, double deadline)
 {
   double next_choked_update = MSG_get_clock() + UPDATE_CHOKED_INTERVAL;
   XBT_DEBUG("Start seeding.");
-  //start the main seed loop
+  // start the main seed loop
   while (MSG_get_clock() < deadline) {
     if (peer->comm_received == NULL) {
       peer->task_received = NULL;
@@ -158,7 +162,7 @@ void seed_loop(peer_t peer, double deadline)
     } else {
       if (MSG_get_clock() >= next_choked_update) {
         update_choked_peers(peer);
-        //TODO: Change the choked peer algorithm when seeding.
+        // TODO: Change the choked peer algorithm when seeding.
         next_choked_update += UPDATE_CHOKED_INTERVAL;
       } else {
         MSG_process_sleep(SLEEP_DURATION);
@@ -172,12 +176,12 @@ void seed_loop(peer_t peer, double deadline)
  */
 int get_peers_data(peer_t peer)
 {
-  int success = 0;
+  int success    = 0;
   double timeout = MSG_get_clock() + GET_PEERS_TIMEOUT;
 
-  //Build the task to send to the tracker
-  tracker_task_data_t data = tracker_task_data_new(MSG_host_get_name(MSG_host_self()), peer->mailbox_tracker,
-                                                   peer->id, 0, 0, FILE_SIZE);
+  // Build the task to send to the tracker
+  tracker_task_data_t data =
+      tracker_task_data_new(MSG_host_get_name(MSG_host_self()), peer->mailbox_tracker, peer->id, 0, 0, FILE_SIZE);
   msg_task_t task_send = MSG_task_create(NULL, 0, TRACKER_COMM_SIZE, data);
   while ((success == 0) && MSG_get_clock() < timeout) {
     XBT_DEBUG("Sending a peer request to the tracker.");
@@ -187,22 +191,22 @@ int get_peers_data(peer_t peer)
     }
   }
 
-  success = 0;
+  success                  = 0;
   msg_task_t task_received = NULL;
   while ((success == 0) && MSG_get_clock() < timeout) {
     msg_comm_t comm_received = MSG_task_irecv(&task_received, peer->mailbox_tracker);
-    msg_error_t status = MSG_comm_wait(comm_received, GET_PEERS_TIMEOUT);
+    msg_error_t status       = MSG_comm_wait(comm_received, GET_PEERS_TIMEOUT);
     if (status == MSG_OK) {
       tracker_task_data_t data = MSG_task_get_data(task_received);
       unsigned i;
       int peer_id;
-      //Add the peers the tracker gave us to our peer list.
-      xbt_dynar_foreach(data->peers, i, peer_id) {
+      // Add the peers the tracker gave us to our peer list.
+      xbt_dynar_foreach (data->peers, i, peer_id) {
         if (peer_id != peer->id)
-          xbt_dict_set_ext(peer->peers, (char *) &peer_id, sizeof(int), connection_new(peer_id), NULL);
+          xbt_dict_set_ext(peer->peers, (char*)&peer_id, sizeof(int), connection_new(peer_id), NULL);
       }
       success = 1;
-      //free the communication and the task
+      // free the communication and the task
       MSG_comm_destroy(comm_received);
       tracker_task_data_free(data);
       MSG_task_destroy(task_received);
@@ -219,20 +223,20 @@ int get_peers_data(peer_t peer)
  */
 peer_t peer_init(int id, int seed)
 {
-  peer_t peer = xbt_new(s_peer_t,1);
-  peer->id = id;
+  peer_t peer    = xbt_new(s_peer_t, 1);
+  peer->id       = id;
   peer->hostname = MSG_host_get_name(MSG_host_self());
 
-  snprintf(peer->mailbox,MAILBOX_SIZE-1, "%d", id);
-  snprintf(peer->mailbox_tracker,MAILBOX_SIZE-1, "tracker_%d", id);
+  snprintf(peer->mailbox, MAILBOX_SIZE - 1, "%d", id);
+  snprintf(peer->mailbox_tracker, MAILBOX_SIZE - 1, "tracker_%d", id);
   peer->peers        = xbt_dict_new_homogeneous(NULL);
   peer->active_peers = xbt_dict_new_homogeneous(NULL);
 
   if (seed) {
-    peer->bitfield = (1U<<FILE_PIECES)-1U;
-    peer->bitfield_blocks = (1ULL<<(FILE_PIECES * PIECES_BLOCKS))-1ULL  ;
+    peer->bitfield        = (1U << FILE_PIECES) - 1U;
+    peer->bitfield_blocks = (1ULL << (FILE_PIECES * PIECES_BLOCKS)) - 1ULL;
   } else {
-    peer->bitfield = 0;
+    peer->bitfield        = 0;
     peer->bitfield_blocks = 0;
   }
 
@@ -251,10 +255,10 @@ peer_t peer_init(int id, int seed)
 /** Destroys a poor peer object. */
 void peer_free(peer_t peer)
 {
-  char *key;
+  charkey;
   connection_t connection;
   xbt_dict_cursor_t cursor;
-  xbt_dict_foreach(peer->peers, cursor, key, connection) {
+  xbt_dict_foreach (peer->peers, cursor, key, connection) {
     connection_free(connection);
   }
   xbt_dict_free(&peer->peers);
@@ -268,16 +272,16 @@ void peer_free(peer_t peer)
  */
 int has_finished(unsigned int bitfield)
 {
-  return bitfield == (1U<<FILE_PIECES)-1U;
+  return bitfield == (1U << FILE_PIECES) - 1U;
 }
 
 int nb_interested_peers(peer_t peer)
 {
   xbt_dict_cursor_t cursor = NULL;
-  char *key;
+  charkey;
   connection_t connection;
   int nb = 0;
-  xbt_dict_foreach(peer->peers, cursor, key, connection) {
+  xbt_dict_foreach (peer->peers, cursor, key, connection) {
     if (connection->interested)
       nb++;
   }
@@ -287,10 +291,10 @@ int nb_interested_peers(peer_t peer)
 void update_active_peers_set(peer_t peer, connection_t remote_peer)
 {
   if ((remote_peer->interested != 0) && (remote_peer->choked_upload == 0)) {
-    //add in the active peers set
-    xbt_dict_set_ext(peer->active_peers, (char *) &remote_peer->id, sizeof(int), remote_peer, NULL);
-  } else if (xbt_dict_get_or_null_ext(peer->active_peers, (char *) &remote_peer->id, sizeof(int))) {
-    xbt_dict_remove_ext(peer->active_peers, (char *) &remote_peer->id, sizeof(int));
+    // add in the active peers set
+    xbt_dict_set_ext(peer->active_peers, (char*)&remote_peer->id, sizeof(int), remote_peer, NULL);
+  } else if (xbt_dict_get_or_null_ext(peer->active_peers, (char*)&remote_peer->id, sizeof(int))) {
+    xbt_dict_remove_ext(peer->active_peers, (char*)&remote_peer->id, sizeof(int));
   }
 }
 
@@ -300,128 +304,129 @@ void update_active_peers_set(peer_t peer, connection_t remote_peer)
  */
 void handle_message(peer_t peer, msg_task_t task)
 {
-  const char* type_names[10] =
-  {"HANDSHAKE","CHOKE","UNCHOKE","INTERESTED","NOTINTERESTED","HAVE","BITFIELD","REQUEST", "PIECE", "CANCEL" };
+  const char* type_names[10] = {"HANDSHAKE", "CHOKE",    "UNCHOKE", "INTERESTED", "NOTINTERESTED",
+                                "HAVE",      "BITFIELD", "REQUEST", "PIECE",      "CANCEL"};
   message_t message = MSG_task_get_data(task);
   XBT_DEBUG("Received a %s message from %s (%s)", type_names[message->type], message->mailbox,
-                                                  message->issuer_host_name);
+            message->issuer_host_name);
 
   connection_t remote_peer;
-  remote_peer = xbt_dict_get_or_null_ext(peer->peers, (char *) &message->peer_id, sizeof(int));
+  remote_peer = xbt_dict_get_or_null_ext(peer->peers, (char*)&message->peer_id, sizeof(int));
 
   switch (message->type) {
-  case MESSAGE_HANDSHAKE:
-    //Check if the peer is in our connection list.
-    if (remote_peer == 0) {
-      xbt_dict_set_ext(peer->peers, (char *) &message->peer_id, sizeof(int), connection_new(message->peer_id), NULL);
-      send_handshake(peer, message->mailbox);
-    }
-    //Send our bitfield to the peer
-    send_bitfield(peer, message->mailbox);
-    break;
-  case MESSAGE_BITFIELD:
-    //Update the pieces list
-    update_pieces_count_from_bitfield(peer, message->bitfield);
-    //Store the bitfield
-    remote_peer->bitfield = message->bitfield;
-    xbt_assert(!remote_peer->am_interested, "Should not be interested at first");
-    if (is_interested(peer, remote_peer)) {
-      remote_peer->am_interested = 1;
-      send_interested(peer, message->mailbox);
-    }
-    break;
-  case MESSAGE_INTERESTED:
-    xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
-    //Update the interested state of the peer.
-    remote_peer->interested = 1;
-    update_active_peers_set(peer, remote_peer);
-    break;
-  case MESSAGE_NOTINTERESTED:
-    xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
-    remote_peer->interested = 0;
-    update_active_peers_set(peer, remote_peer);
-    break;
-  case MESSAGE_UNCHOKE:
-    xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
-    xbt_assert(remote_peer->choked_download);
-    remote_peer->choked_download = 0;
-    //Send requests to the peer, since it has unchoked us
-    if (remote_peer->am_interested)
-      request_new_piece_to_peer(peer, remote_peer);
-    break;
-  case MESSAGE_CHOKE:
-    xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
-    xbt_assert(!remote_peer->choked_download);
-    remote_peer->choked_download = 1;
-    if (remote_peer->current_piece != -1)
-      remove_current_piece(peer, remote_peer, remote_peer->current_piece);
-    break;
-  case MESSAGE_HAVE:
-    XBT_DEBUG("\t for piece %d", message->index);
-    xbt_assert((message->index >= 0 && message->index < FILE_PIECES), "Wrong HAVE message received");
-    remote_peer->bitfield = remote_peer->bitfield | (1U<<message->index);
-    peer->pieces_count[message->index]++;
-    //If the piece is in our pieces, we tell the peer that we are interested.
-    if ((remote_peer->am_interested == 0) && peer_has_not_piece(peer,message->index)) {
-      remote_peer->am_interested = 1;
-      send_interested(peer, message->mailbox);
-      if (remote_peer->choked_download == 0)
+    case MESSAGE_HANDSHAKE:
+      // Check if the peer is in our connection list.
+      if (remote_peer == 0) {
+        xbt_dict_set_ext(peer->peers, (char*)&message->peer_id, sizeof(int), connection_new(message->peer_id), NULL);
+        send_handshake(peer, message->mailbox);
+      }
+      // Send our bitfield to the peer
+      send_bitfield(peer, message->mailbox);
+      break;
+    case MESSAGE_BITFIELD:
+      // Update the pieces list
+      update_pieces_count_from_bitfield(peer, message->bitfield);
+      // Store the bitfield
+      remote_peer->bitfield = message->bitfield;
+      xbt_assert(!remote_peer->am_interested, "Should not be interested at first");
+      if (is_interested(peer, remote_peer)) {
+        remote_peer->am_interested = 1;
+        send_interested(peer, message->mailbox);
+      }
+      break;
+    case MESSAGE_INTERESTED:
+      xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
+      // Update the interested state of the peer.
+      remote_peer->interested = 1;
+      update_active_peers_set(peer, remote_peer);
+      break;
+    case MESSAGE_NOTINTERESTED:
+      xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
+      remote_peer->interested = 0;
+      update_active_peers_set(peer, remote_peer);
+      break;
+    case MESSAGE_UNCHOKE:
+      xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
+      xbt_assert(remote_peer->choked_download);
+      remote_peer->choked_download = 0;
+      // Send requests to the peer, since it has unchoked us
+      if (remote_peer->am_interested)
         request_new_piece_to_peer(peer, remote_peer);
-    }
-    break;
-  case MESSAGE_REQUEST:
-    xbt_assert(remote_peer->interested);
-    xbt_assert((message->index >= 0 && message->index < FILE_PIECES), "Wrong request received");
-    if (remote_peer->choked_upload == 0) {
-      XBT_DEBUG("\t for piece %d (%d,%d)", message->index, message->block_index,
-                                           message->block_index + message->block_length);
-      if (!peer_has_not_piece(peer, message->index)) {
-        send_piece(peer, message->mailbox, message->index, message->block_index, message->block_length);
+      break;
+    case MESSAGE_CHOKE:
+      xbt_assert((remote_peer != NULL), "A non-in-our-list peer has sent us a message. WTH ?");
+      xbt_assert(!remote_peer->choked_download);
+      remote_peer->choked_download = 1;
+      if (remote_peer->current_piece != -1)
+        remove_current_piece(peer, remote_peer, remote_peer->current_piece);
+      break;
+    case MESSAGE_HAVE:
+      XBT_DEBUG("\t for piece %d", message->index);
+      xbt_assert((message->index >= 0 && message->index < FILE_PIECES), "Wrong HAVE message received");
+      remote_peer->bitfield = remote_peer->bitfield | (1U << message->index);
+      peer->pieces_count[message->index]++;
+      // If the piece is in our pieces, we tell the peer that we are interested.
+      if ((remote_peer->am_interested == 0) && peer_has_not_piece(peer, message->index)) {
+        remote_peer->am_interested = 1;
+        send_interested(peer, message->mailbox);
+        if (remote_peer->choked_download == 0)
+          request_new_piece_to_peer(peer, remote_peer);
       }
-    } else {
-      XBT_DEBUG("\t for piece %d but he is choked.",  message->peer_id);
-    }
-    break;
-  case MESSAGE_PIECE:
-    XBT_DEBUG(" \t for piece %d (%d,%d)", message->index, message->block_index,
-                                        message->block_index + message->block_length);
-    xbt_assert(!remote_peer->choked_download);
-    xbt_assert(remote_peer->am_interested || ENABLE_END_GAME_MODE,
-               "Can't received a piece if I'm not interested wihtout end-game mode!"
-               "piece (%d) bitfield(%u) remote bitfield(%u)", message->index, peer->bitfield, remote_peer->bitfield);
-    xbt_assert(remote_peer->choked_download != 1, "Can't received a piece if I'm choked !");
-    xbt_assert((message->index >= 0 && message->index < FILE_PIECES), "Wrong piece received");
-    //TODO: Execute Ã  computation.
-    if (peer_has_not_piece(peer,message->index)) {
-      update_bitfield_blocks(peer, message->index, message->block_index, message->block_length);
-      if (piece_complete(peer, message->index)) {
-        //Removing the piece from our piece list
-        remove_current_piece(peer, remote_peer, message->index);
-        //Setting the fact that we have the piece
-        peer->bitfield = peer->bitfield | (1U<<message->index);
-        char* status = xbt_malloc0(FILE_PIECES+1);
-        get_status(&status, peer->bitfield);
-        XBT_DEBUG("My status is now %s", status);
-        xbt_free(status);
-        //Sending the information to all the peers we are connected to
-        send_have(peer, message->index);
-        //sending UNINTERESTED to peers that do not have what we want.
-        update_interested_after_receive(peer);
-      } else {                // piece not completed
-        send_request_to_peer(peer, remote_peer, message->index);      // ask for the next block
+      break;
+    case MESSAGE_REQUEST:
+      xbt_assert(remote_peer->interested);
+      xbt_assert((message->index >= 0 && message->index < FILE_PIECES), "Wrong request received");
+      if (remote_peer->choked_upload == 0) {
+        XBT_DEBUG("\t for piece %d (%d,%d)", message->index, message->block_index,
+                  message->block_index + message->block_length);
+        if (!peer_has_not_piece(peer, message->index)) {
+          send_piece(peer, message->mailbox, message->index, message->block_index, message->block_length);
+        }
+      } else {
+        XBT_DEBUG("\t for piece %d but he is choked.", message->peer_id);
       }
-    } else {
-      XBT_DEBUG("However, we already have it");
-      xbt_assert(ENABLE_END_GAME_MODE, "Should not happen because we don't use end game mode !");
-      request_new_piece_to_peer(peer, remote_peer);
-    }
-    break;
-  case MESSAGE_CANCEL:
-    break;
-  default:
-    THROW_IMPOSSIBLE;
+      break;
+    case MESSAGE_PIECE:
+      XBT_DEBUG(" \t for piece %d (%d,%d)", message->index, message->block_index,
+                message->block_index + message->block_length);
+      xbt_assert(!remote_peer->choked_download);
+      xbt_assert(remote_peer->am_interested || ENABLE_END_GAME_MODE,
+                 "Can't received a piece if I'm not interested wihtout end-game mode!"
+                 "piece (%d) bitfield(%u) remote bitfield(%u)",
+                 message->index, peer->bitfield, remote_peer->bitfield);
+      xbt_assert(remote_peer->choked_download != 1, "Can't received a piece if I'm choked !");
+      xbt_assert((message->index >= 0 && message->index < FILE_PIECES), "Wrong piece received");
+      // TODO: Execute Ã  computation.
+      if (peer_has_not_piece(peer, message->index)) {
+        update_bitfield_blocks(peer, message->index, message->block_index, message->block_length);
+        if (piece_complete(peer, message->index)) {
+          // Removing the piece from our piece list
+          remove_current_piece(peer, remote_peer, message->index);
+          // Setting the fact that we have the piece
+          peer->bitfield = peer->bitfield | (1U << message->index);
+          char* status   = xbt_malloc0(FILE_PIECES + 1);
+          get_status(&status, peer->bitfield);
+          XBT_DEBUG("My status is now %s", status);
+          xbt_free(status);
+          // Sending the information to all the peers we are connected to
+          send_have(peer, message->index);
+          // sending UNINTERESTED to peers that do not have what we want.
+          update_interested_after_receive(peer);
+        } else {                                                   // piece not completed
+          send_request_to_peer(peer, remote_peer, message->index); // ask for the next block
+        }
+      } else {
+        XBT_DEBUG("However, we already have it");
+        xbt_assert(ENABLE_END_GAME_MODE, "Should not happen because we don't use end game mode !");
+        request_new_piece_to_peer(peer, remote_peer);
+      }
+      break;
+    case MESSAGE_CANCEL:
+      break;
+    default:
+      THROW_IMPOSSIBLE;
   }
-  //Update the peer speed.
+  // Update the peer speed.
   if (remote_peer) {
     connection_add_speed_value(remote_peer, 1.0 / (MSG_get_clock() - peer->begin_receive_time));
   }
@@ -435,7 +440,7 @@ void request_new_piece_to_peer(peer_t peer, connection_t remote_peer)
 {
   int piece = select_piece_to_download(peer, remote_peer);
   if (piece != -1) {
-    peer->current_pieces|= (1U << (unsigned int) piece);
+    peer->current_pieces |= (1U << (unsigned int)piece);
     send_request_to_peer(peer, remote_peer, piece);
   }
 }
@@ -481,21 +486,21 @@ int select_piece_to_download(peer_t peer, connection_t remote_peer)
   if (count_pieces(peer->current_pieces) >= (FILE_PIECES - count_pieces(peer->bitfield)) &&
       (is_interested(peer, remote_peer) != 0)) {
 #if ENABLE_END_GAME_MODE == 0
-      return -1;
+    return -1;
 #endif
     int nb_interesting_pieces = 0;
     // compute the number of interesting pieces
     for (int i = 0; i < FILE_PIECES; i++) {
-      if (peer_has_not_piece(peer,i) && connection_has_piece(remote_peer,i)) {
+      if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i)) {
         nb_interesting_pieces++;
       }
     }
     xbt_assert(nb_interesting_pieces != 0);
     // get a random interesting piece
     int random_piece_index = RngStream_RandInt(peer->stream, 0, nb_interesting_pieces - 1);
-    int current_index = 0;
+    int current_index      = 0;
     for (int i = 0; i < FILE_PIECES; i++) {
-      if (peer_has_not_piece(peer,i) && connection_has_piece(remote_peer,i)) {
+      if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i)) {
         if (random_piece_index == current_index) {
           piece = i;
           break;
@@ -511,16 +516,18 @@ int select_piece_to_download(peer_t peer, connection_t remote_peer)
     int nb_interesting_pieces = 0;
     // compute the number of interesting pieces
     for (int i = 0; i < FILE_PIECES; i++) {
-      if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i) && peer_is_not_downloading_piece(peer, i)) {
+      if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) &&
+          peer_is_not_downloading_piece(peer, i)) {
         nb_interesting_pieces++;
       }
     }
     xbt_assert(nb_interesting_pieces != 0);
     // get a random interesting piece
     int random_piece_index = RngStream_RandInt(peer->stream, 0, nb_interesting_pieces - 1);
-    int current_index = 0;
+    int current_index      = 0;
     for (int i = 0; i < FILE_PIECES; i++) {
-      if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i) && peer_is_not_downloading_piece(peer, i)) {
+      if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) &&
+          peer_is_not_downloading_piece(peer, i)) {
         if (random_piece_index == current_index) {
           piece = i;
           break;
@@ -530,28 +537,28 @@ int select_piece_to_download(peer_t peer, connection_t remote_peer)
     }
     xbt_assert(piece != -1);
     return piece;
-  } else {                      // Rarest first policy
-    short min = SHRT_MAX;
+  } else { // Rarest first policy
+    short min         = SHRT_MAX;
     int nb_min_pieces = 0;
     int current_index = 0;
     // compute the smallest number of copies of available pieces
     for (int i = 0; i < FILE_PIECES; i++) {
-      if (peer->pieces_count[i] < min && peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i) &&
+      if (peer->pieces_count[i] < min && peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) &&
           peer_is_not_downloading_piece(peer, i))
         min = peer->pieces_count[i];
     }
-    xbt_assert(min != SHRT_MAX || (is_interested_and_free(peer, remote_peer) ==0));
+    xbt_assert(min != SHRT_MAX || (is_interested_and_free(peer, remote_peer) == 0));
     // compute the number of rarest pieces
     for (int i = 0; i < FILE_PIECES; i++) {
-      if (peer->pieces_count[i] == min && peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i) &&
+      if (peer->pieces_count[i] == min && peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) &&
           peer_is_not_downloading_piece(peer, i))
         nb_min_pieces++;
     }
-    xbt_assert(nb_min_pieces != 0 || (is_interested_and_free(peer, remote_peer)==0));
+    xbt_assert(nb_min_pieces != 0 || (is_interested_and_free(peer, remote_peer) == 0));
     // get a random rarest piece
     int random_rarest_index = RngStream_RandInt(peer->stream, 0, nb_min_pieces - 1);
     for (int i = 0; i < FILE_PIECES; i++) {
-      if (peer->pieces_count[i] == min && peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i) &&
+      if (peer->pieces_count[i] == min && peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) &&
           peer_is_not_downloading_piece(peer, i)) {
         if (random_rarest_index == current_index) {
           piece = i;
@@ -572,18 +579,18 @@ void update_choked_peers(peer_t peer)
 {
   if (nb_interested_peers(peer) == 0)
     return;
-  XBT_DEBUG("(%d) update_choked peers %d active peers", peer->id, xbt_dict_size(peer->active_peers));
-  //update the current round
+  XBT_DEBUG("(%d) update_choked peers %u active peers", peer->id, xbt_dict_size(peer->active_peers));
+  // update the current round
   peer->round = (peer->round + 1) % 3;
-  char *key;
-  char *key_choked=NULL;
+  charkey;
+  char* key_choked          = NULL;
   connection_t peer_choosed = NULL;
-  connection_t peer_choked = NULL;
-  //remove a peer from the list
+  connection_t peer_choked  = NULL;
+  // remove a peer from the list
   xbt_dict_cursor_t cursor = NULL;
   xbt_dict_cursor_first(peer->active_peers, &cursor);
   if (xbt_dict_length(peer->active_peers) > 0) {
-    key_choked = xbt_dict_cursor_get_key(cursor);
+    key_choked  = xbt_dict_cursor_get_key(cursor);
     peer_choked = xbt_dict_cursor_get_data(cursor);
   }
   xbt_dict_cursor_free(&cursor);
@@ -593,23 +600,23 @@ void update_choked_peers(peer_t peer)
     connection_t connection;
     double unchoke_time = MSG_get_clock() + 1;
 
-    xbt_dict_foreach(peer->peers, cursor, key, connection) {
-      if (connection->last_unchoke < unchoke_time &&
-          (connection->interested != 0) && (connection->choked_upload != 0)) {
+    xbt_dict_foreach (peer->peers, cursor, key, connection) {
+      if (connection->last_unchoke < unchoke_time && (connection->interested != 0) &&
+          (connection->choked_upload != 0)) {
         unchoke_time = connection->last_unchoke;
         peer_choosed = connection;
       }
     }
   } else {
-    //Random optimistic unchoking
+    // Random optimistic unchoking
     if (peer->round == 0) {
       int j = 0;
       do {
-        //We choose a random peer to unchoke.
+        // We choose a random peer to unchoke.
         int id_chosen = RngStream_RandInt(peer->stream, 0, xbt_dict_length(peer->peers) - 1);
-        int i = 0;
+        int i         = 0;
         connection_t connection;
-        xbt_dict_foreach(peer->peers, cursor, key, connection) {
+        xbt_dict_foreach (peer->peers, cursor, key, connection) {
           if (i == id_chosen) {
             peer_choosed = connection;
             break;
@@ -624,15 +631,15 @@ void update_choked_peers(peer_t peer)
         else
           XBT_DEBUG("Nothing to do, keep going");
         j++;
-      } while (peer_choosed == NULL && j < MAXIMUM_PAIRS);
+      } while (peer_choosed == NULL && j < MAXIMUM_PEERS);
     } else {
-      //Use the "fastest download" policy.
+      // Use the "fastest download" policy.
       connection_t connection;
       double fastest_speed = 0.0;
-      xbt_dict_foreach(peer->peers, cursor, key, connection) {
-        if (connection->peer_speed > fastest_speed &&
-            (connection->choked_upload != 0) && (connection->interested != 0)) {
-          peer_choosed = connection;
+      xbt_dict_foreach (peer->peers, cursor, key, connection) {
+        if (connection->peer_speed > fastest_speed && (connection->choked_upload != 0) &&
+            (connection->interested != 0)) {
+          peer_choosed  = connection;
           fastest_speed = connection->peer_speed;
         }
       }
@@ -640,14 +647,14 @@ void update_choked_peers(peer_t peer)
   }
 
   if (peer_choosed != NULL)
-    XBT_DEBUG("(%d) update_choked peers unchoked (%d) ; int (%d) ; choked (%d) ",
-              peer->id, peer_choosed->id, peer_choosed->interested, peer_choosed->choked_upload);
+    XBT_DEBUG("(%d) update_choked peers unchoked (%d) ; int (%d) ; choked (%d) ", peer->id, peer_choosed->id,
+              peer_choosed->interested, peer_choosed->choked_upload);
 
   if (peer_choked != peer_choosed) {
     if (peer_choked != NULL) {
       xbt_assert((!peer_choked->choked_upload), "Tries to choked a choked peer");
       peer_choked->choked_upload = 1;
-      xbt_assert((*((int *) key_choked) == peer_choked->id));
+      xbt_assert((*((int*)key_choked) == peer_choked->id));
       update_active_peers_set(peer, peer_choked);
       XBT_DEBUG("(%d) Sending a CHOKE to %d", peer->id, peer_choked->id);
       send_choked(peer, peer_choked->mailbox);
@@ -655,7 +662,7 @@ void update_choked_peers(peer_t peer)
     if (peer_choosed != NULL) {
       xbt_assert((peer_choosed->choked_upload), "Tries to unchoked an unchoked peer");
       peer_choosed->choked_upload = 0;
-      xbt_dict_set_ext(peer->active_peers, (char *) &peer_choosed->id, sizeof(int), peer_choosed, NULL);
+      xbt_dict_set_ext(peer->active_peers, (char*)&peer_choosed->id, sizeof(int), peer_choosed, NULL);
       peer_choosed->last_unchoke = MSG_get_clock();
       XBT_DEBUG("(%d) Sending a UNCHOKE to %d", peer->id, peer_choosed->id);
       update_active_peers_set(peer, peer_choosed);
@@ -669,20 +676,20 @@ void update_choked_peers(peer_t peer)
  */
 void update_interested_after_receive(peer_t peer)
 {
-  char *key;
+  charkey;
   xbt_dict_cursor_t cursor;
   connection_t connection;
-  xbt_dict_foreach(peer->peers, cursor, key, connection) {
+  xbt_dict_foreach (peer->peers, cursor, key, connection) {
     if (connection->am_interested != 0) {
       int interested = 0;
-      //Check if the peer still has a piece we want.
+      // Check if the peer still has a piece we want.
       for (int i = 0; i < FILE_PIECES; i++) {
-        if (peer_has_not_piece(peer, i) && connection_has_piece(connection,i)) {
+        if (peer_has_not_piece(peer, i) && connection_has_piece(connection, i)) {
           interested = 1;
           break;
         }
       }
-      if (!interested) {        //no more piece to download from connection
+      if (!interested) { // no more piece to download from connection
         connection->am_interested = 0;
         send_notinterested(peer, connection->mailbox);
       }
@@ -695,7 +702,7 @@ void update_bitfield_blocks(peer_t peer, int index, int block_index, int block_l
   xbt_assert((index >= 0 && index <= FILE_PIECES), "Wrong piece.");
   xbt_assert((block_index >= 0 && block_index <= PIECES_BLOCKS), "Wrong block : %d.", block_index);
   for (int i = block_index; i < (block_index + block_length); i++) {
-    peer->bitfield_blocks |= (1ULL<<(unsigned int)(index * PIECES_BLOCKS + i));
+    peer->bitfield_blocks |= (1ULL << (unsigned int)(index * PIECES_BLOCKS + i));
   }
 }
 
@@ -703,7 +710,7 @@ void update_bitfield_blocks(peer_t peer, int index, int block_index, int block_l
 int piece_complete(peer_t peer, int index)
 {
   for (int i = 0; i < PIECES_BLOCKS; i++) {
-    if (!(peer->bitfield_blocks & 1ULL<<(index * PIECES_BLOCKS + i))) {
+    if (!(peer->bitfield_blocks & 1ULL << (index * PIECES_BLOCKS + i))) {
       return 0;
     }
   }
@@ -714,7 +721,7 @@ int piece_complete(peer_t peer, int index)
 int get_first_block(peer_t peer, int piece)
 {
   for (int i = 0; i < PIECES_BLOCKS; i++) {
-    if (!(peer->bitfield_blocks & 1ULL<<(piece * PIECES_BLOCKS + i))) {
+    if (!(peer->bitfield_blocks & 1ULL << (piece * PIECES_BLOCKS + i))) {
       return i;
     }
   }
@@ -724,14 +731,14 @@ int get_first_block(peer_t peer, int piece)
 /** Indicates if the remote peer has a piece not stored by the local peer */
 int is_interested(peer_t peer, connection_t remote_peer)
 {
-  return remote_peer->bitfield & (peer->bitfield^((1<<FILE_PIECES)-1));
+  return remote_peer->bitfield & (peer->bitfield ^ ((1 << FILE_PIECES) - 1));
 }
 
 /** Indicates if the remote peer has a piece not stored by the local peer nor requested by the local peer */
 int is_interested_and_free(peer_t peer, connection_t remote_peer)
 {
   for (int i = 0; i < FILE_PIECES; i++) {
-    if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i) && peer_is_not_downloading_piece(peer, i)) {
+    if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) && peer_is_not_downloading_piece(peer, i)) {
       return 1;
     }
   }
@@ -742,10 +749,9 @@ int is_interested_and_free(peer_t peer, connection_t remote_peer)
 int partially_downloaded_piece(peer_t peer, connection_t remote_peer)
 {
   for (int i = 0; i < FILE_PIECES; i++) {
-    if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer,i)&& peer_is_not_downloading_piece(peer, i)) {
-      if (get_first_block(peer, i) > 0)
-        return i;
-    }
+    if (peer_has_not_piece(peer, i) && connection_has_piece(remote_peer, i) && peer_is_not_downloading_piece(peer, i) &&
+        get_first_block(peer, i) > 0)
+      return i;
   }
   return -1;
 }
@@ -757,7 +763,7 @@ int partially_downloaded_piece(peer_t peer, connection_t remote_peer)
 void send_request_to_peer(peer_t peer, connection_t remote_peer, int piece)
 {
   remote_peer->current_piece = piece;
-  xbt_assert(connection_has_piece(remote_peer,piece));
+  xbt_assert(connection_has_piece(remote_peer, piece));
   int block_index = get_first_block(peer, piece);
   if (block_index != -1) {
     int block_length = MIN(BLOCKS_REQUESTED, PIECES_BLOCKS - block_index);
@@ -775,7 +781,7 @@ void send_request_to_peer(peer_t peer, connection_t remote_peer, int piece)
  *  @param peer peer data
  *  @param mailbox destination mailbox
  */
-void send_interested(peer_t peer, const char *mailbox)
+void send_interested(peer_t peer, const charmailbox)
 {
   msg_task_t task = task_message_new(MESSAGE_INTERESTED, peer->hostname, peer->mailbox, peer->id,
                                      task_message_size(MESSAGE_INTERESTED));
@@ -787,7 +793,7 @@ void send_interested(peer_t peer, const char *mailbox)
  *  @param peer peer data
  *  @param mailbox destination mailbox
  */
-void send_notinterested(peer_t peer, const char *mailbox)
+void send_notinterested(peer_t peer, const charmailbox)
 {
   msg_task_t task = task_message_new(MESSAGE_NOTINTERESTED, peer->hostname, peer->mailbox, peer->id,
                                      task_message_size(MESSAGE_NOTINTERESTED));
@@ -802,8 +808,8 @@ void send_handshake_all(peer_t peer)
 {
   connection_t remote_peer;
   xbt_dict_cursor_t cursor = NULL;
-  char *key;
-  xbt_dict_foreach(peer->peers, cursor, key, remote_peer) {
+  charkey;
+  xbt_dict_foreach (peer->peers, cursor, key, remote_peer) {
     msg_task_t task = task_message_new(MESSAGE_HANDSHAKE, peer->hostname, peer->mailbox, peer->id,
                                        task_message_size(MESSAGE_HANDSHAKE));
     MSG_task_dsend(task, remote_peer->mailbox, task_message_free);
@@ -815,7 +821,7 @@ void send_handshake_all(peer_t peer)
  *  @param peer peer data
  *  @param mailbox mailbox where to we send the message
  */
-void send_handshake(peer_t peer, const char *mailbox)
+void send_handshake(peer_t peer, const charmailbox)
 {
   XBT_DEBUG("Sending a HANDSHAKE to %s", mailbox);
   msg_task_t task = task_message_new(MESSAGE_HANDSHAKE, peer->hostname, peer->mailbox, peer->id,
@@ -824,20 +830,20 @@ void send_handshake(peer_t peer, const char *mailbox)
 }
 
 /** Send a "choked" message to a peer. */
-void send_choked(peer_t peer, const char *mailbox)
+void send_choked(peer_t peer, const charmailbox)
 {
   XBT_DEBUG("Sending a CHOKE to %s", mailbox);
-  msg_task_t task = task_message_new(MESSAGE_CHOKE, peer->hostname, peer->mailbox, peer->id,
-                    task_message_size(MESSAGE_CHOKE));
+  msg_task_t task =
+      task_message_new(MESSAGE_CHOKE, peer->hostname, peer->mailbox, peer->id, task_message_size(MESSAGE_CHOKE));
   MSG_task_dsend(task, mailbox, task_message_free);
 }
 
 /** Send a "unchoked" message to a peer */
-void send_unchoked(peer_t peer, const char *mailbox)
+void send_unchoked(peer_t peer, const charmailbox)
 {
   XBT_DEBUG("Sending a UNCHOKE to %s", mailbox);
-  msg_task_t task = task_message_new(MESSAGE_UNCHOKE, peer->hostname, peer->mailbox, peer->id,
-                                     task_message_size(MESSAGE_UNCHOKE));
+  msg_task_t task =
+      task_message_new(MESSAGE_UNCHOKE, peer->hostname, peer->mailbox, peer->id, task_message_size(MESSAGE_UNCHOKE));
   MSG_task_dsend(task, mailbox, task_message_free);
 }
 
@@ -847,8 +853,8 @@ void send_have(peer_t peer, int piece)
   XBT_DEBUG("Sending HAVE message to all my peers");
   connection_t remote_peer;
   xbt_dict_cursor_t cursor = NULL;
-  char *key;
-  xbt_dict_foreach(peer->peers, cursor, key, remote_peer) {
+  charkey;
+  xbt_dict_foreach (peer->peers, cursor, key, remote_peer) {
     msg_task_t task = task_message_index_new(MESSAGE_HAVE, peer->hostname, peer->mailbox, peer->id, piece,
                                              task_message_size(MESSAGE_HAVE));
     MSG_task_dsend(task, remote_peer->mailbox, task_message_free);
@@ -858,7 +864,7 @@ void send_have(peer_t peer, int piece)
 /** @brief Send a bitfield message to all the peers the peer has.
  *  @param peer peer data
  */
-void send_bitfield(peer_t peer, const char *mailbox)
+void send_bitfield(peer_t peer, const charmailbox)
 {
   XBT_DEBUG("Sending a BITFIELD to %s", mailbox);
   msg_task_t task = task_message_bitfield_new(peer->hostname, peer->mailbox, peer->id, peer->bitfield, FILE_PIECES);
@@ -866,7 +872,7 @@ void send_bitfield(peer_t peer, const char *mailbox)
 }
 
 /** Send a "request" message to a pair, containing a request for a piece */
-void send_request(peer_t peer, const char *mailbox, int piece, int block_index, int block_length)
+void send_request(peer_t peer, const charmailbox, int piece, int block_index, int block_length)
 {
   XBT_DEBUG("Sending a REQUEST to %s for piece %d (%d,%d)", mailbox, piece, block_index, block_length);
   msg_task_t task = task_message_request_new(peer->hostname, peer->mailbox, peer->id, piece, block_index, block_length);
@@ -874,12 +880,12 @@ void send_request(peer_t peer, const char *mailbox, int piece, int block_index,
 }
 
 /** Send a "piece" message to a pair, containing a piece of the file */
-void send_piece(peer_t peer, const char *mailbox, int piece, int block_index, int block_length)
+void send_piece(peer_t peer, const charmailbox, int piece, int block_index, int block_length)
 {
   XBT_DEBUG("Sending the PIECE %d (%d,%d) to %s", piece, block_index, block_length, mailbox);
   xbt_assert(piece >= 0, "Tried to send a piece that doesn't exist.");
-  xbt_assert(!peer_has_not_piece(peer,piece), "Tried to send a piece that we doesn't have.");
-  msg_task_t task = task_message_piece_new(peer->hostname, peer->mailbox, peer->id, piece, block_index, block_length,
-                                           BLOCK_SIZE);
+  xbt_assert(!peer_has_not_piece(peer, piece), "Tried to send a piece that we doesn't have.");
+  msg_task_t task =
+      task_message_piece_new(peer->hostname, peer->mailbox, peer->id, piece, block_index, block_length, BLOCK_SIZE);
   MSG_task_dsend(task, mailbox, task_message_free);
 }
similarity index 57%
rename from examples/msg/app-bittorrent/peer.h
rename to teshsuite/msg/app-bittorrent/peer.h
index d08f1f2..a3ac6bf 100644 (file)
@@ -6,43 +6,43 @@
 
 #ifndef BITTORRENT_PEER_H
 #define BITTORRENT_PEER_H
+#include "bittorrent.h"
+#include "connection.h"
 #include <simgrid/msg.h>
+#include <xbt/RngStream.h>
 #include <xbt/dict.h>
 #include <xbt/dynar.h>
-#include <xbt/RngStream.h>
-#include "connection.h"
-#include "bittorrent.h"
 
 /** Peer data */
 typedef struct s_peer {
-  int id;                       //peer id
+  int id; // peer id
 
-  unsigned int bitfield;        //list of pieces the peer has.
-  unsigned long long bitfield_blocks; //list of blocks the peer has.
-  short *pieces_count;          //number of peers that have each piece.
+  unsigned int bitfield;              // list of pieces the peer has.
+  unsigned long long bitfield_blocks; // list of blocks the peer has.
+  short* pieces_count;                // number of peers that have each piece.
 
-  unsigned int current_pieces;   //current pieces the peer is downloading
+  unsigned int current_pieces; // current pieces the peer is downloading
 
-  xbt_dict_t peers;             //peers list
-  xbt_dict_t active_peers;      //active peers list
-  int round;                    //current round for the chocking algorithm.
+  xbt_dict_t peers;        // peers list
+  xbt_dict_t active_peers; // active peers list
+  int round;               // current round for the chocking algorithm.
 
-  char mailbox[MAILBOX_SIZE];   //peer mailbox.
-  char mailbox_tracker[MAILBOX_SIZE];   //pair mailbox while communicating with the tracker.
-  const char *hostname;         //peer hostname
+  char mailbox[MAILBOX_SIZE];         // peer mailbox.
+  char mailbox_tracker[MAILBOX_SIZE]; // pair mailbox while communicating with the tracker.
+  const char* hostname;               // peer hostname
 
-  msg_task_t task_received;     //current task being received
-  msg_comm_t comm_received;     //current comm
+  msg_task_t task_received; // current task being received
+  msg_comm_t comm_received; // current comm
 
-  RngStream stream;             //RngStream for
+  RngStream stream; // RngStream for
 
-  double begin_receive_time;    //time when the receiving communication has begun, useful for calculating host speed.
+  double begin_receive_time; // time when the receiving communication has begun, useful for calculating host speed.
 } s_peer_t;
-typedef s_peer_t *peer_t;
+typedef s_peer_tpeer_t;
 
 /** Peer main function */
-int peer(int argc, char *argv[]);
-void get_status(char **status, unsigned int bitfield);
+int peer(int argc, charargv[]);
+void get_status(char** status, unsigned int bitfield);
 
 int get_peers_data(peer_t peer);
 void leech_loop(peer_t peer, double deadline);
@@ -83,16 +83,16 @@ int select_piece_to_download(peer_t peer, connection_t remote_peer);
 
 void send_handshake_all(peer_t peer);
 
-void send_interested(peer_t peer, const char *mailbox);
+void send_interested(peer_t peer, const charmailbox);
 
-void send_notinterested(peer_t peer, const char *mailbox);
-void send_handshake(peer_t peer, const char *mailbox);
-void send_bitfield(peer_t peer, const char *mailbox);
-void send_choked(peer_t peer, const char *mailbox);
-void send_unchoked(peer_t peer, const char *mailbox);
+void send_notinterested(peer_t peer, const charmailbox);
+void send_handshake(peer_t peer, const charmailbox);
+void send_bitfield(peer_t peer, const charmailbox);
+void send_choked(peer_t peer, const charmailbox);
+void send_unchoked(peer_t peer, const charmailbox);
 void send_have(peer_t peer, int piece);
 
-void send_request(peer_t peer, const char *mailbox, int piece, int block_index, int block_length);
-void send_piece(peer_t peer, const char *mailbox, int piece, int block_index, int block_length);
+void send_request(peer_t peer, const charmailbox, int piece, int block_index, int block_length);
+void send_piece(peer_t peer, const charmailbox, int piece, int block_index, int block_length);
 
-#endif                          /* BITTORRENT_PEER_H */
+#endif /* BITTORRENT_PEER_H */
similarity index 72%
rename from examples/msg/app-bittorrent/tracker.c
rename to teshsuite/msg/app-bittorrent/tracker.c
index bdcea7f..d4025c7 100644 (file)
@@ -8,7 +8,7 @@
 #include <simgrid/msg.h>
 #include <xbt/RngStream.h>
 
-static void task_free(void *data);
+static void task_free(voiddata);
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_tracker, "Messages specific for the tracker");
 /**
@@ -16,16 +16,16 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_tracker, "Messages specific for the tracker");
  * @param argc number of arguments
  * @param argv arguments
  */
-int tracker(int argc, char *argv[])
+int tracker(int argc, charargv[])
 {
-  //Checking arguments
+  // Checking arguments
   xbt_assert(argc == 2, "Wrong number of arguments for the tracker.");
-  //Retrieving end time
-  double deadline = xbt_str_parse_double(argv[1],"Invalid deadline: %s");
+  // Retrieving end time
+  double deadline = xbt_str_parse_double(argv[1], "Invalid deadline: %s");
   xbt_assert(deadline > 0, "Wrong deadline supplied");
 
-  RngStream stream = (RngStream) MSG_host_get_data(MSG_host_self());
-  //Building peers array
+  RngStream stream = (RngStream)MSG_host_get_data(MSG_host_self());
+  // Building peers array
   xbt_dynar_t peers_list = xbt_dynar_new(sizeof(int), NULL);
 
   XBT_INFO("Tracker launched.");
@@ -38,28 +38,28 @@ int tracker(int argc, char *argv[])
       comm_received = MSG_task_irecv(&task_received, TRACKER_MAILBOX);
     }
     if (MSG_comm_test(comm_received)) {
-      //Check for correct status
+      // Check for correct status
       if (MSG_comm_get_status(comm_received) == MSG_OK) {
-        //Retrieve the data sent by the peer.
+        // Retrieve the data sent by the peer.
         tracker_task_data_t data = MSG_task_get_data(task_received);
-        //Add the peer to our peer list.
+        // Add the peer to our peer list.
         if (is_in_list(peers_list, data->peer_id) == 0) {
           xbt_dynar_push_as(peers_list, int, data->peer_id);
         }
-        //Sending peers to the peer
+        // Sending peers to the peer
         int next_peer;
         int peers_length = xbt_dynar_length(peers_list);
-        for (int i = 0; i < MAXIMUM_PAIRS && i < peers_length; i++) {
+        for (int i = 0; i < MAXIMUM_PEERS && i < peers_length; i++) {
           do {
             next_peer = xbt_dynar_get_as(peers_list, RngStream_RandInt(stream, 0, peers_length - 1), int);
           } while (is_in_list(data->peers, next_peer));
           xbt_dynar_push_as(data->peers, int, next_peer);
         }
-        //setting the interval
+        // setting the interval
         data->interval = TRACKER_QUERY_INTERVAL;
-        //sending the task back to the peer.
+        // sending the task back to the peer.
         MSG_task_dsend(task_received, data->mailbox, task_free);
-        //destroy the communication.
+        // destroy the communication.
       }
       MSG_comm_destroy(comm_received);
       comm_received = NULL;
@@ -68,11 +68,11 @@ int tracker(int argc, char *argv[])
       MSG_process_sleep(1);
     }
   }
-  //Free the remaining communication if any
+  // Free the remaining communication if any
   if (comm_received) {
     MSG_comm_destroy(comm_received);
   }
-  //Free the peers list
+  // Free the peers list
   xbt_dynar_free(&peers_list);
 
   XBT_INFO("Tracker is leaving");
@@ -84,18 +84,18 @@ int tracker(int argc, char *argv[])
  * Build a new task for the tracker.
  * @param issuer_host_name Hostname of the issuer. For debugging purposes
  */
-tracker_task_data_t tracker_task_data_new(const char *issuer_host_name, const char *mailbox, int peer_id,
-                                          int uploaded, int downloaded, int left)
+tracker_task_data_t tracker_task_data_new(const char* issuer_host_name, const char* mailbox, int peer_id, int uploaded,
+                                          int downloaded, int left)
 {
   tracker_task_data_t task = xbt_new(s_tracker_task_data_t, 1);
 
-  task->type = TRACKER_TASK_QUERY;
+  task->type             = TRACKER_TASK_QUERY;
   task->issuer_host_name = issuer_host_name;
-  task->mailbox = mailbox;
-  task->peer_id = peer_id;
-  task->uploaded = uploaded;
-  task->downloaded = downloaded;
-  task->left = left;
+  task->mailbox          = mailbox;
+  task->peer_id          = peer_id;
+  task->uploaded         = uploaded;
+  task->downloaded       = downloaded;
+  task->left             = left;
 
   task->peers = xbt_dynar_new(sizeof(int), NULL);
 
@@ -106,7 +106,7 @@ tracker_task_data_t tracker_task_data_new(const char *issuer_host_name, const ch
  * Free a tracker task that has not successfully been sent.
  * @param data Task to free
  */
-static void task_free(void *data)
+static void task_free(voiddata)
 {
   tracker_task_data_t task_data = MSG_task_get_data(data);
   tracker_task_data_free(task_data);
diff --git a/teshsuite/msg/app-bittorrent/tracker.h b/teshsuite/msg/app-bittorrent/tracker.h
new file mode 100644 (file)
index 0000000..f00e71f
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright (c) 2012-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program 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 BITTORRENT_TRACKER_H_
+#define BITTORRENT_TRACKER_H_
+#include "bittorrent.h"
+#include <xbt/dynar.h>
+/**
+ * Tracker main function
+ */
+int tracker(int argc, char* argv[]);
+/**
+ * Task types exchanged between a node and the tracker
+ */
+typedef enum { TRACKER_TASK_QUERY, TRACKER_TASK_ANSWER } e_tracker_task_type_t;
+/**
+ * Tasks exchanged between a tracker and peers.
+ */
+typedef struct s_tracker_task_data {
+  e_tracker_task_type_t type;   // type of the task
+  const char* mailbox;          // mailbox where the tracker should answer
+  const char* issuer_host_name; // hostname, for debug purposes
+  // Query data
+  int peer_id;    // peer id
+  int uploaded;   // how much the peer has already uploaded
+  int downloaded; // how much the peer has downloaded
+  int left;       // how much the peer has left
+  // Answer data
+  int interval;      // how often the peer should contact the tracker (unused for now)
+  xbt_dynar_t peers; // the peer list the peer has asked for.
+} s_tracker_task_data_t;
+typedef s_tracker_task_data_t* tracker_task_data_t;
+
+tracker_task_data_t tracker_task_data_new(const char* issuer_host_name, const char* mailbox, int peer_id, int uploaded,
+                                          int downloaded, int left);
+void tracker_task_data_free(tracker_task_data_t task);
+
+int is_in_list(xbt_dynar_t peers, int id);
+#endif /* BITTORRENT_TRACKER_H */
index c6c2296..3ff450c 100644 (file)
@@ -37,8 +37,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-sharing$EXEEXT --log=root.fmt:%m%n ${srcdir:
 > Passed: (Xx)2 with 1 load (100000000flops) took 0.1s as expected
 > ### Test '( ooo )2'. 3 tasks on a bicore PM
 > Passed: (xxX)2 with 0.6667 load (66666666flops) took 0.1s as expected
-> Passed: (Xxx)2 with 0.6667 load (66666666flops) took 0.1s as expected
 > Passed: (xXx)2 with 0.6667 load (66666666flops) took 0.1s as expected
+> Passed: (Xxx)2 with 0.6667 load (66666666flops) took 0.1s as expected
 > # TEST ON TWO-CORE PMs AND SINGLE-CORE VMs
 > ## Check impact of a single VM (no degradation for the moment)
 > ### Test '( [o]1 )2'. A task in a VM on a bicore PM
@@ -62,8 +62,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-sharing$EXEEXT --log=root.fmt:%m%n ${srcdir:
 > Passed: ( [x]1 [X]1 [ ]1 )2 with 1 load (100000000flops) took 0.1s as expected
 > ### Put three VMs on a PM, and put a task to each VM
 > Passed: ( [X]1 [o]1 [o]1 )2 with 0.6667 load (66666666flops) took 0.1s as expected
-> Passed: ( [o]1 [o]1 [X]1 )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > Passed: ( [o]1 [X]1 [o]1 )2 with 0.6667 load (66666666flops) took 0.1s as expected
+> Passed: ( [o]1 [o]1 [X]1 )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > # TEST ON TWO-CORE PMs AND TWO-CORE VMs
 > ## Check impact of a single VM (there is no degradation for the moment)
 > ### Put a VM on a PM, and put a task to the VM
@@ -73,8 +73,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-sharing$EXEEXT --log=root.fmt:%m%n ${srcdir:
 > Passed: ( [Xo]2 )2 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put three tasks to the VM
 > Passed: ( [ooX]2 )2 with 0.6667 load (66666666flops) took 0.1s as expected
-> Passed: ( [Xoo]2 )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > Passed: ( [oXo]2 )2 with 0.6667 load (66666666flops) took 0.1s as expected
+> Passed: ( [Xoo]2 )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > ## Check impact of a single VM collocated with a task (there is no degradation for the moment)
 > ### Put a VM on a PM, and put a task to the PM
 > Passed: ( [ ]2 X )2 with 1 load (100000000flops) took 0.1s as expected
@@ -88,26 +88,26 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-sharing$EXEEXT --log=root.fmt:%m%n ${srcdir:
 > ### Put a VM on a PM, put one task to the PM and three tasks to the VM
 > Passed: ( [ooo]2 X )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > Passed: ( [ooX]2 o )2 with 0.4444 load (44444444flops) took 0.1s as expected
-> Passed: ( [Xoo]2 o )2 with 0.4444 load (44444444flops) took 0.1s as expected
 > Passed: ( [oXo]2 o )2 with 0.4444 load (44444444flops) took 0.1s as expected
+> Passed: ( [Xoo]2 o )2 with 0.4444 load (44444444flops) took 0.1s as expected
 > ### Put a VM on a PM, and put two tasks to the PM
 > Passed: ( [ ]2 oX )2 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [ ]2 Xo )2 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, put one task to the PM and one task to the VM
-> Passed: ( [o]2 Xo )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > Passed: ( [o]2 oX )2 with 0.6667 load (66666666flops) took 0.1s as expected
+> Passed: ( [o]2 Xo )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > Passed: ( [X]2 oo )2 with 0.6667 load (66666666flops) took 0.1s as expected
 > ### Put a VM on a PM, put one task to the PM and two tasks to the VM
-> Passed: ( [oo]2 Xo )2 with 0.5 load (50000000flops) took 0.1s as expected
 > Passed: ( [oo]2 oX )2 with 0.5 load (50000000flops) took 0.1s as expected
+> Passed: ( [oo]2 Xo )2 with 0.5 load (50000000flops) took 0.1s as expected
 > Passed: ( [oX]2 oo )2 with 0.5 load (50000000flops) took 0.1s as expected
 > Passed: ( [Xo]2 oo )2 with 0.5 load (50000000flops) took 0.1s as expected
 > ### Put a VM on a PM, put one task to the PM and three tasks to the VM
-> Passed: ( [ooo]2 Xo )2 with 0.5 load (50000000flops) took 0.1s as expected
 > Passed: ( [ooo]2 oX )2 with 0.5 load (50000000flops) took 0.1s as expected
+> Passed: ( [ooo]2 Xo )2 with 0.5 load (50000000flops) took 0.1s as expected
 > Passed: ( [ooX]2 oo )2 with 0.3333 load (33333333flops) took 0.1s as expected
-> Passed: ( [Xoo]2 oo )2 with 0.3333 load (33333333flops) took 0.1s as expected
 > Passed: ( [oXo]2 oo )2 with 0.3333 load (33333333flops) took 0.1s as expected
+> Passed: ( [Xoo]2 oo )2 with 0.3333 load (33333333flops) took 0.1s as expected
 > # TEST ON FOUR-CORE PMs AND TWO-CORE VMs
 > ## Check impact of a single VM
 > ### Put a VM on a PM, and put a task to the VM
@@ -117,8 +117,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-sharing$EXEEXT --log=root.fmt:%m%n ${srcdir:
 > Passed: ( [Xo]2 )4 with 1 load (100000000flops) took 0.1s as expected
 > ### ( [ooo]2 )4: Put a VM on a PM, and put three tasks to the VM
 > Passed: ( [ooX]2 )4 with 0.6667 load (66666666flops) took 0.1s as expected
-> Passed: ( [Xoo]2 )4 with 0.6667 load (66666666flops) took 0.1s as expected
 > Passed: ( [oXo]2 )4 with 0.6667 load (66666666flops) took 0.1s as expected
+> Passed: ( [Xoo]2 )4 with 0.6667 load (66666666flops) took 0.1s as expected
 > ## Check impact of a single empty VM collocated with tasks
 > ### Put a VM on a PM, and put a task to the PM
 > Passed: ( [ ]2 X )4 with 1 load (100000000flops) took 0.1s as expected
@@ -127,8 +127,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-sharing$EXEEXT --log=root.fmt:%m%n ${srcdir:
 > Passed: ( [ ]2 Xo )4 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put three tasks to the PM
 > Passed: ( [ ]2 ooX )4 with 1 load (100000000flops) took 0.1s as expected
-> Passed: ( [ ]2 Xoo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [ ]2 oXo )4 with 1 load (100000000flops) took 0.1s as expected
+> Passed: ( [ ]2 Xoo )4 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put four tasks to the PM
 > Passed: ( [ ]2 oooX )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [ ]2 ooXo )4 with 1 load (100000000flops) took 0.1s as expected
@@ -139,32 +139,32 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-sharing$EXEEXT --log=root.fmt:%m%n ${srcdir:
 > Passed: ( [o]2 X )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [X]2 o )4 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put two tasks to the PM and one task to the VM
-> Passed: ( [o]2 Xo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [o]2 oX )4 with 1 load (100000000flops) took 0.1s as expected
+> Passed: ( [o]2 Xo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [X]2 oo )4 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put two tasks to the PM and two tasks to the VM
-> Passed: ( [oo]2 Xo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [oo]2 oX )4 with 1 load (100000000flops) took 0.1s as expected
+> Passed: ( [oo]2 Xo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [oX]2 oo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [Xo]2 oo )4 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put three tasks to the PM and one tasks to the VM
 > Passed: ( [o]2 ooX )4 with 1 load (100000000flops) took 0.1s as expected
-> Passed: ( [o]2 Xoo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [o]2 oXo )4 with 1 load (100000000flops) took 0.1s as expected
+> Passed: ( [o]2 Xoo )4 with 1 load (100000000flops) took 0.1s as expected
 > Passed: ( [X]2 ooo )4 with 1 load (100000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put three tasks to the PM and two tasks to the VM
 > Passed: ( [oo]2 ooX )4 with 0.8 load (80000000flops) took 0.1s as expected
-> Passed: ( [oo]2 Xoo )4 with 0.8 load (80000000flops) took 0.1s as expected
 > Passed: ( [oo]2 oXo )4 with 0.8 load (80000000flops) took 0.1s as expected
+> Passed: ( [oo]2 Xoo )4 with 0.8 load (80000000flops) took 0.1s as expected
 > Passed: ( [oX]2 ooo )4 with 0.8 load (80000000flops) took 0.1s as expected
 > Passed: ( [Xo]2 ooo )4 with 0.8 load (80000000flops) took 0.1s as expected
 > ### Put a VM on a PM, and put three tasks to the PM and three tasks to the VM
 > Passed: ( [ooo]2 ooX )4 with 0.8 load (80000000flops) took 0.1s as expected
-> Passed: ( [ooo]2 Xoo )4 with 0.8 load (80000000flops) took 0.1s as expected
 > Passed: ( [ooo]2 oXo )4 with 0.8 load (80000000flops) took 0.1s as expected
+> Passed: ( [ooo]2 Xoo )4 with 0.8 load (80000000flops) took 0.1s as expected
 > Passed: ( [ooX]2 ooo )4 with 0.5333 load (53333333flops) took 0.1s as expected
-> Passed: ( [Xoo]2 ooo )4 with 0.5333 load (53333333flops) took 0.1s as expected
 > Passed: ( [oXo]2 ooo )4 with 0.5333 load (53333333flops) took 0.1s as expected
+> Passed: ( [Xoo]2 ooo )4 with 0.5333 load (53333333flops) took 0.1s as expected
 >    
 >    
 > ## 0 test failed
index a064000..680b014 100644 (file)
@@ -10,13 +10,22 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 xbt_dynar_t tests;
 int tasks_done = 0;
 
+static void task_cleanup_handler(void *task)
+{
+  if (task)
+    MSG_task_destroy(task);
+}
+
 static int process_daemon(int argc, char *argv[])
 {
+  msg_process_t self = MSG_process_self();
   XBT_INFO("  Start daemon on %s (%f)", MSG_host_get_name(MSG_host_self()), MSG_host_get_speed(MSG_host_self()));
   for(;;){
     msg_task_t task = MSG_task_create("daemon", MSG_host_get_speed(MSG_host_self()), 0, NULL);
+    MSG_process_set_data(self, task);
     XBT_INFO("  Execute daemon");
     MSG_task_execute(task);
+    MSG_process_set_data(self, NULL);
     MSG_task_destroy(task);
     tasks_done ++;
   }
@@ -39,7 +48,7 @@ static int commTX(int argc, char *argv[])
   const char * mailbox = "comm";
   XBT_INFO("  Start TX");
   msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL);
-  MSG_task_isend(task, mailbox);
+  MSG_task_dsend(task, mailbox, task_cleanup_handler);
   // We should wait a bit (if not the process will end before the communication, hence an exception on the other side).
   MSG_process_sleep(30);
   XBT_INFO("  TX done");
@@ -54,12 +63,13 @@ static int commRX(int argc, char *argv[])
   msg_error_t error = MSG_task_receive(&(task), mailbox);
   if (error==MSG_OK) {
     XBT_INFO("  Receive message: %s", task->name);
+    MSG_task_destroy(task);
   } else if (error==MSG_HOST_FAILURE) {
     XBT_INFO("  Receive message: HOST_FAILURE");
   } else if (error==MSG_TRANSFER_FAILURE) {
     XBT_INFO("  Receive message: TRANSFERT_FAILURE");
   } else {
-    XBT_INFO("  Receive message: %d", error);
+    XBT_INFO("  Receive message: %u", error);
   }
   XBT_INFO("  RX Done");
   return 0;
@@ -162,11 +172,12 @@ static int test_launcher(int argc, char *argv[])
     MSG_process_sleep(10);
     XBT_INFO("  Turn Jupiter off");
     MSG_host_off(jupiter);
-    XBT_INFO("Test 5 seems ok, cool !(number of Process : %d, it should be 2", MSG_process_get_number());
+    XBT_INFO("Test 5 seems ok (number of Process: %d, it should be 2)", MSG_process_get_number());
   }
 
   test =6;
   if (xbt_dynar_search_or_negative(tests, &test)!=-1){
+    MSG_process_set_data_cleanup(NULL); /* FIXME: we are leaking here, but removing this line changes the test output */
     XBT_INFO("Test 6: Turn on Jupiter, assign a VM on Jupiter, launch a process inside the VM, and turn off the node");
 
     // Create VM0
@@ -225,11 +236,13 @@ int main(int argc, char *argv[])
 
   MSG_create_environment(argv[1]);
 
+  MSG_process_set_data_cleanup(task_cleanup_handler);
   MSG_process_create("test_launcher", test_launcher, NULL, MSG_get_host_by_name("Tremblay"));
 
   res = MSG_main();
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
+  xbt_dynar_free(&tests);
 
   return res != MSG_OK;
 }
index 13b028d..5d5d220 100644 (file)
@@ -61,7 +61,7 @@ $ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platfor
 > [Tremblay:commTX:(3) 10.000000] [msg_test/INFO]   Start TX
 > [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO]   number of processes: 3
 > [Tremblay:test_launcher:(1) 20.000000] [msg_test/INFO]   Turn Jupiter off
-> [Tremblay:test_launcher:(1) 20.000000] [msg_test/INFO] Test 5 seems ok, cool !(number of Process : 2, it should be 2
+> [Tremblay:test_launcher:(1) 20.000000] [msg_test/INFO] Test 5 seems ok (number of Process: 2, it should be 2)
 > [Tremblay:test_launcher:(1) 20.000000] [msg_test/INFO]   Test done. See you!
 > [Tremblay:commTX:(3) 40.000000] [msg_test/INFO]   TX done
 > [40.000000] [msg_test/INFO] Simulation time 40
index 5c22018..0326f56 100644 (file)
@@ -98,7 +98,7 @@ static int worker(int /*argc*/, char* /*argv*/ [])
     MSG_task_execute(task);
     double end = MSG_get_clock();
     XBT_INFO("Task \"%s\" done in %f (amount %f)", MSG_task_get_name(task), end - start,
-             MSG_task_get_flops_amount(task));
+             MSG_task_get_remaining_work_ratio(task));
 
     MSG_task_destroy(task);
   }
diff --git a/teshsuite/msg/task_progress/task_progress.cpp b/teshsuite/msg/task_progress/task_progress.cpp
new file mode 100644 (file)
index 0000000..c681ec9
--- /dev/null
@@ -0,0 +1,111 @@
+/* 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 <xbt/ex.hpp>
+#include "simgrid/msg.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
+
+static std::vector<msg_task_t> tasks = std::vector<msg_task_t>();
+
+static int seq_task(int /*argc*/, char* /*argv*/ [])
+{
+  double task_comp_size = 5E7;
+  double task_comm_size = 1E6;
+  double progress = 0;
+
+  msg_task_t task = MSG_task_create("simple", task_comp_size, task_comm_size, NULL);
+  tasks.push_back(task);
+
+  XBT_INFO("get the progress of %s before the task starts", task->name);
+  progress = MSG_task_get_remaining_work_ratio(task);
+  xbt_assert(progress == 0, "Progress should be 0 not %f", progress);
+
+  XBT_INFO("Executing task: \"%s\"", task->name);
+  MSG_task_execute(task);
+
+  XBT_INFO("get the progress of %s after the task finishes", task->name);
+  progress = MSG_task_get_remaining_work_ratio(task);
+  xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress);
+
+  MSG_task_destroy(task);
+  XBT_INFO("Goodbye now!");
+  return 0;
+}
+
+static int par_task(int /*argc*/, char* /*argv*/ [])
+{
+  double * computation_amount = new double[2] {10E7, 10E7};
+  double * communication_amount = new double[4] {1E6, 1E6, 1E6, 1E6};
+  double progress = 0;
+
+  std::vector<msg_host_t> hosts_to_use = std::vector<msg_host_t>();
+  hosts_to_use.push_back(MSG_get_host_by_name("Tremblay"));
+  hosts_to_use.push_back(MSG_get_host_by_name("Jupiter"));
+
+  msg_task_t task = MSG_parallel_task_create("ptask", 2, hosts_to_use.data(), computation_amount, communication_amount, NULL);
+  tasks.push_back(task);
+
+  XBT_INFO("get the progress of %s before the task starts", task->name);
+  progress = MSG_task_get_remaining_work_ratio(task);
+  xbt_assert(progress == 0, "Progress should be 0 not %f", progress);
+
+  XBT_INFO("Executing task: \"%s\"", task->name);
+  MSG_parallel_task_execute(task);
+
+  XBT_INFO("get the progress of %s after the task finishes", task->name);
+  progress = MSG_task_get_remaining_work_ratio(task);
+  xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress);
+
+  MSG_task_destroy(task);
+  delete[] computation_amount;
+  delete[] communication_amount;
+
+  XBT_INFO("Goodbye now!");
+  return 0;
+}
+
+static int get_progress(int /*argc*/, char* /*argv*/ [])
+{
+  while (tasks.empty()) {
+    MSG_process_sleep(0.5);
+  }
+  double progress;
+  for(auto const& task: tasks) {
+    double progress_prev = 1;
+    for (int i = 0; i < 3; i++) {
+      MSG_process_sleep(0.2);
+      progress = MSG_task_get_remaining_work_ratio(task);
+      xbt_assert(progress >= 0 and progress < 1, "Progress should be in [0, 1[, and not %f", progress);
+      xbt_assert(progress < progress_prev, "Progress should decrease, not increase");
+      XBT_INFO("Progress of \"%s\": %f", task->name, progress);
+      progress_prev = progress;
+    }
+  }
+  return 0;
+}
+
+int main(int argc, char *argv[])
+{
+  MSG_init(&argc, argv);
+  MSG_config("host/model", "ptask_L07");
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../examples/platforms/two_hosts.xml\n", argv[0], argv[0]);
+
+  MSG_create_environment(argv[1]);
+
+  MSG_process_create("sequential", seq_task, NULL, MSG_get_host_by_name("Tremblay"));
+
+  MSG_process_create("parallel", par_task, NULL, MSG_get_host_by_name("Tremblay"));
+
+  // Create a process to test in progress task
+  MSG_process_create("get_progress", get_progress, NULL, MSG_get_host_by_name("Tremblay"));
+
+  msg_error_t res = MSG_main();
+
+  XBT_INFO("Simulation time %g", MSG_get_clock());
+
+  return res != MSG_OK;
+}
diff --git a/teshsuite/msg/task_progress/task_progress.tesh b/teshsuite/msg/task_progress/task_progress.tesh
new file mode 100644 (file)
index 0000000..679e181
--- /dev/null
@@ -0,0 +1,18 @@
+$ ./task_progress ${srcdir:=.}/../../../examples/platforms/small_platform.xml
+> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
+> [Tremblay:sequential:(1) 0.000000] [msg_test/INFO] get the progress of simple before the task starts
+> [Tremblay:sequential:(1) 0.000000] [msg_test/INFO] Executing task: "simple"
+> [Tremblay:parallel:(2) 0.000000] [msg_test/INFO] get the progress of ptask before the task starts
+> [Tremblay:parallel:(2) 0.000000] [msg_test/INFO] Executing task: "ptask"
+> [Tremblay:get_progress:(3) 0.200000] [msg_test/INFO] Progress of "simple": 0.802376
+> [Tremblay:get_progress:(3) 0.400000] [msg_test/INFO] Progress of "simple": 0.606186
+> [Tremblay:get_progress:(3) 0.600000] [msg_test/INFO] Progress of "simple": 0.409996
+> [Tremblay:get_progress:(3) 0.800000] [msg_test/INFO] Progress of "ptask": 0.608337
+> [Tremblay:get_progress:(3) 1.000000] [msg_test/INFO] Progress of "ptask": 0.510242
+> [Tremblay:sequential:(1) 1.017958] [msg_test/INFO] get the progress of simple after the task finishes
+> [Tremblay:sequential:(1) 1.017958] [msg_test/INFO] Goodbye now!
+> [Tremblay:get_progress:(3) 1.200000] [msg_test/INFO] Progress of "ptask": 0.362543
+> [Tremblay:parallel:(2) 1.675180] [msg_test/INFO] get the progress of ptask after the task finishes
+> [Tremblay:parallel:(2) 1.675180] [msg_test/INFO] Goodbye now!
+> [1.675180] [msg_test/INFO] Simulation time 1.67518
+
index 7de0dc6..7b14f78 100644 (file)
@@ -5,7 +5,7 @@
     <argument value="25"/>
     <argument value="1.0"/>
   </actor>
-  <actor host="Cpu B" function="test_trace" start_time="10">
+  <actor host="Cpu B" function="test_trace" start_time="10.5">
     <argument value="75"/>
     <argument value="3.0"/>
   </actor>
index 0048734..e846646 100644 (file)
@@ -5,7 +5,7 @@
     <argument value="50"/>
     <argument value="2.5"/>
   </actor>
-  <actor host="Cpu B" function="test_trace" start_time="10">
+  <actor host="Cpu B" function="test_trace" start_time="10.5">
     <argument value="70"/>
     <argument value="1.5"/>
   </actor>
index 3ba862d..58b9ad9 100644 (file)
@@ -123,26 +123,26 @@ $ ./trace_integration ${srcdir:=.}/../../../examples/platforms/two_hosts_platfor
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
 > [ 10.000000] (1:test_trace@Cpu B) Task size: 50.000000
 > [ 10.000000] (1:test_trace@Cpu B) Task prio: 2.500000
-> [ 10.000000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
-> [ 10.000000] (2:test_trace@Cpu B) Task size: 70.000000
-> [ 10.000000] (2:test_trace@Cpu B) Task prio: 1.500000
-> [ 20.000000] (1:test_trace@Cpu B) Test finished
+> [ 10.500000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
+> [ 10.500000] (2:test_trace@Cpu B) Task size: 70.000000
+> [ 10.500000] (2:test_trace@Cpu B) Task prio: 1.500000
+> [ 19.700000] (1:test_trace@Cpu B) Test finished
 > [ 30.000000] (2:test_trace@Cpu B) Test finished
 
-p Testing trace integration using trace_B.txt and test-hbp2.5-hbp1.5.xml, two process with different priority
+p Testing trace integration using trace_B.txt and test-hbp2.5-hbp1.5.xml, two process with different priority (included)
 
 ! output sort
-$ ./trace_integration ${srcdir:=.}/../../../examples/platforms/two_hosts_platform_with_availability.xml  ${srcdir:=.}/test-hbp2.5-hbp1.5.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI --log=simix.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ./trace_integration ${srcdir:=.}/../../../examples/platforms/two_hosts_platform_with_availability_included.xml  ${srcdir:=.}/test-hbp2.5-hbp1.5.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI --log=simix.thresh:warning "--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 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
 > [ 10.000000] (1:test_trace@Cpu B) Task size: 50.000000
 > [ 10.000000] (1:test_trace@Cpu B) Task prio: 2.500000
-> [ 10.000000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
-> [ 10.000000] (2:test_trace@Cpu B) Task size: 70.000000
-> [ 10.000000] (2:test_trace@Cpu B) Task prio: 1.500000
-> [ 20.000000] (1:test_trace@Cpu B) Test finished
+> [ 10.500000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
+> [ 10.500000] (2:test_trace@Cpu B) Task size: 70.000000
+> [ 10.500000] (2:test_trace@Cpu B) Task prio: 1.500000
+> [ 19.700000] (1:test_trace@Cpu B) Test finished
 > [ 30.000000] (2:test_trace@Cpu B) Test finished
 
 p Testing trace integration using trace_B.txt and test-hbp1.0-hbp1.0-hbp1.0.xml, three process with same priority
@@ -165,26 +165,6 @@ $ ./trace_integration ${srcdir:=.}/../../../examples/platforms/two_hosts_platfor
 > [ 50.000000] (2:test_trace@Cpu B) Test finished
 > [ 60.000000] (3:test_trace@Cpu B) Test finished
 
-p Testing trace integration using trace_B.txt and test-hbp1.0-hbp3.0-hbp4.0.xml, three process with same priority
-
-! output sort
-$ ./trace_integration ${srcdir:=.}/../../../examples/platforms/two_hosts_platform_with_availability.xml  ${srcdir:=.}/test-hbp1.0-hbp3.0-hbp4.0.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI --log=simix.thresh:warning "--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 'network/model' to 'CM02'
-> [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
-> [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
-> [ 10.000000] (1:test_trace@Cpu B) Task size: 25.000000
-> [ 10.000000] (1:test_trace@Cpu B) Task prio: 1.000000
-> [ 10.000000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
-> [ 10.000000] (2:test_trace@Cpu B) Task size: 75.000000
-> [ 10.000000] (2:test_trace@Cpu B) Task prio: 3.000000
-> [ 20.000000] (3:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
-> [ 20.000000] (3:test_trace@Cpu B) Task size: 120.000000
-> [ 20.000000] (3:test_trace@Cpu B) Task prio: 4.000000
-> [ 30.000000] (1:test_trace@Cpu B) Test finished
-> [ 30.000000] (2:test_trace@Cpu B) Test finished
-> [ 40.000000] (3:test_trace@Cpu B) Test finished
-
 p Testing trace integration using trace_B.txt and test-hbp1.0-hbp3.0-hbp4.0.xml, three process with different priority
 
 ! output sort
@@ -195,14 +175,14 @@ $ ./trace_integration ${srcdir:=.}/../../../examples/platforms/two_hosts_platfor
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
 > [ 10.000000] (1:test_trace@Cpu B) Task size: 25.000000
 > [ 10.000000] (1:test_trace@Cpu B) Task prio: 1.000000
-> [ 10.000000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
-> [ 10.000000] (2:test_trace@Cpu B) Task size: 75.000000
-> [ 10.000000] (2:test_trace@Cpu B) Task prio: 3.000000
+> [ 10.500000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
+> [ 10.500000] (2:test_trace@Cpu B) Task size: 75.000000
+> [ 10.500000] (2:test_trace@Cpu B) Task prio: 3.000000
 > [ 20.000000] (3:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
 > [ 20.000000] (3:test_trace@Cpu B) Task size: 120.000000
 > [ 20.000000] (3:test_trace@Cpu B) Task prio: 4.000000
-> [ 30.000000] (1:test_trace@Cpu B) Test finished
-> [ 30.000000] (2:test_trace@Cpu B) Test finished
+> [ 24.000000] (1:test_trace@Cpu B) Test finished
+> [ 30.400000] (2:test_trace@Cpu B) Test finished
 > [ 40.000000] (3:test_trace@Cpu B) Test finished
 
 p Testing trace integration using trace_B.txt and test-hbp1.0-hbp3.0-hbp4.0.xml, three process with different priority (included)
@@ -215,12 +195,12 @@ $ ./trace_integration ${srcdir:=.}/../../../examples/platforms/two_hosts_platfor
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
 > [ 10.000000] (1:test_trace@Cpu B) Task size: 25.000000
 > [ 10.000000] (1:test_trace@Cpu B) Task prio: 1.000000
-> [ 10.000000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
-> [ 10.000000] (2:test_trace@Cpu B) Task size: 75.000000
-> [ 10.000000] (2:test_trace@Cpu B) Task prio: 3.000000
+> [ 10.500000] (2:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
+> [ 10.500000] (2:test_trace@Cpu B) Task size: 75.000000
+> [ 10.500000] (2:test_trace@Cpu B) Task prio: 3.000000
 > [ 20.000000] (3:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
 > [ 20.000000] (3:test_trace@Cpu B) Task size: 120.000000
 > [ 20.000000] (3:test_trace@Cpu B) Task prio: 4.000000
-> [ 30.000000] (1:test_trace@Cpu B) Test finished
-> [ 30.000000] (2:test_trace@Cpu B) Test finished
+> [ 24.000000] (1:test_trace@Cpu B) Test finished
+> [ 30.400000] (2:test_trace@Cpu B) Test finished
 > [ 40.000000] (3:test_trace@Cpu B) Test finished
index 27538f6..539a53a 100644 (file)
@@ -1,4 +1,4 @@
-foreach(x actor comm-pt2pt comm-waitany concurrent_rw host_on_off_wait listen_async pid storage_client_server)
+foreach(x actor comm-pt2pt concurrent_rw host_on_off_wait listen_async pid storage_client_server)
   add_executable       (${x}  ${x}/${x}.cpp)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -10,7 +10,7 @@ endforeach()
 ## Some need to be run with all factories, some need not tesh to run
 foreach(x actor concurrent_rw)
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
-  ADD_TESH_FACTORIES(tesh-s4u-${x} "thread;boost;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
+  ADD_TESH_FACTORIES(tesh-s4u-${x} "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
 endforeach()
 
 foreach(x host_on_off_wait listen_async pid storage_client_server)
@@ -20,7 +20,6 @@ endforeach()
 
 # The output is not relevant
 ADD_TEST(tesh-s4u-comm-pt2pt   ${CMAKE_BINARY_DIR}/teshsuite/s4u/comm-pt2pt/comm-pt2pt     ${CMAKE_HOME_DIRECTORY}/examples/platforms/cluster.xml)
-ADD_TEST(tesh-s4u-comm-waitany ${CMAKE_BINARY_DIR}/teshsuite/s4u/comm-waitany/comm-waitany ${CMAKE_HOME_DIRECTORY}/examples/platforms/two_hosts.xml)
 
 
 
index 6d8c6d5..46b464f 100644 (file)
@@ -25,8 +25,8 @@ static void master()
   std::vector<simgrid::s4u::ActorPtr>* actor_list = new std::vector<simgrid::s4u::ActorPtr>();
   simgrid::s4u::this_actor::getHost()->actorList(actor_list);
 
-  for (auto actor : *actor_list) {
-    XBT_INFO("Actor (pid=%lu, ppid=%lu, name=%s)", actor->getPid(), actor->getPpid(), actor->getName().c_str());
+  for (auto const& actor : *actor_list) {
+    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 6827ed4..6b70db2 100644 (file)
@@ -50,43 +50,43 @@ static void sender(std::vector<std::string> args)
   XBT_INFO("Sender spec: %s", args[0].c_str());
   for (unsigned int test = 1; test <= args[0].size(); test++) {
     this_actor::sleep_until(test * 5 - 5);
-    char* mboxName                = bprintf("Test #%u", test);
-    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
+    std::string* mboxName         = new std::string("Test #" + std::to_string(test));
+    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName->c_str());
 
     switch (args[0][test - 1]) {
       case 'r':
-        XBT_INFO("Test %d: r (regular send)", test);
+        XBT_INFO("Test %u: r (regular send)", test);
         mbox->put((void*)mboxName, 42.0);
         break;
       case 'R':
-        XBT_INFO("Test %d: R (sleep + regular send)", test);
+        XBT_INFO("Test %u: R (sleep + regular send)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->put((void*)mboxName, 42.0);
         break;
 
       case 'i':
-        XBT_INFO("Test %d: i (asynchronous isend)", test);
+        XBT_INFO("Test %u: i (asynchronous isend)", test);
         mbox->put_async((void*)mboxName, 42.0)->wait();
         break;
       case 'I':
-        XBT_INFO("Test %d: I (sleep + isend)", test);
+        XBT_INFO("Test %u: I (sleep + isend)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->put_async((void*)mboxName, 42.0)->wait();
         break;
 
       case 'd':
-        XBT_INFO("Test %d: d (detached send)", test);
+        XBT_INFO("Test %u: d (detached send)", test);
         mbox->put_init((void*)mboxName, 42.0)->detach();
         break;
       case 'D':
-        XBT_INFO("Test %d: D (sleep + detached send)", test);
+        XBT_INFO("Test %u: D (sleep + detached send)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->put_init((void*)mboxName, 42.0)->detach();
         break;
       default:
-        xbt_die("Unknown sender spec for test %d: '%c'", test, args[0][test - 1]);
+        xbt_die("Unknown sender spec for test %u: '%c'", test, args[0][test - 1]);
     }
-    XBT_INFO("Test %d OK", test);
+    XBT_INFO("Test %u OK", test);
   }
   simgrid::s4u::this_actor::sleep_for(0.5);
   // FIXME: we should test what happens when the process ends before the end of remote comm instead of hiding it
@@ -97,60 +97,59 @@ static void receiver(std::vector<std::string> args)
   XBT_INFO("Receiver spec: %s", args[0].c_str());
   for (unsigned int test = 1; test <= args[0].size(); test++) {
     this_actor::sleep_until(test * 5 - 5);
-    char* mboxName                = bprintf("Test #%u", test);
-    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
+    std::string mboxName          = "Test #" + std::to_string(test);
+    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName.c_str());
     void* received                = nullptr;
 
     switch (args[0][test - 1]) {
       case 'r':
-        XBT_INFO("Test %d: r (regular receive)", test);
+        XBT_INFO("Test %u: r (regular receive)", test);
         received = mbox->get();
         break;
       case 'R':
-        XBT_INFO("Test %d: R (sleep + regular receive)", test);
+        XBT_INFO("Test %u: R (sleep + regular receive)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         received = mbox->get();
         break;
 
       case 'i':
-        XBT_INFO("Test %d: i (asynchronous irecv)", test);
+        XBT_INFO("Test %u: i (asynchronous irecv)", test);
         mbox->get_async(&received)->wait();
         break;
       case 'I':
-        XBT_INFO("Test %d: I (sleep + asynchronous irecv)", test);
+        XBT_INFO("Test %u: I (sleep + asynchronous irecv)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->get_async(&received)->wait();
         break;
       case 'p':
-        XBT_INFO("Test %d: p (regular receive on permanent mailbox)", test);
+        XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test);
         mbox->setReceiver(Actor::self());
         received = mbox->get();
         break;
       case 'P':
-        XBT_INFO("Test %d: P (sleep + regular receive on permanent mailbox)", test);
+        XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->setReceiver(Actor::self());
         received = mbox->get();
         break;
       case 'j':
-        XBT_INFO("Test %d: j (irecv on permanent mailbox)", test);
+        XBT_INFO("Test %u: j (irecv on permanent mailbox)", test);
         mbox->setReceiver(Actor::self());
         mbox->get_async(&received)->wait();
         break;
       case 'J':
-        XBT_INFO("Test %d: J (sleep + irecv on permanent mailbox)", test);
+        XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->setReceiver(Actor::self());
         mbox->get_async(&received)->wait();
         break;
       default:
-        xbt_die("Unknown receiver spec for test %d: '%c'", test, args[0][test - 1]);
+        xbt_die("Unknown receiver spec for test %u: '%c'", test, args[0][test - 1]);
     }
-
-    xbt_assert(strcmp(static_cast<char*>(received), mboxName) == 0);
-    xbt_free(received);
-    xbt_free(mboxName);
-    XBT_INFO("Test %d OK", test);
+    std::string* receivedStr = static_cast<std::string*>(received);
+    xbt_assert(*receivedStr == mboxName);
+    delete receivedStr;
+    XBT_INFO("Test %u OK", test);
   }
   simgrid::s4u::this_actor::sleep_for(0.5);
 }
diff --git a/teshsuite/s4u/comm-waitany/comm-waitany.cpp b/teshsuite/s4u/comm-waitany/comm-waitany.cpp
deleted file mode 100644 (file)
index 6b96583..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (c) 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 <iostream>
-#include <simgrid/s4u.hpp>
-#include <stdlib.h>
-#include <vector>
-
-#define NUM_COMMS 1
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "Minimum Working Example");
-
-static void receiver()
-{
-  simgrid::s4u::MailboxPtr mymailbox = simgrid::s4u::Mailbox::byName("receiver_mailbox");
-
-  std::vector<simgrid::s4u::CommPtr> pending_comms;
-
-  XBT_INFO("Placing %d asynchronous recv requests", NUM_COMMS);
-  void* data;
-  for (int i = 0; i < NUM_COMMS; i++) {
-    simgrid::s4u::CommPtr comm = mymailbox->get_async(&data);
-    pending_comms.push_back(comm);
-  }
-
-  for (int i = 0; i < NUM_COMMS; i++) {
-    XBT_INFO("Sleeping for 3 seconds (for the %dth time)...", i + 1);
-    simgrid::s4u::this_actor::sleep_for(3.0);
-    XBT_INFO("Calling wait_any() for %zu pending comms", pending_comms.size());
-    int changed_pos = simgrid::s4u::Comm::wait_any(&pending_comms);
-    XBT_INFO("Counting the number of completed comms...");
-
-    pending_comms.erase(pending_comms.begin() + changed_pos);
-  }
-}
-
-static void sender()
-{
-  simgrid::s4u::MailboxPtr theirmailbox = simgrid::s4u::Mailbox::byName("receiver_mailbox");
-
-  void* data = (void*)"data";
-
-  for (int i = 0; i < NUM_COMMS; i++) {
-    XBT_INFO("Sending a message to the receiver");
-    theirmailbox->put(&data, 4);
-    XBT_INFO("Sleeping for 1000 seconds");
-    simgrid::s4u::this_actor::sleep_for(1000.0);
-  }
-}
-
-int main(int argc, char** argv)
-{
-
-  simgrid::s4u::Engine* engine = new simgrid::s4u::Engine(&argc, argv);
-
-  xbt_assert(argc >= 2, "Usage: %s <xml platform file>", argv[0]);
-
-  engine->loadPlatform(argv[1]);
-  simgrid::s4u::Host** hosts = sg_host_list();
-  simgrid::s4u::Actor::createActor("Receiver", hosts[0], receiver);
-  simgrid::s4u::Actor::createActor("Sender", hosts[1], sender);
-  xbt_free(hosts);
-
-  engine->run();
-
-  delete engine;
-  return 0;
-}
index 217a166..0c1db3c 100644 (file)
@@ -4,38 +4,27 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u.hpp"
-#include <unistd.h>
-
-#define FILENAME1 "/home/doc/simgrid/examples/platforms/g5k.xml"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u test");
 
 static void host()
 {
-  char name[2048];
+  simgrid::s4u::Storage* storage = simgrid::s4u::Storage::byName("Disk1");
   int id = simgrid::s4u::this_actor::getPid();
-  snprintf(name, 2048, "%s%i", FILENAME1, id);
-  simgrid::s4u::File* file = new simgrid::s4u::File(name, NULL);
   XBT_INFO("process %d is writing!", id);
-  file->write(3000000);
+  storage->write(3000000);
   XBT_INFO("process %d goes to sleep for %d seconds", id, id);
   simgrid::s4u::this_actor::sleep_for(id);
   XBT_INFO("process %d is writing again!", id);
-  file->write(3000000);
+  storage->write(3000000);
   XBT_INFO("process %d goes to sleep for %d seconds", id, 6 - id);
   simgrid::s4u::this_actor::sleep_for(6 - id);
   XBT_INFO("process %d is reading!", id);
-  file->seek(0);
-  file->read(3000000);
+  storage->read(3000000);
   XBT_INFO("process %d goes to sleep for %d seconds", id, id);
   simgrid::s4u::this_actor::sleep_for(id);
   XBT_INFO("process %d is reading again!", id);
-  file->seek(0);
-  file->read(3000000);
-
-  XBT_INFO("process %d => Size of %s: %llu", id, name, file->size());
-  // Close the file
-  delete file;
+  storage->read(3000000);
 }
 
 int main(int argc, char** argv)
index 8be078f..1d46abe 100644 (file)
@@ -19,24 +19,19 @@ $ ./concurrent_rw$EXEEXT ${srcdir:=.}/../../../examples/platforms/storage/storag
 > [  4.600000] (host@bob) process 4 goes to sleep for 2 seconds
 > [  5.500000] (host@bob) process 5 is writing again!
 > [  5.600000] (host@bob) process 5 goes to sleep for 1 seconds
-> [  6.600000] (host@bob) process 4 is reading!
-> [  6.600000] (host@bob) process 5 is reading!
 > [  6.600000] (host@bob) process 1 is reading!
 > [  6.600000] (host@bob) process 2 is reading!
 > [  6.600000] (host@bob) process 3 is reading!
-> [  6.750000] (host@bob) process 4 goes to sleep for 4 seconds
-> [  6.750000] (host@bob) process 5 goes to sleep for 5 seconds
+> [  6.600000] (host@bob) process 4 is reading!
+> [  6.600000] (host@bob) process 5 is reading!
 > [  6.750000] (host@bob) process 1 goes to sleep for 1 seconds
 > [  6.750000] (host@bob) process 2 goes to sleep for 2 seconds
 > [  6.750000] (host@bob) process 3 goes to sleep for 3 seconds
+> [  6.750000] (host@bob) process 4 goes to sleep for 4 seconds
+> [  6.750000] (host@bob) process 5 goes to sleep for 5 seconds
 > [  7.750000] (host@bob) process 1 is reading again!
-> [  7.780000] (host@bob) process 1 => Size of /home/doc/simgrid/examples/platforms/g5k.xml1: 6000000
 > [  8.750000] (host@bob) process 2 is reading again!
-> [  8.780000] (host@bob) process 2 => Size of /home/doc/simgrid/examples/platforms/g5k.xml2: 6000000
 > [  9.750000] (host@bob) process 3 is reading again!
-> [  9.780000] (host@bob) process 3 => Size of /home/doc/simgrid/examples/platforms/g5k.xml3: 6000000
 > [ 10.750000] (host@bob) process 4 is reading again!
-> [ 10.780000] (host@bob) process 4 => Size of /home/doc/simgrid/examples/platforms/g5k.xml4: 6000000
 > [ 11.750000] (host@bob) process 5 is reading again!
-> [ 11.780000] (host@bob) process 5 => Size of /home/doc/simgrid/examples/platforms/g5k.xml5: 6000000
 > [ 11.780000] (maestro@) Simulation time 11.78
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 db4614c..78598bc 100644 (file)
@@ -5,56 +5,51 @@
 
 #include "simgrid/s4u.hpp"
 #include <string>
+#include <xbt/string.hpp>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(storage, "Messages specific for this simulation");
 
 static void display_storage_properties(simgrid::s4u::Storage* storage)
 {
-  xbt_dict_t props = storage->getProperties();
-  if (xbt_dict_length(props) > 0) {
-    XBT_INFO("\tProperties of mounted storage: %s", storage->getName());
-
-    xbt_dict_cursor_t cursor = NULL;
-    char* key;
-    char* data;
-    xbt_dict_foreach (props, cursor, key, data)
-      XBT_INFO("\t\t'%s' -> '%s'", key, data);
+  std::map<std::string, std::string>* props = storage->getProperties();
+  if (not props->empty()) {
+    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());
+    }
   } else {
     XBT_INFO("\tNo property attached.");
   }
 }
 
-static sg_size_t write_local_file(const char* dest, sg_size_t file_size)
+static sg_size_t write_local_file(const std::string& dest, sg_size_t file_size)
 {
-  simgrid::s4u::File* file = new simgrid::s4u::File(dest, nullptr);
-  sg_size_t written        = file->write(file_size);
+  simgrid::s4u::File 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());
-  delete file;
+           simgrid::s4u::Actor::self()->getCname());
   return written;
 }
 
-static sg_size_t read_local_file(const char* src)
+static sg_size_t read_local_file(const std::string& src)
 {
-  simgrid::s4u::File* file = new simgrid::s4u::File(src, nullptr);
-  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);
-  delete file;
-
+  simgrid::s4u::File file(src, nullptr);
+  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()->getCname(), read, src.c_str());
   return read;
 }
 
 // Read src file on local disk and send a put message to remote host (size of message = size of src file)
-static void hsm_put(const char* remote_host, const char* src, const char* dest)
+static void hsm_put(const std::string& remote_host, const std::string& src, const std::string& dest)
 {
   // Read local src file, and return the size that was actually read
   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);
-  char* payload                    = bprintf("%s %llu", dest, read_size);
+  XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::getCname(), read_size, remote_host.c_str());
+  std::string* payload             = new std::string(simgrid::xbt::string_printf("%s %llu", dest.c_str(), read_size));
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(remote_host);
   mailbox->put(payload, static_cast<double>(read_size));
   simgrid::s4u::this_actor::sleep_for(.4);
@@ -62,26 +57,26 @@ 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 entry : *content)
+    for (auto const& entry : *content)
       XBT_INFO("\t%s size: %llu bytes", entry.first.c_str(), entry.second);
   } else {
     XBT_INFO("\tNo content.");
   }
 }
 
-static void dump_storage_by_name(const char* name)
+static void dump_storage_by_name(const std::string& name)
 {
   XBT_INFO("*** Dump a storage element ***");
   simgrid::s4u::Storage* storage = simgrid::s4u::Storage::byName(name);
   display_storage_content(storage);
 }
 
-static void get_set_storage_data(const char* storage_name)
+static void get_set_storage_data(const std::string& storage_name)
 {
-  XBT_INFO("*** GET/SET DATA for storage element: %s ***", storage_name);
+  XBT_INFO("*** GET/SET DATA for storage element: %s ***", storage_name.c_str());
   simgrid::s4u::Storage* storage = simgrid::s4u::Storage::byName(storage_name);
 
   char* data = static_cast<char*>(storage->getUserdata());
@@ -96,7 +91,7 @@ static void dump_platform_storages()
 {
   std::map<std::string, simgrid::s4u::Storage*>* storages = simgrid::s4u::allStorages();
 
-  for (auto storage : *storages) {
+  for (auto const& storage : *storages) {
     XBT_INFO("Storage %s is attached to %s", storage.first.c_str(), storage.second->getHost()->getCname());
     storage.second->setProperty("other usage", "gpfs");
   }
@@ -107,10 +102,10 @@ static void storage_info(simgrid::s4u::Host* host)
 {
   XBT_INFO("*** Storage info on %s ***", host->getCname());
 
-  for (auto elm : host->getMountedStorages()) {
-    const char* mount_name         = elm.first.c_str();
+  for (auto const& elm : host->getMountedStorages()) {
+    const std::string& mount_name  = elm.first;
     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.c_str());
 
     sg_size_t free_size = storage->getSizeFree();
     sg_size_t used_size = storage->getSizeUsed();
@@ -119,7 +114,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());
   }
 }
 
@@ -130,7 +125,7 @@ static void client()
   hsm_put("alice", "/home/doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c", "c:\\Windows\\tata.c");
 
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("alice");
-  mailbox->put(xbt_strdup("finalize"), 0);
+  mailbox->put(new std::string("finalize"), 0);
 
   get_set_storage_data("Disk1");
 }
@@ -142,16 +137,16 @@ static void server()
 
   XBT_INFO("Server waiting for transfers ...");
   while (1) {
-    char* msg = static_cast<char*>(mailbox->get());
-    if (not strcmp(msg, "finalize")) { // Shutdown ...
-      xbt_free(msg);
+    std::string* msg = static_cast<std::string*>(mailbox->get());
+    if (*msg == "finalize") { // Shutdown ...
+      delete msg;
       break;
     } else { // Receive file to save
-      char* saveptr;
-      char* dest              = strtok_r(msg, " ", &saveptr);
-      sg_size_t size_to_write = std::stoull(strtok_r(nullptr, " ", &saveptr));
+      size_t pos              = msg->find(' ');
+      std::string dest        = msg->substr(0, pos);
+      sg_size_t size_to_write = std::stoull(msg->substr(pos + 1));
       write_local_file(dest, size_to_write);
-      xbt_free(dest);
+      delete msg;
     }
   }
 
@@ -161,17 +156,16 @@ static void server()
 
 int main(int argc, char* argv[])
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
+  sg_storage_file_system_init();
   xbt_assert(argc == 2, "Usage: %s platform_file\n", argv[0]);
-  e->loadPlatform(argv[1]);
+  e.loadPlatform(argv[1]);
 
   simgrid::s4u::Actor::createActor("server", simgrid::s4u::Host::by_name("alice"), server);
   simgrid::s4u::Actor::createActor("client", simgrid::s4u::Host::by_name("bob"), client);
 
-  e->run();
-
-  XBT_INFO("Simulated time: %g", e->getClock());
+  e.run();
 
-  delete e;
+  XBT_INFO("Simulated time: %g", e.getClock());
   return 0;
 }
index 08781a1..0a7dffc 100644 (file)
@@ -54,11 +54,11 @@ $ ./storage_client_server$EXEEXT ${srcdir:=.}/../../../examples/platforms/storag
 > [  0.806104] (server@alice) 6217 bytes on 6217 bytes have been written by server on /sd1
 > [  1.207952] (server@alice) *** Storage info on alice ***
 > [  1.207952] (server@alice)  Storage name: Disk2, mount name: c:
+> [  1.207952] (server@alice)          Free size: 534479367024 bytes
+> [  1.207952] (server@alice)          Used size: 2391544976 bytes
 > [  1.207952] (client@bob) *** GET/SET DATA for storage element: Disk1 ***
 > [  1.207952] (client@bob) Get data: '(null)'
 > [  1.207952] (client@bob)    Set and get data: 'Some data'
-> [  1.207952] (server@alice)          Free size: 534479367024 bytes
-> [  1.207952] (server@alice)          Used size: 2391544976 bytes
 > [  1.207952] (server@alice)  No property attached.
 > [  1.207952] (server@alice) *** Dump a storage element ***
 > [  1.207952] (server@alice) Print the content of the storage element: Disk2
index 2c39100..3e8259f 100644 (file)
@@ -42,7 +42,6 @@ set(xml_files     ${xml_files}      ${CMAKE_CURRENT_SOURCE_DIR}/platforms/four_h
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/one_cluster_router_id.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/one_cluster.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_4p_1switch.xml
-                                    ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_include.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/properties.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/test_of_is_router.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/three_hosts_non_symmetric_route.xml
@@ -54,8 +53,6 @@ set(xml_files     ${xml_files}      ${CMAKE_CURRENT_SOURCE_DIR}/platforms/four_h
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/bogus_two_hosts_asymetric.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_hosts_one_link_fullduplex.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_hosts_one_link.xml
-                                    ${CMAKE_CURRENT_SOURCE_DIR}/platforms/clusterA.xml
-                                    ${CMAKE_CURRENT_SOURCE_DIR}/platforms/clusterB.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/Dijkstra.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_2p_1bb.xml
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_2p_1fl.xml
index ee27b68..099c46b 100644 (file)
@@ -40,16 +40,16 @@ $ ${bindir:=.}/basic-parsing-test ../platforms/four_hosts_floyd.xml
 > Workstation number: 4, link number: 5
 
 $ ${bindir:=.}/basic-parsing-test ../platforms/properties.xml
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'host/model' to 'compound'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/optim' to 'TI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'host/model' to 'compound'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '0.000010'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'Vegas'
 > Workstation number: 1, link number: 1
 
 $ ${bindir:=.}/basic-parsing-test ../platforms/properties.xml --cfg=cpu/optim:TI
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/optim' to 'TI'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'host/model' to 'compound'
 > [0.000000] [surf_parse/INFO] The custom configuration 'cpu/optim' is already defined by user!
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'host/model' to 'compound'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '0.000010'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'Vegas'
 > Workstation number: 1, link number: 1
index 9bce26c..d2dde0e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2008-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. */
@@ -13,7 +12,6 @@
 #endif
 
 #include "simgrid/simdag.h"
-#include "surf/surf.h"
 #include "xbt/xbt_os_time.h"
 
 int main(int argc, char **argv)
index 75a363c..cd94fdc 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(flatifier, "Logging specific to this platform parsing tool");
 
-static int name_compare_hosts(const void *n1, const void *n2)
-{
-  return std::strcmp(sg_host_get_name(*(sg_host_t *) n1), sg_host_get_name(*(sg_host_t *) n2));
-}
-
-static int name_compare_links(const void *n1, const void *n2)
-{
-  return std::strcmp(sg_link_name(*(SD_link_t *) n1),sg_link_name(*(SD_link_t *) n2));
-}
-
 static bool parse_cmdline(int* timings, char** platformFile, int argc, char** argv)
 {
   bool parse_ok = true;
@@ -57,64 +47,46 @@ static void create_environment(xbt_os_timer_t parse_time, const char *platformFi
   }
 }
 
-static void dump_platform()
+static void dump_hosts()
 {
-  int version = 4;
-  xbt_dict_t props = nullptr;
-  xbt_dict_cursor_t cursor = nullptr;
-  char* key;
-  char* data;
-
-  std::printf("<?xml version='1.0'?>\n");
-  std::printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">\n");
-  std::printf("<platform version=\"%d\">\n", version);
-  std::printf("<AS id=\"AS0\" routing=\"Full\">\n");
-
-  // Hosts
+  std::map<std::string, std::string>* props = nullptr;
   unsigned int totalHosts = sg_host_count();
   sg_host_t* hosts        = sg_host_list();
-  std::qsort((void*)hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts);
+  std::sort(hosts, hosts + totalHosts,
+            [](sg_host_t a, sg_host_t b) { return strcmp(sg_host_get_name(a), sg_host_get_name(b)) < 0; });
 
   for (unsigned int i = 0; i < totalHosts; i++) {
     std::printf("  <host id=\"%s\" speed=\"%.0f\"", hosts[i]->getCname(), sg_host_speed(hosts[i]));
-    props = sg_host_get_properties(hosts[i]);
+    props = hosts[i]->getProperties();
     if (hosts[i]->getCoreCount() > 1) {
       std::printf(" core=\"%d\"", hosts[i]->getCoreCount());
     }
-    if (props && not xbt_dict_is_empty(props)) {
+    if (props && not props->empty()) {
       std::printf(">\n");
-      xbt_dict_foreach (props, cursor, key, data) {
-        std::printf("    <prop id=\"%s\" value=\"%s\"/>\n", key, data);
+      for (auto const& kv : *props) {
+        std::printf("    <prop id=\"%s\" value=\"%s\"/>\n", kv.first.c_str(), kv.second.c_str());
       }
       std::printf("  </host>\n");
     } else {
       std::printf("/>\n");
     }
   }
+  std::free(hosts);
+}
 
-  // Routers
-  std::vector<simgrid::kernel::routing::NetPoint*> netcardList;
-  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();
-            });
-
-  for (auto srcCard : netcardList)
-    if (srcCard->isRouter())
-      std::printf("  <router id=\"%s\"/>\n", srcCard->cname());
-
-  // Links
+static void dump_links()
+{
   unsigned int totalLinks    = sg_link_count();
   simgrid::s4u::Link** links = sg_link_list();
 
-  std::qsort((void*)links, totalLinks, sizeof(SD_link_t), name_compare_links);
+  std::sort(links, links + totalLinks,
+            [](simgrid::s4u::Link* a, simgrid::s4u::Link* b) { return strcmp(sg_link_name(a), sg_link_name(b)) < 0; });
 
   for (unsigned int i = 0; i < totalLinks; i++) {
     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,6 +94,36 @@ static void dump_platform()
     }
   }
 
+  std::free(links);
+}
+
+static void dump_routers()
+{
+  std::vector<simgrid::kernel::routing::NetPoint*> netcardList;
+  simgrid::s4u::Engine::getInstance()->getNetpointList(&netcardList);
+  std::sort(netcardList.begin(), netcardList.end(),
+            [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
+              return a->getName() < b->getName();
+            });
+
+  for (auto const& srcCard : netcardList)
+    if (srcCard->isRouter())
+      std::printf("  <router id=\"%s\"/>\n", srcCard->getCname());
+}
+
+static void dump_routes()
+{
+  unsigned int totalHosts = sg_host_count();
+  sg_host_t* hosts        = sg_host_list();
+  std::sort(hosts, hosts + totalHosts,
+            [](sg_host_t a, sg_host_t b) { return strcmp(sg_host_get_name(a), sg_host_get_name(b)) < 0; });
+  std::vector<simgrid::kernel::routing::NetPoint*> netcardList;
+  simgrid::s4u::Engine::getInstance()->getNetpointList(&netcardList);
+  std::sort(netcardList.begin(), netcardList.end(),
+            [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
+              return a->getName() < b->getName();
+            });
+
   for (unsigned int it_src = 0; it_src < totalHosts; it_src++) { // Routes from host
     simgrid::s4u::Host* host1                      = hosts[it_src];
     simgrid::kernel::routing::NetPoint* netcardSrc = host1->pimpl_netpoint;
@@ -129,55 +131,77 @@ static void dump_platform()
       simgrid::s4u::Host* host2 = hosts[it_dst];
       std::vector<simgrid::surf::LinkImpl*> route;
       simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
-      simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, &route, nullptr);
+      simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr);
       if (not route.empty()) {
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->getCname(), host2->getCname());
-        for (auto link : route)
-          std::printf("<link_ctn id=\"%s\"/>", link->cname());
+        for (auto const& link : route)
+          std::printf("<link_ctn id=\"%s\"/>", link->getCname());
         std::printf("\n  </route>\n");
       }
     }
-    for (auto netcardDst : netcardList) { // to router
+
+    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 link : route)
-          std::printf("<link_ctn id=\"%s\"/>", link->cname());
+        simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr);
+        for (auto const& link : route)
+          std::printf("<link_ctn id=\"%s\"/>", link->getCname());
         std::printf("\n  </route>\n");
       }
     }
   }
 
-  for (auto value1 : netcardList) { // Routes from router
+  for (auto const& value1 : netcardList) { // Routes from router
     if (value1->isRouter()) {
-      for (auto value2 : netcardList) { // to router
+      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 link : route)
-            std::printf("<link_ctn id=\"%s\"/>", link->cname());
+          simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr);
+          for (auto const& link : route)
+            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 link : route)
-          std::printf("<link_ctn id=\"%s\"/>", link->cname());
+        simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, netcardDst, route, nullptr);
+        for (auto const& link : route)
+          std::printf("<link_ctn id=\"%s\"/>", link->getCname());
         std::printf("\n  </route>\n");
       }
     }
   }
+  std::free(hosts);
+}
+
+static void dump_platform()
+{
+  int version = 4;
+
+  std::printf("<?xml version='1.0'?>\n");
+  std::printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">\n");
+  std::printf("<platform version=\"%d\">\n", version);
+  std::printf("<AS id=\"AS0\" routing=\"Full\">\n");
+
+  // Hosts
+  dump_hosts();
+
+  // Routers
+  dump_routers();
+
+  // Links
+  dump_links();
+
+  // Routes
+  dump_routes();
 
   std::printf("</AS>\n");
   std::printf("</platform>\n");
-  std::free(hosts);
-  std::free(links);
 }
 
 int main(int argc, char** argv)
index 0b09725..88b6530 100644 (file)
@@ -8,7 +8,7 @@
 #include "simgrid/simdag.h"
 #include "src/kernel/routing/NetPoint.hpp"
 #include <algorithm>
-#include <stdio.h>
+#include <cstdio>
 
 int main(int argc, char **argv)
 {
@@ -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;
@@ -41,8 +41,8 @@ int main(int argc, char **argv)
   xbt_dynar_free(&hosts);
 
   std::printf("NetCards count: %zu\n", netcardList.size());
-  for (auto nc : netcardList)
-    std::printf("   - Seen: \"%s\". Type: %s\n", nc->cname(),
+  for (auto const& nc : netcardList)
+    std::printf("   - Seen: \"%s\". Type: %s\n", nc->getCname(),
                 nc->isRouter() ? "router" : (nc->isNetZone() ? "netzone" : (nc->isHost() ? "host" : "buggy")));
 
   return 0;
diff --git a/teshsuite/simdag/platforms/clusterA.xml b/teshsuite/simdag/platforms/clusterA.xml
deleted file mode 100644 (file)
index ad7bcdf..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<AS id="ASA" routing="Full">
-  <cluster id="clusterA" prefix="A" suffix=".hamburger.edu" radical="0,2-4,6" power="1Gf" bw="125MBps" lat="50us"
-           bb_bw="2.25GBps" bb_lat="500us"/>
-</AS>
diff --git a/teshsuite/simdag/platforms/clusterB.xml b/teshsuite/simdag/platforms/clusterB.xml
deleted file mode 100644 (file)
index 45476ed..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<AS id="ASB" routing="Full">
-  <cluster id="clusterB" prefix="B" suffix=".hamburger.edu" radical="0,2-4,6" power="1Gf" bw="125MBps" lat="50us"
-           bb_bw="2.25GBps" bb_lat="500us"/>
-</AS>
diff --git a/teshsuite/simdag/platforms/platform_include.xml b/teshsuite/simdag/platforms/platform_include.xml
deleted file mode 100644 (file)
index fa5cede..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4.1">
-  <zone id="main" routing="Full">
-    <include file="clusterA.xml"/>
-    <include file="clusterB.xml"/>
-  </zone>
-</platform>
index c466975..6053625 100644 (file)
@@ -25,9 +25,11 @@ ELSE()
   ADD_TESH(tesh-simix-factory-default --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check_defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults factory_thread.tesh)
 ENDIF()
 
+if (NOT enable_memcheck AND NOT enable_address_sanitizer)
+  ADD_TESH_FACTORIES(stack-overflow   "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/stack_overflow --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack_overflow stack_overflow.tesh)
+endif()
 if (NOT enable_memcheck)
-ADD_TESH_FACTORIES(stack-overflow   "thread;ucontext;boost;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/stack_overflow --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack_overflow stack_overflow.tesh)
-ADD_TESH_FACTORIES(generic-simcalls "thread;ucontext;boost;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/generic_simcalls --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/generic_simcalls generic_simcalls.tesh)
+  ADD_TESH_FACTORIES(generic-simcalls "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/generic_simcalls --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/generic_simcalls generic_simcalls.tesh)
 endif()
 
 foreach (factory raw thread boost ucontext)
index 1b87257..c7eb726 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
@@ -18,6 +18,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "my log messages");
 
 namespace example {
 
+class exception : public std::runtime_error {
+  using std::runtime_error::runtime_error;
+};
+
 /** Create a future which becomes ready when the date is reached */
 static
 simgrid::kernel::Future<void> kernel_wait_until(double date)
@@ -40,7 +44,7 @@ static int master(int argc, char *argv[])
   XBT_INFO("kernel, returned");
 
   // Synchronize on a successful Future<void>:
-  simgrid::simix::kernelSync([&] {
+  simgrid::simix::kernelSync([] {
     return kernel_wait_until(10).then([](simgrid::kernel::Future<void> future) {
       future.get();
       XBT_INFO("kernelSync with void");
@@ -50,20 +54,19 @@ static int master(int argc, char *argv[])
 
   // Synchronize on a failing Future<void>:
   try {
-    simgrid::simix::kernelSync([&] {
+    simgrid::simix::kernelSync([] {
       return kernel_wait_until(20).then([](simgrid::kernel::Future<void> future) {
         future.get();
-        throw std::runtime_error("Exception throwed from kernel_defer");
+        throw example::exception("Exception throwed from kernel_defer");
       });
     });
     XBT_ERROR("No exception caught!");
-  }
-  catch(std::runtime_error& e) {
+  } catch (const example::exception& e) {
     XBT_INFO("Exception caught: %s", e.what());
   }
 
   // Synchronize on a successul Future<int> and get the value:
-  int res = simgrid::simix::kernelSync([&] {
+  int res = simgrid::simix::kernelSync([] {
     return kernel_wait_until(30).then([](simgrid::kernel::Future<void> future) {
       future.get();
       XBT_INFO("kernelSync with value");
@@ -73,7 +76,7 @@ static int master(int argc, char *argv[])
   XBT_INFO("kernelSync with value returned with %i", res);
 
   // Synchronize on a successul Future<int> and get the value:
-  simgrid::simix::Future<int> future = simgrid::simix::kernelAsync([&] {
+  simgrid::simix::Future<int> future = simgrid::simix::kernelAsync([] {
     return kernel_wait_until(50).then([](simgrid::kernel::Future<void> future) {
       future.get();
       XBT_INFO("kernelAsync with value");
@@ -84,7 +87,7 @@ static int master(int argc, char *argv[])
   XBT_INFO("kernelAsync with value returned with %i", res);
 
   // Synchronize on a successul Future<int> and get the value:
-  future = simgrid::simix::kernelAsync([&] {
+  future = simgrid::simix::kernelAsync([] {
     return kernel_wait_until(60).then([](simgrid::kernel::Future<void> future) {
       future.get();
       XBT_INFO("kernelAsync with value");
index 68cfc76..83ba94a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -46,11 +46,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("allgather returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("allgather returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index cda0bba..7f6d031 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Alltoall collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test allgather
index 1cbda3c..7e2f35e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -39,16 +39,16 @@ int main(int argc, char *argv[])
   int* sb = (int *) xbt_malloc(recv_counts[rank] * sizeof(int));
   int* rb = (int *) xbt_malloc(recv_sb_size * sizeof(int));
 
-  for (i = 0; i < recv_counts[rank]; ++i)
-    sb[i] = recv_disps[rank] + i;
-  for (i = 0; i < recv_sb_size; ++i)
-    rb[i] = -1;
-
   printf("[%d] sndbuf=[", rank);
-  for (i = 0; i < recv_counts[rank]; i++)
+  for (i = 0; i < recv_counts[rank]; i++){
+    sb[i] = recv_disps[rank] + i;
     printf("%d ", sb[i]);
+  }
   printf("]\n");
 
+  for (i = 0; i < recv_sb_size; i++)
+    rb[i] = -1;
+
   status = MPI_Allgatherv(sb, recv_counts[rank], MPI_INT, rb, recv_counts, recv_disps, MPI_INT, MPI_COMM_WORLD);
 
   printf("[%d] rcvbuf=[", rank);
@@ -56,11 +56,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("allgatherv returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("allgatherv returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index b3a6e49..835f628 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Allgatherv collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test allgatherv
index 57d1fa2..b8b7762 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Allreduce collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 
 p Test allreduce
 ! output sort
index 841a8f4..1aa4a72 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Allreduce collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 ! timeout 20
index 45eeb9c..c35732f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@ int main(int argc, char *argv[])
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   if (maxlen > 1)
-    mult = size;
+    mult = maxlen > size ? size : maxlen;
   int* sb = (int *) xbt_malloc(size *maxlen * sizeof(int));
   int* rb = (int *) xbt_malloc(size *maxlen * sizeof(int));
 
@@ -50,11 +50,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("all_to_all returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("all_to_all returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index f3eefc0..f1b9a3c 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Allreduce collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test allreduce
index 49527e2..1367a2e 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Alltoall on various cluster files, with several routings
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test classic - backbone
index 1bbcf69..da76146 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -46,11 +46,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("all_to_all returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("all_to_all returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index d9cf5d2..1dda4e2 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Alltoall collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test all to all
index 780ee63..d1e3b42 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
    <2> rbuf: (#9):   [3][4][103][104][203][204][-1][-1][-1]
 */
 
-static void print_buffer_int(void *buf, int len, char *msg, int rank)
+static void print_buffer_int(void *buf, int len, const char *msg, int rank)
 {
-  int* v;
   printf("[%d] %s (#%d): ", rank, msg, len);
   for (int tmp = 0; tmp < len; tmp++) {
-    v = buf;
+    int* v = buf;
     printf("[%d]", v[tmp]);
   }
   printf("\n");
-  free(msg);
 }
 
 int main(int argc, char **argv)
@@ -69,12 +67,17 @@ int main(int argc, char **argv)
 
   /* Create the buffer */
   MPI_Comm_size(comm, &size);
+  if(size<=0){
+    printf("error : comm size <= 0, run with mpirun\n");
+    return -1;
+  }
   MPI_Comm_rank(comm, &rank);
-  int* sbuf = (int *) xbt_malloc(size * size * sizeof(int));
-  int* rbuf = (int *) xbt_malloc(size * size * sizeof(int));
+  int size2 = size * size;
+  int* sbuf = (int*)xbt_malloc(size2 * sizeof(int));
+  int* rbuf = (int*)xbt_malloc(size2 * sizeof(int));
 
   /* Load up the buffers */
-  for (i = 0; i < size * size; i++) {
+  for (i = 0; i < size2; i++) {
     sbuf[i] = i + 100 * rank;
     rbuf[i] = -1;
   }
@@ -91,15 +94,15 @@ int main(int argc, char **argv)
     sdispls[i] = (i * (i + 1)) / 2;
   }
 
-  print_buffer_int( sbuf, size*size, strdup("sbuf:"),rank);
-  print_buffer_int( sendcounts, size, strdup("scount:"),rank);
-  print_buffer_int( recvcounts, size, strdup("rcount:"),rank);
-  print_buffer_int( sdispls, size, strdup("sdisp:"),rank);
-  print_buffer_int( rdispls, size, strdup("rdisp:"),rank);
+  print_buffer_int(sbuf, size2, "sbuf:", rank);
+  print_buffer_int(sendcounts, size, "scount:", rank);
+  print_buffer_int(recvcounts, size, "rcount:", rank);
+  print_buffer_int(sdispls, size, "sdisp:", rank);
+  print_buffer_int(rdispls, size, "rdisp:", rank);
 
   MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, comm);
 
-  print_buffer_int( rbuf, size*size, strdup("rbuf:"),rank);
+  print_buffer_int(rbuf, size2, "rbuf:", rank);
 
   MPI_Barrier(MPI_COMM_WORLD);
   if (0 == rank) {
index dfcf17e..02acc66 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Alltoall collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test all to all
index 6dd6821..6f92664 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi  scatter collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test barrier
index e8aeaec..a53771a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -46,11 +46,9 @@ int main(int argc, char **argv)
     if (values[i]==17) good++;
   printf("[%d] number of values equals to 17: %d\n", rank, good);
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("bcast returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("bcast returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(values);
   MPI_Finalize();
index 000ddca..32d741e 100644 (file)
@@ -1,5 +1,4 @@
 p Test Broadcast with more processes than hosts
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-bcast --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
index 6ac136a..99efd2b 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Alltoall collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 ! timeout 30
 
index 557b7c9..5c04f3e 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi reduce scatter collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test reduce_scatter
index b33cfb3..bbab866 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi Allreduce collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test allreduce
index 08c2aaf..9f18ddb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. 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
@@ -15,7 +15,6 @@ int main(int argc, char **argv)
    int retval;
    int sendcount = 1;            // one double to each process
    int recvcount = 1;
-   int i;
    double *sndbuf = NULL;
    double rcvd;
    int root = 0;                 // arbitrary choice
@@ -27,7 +26,7 @@ int main(int argc, char **argv)
    // on root, initialize sendbuf
    if (root == rank) {
      sndbuf = malloc(size * sizeof(double));
-     for (i = 0; i < size; i++) {
+     for (int i = 0; i < size; i++) {
        sndbuf[i] = (double) i;
      }
    }
index f1ba5c6..a7bd5a6 100644 (file)
@@ -1,5 +1,4 @@
 # Smpi  scatter collectives tests
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
 p Test scatter
index b639c18..cc7f9c7 100644 (file)
@@ -28,7 +28,6 @@ set(umpire_tests_passing
   no-error-wait-any_src3
   no-error-wait-any_src4
   no-error-waitany-any_src
-  partial-recv
   sendrecv-deadlock
   send-recv-ok
   irecv-isend-ok
@@ -37,6 +36,7 @@ set(umpire_tests_passing
 
 set(umpire_tests_passing_broken
   irecv-isend-ok2
+  partial-recv
   )
 
 # These are supposed to deadlock but ISP does not find deadlock
@@ -208,7 +208,7 @@ if(enable_smpi AND enable_model-checking AND enable_smpi_ISP_testsuite)
   foreach (test ${umpire_tests_passing} ${umpire_tests_deadlock} ${umpire_tests_problematic} )
     add_executable(${test} ${test}.c)
     target_link_libraries(${test} simgrid)
-    set_source_files_properties(${test}.c PROPERTIES COMPILE_FLAGS "-Wno-error -Wno-return-type")
+    set_source_files_properties(${test}.c PROPERTIES COMPILE_FLAGS "-Dlint -Wno-error -Wno-return-type")
     set(umpire_tesh ${umpire_tesh} ${test})
     set(files_to_clean ${files_to_clean} ${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh)
   endforeach(test)
@@ -218,14 +218,14 @@ if(enable_smpi AND enable_model-checking AND enable_smpi_ISP_testsuite)
   foreach (test ${umpire_tests_passing})
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! timeout 30")
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! output display" APPEND)
-    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
+    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll-selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
   endforeach()
 
   foreach (test ${umpire_tests_deadlock} ${umpire_tests_problematic} )
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! timeout 30"     )
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! expect return 3" APPEND)
     write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! output display"  APPEND)
-    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
+    write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../smpi_script/bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/host-speed:1e9 --cfg=smpi/coll-selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
   endforeach()
 endif()
 
index 4d21ed5..e3c9d3e 100644 (file)
@@ -34,7 +34,6 @@ main (int argc, char **argv)
   MPI_Get_processor_name (processor_name, &namelen);
   printf ("(%d) is alive on %s\n", rank, processor_name);
   fflush (stdout);
-int j, k;
   for (i = 0; i < 128; i++)
     {
       buf0[i] = i;
index c6e54ca..7acfc01 100644 (file)
@@ -24,7 +24,6 @@ main (int argc, char **argv)
   int key = -1;
   int nrank;
   int nsize;
-  int dat = 0;
   int color = -1;
 
 
index c1a16fe..a4ab3d0 100644 (file)
@@ -15,7 +15,6 @@ main (int argc, char **argv)
   char processor_name[128];
   int namelen = 128;
   int buf0[buf_size];
-  int buf1[buf_size];
   MPI_Status status;
   MPI_Request req;
 
index 4a6051b..9eee182 100644 (file)
@@ -14,7 +14,7 @@ static char *rcsid =
 
 #define buf_size 128
 
-int mydelay ()                 /* about 6 seconds */
+static int mydelay(void) /* about 6 seconds */
 {
   int i;
   int val;
@@ -37,8 +37,8 @@ main (int argc, char **argv)
   int namelen = 128;
   int buf0[buf_size];
   int buf1[buf_size];
-  MPI_Request req, req0, req1;
-  MPI_Status status, status0, status1;
+  MPI_Request req;
+  MPI_Status status;
   MPI_Request areq[10];
   MPI_Status astatus[10];
 
index 75bdb65..f7924fd 100644 (file)
@@ -47,7 +47,7 @@ main (int argc, char **argv)
        MPI_Send (&flipbit, 1, MPI_INT, 1, i, MPI_COMM_WORLD);
 
        flag = 0;
-printf ("req = %0x", (unsigned int)reqs);
+       printf("req = %p", reqs);
        while (!flag)
            MPI_Testany (i, reqs, &done, &flag, &status);
 
index 67acdc0..e528524 100644 (file)
@@ -26,7 +26,6 @@ main (int argc, char **argv)
   MPI_Get_processor_name (processor_name, &namelen);
   printf ("(%d) is alive on %s\n", rank, processor_name);
   fflush (stdout);
-       int i;
   MPI_Barrier (MPI_COMM_WORLD);
 
   if (nprocs < 2)
index 7c17af2..839b940 100644 (file)
@@ -1,5 +1,4 @@
 p Test compute
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 ! timeout 5
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/macro-partial-shared-communication --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
index 9ae1914..985dbbe 100644 (file)
@@ -1,5 +1,4 @@
 p Test compute
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 ! timeout 5
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/macro-partial-shared --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
index 1e09ac4..51da71b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-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 <stdint.h>
 #include <inttypes.h>
 
-static void* hash(char *str, uint64_t* ans)
+static void* hash(const char *str, uint64_t* ans)
 {
-  char *tohash = str;
+  const char *tohash = str;
   *ans=5381;
   printf("hashing !\n");
   int c = *tohash;
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
 
   MPI_Barrier(MPI_COMM_WORLD);
   //Try SMPI_SHARED_CALL function, which should call hash only once and for all.
-  char *str = strdup("onceandforall");
+  static const char str[] = "onceandforall";
   if(rank==size-1){
     SMPI_SHARED_CALL(hash,str,str,buf);
   }
@@ -55,7 +55,6 @@ int main(int argc, char *argv[])
   printf("[%d] After change, the value in the shared buffer is: %" PRIu64"\n", rank, *buf);
 
   SMPI_SHARED_FREE(buf);
-  free(str);
 
   MPI_Finalize();
   return 0;
index 2a79f09..af9fd48 100644 (file)
@@ -1,5 +1,4 @@
 p Test compute
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 ! timeout 5
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/macro-shared --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
index 32a6785..e9d42a1 100644 (file)
@@ -222,33 +222,33 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   
   # Test OMPI selector: CONTEXT if available; RAW if not (with mmap privatization or none)
   if(HAVE_UCONTEXT_CONTEXTS)
-    ADD_TEST(test-smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
+    ADD_TEST(test-smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll-selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-ompi-ucontext PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   else()
     if(HAVE_RAW_CONTEXTS)
-      ADD_TEST(test-smpi-mpich3-coll-ompi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
+      ADD_TEST(test-smpi-mpich3-coll-ompi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:ompi -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-ompi-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
 
   # Test MPICH selector: dlopen privatization and PTHREAD if exists (without priv and with raw if not)
-  if(HAVE_PRIVATIZATION AND HAVE_THREAD_CONTEXTS)
-    ADD_TEST(test-smpi-mpich3-coll-mpich-thread-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatization:dlopen)
-    SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mpich-thread-dlopen PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
+  if(HAVE_PRIVATIZATION AND HAVE_BOOST_CONTEXTS)
+    ADD_TEST(test-smpi-mpich3-coll-mpich-boost-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:boost -execarg=--cfg=smpi/coll-selector:mpich -execarg=--cfg=smpi/privatization:dlopen)
+    SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mpich-boost-dlopen PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   else()
     if(HAVE_RAW_CONTEXTS)
-      ADD_TEST(test-smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
+      ADD_TEST(test-smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:mpich -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mpich-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
 
   # Test MVAPICH2 selector: dlopen privatization and UCONTEXT if exists (without priv and with raw if not)
   if(HAVE_PRIVATIZATION AND HAVE_UCONTEXT_CONTEXTS)
-    ADD_TEST(test-smpi-mpich3-coll-mvapich2-ucontext-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:mvapich2 -execarg=--cfg=smpi/privatization:dlopen)
+    ADD_TEST(test-smpi-mpich3-coll-mvapich2-ucontext-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll-selector:mvapich2 -execarg=--cfg=smpi/privatization:dlopen)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mvapich2-ucontext-dlopen PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   else()
     if(HAVE_RAW_CONTEXTS)
-      ADD_TEST(test-smpi-mpich3-coll-mvapich2-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mvapich2 -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
+      ADD_TEST(test-smpi-mpich3-coll-mvapich2-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:mvapich2 -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mvapich2-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
@@ -256,10 +256,10 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   # Test IMPI selector: always raw, with dlopen if priv exists
   if(HAVE_RAW_CONTEXTS)
     if(HAVE_PRIVATIZATION)
-      ADD_TEST(test-smpi-mpich3-coll-impi-raw-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:impi -execarg=--cfg=smpi/privatization:dlopen)
+      ADD_TEST(test-smpi-mpich3-coll-impi-raw-dlopen ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:impi -execarg=--cfg=smpi/privatization:dlopen)
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-impi-raw-dlopen  PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     else()
-      ADD_TEST(test-smpi-mpich3-coll-impi-raw-nopriv ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:impi -execarg=--cfg=smpi/privatization:no)
+      ADD_TEST(test-smpi-mpich3-coll-impi-raw-nopriv ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll-selector:impi -execarg=--cfg=smpi/privatization:no)
       SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-impi-raw-nopriv  PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
index 39ad856..4c4cde6 100644 (file)
@@ -60,9 +60,9 @@ int main(int argc, char **argv)
         if (!rbuf)
             fprintf(stderr, "\trbuf of %d bytes\n", MAX_BUF);
         if (!recvcounts)
-            fprintf(stderr, "\trecvcounts of %zd bytes\n", comm_size * sizeof(int));
+          fprintf(stderr, "\trecvcounts of %zu bytes\n", comm_size * sizeof(int));
         if (!displs)
-            fprintf(stderr, "\tdispls of %zd bytes\n", comm_size * sizeof(int));
+          fprintf(stderr, "\tdispls of %zu bytes\n", comm_size * sizeof(int));
         fflush(stderr);
         MPI_Abort(MPI_COMM_WORLD, -1);
     }
index c5cbb95..ff76581 100644 (file)
@@ -67,10 +67,14 @@ int main(int argc, char ** argv)
     SMPI_VARGET_GLOBAL(displs) = (void *) malloc(comm_size * sizeof(int));
     if (!SMPI_VARGET_GLOBAL(recvcounts) || !SMPI_VARGET_GLOBAL(displs) || !SMPI_VARGET_GLOBAL(sbuf) || !SMPI_VARGET_GLOBAL(rbuf)) {
         fprintf(stderr, "Unable to allocate memory:\n");
-       if (!SMPI_VARGET_GLOBAL(sbuf)) fprintf(stderr,"\tsbuf of %d bytes\n", MAX_BUF );
-       if (!SMPI_VARGET_GLOBAL(rbuf)) fprintf(stderr,"\trbuf of %d bytes\n", MAX_BUF );
-       if (!SMPI_VARGET_GLOBAL(recvcounts)) fprintf(stderr,"\trecvcounts of %zd bytes\n", comm_size * sizeof(int) );
-       if (!SMPI_VARGET_GLOBAL(displs)) fprintf(stderr,"\tdispls of %zd bytes\n", comm_size * sizeof(int) );
+       if (!SMPI_VARGET_GLOBAL(sbuf))
+            fprintf(stderr,"\tsbuf of %d bytes\n", MAX_BUF );
+       if (!SMPI_VARGET_GLOBAL(rbuf))
+            fprintf(stderr,"\trbuf of %d bytes\n", MAX_BUF );
+        if (!SMPI_VARGET_GLOBAL(recvcounts))
+            fprintf(stderr,"\trecvcounts of %zu bytes\n", comm_size * sizeof(int));
+        if (!SMPI_VARGET_GLOBAL(displs))
+            fprintf(stderr,"\tdispls of %zu bytes\n", comm_size * sizeof(int));
         fflush(stderr);
         MPI_Abort(MPI_COMM_WORLD, -1);
         exit(-1);
index 16681a2..c9d1d08 100644 (file)
@@ -17,7 +17,7 @@ int main(int argc, char *argv[])
     int rank, size, verbose = 0, errs=0, tot_errs=0;
     int wrank;
     MPI_Comm comm;
-    MPI_Info __attribute__((unused)) info;
+    XBT_ATTRIB_UNUSED MPI_Info info;
 
     MPI_Init(&argc, &argv);
 
index 9539b95..1754cd9 100644 (file)
@@ -85,12 +85,10 @@ int main(int argc, char *argv[])
              * this can generate a file that diff, for example,
              * believes is a binary file */
             if (isprint((int) (s1[j].c))) {
-                fprintf(stderr, "Got s[%d].c = %c; expected %c\n",
-                        j, s1[j].c, j + status.MPI_SOURCE + 'a');
+              fprintf(stderr, "Got s[%d].c = %c; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a');
             }
             else {
-                fprintf(stderr, "Got s[%d].c = %x; expected %c\n",
-                        j, (int) s1[j].c, j + status.MPI_SOURCE + 'a');
+              fprintf(stderr, "Got s[%d].c = %hhx; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a');
             }
         }
     }
index 9275ef1..d9f9ca5 100644 (file)
@@ -35,9 +35,8 @@ int main(int argc, char *argv[])
         if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
             MPI_Type_size(MPI_LONG_DOUBLE, &type_size);
             if (type_size != sizeof(long double)) {
-                printf("type_size != sizeof(long double) : (%d != %zd)\n",
-                       type_size, sizeof(long double));
-                ++errs;
+              printf("type_size != sizeof(long double) : (%d != %zu)\n", type_size, sizeof(long double));
+              ++errs;
             }
         }
 #endif
@@ -45,9 +44,9 @@ int main(int argc, char *argv[])
         if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {
             MPI_Type_size(MPI_C_LONG_DOUBLE_COMPLEX, &type_size);
             if (type_size != sizeof(long double _Complex)) {
-                printf("type_size != sizeof(long double _Complex) : (%d != %zd)\n",
-                       type_size, sizeof(long double _Complex));
-                ++errs;
+              printf("type_size != sizeof(long double _Complex) : (%d != %zu)\n", type_size,
+                     sizeof(long double _Complex));
+              ++errs;
             }
         }
 #endif
index 14c5725..6ff46d2 100644 (file)
@@ -93,7 +93,7 @@ int main(int argc, char **argv)
                             myname, j, world_rank, errloc - 1);
                     p1 = (char *) inbufs[j];
                     p2 = (char *) outbufs[j];
-                    fprintf(stderr, "Got %x expected %x\n", p1[errloc - 1], p2[errloc - 1]);
+                    fprintf(stderr, "Got %hhx expected %hhx\n", p1[errloc - 1], p2[errloc - 1]);
                     err++;
                 }
             }
index 013b1c2..4950ac7 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../include/")
 
   add_executable(attrmpi1f attrmpi1f.f)
   add_executable(baseattr2f baseattr2f.f)
index d8e0cd7..8134355 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
 #  add_executable(allredint8f allredint8f.f)
 #  add_executable(allredopttf allredopttf.f)
index 7ec483b..cb6c37a 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
  # add_executable(commerrf commerrf.f)
 #  add_executable(commnamef commnamef.f)
index 26b871a..bda4c89 100644 (file)
@@ -7,9 +7,9 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+  include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in ${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h @ONLY)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in typeaints.h @ONLY)
 
 #  add_executable(allctypesf allctypesf.f)
   add_executable(gaddressf gaddressf.f)
index 858c661..da6e1c8 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
 #  add_executable(allocmemf allocmemf.f)
 #  add_executable(c2f2cf c2f2cf.f c2f2c.c)
index 312c945..6568a72 100644 (file)
@@ -8,7 +8,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
 
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(infotest2f infotest2f.f ../util/mtestf.f)
   add_executable(infotestf infotestf.f ../util/mtestf.f)
index d96353a..deda911 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(baseenvf baseenvf.f)
   target_link_libraries(baseenvf simgrid mtest_f77)
index db09537..9b0f807 100644 (file)
@@ -8,7 +8,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
 
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(allpairf allpairf.f)
 #  add_executable(greqf greqf.f dummyf.f)
index afd0b85..2bdb749 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(winaccf winaccf.f)
 #  add_executable(winerrf winerrf.f)
index 8ec623e..7929cec 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(cartcrf cartcrf.f)
 #  add_executable(dgraph_unwgtf dgraph_unwgtf.f)
index 15a52a7..1387e60 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   #F77 version of the mtest library
   add_library(mtest_f77 STATIC ../util/mtestf.f)
index ba8a0d3..fb41d8b 100644 (file)
@@ -7,7 +7,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   endif()
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   add_executable(winaccf90 winaccf90.f90)
 #  add_executable(winerrf90 winerrf90.f90)
index ac33562..1b3c55e 100755 (executable)
@@ -2,8 +2,8 @@
 
 explore_files() {
 
-  for cmake in `find -name CMakeLists.txt` ; do
-    d=`dirname $cmake`
+  for cmake in $(find -name CMakeLists.txt) ; do
+    d=$(dirname $cmake)
   
     echo;echo "Directory $d"
   
index 9bdedeb..e92bcd1 100644 (file)
@@ -17,7 +17,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
 endif()
 
 if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
-  ADD_TEST(test-smpi-mpich3-perf-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/running-power:-1)
+  ADD_TEST(test-smpi-mpich3-perf-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -tests=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf/testlist -execarg=-platform\ ${CMAKE_HOME_DIRECTORY}/examples/platforms/cluster.xml -execarg=--log=root.thr:critical -execarg=--cfg=smpi/async-small-thresh:65536 -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/host-speed:-1)
 endif()
 
 foreach(file allredtrace commcreatep non_zero_root sendrecvl timer transp-datatype twovec dtpack indexperf manyrma 
index 4bd97a2..8793198 100755 (executable)
@@ -157,7 +157,7 @@ foreach $_ (@ARGV) {
     elsif (/--?maxnp=(.*)/) { $np_max = $1; }
     elsif (/--?tests=(.*)/) { $listfiles = $1; }
     elsif (/--?srcdir=(.*)/) { $srcdir = $1;
-       $mpiexec="$mpiexec  -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/running-power:1e9  --cfg=smpi/async-small-thresh:65536"; }
+       $mpiexec="$mpiexec  -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/host-speed:1e9  --cfg=smpi/async-small-thresh:65536"; }
     elsif (/--?verbose/) { $verbose = 1; }
     elsif (/--?showprogress/) { $showProgress = 1; }
     elsif (/--?debug/) { $debug = 1; }
@@ -282,6 +282,7 @@ else {
         print "TAP formatted results in $tapfullfile\n";
     }
 }
+exit ($err_count > 0);
 #\f
 # ---------------------------------------------------------------------------
 # Routines
index 7191e15..8e60c20 100644 (file)
@@ -361,7 +361,7 @@ static int MtestDatatype2CheckAndPrint(void *inbuf, void *outbuf, int size_bytes
                 typename, typenum, world_rank, errloc - 1, size_bytes);
         p1 = (char *) inbuf;
         p2 = (char *) outbuf;
-        fprintf(stderr, "Got %x expected %x\n", p2[errloc - 1], p1[errloc - 1]);
+        fprintf(stderr, "Got %hhx expected %hhx\n", p2[errloc - 1], p1[errloc - 1]);
     }
     return errloc;
 }
index e8f4322..48bc309 100644 (file)
@@ -361,7 +361,7 @@ static int MtestDatatype2CheckAndPrint(void *inbuf, void *outbuf, int size_bytes
                 typename, typenum, world_rank, errloc - 1, size_bytes);
         p1 = (char *) inbuf;
         p2 = (char *) outbuf;
-        fprintf(stderr, "Got %x expected %x\n", p2[errloc - 1], p1[errloc - 1]);
+        fprintf(stderr, "Got %hhx expected %hhx\n", p2[errloc - 1], p1[errloc - 1]);
     }
     return errloc;
 }
index b04775f..c749a9e 100644 (file)
@@ -1,5 +1,4 @@
 p Test privatization
-! setenv LD_LIBRARY_PATH=../../lib
 ! timeout 5
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:1 --log=simix_context.thres:error --log=xbt_memory_map.thres:critical
 > You requested to use 32 ranks, but there is only 5 processes in your hostfile...
index ced2221..6dea653 100644 (file)
@@ -1,5 +1,4 @@
 p Test privatization with dlopen
-! setenv LD_LIBRARY_PATH=../../lib
 ! timeout 5
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:dlopen --log=simix_context.thres:error
 > You requested to use 32 ranks, but there is only 5 processes in your hostfile...
index 23f4e20..ea6e709 100644 (file)
@@ -1,5 +1,4 @@
 p Test dsend
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Jupiter:1:(2) 0.000000] [dsend/INFO] rank 1: data exchanged
@@ -11,7 +10,6 @@ p Test dsend with timings injection
 p message size is 4 bytes
 p process 1 will finish at 0.5+2*4 (send) + 1+0.1*4 (isend) = 9.9s
 p process 2 will finish at 0.5+2*4 (time before first send) + 2*(1+0.5*4) (recv+irecv) + 0.005890 (network time, same as before) = 14.505890s
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -q --log=smpi_kernel.thres:warning --cfg=smpi/or:0:1:0.5 --cfg=smpi/os:0:0.5:2 --cfg=smpi/ois:0:1:0.1 --log=xbt_cfg.thres:warning
 > [Jupiter:1:(2) 9.900000] [dsend/INFO] rank 1: data exchanged
index 41b3d13..adacbe7 100644 (file)
@@ -3,7 +3,6 @@ $ rm -rf ./out_in_ti.txt_files
 
 p Test output of time independent tracing
 p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted)
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/simulate-computation:no -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 >
index fe266ef..3629028 100644 (file)
@@ -1,4 +1,3 @@
-! setenv LD_LIBRARY_PATH=../../lib
 ! expect return 1
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile_empty  -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning
 > [smpirun] ** error: the hostfile '../hostfile_empty' is empty. Aborting.
index 9bcbfa9..6120d55 100644 (file)
@@ -1,5 +1,4 @@
 p Test pingpong
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 >     *** Ping-pong test (MPI_Send/MPI_Recv) ***
index 18ff5d8..ad0cab5 100644 (file)
@@ -28,7 +28,7 @@ int main(int argc, char* argv[])
   gettimeofday(&tv1, NULL);
   sleep(1);
   gettimeofday(&tv2, NULL);
-  long res = ((tv2.tv_sec * 1000000 + tv2.tv_usec)) - ((tv1.tv_sec * 1000000 + tv1.tv_usec));
+  long res = (tv2.tv_sec * 1000000 + tv2.tv_usec) - (tv1.tv_sec * 1000000 + tv1.tv_usec);
   if (res < 999998 || res > 1000002)
     printf("Error, sleep(1) did not exactly slept 1s\n");
 
@@ -36,7 +36,7 @@ int main(int argc, char* argv[])
   gettimeofday(&tv1, NULL);
   usleep(100);
   gettimeofday(&tv2, NULL);
-  res = ((tv2.tv_sec * 1000000 + tv2.tv_usec)) - ((tv1.tv_sec * 1000000 + tv1.tv_usec));
+  res = (tv2.tv_sec * 1000000 + tv2.tv_usec) - (tv1.tv_sec * 1000000 + tv1.tv_usec);
   if (res < 98 || res > 102)
     printf("Error, usleep did not really sleep 100us, but %ld\n", res);
 
@@ -48,7 +48,7 @@ int main(int argc, char* argv[])
   struct timespec tpsleep;
   clock_gettime(CLOCK_REALTIME, &tp1);
   clock_gettime(CLOCK_REALTIME, &tp2);
-  if ((tp1.tv_sec != tp2.tv_sec) || (tp1.tv_nsec != tp2.tv_nsec))
+  if (tp1.tv_sec != tp2.tv_sec || tp1.tv_nsec != tp2.tv_nsec)
     printf("Error, two consecutive calls to gettimeofday did not return same time (with running power to 0)\n");
 
   // nanosleep for 100ns
@@ -57,7 +57,7 @@ int main(int argc, char* argv[])
   tpsleep.tv_nsec = 100;
   nanosleep(&tpsleep, NULL);
   clock_gettime(CLOCK_REALTIME, &tp2);
-  res = ((tp2.tv_sec * 1000000000 + tp2.tv_nsec)) - ((tp1.tv_sec * 1000000000 + tp1.tv_nsec));
+  res = (tp2.tv_sec * 1000000000 + tp2.tv_nsec) - (tp1.tv_sec * 1000000000 + tp1.tv_nsec);
   if (res < 98 || res > 102)
     printf("Error, nanosleep did not really sleep 100ns, but %ld\n", res);
 #endif
index 9726e7b..92448d1 100644 (file)
@@ -1,5 +1,4 @@
 p Test timers
-! setenv LD_LIBRARY_PATH=../../lib
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 1 ${bindir:=.}/timers -q --log=smpi_kernel.thres:warning --cfg=smpi/simulate-computation:no --cfg=smpi/host-speed:100000 --log=xbt_cfg.thres:warning
 > [rank 0] -> Tremblay
 
index 91bbe67..839186d 100644 (file)
@@ -1,5 +1,4 @@
 p Test hvector
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/type-hvector -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [rank 0] -> Tremblay
index 9bf1d2f..9330043 100644 (file)
@@ -1,5 +1,4 @@
 p Test indexed
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/type-indexed -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [rank 0] -> Tremblay
index 6340f92..f564cbb 100644 (file)
@@ -1,5 +1,4 @@
 p Test struct
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/type-struct -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [rank 0] -> Tremblay
index 5b23a47..d756d2a 100644 (file)
@@ -1,5 +1,4 @@
 p Test vector
-! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/type-vector -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [rank 0] -> Tremblay
index ce8eac5..0a9aaf8 100644 (file)
@@ -1,6 +1,6 @@
 /* A few tests for the maxmin library                                       */
 
-/* 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
@@ -8,26 +8,25 @@
 
 #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"
-#include <math.h>
+#include <algorithm>
+#include <cmath>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
-#define PRINT_VAR(var) XBT_DEBUG(#var " = %g",lmm_variable_getvalue(var))
+using namespace simgrid::surf;
+
+#define PRINT_VAR(var) XBT_DEBUG(#var " = %g", (var)->get_value())
 #define SHOW_EXPR(expr) XBT_DEBUG(#expr " = %g",expr)
 
 /*        ______                 */
 /*  ==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)
 {
@@ -97,28 +96,28 @@ static void test1(method_t method)
   else if (method == LAGRANGE_RENO)
     lmm_set_default_protocol_function(func_reno_f, func_reno_fpi, func_reno_fpi);
 
-  lmm_system_t Sys = lmm_system_new(1);
-  lmm_constraint_t L1 = lmm_constraint_new(Sys, nullptr, a);
-  lmm_constraint_t L2 = lmm_constraint_new(Sys, nullptr, b);
-  lmm_constraint_t L3 = lmm_constraint_new(Sys, nullptr, a);
+  lmm_system_t Sys    = new s_lmm_system_t(true);
+  lmm_constraint_t L1 = Sys->constraint_new(nullptr, a);
+  lmm_constraint_t L2 = Sys->constraint_new(nullptr, b);
+  lmm_constraint_t L3 = Sys->constraint_new(nullptr, a);
 
-  lmm_variable_t R_1_2_3 = lmm_variable_new(Sys, nullptr, 1.0, -1.0, 3);
-  lmm_variable_t R_1 = lmm_variable_new(Sys, nullptr, 1.0, -1.0, 1);
-  lmm_variable_t R_2 = lmm_variable_new(Sys, nullptr, 1.0, -1.0, 1);
-  lmm_variable_t R_3 = lmm_variable_new(Sys, nullptr, 1.0, -1.0, 1);
+  lmm_variable_t R_1_2_3 = Sys->variable_new(nullptr, 1.0, -1.0, 3);
+  lmm_variable_t R_1     = Sys->variable_new(nullptr, 1.0, -1.0, 1);
+  lmm_variable_t R_2     = Sys->variable_new(nullptr, 1.0, -1.0, 1);
+  lmm_variable_t R_3     = Sys->variable_new(nullptr, 1.0, -1.0, 1);
 
-  lmm_update_variable_weight(Sys, R_1_2_3, 1.0);
-  lmm_update_variable_weight(Sys, R_1, 1.0);
-  lmm_update_variable_weight(Sys, R_2, 1.0);
-  lmm_update_variable_weight(Sys, R_3, 1.0);
+  Sys->update_variable_weight(R_1_2_3, 1.0);
+  Sys->update_variable_weight(R_1, 1.0);
+  Sys->update_variable_weight(R_2, 1.0);
+  Sys->update_variable_weight(R_3, 1.0);
 
-  lmm_expand(Sys, L1, R_1_2_3, 1.0);
-  lmm_expand(Sys, L2, R_1_2_3, 1.0);
-  lmm_expand(Sys, L3, R_1_2_3, 1.0);
+  Sys->expand(L1, R_1_2_3, 1.0);
+  Sys->expand(L2, R_1_2_3, 1.0);
+  Sys->expand(L3, R_1_2_3, 1.0);
 
-  lmm_expand(Sys, L1, R_1, 1.0);
-  lmm_expand(Sys, L2, R_2, 1.0);
-  lmm_expand(Sys, L3, R_3, 1.0);
+  Sys->expand(L1, R_1, 1.0);
+  Sys->expand(L2, R_2, 1.0);
+  Sys->expand(L3, R_3, 1.0);
 
   if (method == MAXMIN) {
     lmm_solve(Sys);
@@ -149,20 +148,18 @@ static void test1(method_t method)
     lagrange_solve(Sys);
 
     double max_deviation = 0.0;
-    max_deviation = MAX(max_deviation, fabs(lmm_variable_getvalue(R_1) - x));
-    max_deviation = MAX(max_deviation, fabs(lmm_variable_getvalue(R_3) - x));
-    max_deviation = MAX(max_deviation, fabs(lmm_variable_getvalue(R_2) - (b - a + x)));
-    max_deviation = MAX(max_deviation, fabs(lmm_variable_getvalue(R_1_2_3) - (a - x)));
+    max_deviation        = std::max(max_deviation, fabs(R_1->get_value() - x));
+    max_deviation        = std::max(max_deviation, fabs(R_3->get_value() - x));
+    max_deviation        = std::max(max_deviation, fabs(R_2->get_value() - (b - a + x)));
+    max_deviation        = std::max(max_deviation, fabs(R_1_2_3->get_value() - (a - x)));
 
     if (max_deviation > 0.00001) { // Legacy value used in lagrange.c
       XBT_WARN("Max Deviation from optimal solution : %g", max_deviation);
       XBT_WARN("Found x = %1.20f", x);
-      XBT_WARN("Deviation from optimal solution (R_1 = %g): %1.20f", x, lmm_variable_getvalue(R_1) - x);
-      XBT_WARN("Deviation from optimal solution (R_2 = %g): %1.20f", b - a + x,
-               lmm_variable_getvalue(R_2) - (b - a + x));
-      XBT_WARN("Deviation from optimal solution (R_3 = %g): %1.20f", x, lmm_variable_getvalue(R_3) - x);
-      XBT_WARN("Deviation from optimal solution (R_1_2_3 = %g): %1.20f", a - x,
-               lmm_variable_getvalue(R_1_2_3) - (a - x));
+      XBT_WARN("Deviation from optimal solution (R_1 = %g): %1.20f", x, R_1->get_value() - x);
+      XBT_WARN("Deviation from optimal solution (R_2 = %g): %1.20f", b - a + x, R_2->get_value() - (b - a + x));
+      XBT_WARN("Deviation from optimal solution (R_3 = %g): %1.20f", x, R_3->get_value() - x);
+      XBT_WARN("Deviation from optimal solution (R_1_2_3 = %g): %1.20f", a - x, R_1_2_3->get_value() - (a - x));
     }
   }
 
@@ -171,11 +168,11 @@ static void test1(method_t method)
   PRINT_VAR(R_2);
   PRINT_VAR(R_3);
 
-  lmm_variable_free(Sys, R_1_2_3);
-  lmm_variable_free(Sys, R_1);
-  lmm_variable_free(Sys, R_2);
-  lmm_variable_free(Sys, R_3);
-  lmm_system_free(Sys);
+  Sys->variable_free(R_1_2_3);
+  Sys->variable_free(R_1);
+  Sys->variable_free(R_2);
+  Sys->variable_free(R_3);
+  delete Sys;
 }
 
 static void test2(method_t method)
@@ -185,18 +182,18 @@ static void test2(method_t method)
   if (method == LAGRANGE_RENO)
     lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
 
-  lmm_system_t Sys = lmm_system_new(1);
-  lmm_constraint_t CPU1 = lmm_constraint_new(Sys, nullptr, 200.0);
-  lmm_constraint_t CPU2 = lmm_constraint_new(Sys, nullptr, 100.0);
+  lmm_system_t Sys      = new s_lmm_system_t(true);
+  lmm_constraint_t CPU1 = Sys->constraint_new(nullptr, 200.0);
+  lmm_constraint_t CPU2 = Sys->constraint_new(nullptr, 100.0);
 
-  lmm_variable_t T1 = lmm_variable_new(Sys, nullptr, 1.0, -1.0, 1);
-  lmm_variable_t T2 = lmm_variable_new(Sys, nullptr, 1.0, -1.0, 1);
+  lmm_variable_t T1 = Sys->variable_new(nullptr, 1.0, -1.0, 1);
+  lmm_variable_t T2 = Sys->variable_new(nullptr, 1.0, -1.0, 1);
 
-  lmm_update_variable_weight(Sys, T1, 1.0);
-  lmm_update_variable_weight(Sys, T2, 1.0);
+  Sys->update_variable_weight(T1, 1.0);
+  Sys->update_variable_weight(T2, 1.0);
 
-  lmm_expand(Sys, CPU1, T1, 1.0);
-  lmm_expand(Sys, CPU2, T2, 1.0);
+  Sys->expand(CPU1, T1, 1.0);
+  Sys->expand(CPU2, T2, 1.0);
 
   if (method == MAXMIN) {
     lmm_solve(Sys);
@@ -209,9 +206,9 @@ static void test2(method_t method)
   PRINT_VAR(T1);
   PRINT_VAR(T2);
 
-  lmm_variable_free(Sys, T1);
-  lmm_variable_free(Sys, T2);
-  lmm_system_free(Sys);
+  Sys->variable_free(T1);
+  Sys->variable_free(T2);
+  delete Sys;
 }
 
 static void test3(method_t method)
@@ -219,12 +216,12 @@ static void test3(method_t method)
   int flows = 11;
   int links = 10;
 
-  double **A = xbt_new0(double *, links + 5);
+  double** A = new double*[links + 5];
   /* array to add the constraints of fictitious variables */
   double B[15] = { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 1, 1, 1, 1 };
 
   for (int i = 0; i < links + 5; i++) {
-    A[i] = xbt_new0(double, flows + 5);
+    A[i] = new double[flows + 5];
     for (int j = 0; j < flows + 5; j++) {
       A[i][j] = 0.0;
 
@@ -256,25 +253,25 @@ static void test3(method_t method)
   if (method == LAGRANGE_RENO)
     lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
 
-  lmm_system_t Sys = lmm_system_new(1);
+  lmm_system_t Sys = new s_lmm_system_t(true);
 
   /* Creates the constraints */
-  lmm_constraint_t *tmp_cnst = xbt_new0(lmm_constraint_t, 15);
+  lmm_constraint_t* tmp_cnst = new lmm_constraint_t[15];
   for (int i = 0; i < 15; i++)
-    tmp_cnst[i] = lmm_constraint_new(Sys, nullptr, B[i]);
+    tmp_cnst[i] = Sys->constraint_new(nullptr, B[i]);
 
   /* Creates the variables */
-  lmm_variable_t *tmp_var = xbt_new0(lmm_variable_t, 16);
+  lmm_variable_t* tmp_var = new lmm_variable_t[16];
   for (int j = 0; j < 16; j++) {
-    tmp_var[j] = lmm_variable_new(Sys, nullptr, 1.0, -1.0, 15);
-    lmm_update_variable_weight(Sys, tmp_var[j], 1.0);
+    tmp_var[j] = Sys->variable_new(nullptr, 1.0, -1.0, 15);
+    Sys->update_variable_weight(tmp_var[j], 1.0);
   }
 
   /* Link constraints and variables */
   for (int i = 0; i < 15; i++)
     for (int j = 0; j < 16; j++)
       if (A[i][j])
-        lmm_expand(Sys, tmp_cnst[i], tmp_var[j], 1.0);
+        Sys->expand(tmp_cnst[i], tmp_var[j], 1.0);
 
   if (method == MAXMIN) {
     lmm_solve(Sys);
@@ -290,13 +287,13 @@ static void test3(method_t method)
     PRINT_VAR(tmp_var[j]);
 
   for (int j = 0; j < 16; j++)
-    lmm_variable_free(Sys, tmp_var[j]);
-  xbt_free(tmp_var);
-  xbt_free(tmp_cnst);
-  lmm_system_free(Sys);
+    Sys->variable_free(tmp_var[j]);
+  delete[] tmp_var;
+  delete[] tmp_cnst;
+  delete Sys;
   for (int i = 0; i < links + 5; i++)
-    xbt_free(A[i]);
-  xbt_free(A);
+    delete[] A[i];
+  delete[] A;
 }
 
 int main(int argc, char** argv)
index aed2abb..be01e1d 100644 (file)
@@ -1,12 +1,12 @@
 /* A crash few tests for the maxmin library                                 */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* 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 "surf/maxmin.h"
+#include "surf/maxmin.hpp"
 #include "simgrid/msg.h"
 #include "xbt/module.h"
 #include "xbt/sysdep.h" /* time manipulation for benchmarking */
 
 #define MYRANDMAX 1000
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+
+using namespace simgrid::surf;
 
 double date;
 int64_t seedx = 0;
@@ -43,10 +45,10 @@ static void test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_limi
   lmm_variable_t var[nb_var];
   int used[nb_cnst];
 
-  lmm_system_t Sys = lmm_system_new(1);
+  lmm_system_t Sys = new s_lmm_system_t(true);
 
   for (int i = 0; i < nb_cnst; i++) {
-    cnst[i] = lmm_constraint_new(Sys, NULL, float_random(10.0));
+    cnst[i] = Sys->constraint_new(NULL, float_random(10.0));
     int l;
     if(rate_no_limit>float_random(1.0))
       //Look at what happens when there is no concurrency limit
@@ -55,14 +57,14 @@ static void test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_limi
       //Badly logarithmically random concurrency limit in [2^pw_base_limit+1,2^pw_base_limit+2^pw_max_limit]
       l=(1<<pw_base_limit)+(1<<int_random(pw_max_limit));
 
-    lmm_constraint_concurrency_limit_set(cnst[i],l );
+    cnst[i]->set_concurrency_limit(l);
   }
 
   for (int i = 0; i < nb_var; i++) {
-    var[i] = lmm_variable_new(Sys, NULL, 1.0, -1.0, nb_elem);
+    var[i] = Sys->variable_new(NULL, 1.0, -1.0, nb_elem);
     //Have a few variables with a concurrency share of two (e.g. cross-traffic in some cases)
     int concurrency_share = 1 + int_random(max_share);
-    lmm_variable_concurrency_share_set(var[i],concurrency_share);
+    var[i]->set_concurrency_share(concurrency_share);
 
     for (int j = 0; j < nb_cnst; j++)
       used[j] = 0;
@@ -72,8 +74,8 @@ static void test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_limi
         j--;
         continue;
       }
-      lmm_expand(Sys, cnst[k], var[i], float_random(1.5));
-      lmm_expand_add(Sys, cnst[k], var[i], float_random(1.5));
+      Sys->expand(cnst[k], var[i], float_random(1.5));
+      Sys->expand_add(cnst[k], var[i], float_random(1.5));
       used[k]++;
     }
   }
@@ -87,25 +89,25 @@ static void test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_limi
     fprintf(stderr,"Max concurrency:\n");
     int l=0;
     for (int i = 0; i < nb_cnst; i++) {
-      int j=lmm_constraint_concurrency_maximum_get(cnst[i]);
-      int k=lmm_constraint_concurrency_limit_get(cnst[i]);
+      int j = cnst[i]->get_concurrency_maximum();
+      int k = cnst[i]->get_concurrency_limit();
       xbt_assert(k<0 || j<=k);
       if(j>l)
         l=j;
       fprintf(stderr,"(%i):%i/%i ",i,j,k);
-      lmm_constraint_concurrency_maximum_reset(cnst[i]);
-      xbt_assert(not lmm_constraint_concurrency_maximum_get(cnst[i]));
+      cnst[i]->reset_concurrency_maximum();
+      xbt_assert(not cnst[i]->get_concurrency_maximum());
       if(i%10==9)
         fprintf(stderr,"\n");
     }
     fprintf(stderr,"\nTotal maximum concurrency is %i\n",l);
 
-    lmm_print(Sys);
+    Sys->print();
   }
 
   for (int i = 0; i < nb_var; i++)
-    lmm_variable_free(Sys, var[i]);
-  lmm_system_free(Sys);
+    Sys->variable_free(var[i]);
+  delete Sys;
 }
 
 unsigned int TestClasses [][4]=
@@ -167,7 +169,7 @@ int main(int argc, char **argv)
   unsigned int nb_var= TestClasses[testclass][1];
   unsigned int pw_base_limit= TestClasses[testclass][2];
   unsigned int pw_max_limit= TestClasses[testclass][3];
-  unsigned int max_share=2; //1<<(pw_base_limit/2+1);
+  unsigned int max_share    = 2; // 1<<(pw_base_limit/2+1)
 
   //If you want to test concurrency, you need nb_elem >> 2^pw_base_limit:
   unsigned int nb_elem= (1<<pw_base_limit)+(1<<(8*pw_max_limit/10));
@@ -185,10 +187,10 @@ int main(int argc, char **argv)
   float mean_date= acc_date/(float)testcount;
   float stdev_date= sqrt(acc_date2/(float)testcount-mean_date*mean_date);
 
-  fprintf(stderr,
-         "%ix One shot execution time for a total of %d constraints, "
-         "%d variables with %d active constraint each, concurrency in [%i,%i] and max concurrency share %i\n",
-         testcount,nb_cnst, nb_var, nb_elem, (1<<pw_base_limit), (1<<pw_base_limit)+(1<<pw_max_limit), max_share);
+  fprintf(stderr, "%ix One shot execution time for a total of %u constraints, "
+                  "%u variables with %u active constraint each, concurrency in [%i,%i] and max concurrency share %u\n",
+          testcount, nb_cnst, nb_var, nb_elem, (1 << pw_base_limit), (1 << pw_base_limit) + (1 << pw_max_limit),
+          max_share);
   if(mode==3)
     fprintf(stderr, "Execution time: %g +- %g  microseconds \n",mean_date, stdev_date);
 
index 90914d6..333ecff 100644 (file)
@@ -67,43 +67,35 @@ int main(int argc, char **argv)
     XBT_DEBUG("\t CPU actions");
 
     simgrid::surf::ActionList* action_list = surf_cpu_model_pm->getFailedActionSet();
-    for(simgrid::surf::ActionList::iterator it(action_list->begin()), itNext = it, itend(action_list->end()) ;
-        it != itend ; it=itNext) {
-      ++itNext;
-      simgrid::surf::Action *action = static_cast<simgrid::surf::CpuAction*>(&*it);
-       XBT_INFO("   CPU Failed action");
-       XBT_DEBUG("\t * Failed : %p", action);
-       action->unref();
+    while (not action_list->empty()) {
+      simgrid::surf::Action& action = action_list->front();
+      XBT_INFO("   CPU Failed action");
+      XBT_DEBUG("\t * Failed : %p", &action);
+      action.unref();
     }
 
     action_list = surf_cpu_model_pm->getDoneActionSet();
-    for(simgrid::surf::ActionList::iterator it(action_list->begin()), itNext = it, itend(action_list->end()) ;
-        it != itend ; it=itNext) {
-      ++itNext;
-      simgrid::surf::Action *action = static_cast<simgrid::surf::CpuAction*>(&*it);
+    while (not action_list->empty()) {
+      simgrid::surf::Action& action = action_list->front();
       XBT_INFO("   CPU Done action");
-      XBT_DEBUG("\t * Done : %p", action);
-      action->unref();
+      XBT_DEBUG("\t * Done : %p", &action);
+      action.unref();
     }
 
     action_list = surf_network_model->getFailedActionSet();
-    for(simgrid::surf::ActionList::iterator it(action_list->begin()), itNext = it, itend(action_list->end()) ;
-        it != itend ; it=itNext) {
-      ++itNext;
-      simgrid::surf::Action *action = static_cast<simgrid::surf::NetworkAction*>(&*it);
-       XBT_INFO("   Network Failed action");
-       XBT_DEBUG("\t * Failed : %p", action);
-       action->unref();
+    while (not action_list->empty()) {
+      simgrid::surf::Action& action = action_list->front();
+      XBT_INFO("   Network Failed action");
+      XBT_DEBUG("\t * Failed : %p", &action);
+      action.unref();
     }
 
     action_list = surf_network_model->getDoneActionSet();
-    for(simgrid::surf::ActionList::iterator it(action_list->begin()), itNext = it, itend(action_list->end()) ;
-        it != itend ; it=itNext) {
-      ++itNext;
-      simgrid::surf::Action *action = static_cast<simgrid::surf::NetworkAction*>(&*it);
+    while (not action_list->empty()) {
+      simgrid::surf::Action& action = action_list->front();
       XBT_INFO("   Network Done action");
-      XBT_DEBUG("\t * Done : %p", action);
-      action->unref();
+      XBT_DEBUG("\t * Done : %p", &action);
+      action.unref();
     }
 
   } while ((surf_network_model->getRunningActionSet()->size() ||
index 0b0f8af..41e5c97 100644 (file)
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
     double now = surf_get_clock();
     XBT_INFO("Next Event : %g", now);
 
-    for (auto model: *all_existing_models) {
+    for (auto const& model : *all_existing_models) {
       if (surf_model_running_action_set_size(model)) {
         XBT_DEBUG("\t Running that model");
         running = 1;
index da0f1a1..8a16af4 100644 (file)
@@ -1,4 +1,4 @@
-foreach(x heap_bench log_large log_usage mallocator parallel_log_crashtest parmap_bench parmap_test)
+foreach(x log_large log_usage mallocator parallel_log_crashtest)
   add_executable       (${x}  ${x}/${x}.c)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -7,6 +7,15 @@ foreach(x heap_bench log_large log_usage mallocator parallel_log_crashtest parma
   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
 endforeach()
 
+foreach(x parmap_bench parmap_test)
+  add_executable       (${x}  ${x}/${x}.cpp)
+  target_link_libraries(${x}  simgrid)
+  set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+
+  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
+  set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
+endforeach()
+
 if(HAVE_MMALLOC)
   add_executable       (mmalloc_test ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc/mmalloc_test.cpp)
   target_link_libraries(mmalloc_test simgrid)
@@ -18,12 +27,14 @@ set(tesh_files    ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/log_usage/log_us
                                     ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc/mmalloc_32.tesh          PARENT_SCOPE)
 set(teshsuite_src ${teshsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc/mmalloc_test.cpp           PARENT_SCOPE)
 
-foreach(x heap_bench log_large parallel_log_crashtest parmap_test) #mallocator parmap_bench
+foreach(x log_large parallel_log_crashtest parmap_test) #mallocator parmap_bench
   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)
diff --git a/teshsuite/xbt/heap_bench/heap_bench.c b/teshsuite/xbt/heap_bench/heap_bench.c
deleted file mode 100644 (file)
index 47797d2..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* A few tests for the xbt_heap module                                      */
-
-/* Copyright (c) 2004-2010, 2012-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. */
-
-#include <stdio.h>
-#include <math.h>
-#include <xbt/xbt_os_time.h>
-
-#include "simgrid/msg.h"
-#include "xbt/heap.h"
-#include "xbt/sysdep.h"
-
-#define MAX_TEST 1000000
-
-static int compare_double(const void *a, const void *b)
-{
-  double pa = *((double *) a);
-  double pb = *((double *) b);
-
-  if (pa > pb)
-    return 1;
-  if (pa < pb)
-    return -1;
-  return 0;
-}
-
-static void test_reset_heap(xbt_heap_t * heap, int size)
-{
-  xbt_heap_free(*heap);
-  *heap = xbt_heap_new(size, NULL);
-
-  for (int i = 0; i < size; i++) {
-    xbt_heap_push(*heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0)));
-  }
-}
-
-static void test_heap_validity(int size)
-{
-  xbt_heap_t heap = xbt_heap_new(size, NULL);
-  double *tab = xbt_new0(double, size);
-  int i;
-
-  for (i = 0; i < size; i++) {
-    tab[i] = (double) (10.0 * rand() / (RAND_MAX + 1.0));
-    xbt_heap_push(heap, NULL, (double) tab[i]);
-  }
-
-  qsort(tab, size, sizeof(double), compare_double);
-
-  for (i = 0; i < size; i++) {
-    if (fabs(xbt_heap_maxkey(heap) - tab[i]) > 1e-9) {
-      fprintf(stderr, "Problem !\n");
-      exit(1);
-    }
-    xbt_heap_pop(heap);
-  }
-  xbt_heap_free(heap);
-  free(tab);
-  printf("Validity test complete!\n");
-}
-
-static void test_heap_mean_operation(int size)
-{
-  xbt_heap_t heap = xbt_heap_new(size, NULL);
-
-  double date = xbt_os_time() * 1000000;
-  for (int i = 0; i < size; i++)
-    xbt_heap_push(heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0)));
-
-  date = xbt_os_time() * 1000000 - date;
-  printf("Creation time  %d size heap : %g\n", size, date);
-
-  date = xbt_os_time() * 1000000;
-  for (int j = 0; j < MAX_TEST; j++) {
-
-    if (!(j % size) && j)
-      test_reset_heap(&heap, size);
-
-    double val = xbt_heap_maxkey(heap);
-    xbt_heap_pop(heap);
-    xbt_heap_push(heap, NULL, 3.0 * val);
-  }
-  date = xbt_os_time() * 1000000 - date;
-  printf("Mean access time for a %d size heap : %g\n", size, date * 1.0 / (MAX_TEST + 0.0));
-
-  xbt_heap_free(heap);
-}
-
-int main(int argc, char** argv)
-{
-  MSG_init(&argc, argv);
-
-  for (int size = 100; size < 10000; size *= 10) {
-    test_heap_validity(size);
-    test_heap_mean_operation(size);
-  }
-  return 0;
-}
diff --git a/teshsuite/xbt/heap_bench/heap_bench.tesh b/teshsuite/xbt/heap_bench/heap_bench.tesh
deleted file mode 100644 (file)
index a07abd4..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#! ./tesh
-
-! output display
-$ $SG_TEST_EXENV ${bindir:=.}/heap_bench
-> Validity test complete!
-> Creation time  100 size heap : 6
-> Mean access time for a 100 size heap : 0.14687
-> Validity test complete!
-> Creation time  1000 size heap : 38
-> Mean access time for a 1000 size heap : 0.179765
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 449049d..e40a03f 100644 (file)
@@ -106,4 +106,5 @@ $ ${bindir:=.}/mmalloc_test --log=root.fmt:%m%n
 > Re-allocate every second block
 > free all blocks (each one twice, to check that double free are correctly catched)
 > free again all blocks (to really check that double free are correctly catched)
+> Let's try different codepaths for mrealloc
 > Damnit, I cannot break mmalloc this time. That's SO disappointing.
index 343e2a4..90e01ff 100644 (file)
@@ -106,4 +106,5 @@ $ ${bindir:=.}/mmalloc_test --log=root.fmt:%m%n
 > Re-allocate every second block
 > free all blocks (each one twice, to check that double free are correctly catched)
 > free again all blocks (to really check that double free are correctly catched)
+> Let's try different codepaths for mrealloc
 > Damnit, I cannot break mmalloc this time. That's SO disappointing.
index c480421..a20ee38 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. 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
@@ -6,12 +6,12 @@
 
 #include "xbt/mmalloc.h"
 #include "xbt.h"
-#include <stdio.h>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 
 #include <xbt/ex.hpp>
@@ -22,6 +22,15 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test,"this test");
 #define TESTSIZE 100
 #define size_of_block(i) (((i % 50)+1)* 100)
 
+static void check_block(const void* s, int c, int n)
+{
+  const unsigned char* p = static_cast<const unsigned char*>(s);
+  unsigned char b        = static_cast<unsigned char>(c);
+  for (int i = 0; i < n; i++)
+    if (p[i] != b)
+      xbt_die("value mismatch: %p[%d] = %#hhx, expected %#hhx", p, i, p[i], b);
+}
+
 int main(int argc, char**argv)
 {
   xbt_mheap_t heapA = nullptr;
@@ -45,7 +54,7 @@ int main(int argc, char**argv)
   for (i = 0; i < TESTSIZE; i++) {
     size = size_of_block(i);
     pointers[i] = mmalloc(heapA, size);
-    XBT_INFO("%d bytes allocated with offset %tx", size, ((char*)pointers[i])-((char*)heapA));
+    XBT_INFO("%d bytes allocated with offset %zx", size, (size_t)((char*)pointers[i] - (char*)heapA));
   }
   XBT_INFO("All blocks were correctly allocated. Free every second block");
   for (i = 0; i < TESTSIZE; i+=2) {
@@ -87,6 +96,21 @@ int main(int argc, char**argv)
       xbt_die("FAIL: A double-free went undetected (for size:%d)",size_of_block(i));
   }
 
+  XBT_INFO("Let's try different codepaths for mrealloc");
+  for (i = 0; i < TESTSIZE; i++) {
+    const std::vector<std::pair<int, int>> requests = {
+        {size_of_block(i) / 2, 0x77}, {size_of_block(i) * 2, 0xaa}, {1, 0xc0}, {0, 0}};
+    pointers[i] = nullptr;
+    for (unsigned k = 0; k < requests.size(); ++k) {
+      size        = requests[k].first;
+      pointers[i] = mrealloc(heapA, pointers[i], size);
+      if (k > 0)
+        check_block(pointers[i], requests[k - 1].second, std::min(size, requests[k - 1].first));
+      if (size > 0)
+        memset(pointers[i], requests[k].second, size);
+    }
+  }
+
   XBT_INFO("Damnit, I cannot break mmalloc this time. That's SO disappointing.");
   return 0;
 }
index ab85f5d..dc86382 100644 (file)
@@ -1,6 +1,6 @@
 /* synchro_crashtest -- tries to crash the logging mechanism by doing parallel logs*/
 
-/* Copyright (c) 2007-2014. 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
@@ -11,8 +11,8 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(synchro_crashtest, "Logs of this example");
 
-int test_amount = 99;           /* Up to 999 to not break the logs (and thus the testing mechanism) */
-int crasher_amount = 99;        /* Up to 99  to not break the logs (and thus the testing mechanism) */
+const int test_amount    = 99;  /* Up to 99 to not break the logs (and thus the testing mechanism) */
+const int crasher_amount = 99;  /* Up to 99 to not break the logs (and thus the testing mechanism) */
 int *id;                        /* to pass a pointer to the threads without race condition */
 
 int more_info = 0;              /* SET IT TO TRUE TO GET MORE INFO */
@@ -32,27 +32,24 @@ static void* crasher_thread(void *arg)
   return NULL;
 }
 
-static int crasher(int argc, char *argv[])
+static int crasher()
 {
-  int i;
-  xbt_os_thread_t *crashers;
-
   /* initializations of the philosopher mechanisms */
   id = xbt_new0(int, crasher_amount);
-  crashers = xbt_new(xbt_os_thread_t, crasher_amount);
+  xbt_os_thread_t* crashers = xbt_new(xbt_os_thread_t, crasher_amount);
 
-  for (i = 0; i < crasher_amount; i++)
+  for (int i = 0; i < crasher_amount; i++)
     id[i] = i;
 
   /* spawn threads */
-  for (i = 0; i < crasher_amount; i++) {
-    char *name = bprintf("thread %d", i);
+  for (int i = 0; i < crasher_amount; i++) {
+    char name[16];
+    snprintf(name, sizeof name, "thread %d", i);
     crashers[i] = xbt_os_thread_create(name, &crasher_thread, &id[i], NULL );
-    free(name);
   }
 
   /* wait for them */
-  for (i = 0; i < crasher_amount; i++)
+  for (int i = 0; i < crasher_amount; i++)
     xbt_os_thread_join(crashers[i],NULL);
 
   xbt_free(crashers);
@@ -64,5 +61,5 @@ static int crasher(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
   MSG_init(&argc, argv);
-  return crasher(argc, argv);
+  return crasher();
 }
diff --git a/teshsuite/xbt/parmap_bench/parmap_bench.c b/teshsuite/xbt/parmap_bench/parmap_bench.c
deleted file mode 100644 (file)
index 3944546..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/* 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 "simgrid/msg.h"
-#include "src/internal_config.h" /* HAVE_FUTEX_H */
-#include "xbt/xbt_os_time.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <xbt/dynar.h>
-#include <xbt/parmap.h>
-#include <xbt/sysdep.h>
-
-#define MODES_DEFAULT 0x7
-#define TIMEOUT 10.0
-#define ARRAY_SIZE 10007
-#define FIBO_MAX 25
-
-void (*fun_to_apply)(void *);
-
-static const char *parmap_mode_name(e_xbt_parmap_mode_t mode)
-{
-  static char name[80];
-  switch (mode) {
-  case XBT_PARMAP_POSIX:
-    snprintf(name, sizeof name, "POSIX");
-    break;
-  case XBT_PARMAP_FUTEX:
-    snprintf(name, sizeof name, "FUTEX");
-    break;
-  case XBT_PARMAP_BUSY_WAIT:
-    snprintf(name, sizeof name, "BUSY_WAIT");
-    break;
-  case XBT_PARMAP_DEFAULT:
-    snprintf(name, sizeof name, "DEFAULT");
-    break;
-  default:
-    snprintf(name, sizeof name, "UNKNOWN(%d)", (int)mode);
-    break;
-  }
-  return name;
-}
-
-static int parmap_skip_mode(e_xbt_parmap_mode_t mode)
-{
-#if !HAVE_FUTEX_H
-  if (mode == XBT_PARMAP_FUTEX) {
-    printf("not available\n");
-    return 1;
-  } else
-#endif
-    return 0;
-}
-
-static unsigned fibonacci(unsigned n)
-{
-  if (n < 2)
-    return n;
-  else
-    return fibonacci(n - 1) + fibonacci(n - 2);
-}
-
-static void fun_small_comp(void *arg)
-{
-  unsigned *u = arg;
-  *u = 2 * *u + 1;
-}
-
-static void fun_big_comp(void *arg)
-{
-  unsigned *u = arg;
-  *u = fibonacci(*u % FIBO_MAX);
-}
-
-static void array_new(unsigned **a, xbt_dynar_t *data)
-{
-  *a = xbt_malloc(ARRAY_SIZE * sizeof **a);
-  *data = xbt_dynar_new(sizeof *a, NULL);
-  xbt_dynar_shrink(*data, ARRAY_SIZE);
-  for (int i = 0 ; i < ARRAY_SIZE ; i++) {
-    (*a)[i] = i;
-    xbt_dynar_push_as(*data, void*, &(*a)[i]);
-  }
-}
-
-static void bench_parmap_full(int nthreads, e_xbt_parmap_mode_t mode)
-{
-  unsigned *a;
-  xbt_dynar_t data;
-  xbt_parmap_t parmap;
-  double elapsed_time;
-
-  printf("** mode = %-15s ", parmap_mode_name(mode));
-  fflush(stdout);
-
-  if (parmap_skip_mode(mode))
-    return;
-
-  array_new(&a, &data);
-
-  int i = 0;
-  double start_time = xbt_os_time();
-  do {
-    parmap = xbt_parmap_new(nthreads, mode);
-    xbt_parmap_apply(parmap, fun_to_apply, data);
-    xbt_parmap_destroy(parmap);
-    elapsed_time = xbt_os_time() - start_time;
-    i++;
-  } while (elapsed_time < TIMEOUT);
-
-  printf("ran %d times in %g seconds (%g/s)\n", i, elapsed_time, i / elapsed_time);
-
-  xbt_dynar_free(&data);
-  xbt_free(a);
-}
-
-static void bench_parmap_apply(int nthreads, e_xbt_parmap_mode_t mode)
-{
-  unsigned *a;
-  xbt_dynar_t data;
-  double elapsed_time;
-
-  printf("** mode = %-15s ", parmap_mode_name(mode));
-  fflush(stdout);
-
-  if (parmap_skip_mode(mode))
-    return;
-
-  array_new(&a, &data);
-
-  xbt_parmap_t parmap = xbt_parmap_new(nthreads, mode);
-  int i = 0;
-  double start_time = xbt_os_time();
-  do {
-    xbt_parmap_apply(parmap, fun_to_apply, data);
-    elapsed_time = xbt_os_time() - start_time;
-    i++;
-  } while (elapsed_time < TIMEOUT);
-  xbt_parmap_destroy(parmap);
-
-  printf("ran %d times in %g seconds (%g/s)\n", i, elapsed_time, i / elapsed_time);
-
-  xbt_dynar_free(&data);
-  xbt_free(a);
-}
-
-static void bench_all_modes(void (*bench_fun)(int, e_xbt_parmap_mode_t),
-                            int nthreads, unsigned modes)
-{
-  e_xbt_parmap_mode_t all_modes[] = {XBT_PARMAP_POSIX, XBT_PARMAP_FUTEX, XBT_PARMAP_BUSY_WAIT, XBT_PARMAP_DEFAULT};
-
-  for (unsigned i = 0 ; i < sizeof all_modes / sizeof all_modes[0] ; i++) {
-    if (1U << i & modes)
-      bench_fun(nthreads, all_modes[i]);
-  }
-}
-
-int main(int argc, char *argv[])
-{
-  int nthreads;
-  unsigned modes = MODES_DEFAULT;
-
-  MSG_init(&argc, argv);
-
-  if (argc != 2 && argc != 3) {
-    fprintf(stderr, "Usage: %s nthreads [modes]\n"
-            "    nthreads - number of working threads\n"
-            "    modes    - bitmask of modes to test\n",
-            argv[0]);
-    return EXIT_FAILURE;
-  }
-  nthreads = atoi(argv[1]);
-  if (nthreads < 1) {
-    fprintf(stderr, "ERROR: invalid thread count: %d\n", nthreads);
-    return EXIT_FAILURE;
-  }
-  if (argc == 3)
-    modes = strtol(argv[2], NULL, 0);
-
-  printf("Parmap benchmark with %d workers (modes = %#x)...\n\n", nthreads, modes);
-
-  fun_to_apply = &fun_small_comp;
-
-  printf("Benchmark for parmap create+apply+destroy (small comp):\n");
-  bench_all_modes(bench_parmap_full, nthreads, modes);
-  printf("\n");
-
-  printf("Benchmark for parmap apply only (small comp):\n");
-  bench_all_modes(bench_parmap_apply, nthreads, modes);
-  printf("\n");
-
-  fun_to_apply = &fun_big_comp;
-
-  printf("Benchmark for parmap create+apply+destroy (big comp):\n");
-  bench_all_modes(bench_parmap_full, nthreads, modes);
-  printf("\n");
-
-  printf("Benchmark for parmap apply only (big comp):\n");
-  bench_all_modes(bench_parmap_apply, nthreads, modes);
-  printf("\n");
-
-  return EXIT_SUCCESS;
-}
diff --git a/teshsuite/xbt/parmap_bench/parmap_bench.cpp b/teshsuite/xbt/parmap_bench/parmap_bench.cpp
new file mode 100644 (file)
index 0000000..4fbead4
--- /dev/null
@@ -0,0 +1,156 @@
+/* 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 "src/internal_config.h" // HAVE_FUTEX_H
+#include <simgrid/msg.h>
+#include <xbt.h>
+#include <xbt/parmap.hpp>
+
+#include <cstdlib>
+#include <numeric> // std::iota
+#include <string>
+#include <vector>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(parmap_bench, "Bench for parmap");
+
+#define MODES_DEFAULT 0x7
+#define TIMEOUT 10.0
+#define ARRAY_SIZE 10007
+#define FIBO_MAX 25
+
+void (*fun_to_apply)(unsigned*);
+
+static std::string parmap_mode_name(e_xbt_parmap_mode_t mode)
+{
+  std::string name;
+  switch (mode) {
+    case XBT_PARMAP_POSIX:
+      name = "POSIX";
+      break;
+    case XBT_PARMAP_FUTEX:
+      name = "FUTEX";
+      break;
+    case XBT_PARMAP_BUSY_WAIT:
+      name = "BUSY_WAIT";
+      break;
+    case XBT_PARMAP_DEFAULT:
+      name = "DEFAULT";
+      break;
+    default:
+      name = "UNKNOWN(" + std::to_string(mode) + ")";
+      break;
+  }
+  return name;
+}
+
+static unsigned fibonacci(unsigned n)
+{
+  if (n < 2)
+    return n;
+  else
+    return fibonacci(n - 1) + fibonacci(n - 2);
+}
+
+static void fun_small_comp(unsigned* arg)
+{
+  *arg = 2 * *arg + 1;
+}
+
+static void fun_big_comp(unsigned* arg)
+{
+  *arg = fibonacci(*arg % FIBO_MAX);
+}
+
+static void bench_parmap(int nthreads, e_xbt_parmap_mode_t mode, bool full_bench)
+{
+  XBT_INFO("** mode = %s", parmap_mode_name(mode).c_str());
+
+  if (mode == XBT_PARMAP_FUTEX && not HAVE_FUTEX_H) {
+    XBT_INFO("   not available");
+    return;
+  }
+
+  std::vector<unsigned> a(ARRAY_SIZE);
+  std::vector<unsigned*> data(ARRAY_SIZE);
+  std::iota(begin(a), end(a), 0);
+  std::iota(begin(data), end(data), &a[0]);
+
+  auto* parmap      = new simgrid::xbt::Parmap<unsigned*>(nthreads, mode);
+  int i             = 0;
+  double start_time = xbt_os_time();
+  double elapsed_time;
+  do {
+    if (full_bench) {
+      delete parmap;
+      parmap = new simgrid::xbt::Parmap<unsigned*>(nthreads, mode);
+    }
+    parmap->apply(fun_to_apply, data);
+    elapsed_time = xbt_os_time() - start_time;
+    i++;
+  } while (elapsed_time < TIMEOUT);
+  delete parmap;
+
+  XBT_INFO("   ran %d times in %g seconds (%g/s)", i, elapsed_time, i / elapsed_time);
+}
+
+static void bench_all_modes(int nthreads, unsigned modes, bool full_bench)
+{
+  std::vector<e_xbt_parmap_mode_t> all_modes = {XBT_PARMAP_POSIX, XBT_PARMAP_FUTEX, XBT_PARMAP_BUSY_WAIT,
+                                                XBT_PARMAP_DEFAULT};
+
+  for (unsigned i = 0; i < all_modes.size(); i++) {
+    if (1U << i & modes)
+      bench_parmap(nthreads, all_modes[i], full_bench);
+  }
+}
+
+int main(int argc, char* argv[])
+{
+  int nthreads;
+  unsigned modes = MODES_DEFAULT;
+
+  xbt_log_control_set("parmap_bench.fmt:[%c/%p]%e%m%n");
+  MSG_init(&argc, argv);
+
+  if (argc != 2 && argc != 3) {
+    XBT_INFO("Usage: %s nthreads [modes]", argv[0]);
+    XBT_INFO("    nthreads - number of working threads");
+    XBT_INFO("    modes    - bitmask of modes to test");
+    return EXIT_FAILURE;
+  }
+  nthreads = atoi(argv[1]);
+  if (nthreads < 1) {
+    XBT_ERROR("Invalid thread count: %d", nthreads);
+    return EXIT_FAILURE;
+  }
+  if (argc == 3)
+    modes = strtol(argv[2], NULL, 0);
+
+  XBT_INFO("Parmap benchmark with %d workers (modes = %#x)...", nthreads, modes);
+  XBT_INFO("%s", "");
+
+  SIMIX_context_set_nthreads(nthreads);
+  fun_to_apply = &fun_small_comp;
+
+  XBT_INFO("Benchmark for parmap create+apply+destroy (small comp):");
+  bench_all_modes(nthreads, modes, true);
+  XBT_INFO("%s", "");
+
+  XBT_INFO("Benchmark for parmap apply only (small comp):");
+  bench_all_modes(nthreads, modes, false);
+  XBT_INFO("%s", "");
+
+  fun_to_apply = &fun_big_comp;
+
+  XBT_INFO("Benchmark for parmap create+apply+destroy (big comp):");
+  bench_all_modes(nthreads, modes, true);
+  XBT_INFO("%s", "");
+
+  XBT_INFO("Benchmark for parmap apply only (big comp):");
+  bench_all_modes(nthreads, modes, false);
+  XBT_INFO("%s", "");
+
+  return EXIT_SUCCESS;
+}
similarity index 51%
rename from teshsuite/xbt/parmap_test/parmap_test.c
rename to teshsuite/xbt/parmap_test/parmap_test.cpp
index b520b5d..2e4416f 100644 (file)
@@ -5,45 +5,40 @@
 /* This program is 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"
-#include "src/internal_config.h"
-#include "xbt.h"
-#include "xbt/ex.h"
-#include "xbt/xbt_os_time.h"
+#include "src/internal_config.h" // HAVE_FUTEX_H
+#include <simgrid/msg.h>
+#include <xbt.h>
+#include <xbt/parmap.hpp>
+
+#include <algorithm>
+#include <cstdlib>
+#include <numeric> // std::iota
+#include <vector>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(parmap_test, "Test for parmap");
 
-static void fun_double(void *arg)
+static void fun_double(unsigned* arg)
 {
-  unsigned *u = arg;
-  *u = 2 * *u + 1;
+  *arg = 2 * *arg + 1;
 }
 
 static int test_parmap_basic(e_xbt_parmap_mode_t mode)
 {
   int ret = 0;
-  unsigned num_workers;
-  for (num_workers = 1 ; num_workers <= 16 ; num_workers *= 2) {
+  for (unsigned num_workers = 1; num_workers <= 16; num_workers *= 2) {
     const unsigned len = 1033;
     const unsigned num = 5;
-    unsigned *a;
-    xbt_dynar_t data;
-    xbt_parmap_t parmap;
-    unsigned i;
-
-    parmap = xbt_parmap_new(num_workers, mode);
-
-    a = xbt_malloc(len * sizeof *a);
-    data = xbt_dynar_new(sizeof a, NULL);
-    for (i = 0; i < len; i++) {
-      a[i] = i;
-      xbt_dynar_push_as(data, void *, &a[i]);
-    }
 
-    for (i = 0; i < num; i++)
-      xbt_parmap_apply(parmap, fun_double, data);
+    simgrid::xbt::Parmap<unsigned*> parmap(num_workers, mode);
+    std::vector<unsigned> a(len);
+    std::vector<unsigned*> data(len);
+    std::iota(begin(a), end(a), 0);
+    std::iota(begin(data), end(data), &a[0]);
+
+    for (unsigned i = 0; i < num; i++)
+      parmap.apply(fun_double, data);
 
-    for (i = 0; i < len; i++) {
+    for (unsigned i = 0; i < len; i++) {
       unsigned expected = (1U << num) * (i + 1) - 1;
       if (a[i] != expected) {
         XBT_CRITICAL("with %u threads, a[%u]: expected %u, got %u", num_workers, i, expected, a[i]);
@@ -51,62 +46,36 @@ static int test_parmap_basic(e_xbt_parmap_mode_t mode)
         break;
       }
     }
-
-    xbt_dynar_free(&data);
-    xbt_free(a);
-    xbt_parmap_destroy(parmap);
   }
   return ret;
 }
 
-static void fun_get_id(void *arg)
+static void fun_get_id(uintptr_t* arg)
 {
-  *(uintptr_t *)arg = (uintptr_t)xbt_os_thread_self();
+  *arg = (uintptr_t)xbt_os_thread_self();
   xbt_os_sleep(0.05);
 }
 
-static int fun_compare(const void *pa, const void *pb)
-{
-  uintptr_t a = *(uintptr_t *)pa;
-  uintptr_t b = *(uintptr_t *)pb;
-  return a < b ? -1 : a > b ? 1 : 0;
-}
-
 static int test_parmap_extended(e_xbt_parmap_mode_t mode)
 {
   int ret = 0;
-  unsigned num_workers;
 
-  for (num_workers = 1 ; num_workers <= 16 ; num_workers *= 2) {
+  for (unsigned num_workers = 1; num_workers <= 16; num_workers *= 2) {
     const unsigned len = 2 * num_workers;
-    uintptr_t *a;
-    xbt_parmap_t parmap;
-    xbt_dynar_t data;
-    unsigned i;
-    unsigned count;
-
-    parmap = xbt_parmap_new(num_workers, mode);
-
-    a = xbt_malloc(len * sizeof *a);
-    data = xbt_dynar_new(sizeof a, NULL);
-    for (i = 0; i < len; i++)
-      xbt_dynar_push_as(data, void *, &a[i]);
-
-    xbt_parmap_apply(parmap, fun_get_id, data);
-
-    qsort(a, len, sizeof a[0], fun_compare);
-    count = 1;
-    for (i = 1; i < len; i++)
-      if (a[i] != a[i - 1])
-        count++;
+
+    simgrid::xbt::Parmap<uintptr_t*> parmap(num_workers, mode);
+    std::vector<uintptr_t> a(len);
+    std::vector<uintptr_t*> data(len);
+    std::iota(begin(data), end(data), &a[0]);
+
+    parmap.apply(fun_get_id, data);
+
+    std::sort(begin(a), end(a));
+    unsigned count = std::distance(begin(a), std::unique(begin(a), end(a)));
     if (count != num_workers) {
       XBT_CRITICAL("only %u/%u threads did some work", count, num_workers);
       ret = 1;
     }
-
-    xbt_dynar_free(&data);
-    xbt_free(a);
-    xbt_parmap_destroy(parmap);
   }
   return ret;
 }
@@ -114,7 +83,9 @@ static int test_parmap_extended(e_xbt_parmap_mode_t mode)
 int main(int argc, char** argv)
 {
   int status = 0;
+  xbt_log_control_set("parmap_test.fmt:[%c/%p]%e%m%n");
   MSG_init(&argc, argv);
+  SIMIX_context_set_nthreads(16); // dummy value > 1
 
   XBT_INFO("Basic testing posix");
   status += test_parmap_basic(XBT_PARMAP_POSIX);
index d389a73..3933297 100644 (file)
@@ -1,5 +1,5 @@
 ! timeout 120
-$ ${bindir:=.}/parmap_test --log=root.fmt:%m%n
+$ ${bindir:=.}/parmap_test --log=parmap_test.fmt:%m%n
 > Basic testing posix
 > Basic testing futex
 > Basic testing busy wait
index 41f0565..21327c9 100644 (file)
@@ -5,59 +5,57 @@ set(EXTRA_DIST
   src/include/instr/instr_interface.h
   src/include/mc/datatypes.h
   src/include/mc/mc.h
-  src/mc/mc_mmu.h
-  src/mc/PageStore.hpp
-  src/mc/mc_record.h
   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/surf.h
-  src/msg/msg_private.h
+  src/include/surf/datatypes.hpp
+  src/include/surf/maxmin.hpp
+  src/include/surf/surf.hpp
+  src/include/xbt/parmap.hpp
+  src/mc/mc_mmu.hpp
+  src/mc/mc_record.hpp
+  src/mc/PageStore.hpp
+  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/smpi/include/smpi_utils.hpp
   src/surf/cpu_cas01.hpp
   src/surf/cpu_interface.hpp
   src/surf/cpu_ti.hpp
-  src/surf/maxmin_private.hpp
   src/surf/network_cm02.hpp
   src/surf/network_constant.hpp
   src/surf/network_interface.hpp
   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
   src/surf/xml/simgrid_dtd.c
   src/surf/xml/surfxml_sax_cb.cpp
 
-  src/surf/FileImpl.hpp
   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
@@ -71,7 +69,6 @@ set(EXTRA_DIST
   src/xbt/backtrace_linux.cpp
   src/xbt/dict_private.h
   src/xbt/graph_private.h
-  src/xbt/heap_private.h
   src/xbt/log_private.h
   src/xbt/mallocator_private.h
 
@@ -275,7 +272,6 @@ set(XBT_SRC
   src/xbt/ex.cpp
   src/xbt/exception.cpp
   src/xbt/graph.c
-  src/xbt/heap.c
   src/xbt/log.c
   src/xbt/mallocator.c
   src/xbt/memory_map.cpp
@@ -288,7 +284,7 @@ set(XBT_SRC
   src/xbt/xbt_log_layout_format.c
   src/xbt/xbt_log_layout_simple.c
   src/xbt/xbt_main.cpp
-  src/xbt/xbt_os_file.c
+  src/xbt/xbt_os_file.cpp
   src/xbt/xbt_os_synchro.cpp
   src/xbt/xbt_os_time.c
   src/xbt/xbt_replay.cpp
@@ -302,7 +298,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
@@ -337,7 +333,6 @@ set(SURF_SRC
   src/surf/cpu_interface.cpp
   src/surf/cpu_ti.cpp
   src/surf/fair_bottleneck.cpp
-  src/surf/FileImpl.cpp
   src/surf/instr_routing.cpp
   src/surf/instr_surf.cpp
   src/surf/lagrange.cpp
@@ -346,6 +341,7 @@ set(SURF_SRC
   src/surf/network_constant.cpp
   src/surf/network_interface.cpp
   src/surf/plugins/host_energy.cpp
+  src/surf/plugins/link_energy.cpp
   src/surf/plugins/host_load.cpp
   src/surf/PropertyHolder.cpp
   src/surf/sg_platf.cpp
@@ -380,6 +376,7 @@ set(SIMIX_SRC
   src/kernel/context/Context.cpp
   src/kernel/context/Context.hpp
   src/kernel/context/ContextRaw.cpp
+  src/kernel/context/ContextRaw.hpp
   src/simix/smx_deployment.cpp
   src/simix/smx_environment.cpp
   src/simix/smx_global.cpp
@@ -467,16 +464,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
@@ -494,7 +491,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
@@ -548,12 +545,17 @@ set(TRACING_SRC
   src/instr/instr_config.cpp
   src/instr/instr_interface.cpp
   src/instr/instr_paje_containers.cpp
+  src/instr/instr_paje_containers.hpp
+  src/instr/instr_paje_events.cpp
+  src/instr/instr_paje_events.hpp
   src/instr/instr_paje_header.cpp
   src/instr/instr_paje_trace.cpp
   src/instr/instr_paje_types.cpp
+  src/instr/instr_paje_types.hpp
   src/instr/instr_paje_values.cpp
-  src/instr/instr_private.h
-  src/instr/instr_smpi.h
+  src/instr/instr_paje_values.hpp
+  src/instr/instr_private.hpp
+  src/instr/instr_smpi.hpp
   src/instr/instr_resource_utilization.cpp
   )
 
@@ -571,8 +573,8 @@ 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_replay.h
+  src/mc/mc_record.hpp
+  src/mc/mc_replay.hpp
   src/mc/mc_record.cpp
   src/mc/mc_config.cpp
   src/mc/mc_global.cpp
@@ -615,11 +617,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
@@ -639,32 +641,29 @@ 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
   )
 
 set(MC_SIMGRID_MC_SRC  src/mc/checker/simgrid_mc.cpp)
 
 set(headers_to_install
-  include/msg/msg.h
-  include/msg/datatypes.h
-  include/simdag/simdag.h
-  include/simdag/datatypes.h
   include/simgrid/chrono.hpp
   include/simgrid/plugins/energy.h
+  include/simgrid/plugins/file_system.h
   include/simgrid/plugins/load.h
   include/simgrid/instr.h
   include/simgrid/msg.h
@@ -702,31 +701,28 @@ set(headers_to_install
   include/smpi/smpi_extended_traces_fortran.h
   include/smpi/forward.hpp
   include/xbt.h
-  include/xbt/RngStream.h
+  include/xbt/algorithm.hpp
   include/xbt/asserts.h
   include/xbt/automaton.h
   include/xbt/automaton.hpp
+  include/xbt/backtrace.h
+  include/xbt/backtrace.hpp
   include/xbt/base.h
   include/xbt/config.h
   include/xbt/config.hpp
   include/xbt/cunit.h
   include/xbt/dict.h
-  include/xbt/string.hpp
-  include/xbt/signal.hpp
   include/xbt/dynar.h
   include/xbt/dynar.hpp
   include/xbt/ex.h
   include/xbt/ex.hpp
   include/xbt/exception.hpp
-  include/xbt/backtrace.h
-  include/xbt/backtrace.hpp
-  include/xbt/file.h
-  include/xbt/function_types.h
+  include/xbt/Extendable.hpp
+  include/xbt/file.hpp
   include/xbt/functional.hpp
+  include/xbt/function_types.h
   include/xbt/future.hpp
   include/xbt/graph.h
-  include/xbt/heap.h
-  include/xbt/Extendable.hpp
   include/xbt/log.h
   include/xbt/log.hpp
   include/xbt/mallocator.h
@@ -736,7 +732,10 @@ set(headers_to_install
   include/xbt/parmap.h
   include/xbt/range.hpp
   include/xbt/replay.hpp
+  include/xbt/RngStream.h
+  include/xbt/signal.hpp
   include/xbt/str.h
+  include/xbt/string.hpp
   include/xbt/swag.h
   include/xbt/synchro.h
   include/xbt/sysdep.h
@@ -768,9 +767,11 @@ else() # NOT pthread
 endif()
 
 if(${HAVE_UCONTEXT_CONTEXTS}) #ucontext
-  set(SURF_SRC    ${SURF_SRC}   src/kernel/context/ContextUnix.cpp)
+  set(SURF_SRC    ${SURF_SRC}   src/kernel/context/ContextUnix.hpp
+                                src/kernel/context/ContextUnix.cpp)
 else() # NOT ucontext
-  set(EXTRA_DIST  ${EXTRA_DIST} src/kernel/context/ContextUnix.cpp)
+  set(EXTRA_DIST  ${EXTRA_DIST} src/kernel/context/ContextUnix.hpp
+                                src/kernel/context/ContextUnix.cpp)
 endif()
 
 ### Simgrid Lib sources
@@ -1039,6 +1040,7 @@ set(CMAKE_SOURCE_FILES
   tools/cmake/MakeLibWin.cmake
   tools/cmake/Modules/FindGraphviz.cmake
   tools/cmake/Modules/FindLibdw.cmake
+  tools/cmake/Modules/FindLibelf.cmake
   tools/cmake/Modules/FindLibunwind.cmake
   tools/cmake/Modules/FindLibevent.cmake
   tools/cmake/Modules/FindLuaSimgrid.cmake
@@ -1051,6 +1053,7 @@ set(CMAKE_SOURCE_FILES
   tools/cmake/scripts/update_tesh.pl
   tools/cmake/UnitTesting.cmake
   tools/cmake/src/internal_config.h.in
+  tools/cmake/test_prog/prog_asan.cpp
   tools/cmake/test_prog/prog_gnu_dynlinker.c
   tools/cmake/test_prog/prog_makecontext.c
   tools/cmake/test_prog/prog_mutex_timedlock.c
@@ -1126,6 +1129,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 64a6700..aacd81f 100644 (file)
@@ -142,9 +142,6 @@ set(source_to_pack
   ${JEDULE_SRC}
   ${JMSG_C_SRC}
   ${JMSG_JAVA_SRC}
-  ${JSURF_SWIG_SRC}
-  ${JSURF_SWIG_SRC_EXTRA}
-  ${JSURF_C_SRC}
   ${LUA_SRC}
   ${MC_SRC_BASE}
   ${MC_SRC}
index 68bbde4..94aaffd 100644 (file)
@@ -15,6 +15,9 @@ set(warnCXXFLAGS "")
 
 if(enable_compile_warnings)
   set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing")
+  if(CMAKE_COMPILER_IS_GNUCC AND (NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0")))
+    set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness")
+  endif()
   if(CMAKE_C_COMPILER_ID MATCHES "Clang|GCC")
     set(warnCFLAGS "${warnCFLAGS} -Wno-format-nonliteral")
   endif()
@@ -22,7 +25,10 @@ if(enable_compile_warnings)
     set(warnCFLAGS "${warnCFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes")
   endif()
 
-  set(warnCXXFLAGS "${warnCFLAGS} -Wall -Wextra -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment  -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing")
+  set(warnCXXFLAGS "${warnCFLAGS} -Wall -Wextra -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing")
+  if(CMAKE_COMPILER_IS_GNUCXX AND (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")))
+    set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness")
+  endif()
   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GCC")
     set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-format-nonliteral")
   endif()
@@ -38,10 +44,10 @@ if(enable_compile_warnings)
   # the one specific to C but refused by C++
   set(warnCFLAGS "${warnCFLAGS} -Wmissing-prototypes") 
 
-  if(CMAKE_Fotran_COMPILER_ID MATCHES "GCC|PGI")
+  if(CMAKE_Fortran_COMPILER_ID MATCHES "GCC|PGI")
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall")
   endif()
-  if(CMAKE_Fotran_COMPILER_ID MATCHES "Intel")
+  if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all")
   endif()
   set(CMAKE_JAVA_COMPILE_FLAGS "-Xlint")
@@ -73,6 +79,11 @@ if(enable_compile_optimizations AND CMAKE_COMPILER_IS_GNUCC
   set(optCFLAGS "${optCFLAGS} -finline-functions ")
 endif()
 
+# Do not leak the current directory into the binaries
+if(CMAKE_COMPILER_IS_GNUCC)
+  set(optCFLAGS "${optCFLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.")
+endif()
+
 # Configure LTO
 # NOTE, cmake 3.0 has a INTERPROCEDURAL_OPTIMIZATION target
 #       property for this (http://www.cmake.org/cmake/help/v3.0/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html)
@@ -134,11 +145,10 @@ if(enable_model-checking AND enable_compile_optimizations)
       src/xbt/log.c src/xbt/xbt_log_appender_file.c
       src/xbt/xbt_log_layout_format.c src/xbt/xbt_log_layout_simple.c
       src/xbt/dict.cpp src/xbt/dict_elm.c src/xbt/dict_cursor.c
-      src/xbt/dynar.cpp src/xbt/heap.c src/xbt/swag.c
-      src/xbt/str.c src src/xbt/snprintf.c
-      src/xbt/queue.c
+      src/xbt/dynar.cpp src/xbt/swag.c
+      src/xbt/xbt_str.cpp src/xbt/snprintf.c
       src/xbt/xbt_os_time.c src/xbt/xbt_os_thread.c
-      src/xbt/backtrace_linux.c
+      src/xbt/backtrace_linux.cpp
       ${MC_SRC_BASE} ${MC_SRC})
       set (mcCFLAGS "-O3  -funroll-loops -fno-strict-aliasing")
        if(CMAKE_COMPILER_IS_GNUCC)
@@ -166,12 +176,12 @@ if(enable_coverage)
   find_program(GCOV_PATH gcov)
   if(GCOV_PATH)
     set(COVERAGE_COMMAND "${GCOV_PATH}" CACHE TYPE FILEPATH FORCE)
+    set(COVERAGE_EXTRA_FLAGS "-l -p")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCOVERAGE")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
-    set(TESH_OPTION --enable-coverage)
     add_definitions(-fprofile-arcs -ftest-coverage)
   endif()
 endif()
@@ -181,6 +191,12 @@ if(enable_address_sanitizer)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
     set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -fsanitize=address")
     set(TESH_OPTION --enable-sanitizers)
+    try_compile(HAVE_SANITIZE_ADDRESS ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_asan.cpp)
+    try_compile(HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_asan.cpp
+      COMPILE_DEFINITIONS -DCHECK_FIBER_SUPPORT)
+else()
+    set(HAVE_SANITIZE_ADDRESS FALSE CACHE INTERNAL "")
+    set(HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT FALSE CACHE INTERNAL "")
 endif()
 
 if(enable_thread_sanitizer)
index ebc2e3d..3d5a70d 100644 (file)
@@ -22,15 +22,6 @@ if(WIN32)
   endif()
 endif()
 
-# find_package(SWIG)
-# if(${SWIG_FOUND})
-#   include(UseSWIG)
-#   message("-- [Java] Swig found: version ${SWIG_VERSION}")
-# else()
-#   message("-- [Java] Swig NOT FOUND. That's fine unless you work on this part yourself.")
-# endif()
-#mark_as_advanced(SWIG_EXECUTABLE)
-
 # Rules to build libsimgrid-java
 ################################
 
index eff28d8..14a4c81 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()
@@ -162,7 +162,6 @@ if(enable_maintainer_mode AND NOT WIN32)
     set(string5  "'s/SET(DOCTYPE)/SET(ROOT_dax__adag)/'")
     set(string9  "'s/#include <unistd.h>/#if defined(_WIN32)\\n#  ifndef __STRICT_ANSI__\\n#    include <io.h>\\n#    include <process.h>\\n#  endif\\n#else\\n#  include <unistd.h>\\n#endif/g'")
     set(string14 "'\\!^ \\* Generated [0-9/]\\{10\\} [0-9:]\\{8\\}\\.$$!d'")
-    set(string15 "'s/FAIL(\"Premature EOF/if(!ETag_surfxml_include_state()) FAIL(\"Premature EOF/'")
 
     ADD_CUSTOM_COMMAND(
       OUTPUT   ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h
@@ -206,7 +205,6 @@ if(enable_maintainer_mode AND NOT WIN32)
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c
       COMMAND ${FLEX_EXE} -o src/surf/xml/simgrid_dtd.c -Psurf_parse_ --noline src/surf/xml/simgrid_dtd.l
       COMMAND ${SED_EXE} -i ${string9} src/surf/xml/simgrid_dtd.c
-      COMMAND ${SED_EXE} -i ${string15} src/surf/xml/simgrid_dtd.c
       COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/surf/xml/simgrid_dtd.c
       COMMAND ${SED_EXE} -i 's/int surf_parse_leng\;/unsigned int surf_parse_leng\;/' src/surf/xml/simgrid_dtd.c
       COMMAND ${SED_EXE} -i 's/n = 0\; n < max_size/n = 0\; n < (size_t) max_size/' src/surf/xml/simgrid_dtd.c
index 6f4cf6b..2375082 100644 (file)
@@ -44,25 +44,6 @@ endif()
 if(SIMGRID_HAVE_LUA)
   ADD_CUSTOM_TARGET(link_simgrid_lua ALL
     DEPENDS    simgrid
-    ${CMAKE_BINARY_DIR}/examples/lua/simgrid.${LIB_EXE}
-    ${CMAKE_BINARY_DIR}/examples/msg/masterslave/simgrid.${LIB_EXE}
-    ${CMAKE_BINARY_DIR}/examples/simdag/simgrid.${LIB_EXE}
-    )
-  add_custom_command(
-    OUTPUT     ${CMAKE_BINARY_DIR}/examples/lua/simgrid.${LIB_EXE}
-    ${CMAKE_BINARY_DIR}/examples/msg/masterslave/simgrid.${LIB_EXE}
-    ${CMAKE_BINARY_DIR}/examples/simdag/simgrid.${LIB_EXE}
-    COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/examples/lua/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand
-    COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/examples/lua/
-    COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${CMAKE_BINARY_DIR}/examples/lua/simgrid.${LIB_EXE} #for test
-
-    COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/examples/msg/masterslave/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand
-    COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/examples/msg/masterslave/
-    COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${CMAKE_BINARY_DIR}/examples/msg/masterslave/simgrid.${LIB_EXE} #for test
-
-    COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/examples/simdag/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand
-    COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/examples/simdag/
-    COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${CMAKE_BINARY_DIR}/examples/simdag/simgrid.${LIB_EXE} #for test
     )
   SET(SIMGRID_DEP "${SIMGRID_DEP} ${LUA_LIBRARY} ${DL_LIBRARY}")
 endif()
@@ -86,7 +67,7 @@ if(SIMGRID_HAVE_MC AND HAVE_GNU_LD AND NOT ${DL_LIBRARY} STREQUAL "")
 endif()
 
 if(SIMGRID_HAVE_NS3)
-  SET(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-core${NS3_SUFFIX} -lns${NS3_VERSION}-csma${NS3_SUFFIX} -lns${NS3_VERSION}-point-to-point${NS3_SUFFIX} -lns${NS3_VERSION}-internet${NS3_SUFFIX} -lns${NS3_VERSION}-applications${NS3_SUFFIX}")
+  SET(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-core${NS3_SUFFIX} -lns${NS3_VERSION}-csma${NS3_SUFFIX} -lns${NS3_VERSION}-point-to-point${NS3_SUFFIX} -lns${NS3_VERSION}-internet${NS3_SUFFIX} -lns${NS3_VERSION}-network${NS3_SUFFIX} -lns${NS3_VERSION}-applications${NS3_SUFFIX}")
 endif()
 
 if(HAVE_POSIX_GETTIME)
@@ -114,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
diff --git a/tools/cmake/Modules/FindLibelf.cmake b/tools/cmake/Modules/FindLibelf.cmake
new file mode 100644 (file)
index 0000000..1e1af81
--- /dev/null
@@ -0,0 +1,34 @@
+find_path(LIBELF_INCLUDE_DIR "libelf.h"
+  HINTS
+  $ENV{SIMGRID_LIBELF_LIBRARY_PATH}
+  $ENV{LD_LIBRARY_PATH}
+  $ENV{LIBELF_LIBRARY_PATH}
+  PATH_SUFFIXES include/ GnuWin32/include
+  PATHS
+  /opt
+  /opt/local
+  /opt/csw
+  /sw
+  /usr)
+find_library(LIBELF_LIBRARY
+  NAMES elf
+  HINTS
+  $ENV{SIMGRID_LIBELF_LIBRARY_PATH}
+  $ENV{LD_LIBRARY_PATH}
+  $ENV{LIBELF_LIBRARY_PATH}
+  PATH_SUFFIXES lib/ GnuWin32/lib
+  PATHS
+  /opt
+  /opt/local
+  /opt/csw
+  /sw
+  /usr)
+set(LIBELF_LIBRARIES "${LIBELF_LIBRARY}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+  Libelf
+  DEFAULT_MSG
+  LIBELF_LIBRARIES
+  LIBELF_INCLUDE_DIR)
+mark_as_advanced(LIBELF_INCLUDE_DIR LIBELF_LIBRARIES)
index c432450..8d4d570 100644 (file)
@@ -73,7 +73,7 @@ IF(SIMGRID_HAVE_MC)
 ENDIF()
 
 IF(enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN AND HAVE_THREAD_CONTEXTS)
-  ADD_TEST(test-smpi-mpich3-thread-f77     ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
+  ADD_TEST(test-smpi-mpich3-thread-f77     ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/stack-size:8000 -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
   SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
   ADD_TEST(test-smpi-mpich3-thread-f90     ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/factory:thread)
   SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
@@ -82,8 +82,8 @@ ENDIF()
 IF(SIMGRID_HAVE_LUA)
   # Tests testing simulation from C but using lua for platform files. Executed like this
   # ~$ ./masterslave platform.lua deploy.lua
-  ADD_TESH(lua-platform-masterslave                --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/lua --cd ${CMAKE_BINARY_DIR}/examples/lua ${CMAKE_HOME_DIRECTORY}/teshsuite/lua/lua_platforms.tesh)
-  SET_TESTS_PROPERTIES(lua-platform-masterslave    PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
+  ADD_TESH(lua-platform-masterslave                --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/lua --cd ${CMAKE_BINARY_DIR}/examples ${CMAKE_HOME_DIRECTORY}/teshsuite/lua/lua_platforms.tesh)
+  SET_TESTS_PROPERTIES(lua-platform-masterslave    PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/lib/lib?.${LIB_EXE}")
 ENDIF()
 
 ADD_TEST(testall                                 ${CMAKE_BINARY_DIR}/testall)
@@ -98,4 +98,4 @@ if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
   
 else()
   set(EXTRA_DIST       ${EXTRA_DIST}       src/surf/trace_mgr_test.cpp)
-endif()
\ No newline at end of file
+endif()
index b98161a..aac7ce0 100644 (file)
@@ -3,7 +3,7 @@
 /* Warning: The file internal_config.h is AUTOMATICALLY GENERATED by Cmake. 
  * Edit the template instead: tools/cmake/src/internal_config.h.in          */
 
-/* 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. */
 /* <valgrind/valgrind.h> */
 #cmakedefine01 HAVE_VALGRIND_H
 
+/* Address Sanitizer */
+#cmakedefine01 HAVE_SANITIZE_ADDRESS
+#cmakedefine01 HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT
+
 /* Time portability */
 /* Function gettimeofday */
 #cmakedefine01 HAVE_GETTIMEOFDAY
diff --git a/tools/cmake/test_prog/prog_asan.cpp b/tools/cmake/test_prog/prog_asan.cpp
new file mode 100644 (file)
index 0000000..67d8adf
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright (c) 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. */
+
+/* Check availability of AddressSanitizer */
+
+#if defined(__has_feature)
+#define HAS_FEATURE(x) __has_feature(x)
+#else
+#define HAS_FEATURE(x) 0
+#endif
+
+#if not HAS_FEATURE(address_sanitizer) && not defined(__SANITIZE_ADDRESS__)
+#error "ASan feature not found."
+#endif
+
+#include <sanitizer/asan_interface.h>
+
+#if defined(CHECK_FIBER_SUPPORT)
+// Verify the existence of the fiber annotation interface, with the expected signature
+void (*start_fiber)(void**, const void*, size_t)   = __sanitizer_start_switch_fiber;
+void (*finish_fiber)(void*, const void**, size_t*) = __sanitizer_finish_switch_fiber;
+#endif
+
+int main(void)
+{
+}
index adc5dfe..0144743 100755 (executable)
@@ -116,9 +116,7 @@ sub display_subtree {
 display_subtree("XBT_LOG_ROOT_CAT","");
 
 map {
-    if ($_ ne "mc_main") { # This one is not in libsimgrid
-      warn "Category $_ does not seem to be connected.  Use XBT_LOG_CONNECT($_).\n";
-    }
+    warn "Category $_ does not seem to be connected.  Use XBT_LOG_CONNECT($_).\n";
 } grep {!defined $connected{$_}} sort keys %ancestor;
 map {
     warn "Category $_ does not seem to be connected to the root (anc=$ancestor{$_})\n";
index 6f503c2..f47bec3 100755 (executable)
@@ -2,8 +2,8 @@
 # Generate files from a given dwarf.h
 # Usage: tools/generate-dwarf-functions /usr/include/dwarf.h
 
-cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
-/* Copyright (c) 2014-2015. The SimGrid Team.
+HEADER="\
+/* Copyright (c) 2014-$(date +%Y). The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,10 +11,20 @@ cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
 
 /* Warning: autogenerated, do not edit! */
 
-#include <dwarf.h>
-#include <elfutils/libdw.h>
+#include <string>
+#include <unordered_map>
+
+#include \"src/mc/mc_dwarf.hpp\""
 
-#include <xbt/base.h>
+cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
+$HEADER
+
+namespace {
+const std::unordered_map<int, const char*> tagname_map = {
+    {0x00, "DW_TAG_invalid"},
+$(cat "$1" | grep DW_TAG_ | sed 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/    {\2, "\1"},/')
+};
+}
 
 namespace simgrid {
 namespace dwarf {
@@ -27,13 +37,8 @@ namespace dwarf {
 XBT_PRIVATE
 const char *tagname(int tag)
 {
-  switch (tag) {
-$(cat "$1" | grep DW_TAG_ | sed 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/  case \2: return "\1";/')
-  case DW_TAG_invalid:
-    return "DW_TAG_invalid";
-  default:
-    return "DW_TAG_unknown";
-  }
+  auto name = tagname_map.find(tag);
+  return name == tagname_map.end() ? "DW_TAG_unknown" : name->second;
 }
 
 }
@@ -41,17 +46,13 @@ $(cat "$1" | grep DW_TAG_ | sed 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/  case
 EOF
 
 cat - > src/mc/mc_dwarf_attrnames.cpp << EOF
-/* Copyright (c) 2014-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+$HEADER
 
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/* Warning: autogenerated, do not edit! */
-
-#include <dwarf.h>
-
-#include <xbt/base.h>
+namespace {
+const std::unordered_map<int, const char*> attrname_map = {
+$(cat "$1" | grep DW_AT_ | sed 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/    {\2, "\1"},/')
+};
+}
 
 namespace simgrid {
 namespace dwarf  {
@@ -64,11 +65,8 @@ namespace dwarf  {
 XBT_PRIVATE
 const char *attrname(int attr)
 {
-  switch (attr) {
-$(cat "$1" | grep DW_AT_ | sed 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/  case \2: return "\1";/')
-  default:
-    return "DW_AT_unknown";
-  }
+  auto name = attrname_map.find(attr);
+  return name == attrname_map.end() ? "DW_AT_unknown" : name->second;
 }
 
 }
index db2e47a..8d1bd55 100755 (executable)
@@ -43,7 +43,7 @@ CLANG_FORMAT=$(which clang-format-3.8)
 for name in git-clang-format-3.9 git-clang-format-3.8 git-clang-format ; do
  where=$(which $name)
  if [ x != "x$where" ] ; then
-   GIT_SUBCOMMAND=`echo $name|sed 's/git-//'`
+   GIT_SUBCOMMAND=$(echo $name|sed 's/git-//')
    break
  fi
 done
@@ -74,10 +74,10 @@ canonicalize_filename () {
     local result=""
 
     # Need to restore the working directory after work.
-    pushd `pwd` > /dev/null
+    pushd $(pwd) > /dev/null
 
     cd "$(dirname "$target_file")"
-    target_file=`basename $target_file`
+    target_file=$(basename $target_file)
 
     # Iterate down a (possible) chain of symlinks
     while [ -L "$target_file" ]
@@ -89,7 +89,7 @@ canonicalize_filename () {
 
     # Compute the canonicalized name by finding the physical path
     # for the directory we're in and appending the target file.
-    physical_directory=`pwd -P`
+    physical_directory=$(pwd -P)
     result="$physical_directory"/"$target_file"
 
     # restore the working directory after work.
index baa41d8..954e3ee 100644 (file)
@@ -1,7 +1,7 @@
 add_executable       (graphicator graphicator.c)
 target_link_libraries(graphicator simgrid)
 set_target_properties(graphicator PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh)
+ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.tesh)
 
 ## Clean generated files
 get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
index b2ed44a..cfe1ed1 100755 (executable)
@@ -60,7 +60,7 @@ make -j$NUMPROC
 JACOCO_PATH="/usr/local/share/jacoco"
 export JAVA_TOOL_OPTIONS="-javaagent:${JACOCO_PATH}/lib/jacocoagent.jar"
 
-ctest -D ExperimentalTest -j$NUMPROC || true
+ctest --no-compress-output -D ExperimentalTest -j$NUMPROC || true
 ctest -D ExperimentalCoverage || true
 
 unset JAVA_TOOL_OPTIONS
@@ -75,7 +75,7 @@ if [ -f Testing/TAG ] ; then
     ant -f $WORKSPACE/tools/jenkins/jacoco.xml -Dexamplesrcdir=$WORKSPACE -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
     #convert jacoco xml reports in cobertura xml reports
     cover2cover.py $BUILDFOLDER/${sourcepath}/report.xml .. ../src/bindings/java src/bindings/java > $WORKSPACE/java_coverage_${i}.xml
-    i=$(($i + 1))
+    i=$((i + 1))
   done
 
    #convert all gcov reports to xml cobertura reports
index 9faa38b..53cbde7 100755 (executable)
@@ -57,7 +57,7 @@ cmake -Denable_documentation=OFF -Denable_lua=OFF  \
 
 
 make -j$NUMPROC
-ctest -D ExperimentalTest -j$NUMPROC || true
+ctest --no-compress-output -D ExperimentalTest -j$NUMPROC || true
 
 cd $WORKSPACE/build
 if [ -f Testing/TAG ] ; then
index d375d56..9c66b0d 100755 (executable)
@@ -81,7 +81,7 @@ cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
       -Denable_fortran=OFF ${SANITIZER_OPTIONS} $WORKSPACE
 
 make -j$NUMPROC
-ctest -D ExperimentalTest || true
+ctest --no-compress-output -D ExperimentalTest || true
 
 if [ -f Testing/TAG ] ; then
    xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/$(head -n 1 < Testing/TAG)/Test.xml > CTestResults_${SANITIZER}.xml
index d92a433..eaae782 100755 (executable)
@@ -83,7 +83,8 @@ echo "XX Get out of the tree"
 echo "XX"
 if [ -d $WORKSPACE/build ]
 then
-  rm -rf $WORKSPACE/build
+  # Windows cannot remove the directory if it's still used by the previous build
+  rm -rf $WORKSPACE/build || sleep 10 && rm -rf $WORKSPACE/build || sleep 10 && rm -rf $WORKSPACE/build
 fi
 mkdir $WORKSPACE/build
 cd $WORKSPACE/build
index e626e3d..8b2083f 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/env perl
 
-# Copyright (c) 2005-2012, 2014. The SimGrid Team. All rights reserved.
+# Copyright (c) 2005-2012, 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.
@@ -126,6 +126,7 @@ sub process_one($) {
        print OUT "#include <stdio.h>\n\n";
        print OUT "#include \"xbt.h\"\n\n";
        print OUT "extern xbt_test_unit_t _xbt_current_unit;\n\n";
+       print OUT "#define STRLEN 1024\n";
        print OUT "/* SGU: BEGIN PROTOTYPES */\n";
        print OUT "/* SGU: END PROTOTYPES */\n\n";
        print OUT $GENERATED;
@@ -133,7 +134,7 @@ sub process_one($) {
        print OUT <<EOF;
 int main(int argc, char *argv[]) {
   xbt_test_suite_t suite; 
-  char selection[1024];
+  char selection[STRLEN];
   int verbosity = 0;
   int i;
   int res;
@@ -148,12 +149,9 @@ int main(int argc, char *argv[]) {
     for (i=1;i<argc;i++) {
       if (!strncmp(argv[i],\"--tests=\",strlen(\"--tests=\"))) {
         char *p=strchr(argv[i],'=')+1;
-        if (selection[0] == '\\0') {
-          strncpy(selection,p,1024);
-        } else {
-          strncat(selection, \",\",1);
-          strncat(selection, p, 1023);
-        }
+        if (selection[0] != '\\0')
+          strncat(selection, \",\", STRLEN - 1 - strlen(selection));
+        strncat(selection, p, STRLEN - 1 - strlen(selection));
       } else if (!strcmp(argv[i], \"--verbose\")) {
         verbosity++;
       } else if (!strcmp(argv[i], \"--dump-only\")||
index ff81d66..b7104ca 100644 (file)
@@ -12,7 +12,7 @@
 import sys
 import fnmatch
 import os
-from decimal import Decimal
+from decimal import Decimal, DecimalException
 import re
 
 
@@ -20,7 +20,7 @@ def to_str(dec):
     return re.sub(r"(\.\d*?)0*$", r"\1", dec.to_eng_string()).rstrip(".")
 
 
-def format(xml, formats, attrib):
+def convert(xml, formats, attrib):
     res = []
     m = re.search(r'%s="(.*?)"' % attrib, xml)
     while m:
@@ -37,7 +37,7 @@ def format(xml, formats, attrib):
                     tmp = "%s%s" % (to_str(d), f)
                     break
             res.append(tmp)
-        except:
+        except DecimalException:
             print "Error with:", val
             res.append(val)
         m = re.search(r'%s="(.*?)"' % attrib, xml)
@@ -63,18 +63,18 @@ for root, dirnames, filenames in os.walk(sys.argv[1]):
                                  ("1E15", "Pt"),
                                  ("1E18", "Ef"),
                                  ("1E21", "Zf")])
-        xml = format(xml, power_formats, "power")
+        xml = convert(xml, power_formats, "power")
 
         bandwidth_formats = formats([("1E0", "Bps"),
                                      ("1E3", "kBps"),
                                      ("1E6", "MBps"),
                                      ("1E9", "GBps"),
                                      ("1E12", "TBps")])
-        xml = format(xml, bandwidth_formats, "bandwidth")
-        xml = format(xml, bandwidth_formats, "bw")
-        xml = format(xml, bandwidth_formats, "bb_bw")
-        xml = format(xml, bandwidth_formats, "bw_in")
-        xml = format(xml, bandwidth_formats, "bw_out")
+        xml = convert(xml, bandwidth_formats, "bandwidth")
+        xml = convert(xml, bandwidth_formats, "bw")
+        xml = convert(xml, bandwidth_formats, "bb_bw")
+        xml = convert(xml, bandwidth_formats, "bw_in")
+        xml = convert(xml, bandwidth_formats, "bw_out")
 
         time_formats = formats([("1E-12", "ps"),
                                 ("1E-9", "ns"),
@@ -85,9 +85,9 @@ for root, dirnames, filenames in os.walk(sys.argv[1]):
                                 ("3600E0", "h"),
                                 ("86400E0", "d"),
                                 ("604800E0", "w")])
-        xml = format(xml, time_formats, "latency")
-        xml = format(xml, time_formats, "lat")
-        xml = format(xml, time_formats, "bb_lat")
+        xml = convert(xml, time_formats, "latency")
+        xml = convert(xml, time_formats, "lat")
+        xml = convert(xml, time_formats, "bb_lat")
 
         # print xml
         outfile = open(path, "w")
index 9f742a7..287d7bf 100644 (file)
    obj:/usr/bin/*
 }
 
+{
+   Memory leak in cmake
+   Memcheck:Leak
+   match-leak-kinds:reachable
+   ...
+   fun:_Znwm
+   fun:_ZN4Json5Value13nullSingletonEv
+   obj:*/libjsoncpp.so*
+   ...
+   fun:_dl_init
+}
+
 # There's a constant leak of 56 bytes in the depths of libc which
 # manifests, for example, when using backtrace()
 {
@@ -74,7 +86,7 @@
 
 #SMPI leaks the dlopen handle used to load the program
 {
-   dlopen handle leaks (1/2)
+   dlopen handle leaks (1/3)
    Memcheck:Leak
    match-leak-kinds:reachable
    fun:malloc
@@ -83,7 +95,7 @@
 }
 
 {
-   dlopen handle leaks (2/2)
+   dlopen handle leaks (2/3)
    Memcheck:Leak
    match-leak-kinds:reachable
    fun:calloc
    fun:dlopen@@GLIBC_*
 }
 
+{
+   dlopen handle leaks (3/3)
+   Memcheck:Leak
+   match-leak-kinds:reachable
+   fun:realloc
+   ...
+   fun:dlopen@@GLIBC_*
+}
+
 # Memory leaks appearing to be in libcgraph.  They can be seen with the
 # following simple program:
 # ,----
index 95ff898..68a661e 100755 (executable)
@@ -65,7 +65,7 @@ SIGNALS_TO_NAMES_DICT = dict((getattr(signal, n), n) \
 
 
 #exit correctly
-def exit(errcode):
+def tesh_exit(errcode):
     #If you do not flush some prints are skipped
     sys.stdout.flush()
     #os._exit exit even when executed within a thread
@@ -74,7 +74,7 @@ def exit(errcode):
 
 def fatal_error(msg):
     print("[Tesh/CRITICAL] "+str(msg))
-    exit(1)
+    tesh_exit(1)
 
 
 #Set an environment variable.
@@ -224,7 +224,7 @@ class Cmd(object):
         except FileNotFoundError:
             print("Chdir to "+args[1]+" failed: No such file or directory")
             print("Test suite `"+FileReader().filename+"': NOK (system error)")
-            exit(4)
+            tesh_exit(4)
 
 
     #Run the Cmd if possible.
@@ -293,7 +293,7 @@ class Cmd(object):
             proc = subprocess.Popen(args, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
         except FileNotFoundError:
             print("["+FileReader().filename+":"+str(self.linenumber)+"] Cannot start '"+args[0]+"': File not found")
-            exit(3)
+            tesh_exit(3)
         except OSError as osE:
             if osE.errno == 8:
                 osE.strerror += "\nOSError: [Errno 8] Executed scripts should start with shebang line (like #!/bin/sh)"
@@ -305,7 +305,7 @@ class Cmd(object):
         except subprocess.TimeoutExpired:
             print("Test suite `"+FileReader().filename+"': NOK (<"+cmdName+"> timeout after "+str(self.timeout)+" sec)")
             proc.kill()
-            exit(3)
+            tesh_exit(3)
 
         if self.output_display:
             print(stdout_data)
@@ -363,7 +363,7 @@ class Cmd(object):
                         f.write("> "+line+"\n")
                     f.close()
                     print("Obtained output kept as requested: "+os.path.abspath("obtained"))
-                exit(2)
+                tesh_exit(2)
 
         #print ((proc.returncode, self.expect_return))
 
@@ -371,11 +371,11 @@ class Cmd(object):
             if proc.returncode >= 0:
                 print("Test suite `"+FileReader().filename+"': NOK (<"+cmdName+"> returned code "+str(proc.returncode)+")")
                 if lock is not None: lock.release()
-                exit(2)
+                tesh_exit(2)
             else:
                 print("Test suite `"+FileReader().filename+"': NOK (<"+cmdName+"> got signal "+SIGNALS_TO_NAMES_DICT[-proc.returncode]+")")
                 if lock is not None: lock.release()
-                exit(-proc.returncode)
+                tesh_exit(-proc.returncode)
 
         if lock is not None: lock.release()
 
@@ -402,34 +402,36 @@ if __name__ == '__main__':
     group1.add_argument('teshfile', nargs='?', help='Name of teshfile, stdin if omitted')
     group1.add_argument('--cd', metavar='some/directory', help='ask tesh to switch the working directory before launching the tests')
     group1.add_argument('--setenv', metavar='var=value', action='append', help='set a specific environment variable')
-    group1.add_argument('--cfg', metavar='arg', help='add parameter --cfg=arg to each command line')
-    group1.add_argument('--log', metavar='arg', help='add parameter --log=arg to each command line')
+    group1.add_argument('--cfg', metavar='arg', action='append', help='add parameter --cfg=arg to each command line')
+    group1.add_argument('--log', metavar='arg', action='append', help='add parameter --log=arg to each command line')
     group1.add_argument('--ignore-jenkins', action='store_true', help='ignore all cruft generated on SimGrid continous integration servers')
     group1.add_argument('--wrapper', metavar='arg', help='Run each command in the provided wrapper (eg valgrind)')
     group1.add_argument('--keep', action='store_true', help='Keep the obtained output when it does not match the expected one')
 
     try:
         options = parser.parse_args()
-    except:
-        exit(1)
+    except SystemExit:
+        tesh_exit(1)
 
     if options.cd is not None:
         os.chdir(options.cd)
 
     if options.ignore_jenkins:
         print("Ignore all cruft seen on SimGrid's continous integration servers")
+        # Note: regexps should match at the beginning of lines
         TeshState().ignore_regexps_common = [
-           re.compile("^profiling:"),
-           re.compile(".*WARNING: ASan doesn\'t fully support"),
-           re.compile("Unable to clean temporary file C:.*"),
+           re.compile("profiling:"),
+           re.compile("Unable to clean temporary file C:"),
            re.compile(".*Configuration change: Set \'contexts/"),
-           re.compile(".*Picked up JAVA_TOOL_OPTIONS.*"),
-
-           re.compile("==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top:"),
+           re.compile("Picked up JAVA_TOOL_OPTIONS: "),
+           re.compile("Picked up _JAVA_OPTIONS: "),
+           re.compile("==[0-9]+== ?WARNING: ASan doesn\'t fully support"),
+           re.compile("==[0-9]+== ?WARNING: ASan is ignoring requested __asan_handle_no_return: stack top:"),
            re.compile("False positive error reports may follow"),
-           re.compile("For details see http://code.google.com/p/address-sanitizer/issues/detail?id=189"),
-
+           re.compile("For details see http://code.google.com/p/address-sanitizer/issues/detail\\?id=189"),
+           re.compile("For details see https://github.com/google/sanitizers/issues/189"),
            re.compile("Python runtime initialized with LC_CTYPE=C .*"),
+           re.compile("^cmake: .*? no version information available (required by cmake)"), # Seen on CircleCI
            ]
         TeshState().jenkins = True # This is a Jenkins build
 
@@ -439,7 +441,7 @@ if __name__ == '__main__':
     else:
         if not os.path.isfile(options.teshfile):
             print("Cannot open teshfile '"+options.teshfile+"': File not found")
-            exit(3)
+            tesh_exit(3)
         f = FileReader(options.teshfile)
         print("Test suite '"+f.abspath+"'")
 
@@ -448,9 +450,11 @@ if __name__ == '__main__':
             setenv(e)
 
     if options.cfg is not None:
-        TeshState().args_suffix += " --cfg="+options.cfg
+        for c in options.cfg:
+            TeshState().args_suffix += " --cfg=" + c
     if options.log is not None:
-        TeshState().args_suffix += " --log="+options.log
+        for l in options.log:
+            TeshState().args_suffix += " --log=" + l
 
     if options.wrapper is not None:
         TeshState().wrapper = options.wrapper